:root {
    --panel: #151823;
    --text: #e6e8ef;
}

* {
    box-sizing: border-box
}

/* body {
	margin: 0;
	color: var(--text);
	font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	background-color: #0D0F15;
	background-image: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5)), url('assets/background.jpg');
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-attachment: fixed;
} */

.t-right {
    text-align: right;
}

@keyframes slide-left {
    0% {
        left: 100%;
        transform: translateX(0) translateY(-50%);
    }

    100% {
        left: 0%;
        transform: translateX(-100%) translateY(-50%);
    }
}

.lucky-spin-main {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.lucky-spin-main .card {
    border-radius: 1rem;
    padding: 1.5rem;
}

#lucky-spin-scoreboard .totals {
    display: grid;
    gap: 1rem;
}

#lucky-spin-leaderboard .row {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

input[type="range"] {
    width: 100%;
}

.lucky-spin-main .btn {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    color: #0b0d16;
    background: linear-gradient(180deg, #ffd166, #ff7a18);
    box-shadow: 0 6px 18px rgba(255, 122, 24, .35);
    transition: transform .05s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn[disabled] {
    cursor: not-allowed;
}

#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: none;
    align-items: center;
    justify-content: center;
}

#dialog {
    background: #0f1326;
    border: 1px solid #283056;
    color: #e9ecf6;
    border-radius: 16px;
    padding: 20px;
    width: min(92vw, 420px);
    box-shadow: 0 12px 50px rgba(0, 0, 0, .5);
}

#dialog h3 {
    margin: 0 0 8px;
}

#dialog .actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

#dialog button {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    color: #0b0d16;
    background: linear-gradient(180deg, #ffd166, #ff7a18);
    box-shadow: 0 6px 18px rgba(255, 122, 24, .35);
    transition: transform .05s ease;
}

@media (max-width: 768px) {
    .lucky-spin-main {
        grid-template-columns: 1fr;
    }

    #lucky-spin-game {
        order: 1;
        grid-column: 1 / -1;
    }

    #lucky-spin-scoreboard,
    #lucky-spin-leaderboard {
        order: 2;
        min-width: 0;
    }
}

.backbar {
    max-width: 1200px;
    margin: 8px auto 0;
    padding: 8px 16px;
}

.backbar .backlink {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.backbar .backlink:active {
    opacity: .8;
}

.score-title {
    font-weight: 700;
    font-size: 1.75rem;
    margin: 0 0 1.125rem;
}

.btn-blue {
    appearance: none;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    color: #ffffff;
    background: #4169E1;
    box-shadow: 0 6px 18px rgba(176, 0, 0, .35);
    cursor: pointer;
    width: 100%;
    transition: color .15s ease, background .15s ease;
}

.btn-blue:active {
    transform: translateY(1px);
}

/* .btn-blue:hover {
	background: #ffffff;
	color: #4169E1;
} */

#lucky-spin-scoreboard .totals.stacked {
    display: grid;
    gap: 1rem;
}

#lucky-spin-scoreboard .totals.stacked .metric {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

#lucky-spin-scoreboard .totals.stacked .metric .label {

    font-weight: 600;
    font-size: 1.125rem;
}

#lucky-spin-scoreboard .totals.stacked .full {
    /* margin-top: 4px; */
}

#lucky-spin-scoreboard .totals.stacked .metric .value {
    background-color: #1C1F27;
    font-size: 1.25rem;
    padding: 0.875rem 1rem;
    font-weight: 800;
    border-radius: 0.5rem;

}

.wheel {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    display: block;
    transform-origin: center center;
    will-change: transform;
}

.wheel-wrap {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    overflow: hidden;
    contain: paint;
}

.wheel-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}

.wheel-layer.wheel {
    pointer-events: none;
    transform-origin: 50% 50%;
}

.wheel-layer.frame {
    pointer-events: none;
    z-index: 2;
}

.wheel-spin {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    z-index: 3;
}

.wheel-spin img {
    width: 28%;
    height: auto;
    display: block;
    -webkit-user-drag: none;
    pointer-events: none;
}

@media (max-width: 480px) {
    .wheel-spin img {
        width: 32%;
    }
}

.wheel-layer.wheel {
    transform-origin: 50% 50%;
    will-change: transform;
}

.wheel-rocker {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
    transform: rotate(22.5deg);
    animation: wheelRock 1999ms ease-in-out infinite;
    will-change: transform;
}

#wheelWrap.spinning .wheel-rocker {
    animation: none !important;
}

/* pause during spin */
@media (prefers-reduced-motion: reduce) {
    .wheel-rocker {
        animation: none;
    }
}

@keyframes wheelRock {
    0% {
        transform: rotate(21.7deg);
    }

    /* 22.5 - 0.8 */
    50% {
        transform: rotate(23.3deg);
    }

    /* 22.5 + 0.8 */
    100% {
        transform: rotate(21.7deg);
    }
}

.termsDiv ol {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

/* Disable rocking while spinning; add transition for the spin */
#wheelWrap.spinning .wheel-layer.wheel {
    transition: transform 3800ms cubic-bezier(.16, 1, .3, 1);
    will-change: transform;
}

#spinBtn[disabled] {
    cursor: not-allowed;
}

#overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    z-index: 1000;
}

#overlay.show {
    display: flex;
}


#lucky-spin-leaderboard .lb-wrap {
    max-height: 350px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#lucky-spin-leaderboard .lb-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

#lucky-spin-leaderboard .lb-table th,
#lucky-spin-leaderboard .lb-table td {
    padding: 0.375rem 0.625rem;
    min-width: 100px;
    text-align: left;
    color: var(--mini-game-font-color);
}

#lucky-spin-leaderboard .lb-table thead th {
    color: var(--mini-game-font-color);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--mini-game-secondary-window);
}

#lucky-spin-leaderboard .lb-table tbody {
    font-size: 12px
}

#lucky-spin-leaderboard .lb-table tbody tr:last-child td {
    border-bottom: 0;
}

#lucky-spin-leaderboard .lb-table td:nth-child(2) {
    text-align: left;
}

#lucky-spin-leaderboard .lb-table td:nth-child(3) {
    white-space: nowrap;
}
