/* Lucky Wheel game page.
   (Controllers/GamesController.cs, Views/Games/LuckyWheel.cshtml)

   Loads alongside predict.css purely for the shared top bar, which is keyed on
   body:has(.predict-shell). The past-draw table reuses .history-result-table and
   the .pos-* prize badges from site.css. Nothing else reads this file.

   The wheel is SVG rather than an image so the digits stay sharp at any size and
   can be redrawn in a new order after every spin. */

.whl-shell {
    max-width: 520px;
    margin: 0 auto;
    padding: 16px 16px calc(126px + env(safe-area-inset-bottom));
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.whl-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.whl-back {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 18px;
    text-decoration: none;
}

.whl-topbar h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
}

.whl-tagline {
    margin: 2px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

/* ── Wheel ──────────────────────────────────────────────────────────────── */

.whl-card {
    padding: 18px 16px 20px;
    border: 1px solid rgba(216, 169, 63, .42);
    border-radius: 20px;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(216, 169, 63, .14), transparent 62%),
        var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.whl-stage {
    position: relative;
    width: min(300px, 82vw);
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

/* The rim, drawn around the SVG rather than in it so the rim does not rotate. */
.whl-stage::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: linear-gradient(180deg, #e8514f, #a8221f);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28), inset 0 2px 0 rgba(255, 255, 255, .3);
}

.whl-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    will-change: transform;
}

.whl-digit {
    fill: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 19px;
    font-weight: 900;
    text-anchor: middle;
    dominant-baseline: central;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, .35);
    stroke-width: 2px;
}

.whl-hub {
    fill: #d8a93f;
    stroke: #8b5c12;
    stroke-width: 2;
}

.whl-hub-inner {
    fill: #f0c65a;
}

/* Pointer at twelve o'clock; the wheel turns underneath it. */
.whl-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    z-index: 2;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 22px solid #f0c65a;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4));
}

/* ── Collected digits ───────────────────────────────────────────────────── */

.whl-slots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.whl-slot {
    display: grid;
    place-items: center;
    width: 52px;
    height: 58px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 26px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.whl-slot.is-filled {
    border-color: #8b5c12;
    background: linear-gradient(180deg, #e8bd52, #c8952c);
    color: #40290a;
    animation: whl-drop .35s ease;
}

@keyframes whl-drop {
    from { opacity: 0; transform: translateY(-8px) scale(.9); }
    to   { opacity: 1; transform: none; }
}

.whl-spin-btn {
    width: 100%;
    margin-top: 18px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #8b5c12, #6d4710);
    cursor: pointer;
}

.whl-spin-btn span {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, #e8bd52, #c8952c);
    color: #40290a;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    transform: translateY(-3px);
    transition: transform .09s ease;
}

.whl-spin-btn:active span {
    transform: translateY(0);
}

.whl-spin-btn[disabled] {
    cursor: default;
}

.whl-spin-btn[disabled] span {
    transform: translateY(0);
    opacity: .75;
}

.whl-status {
    margin: 12px 0 0;
    min-height: 18px;
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 700;
}

.whl-status.is-error {
    color: #c0392b;
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.whl-past,
.whl-history,
.whl-about {
    margin-top: 20px;
}

.whl-section-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}

.whl-section-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 900;
}

.whl-section-head span {
    color: var(--text-soft);
    font-size: 11.5px;
}

.whl-empty {
    margin: 0;
    padding: 18px 0;
    color: var(--text-soft);
    font-size: 13px;
    text-align: center;
}

.whl-history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
}

.whl-history-list .whl-empty {
    grid-column: 1 / -1;
}

.whl-history-chip {
    display: grid;
    gap: 2px;
    padding: 10px 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    text-align: center;
}

.whl-history-chip strong {
    color: var(--gold);
    font-size: 19px;
    font-weight: 900;
    letter-spacing: .1em;
    font-variant-numeric: tabular-nums;
}

.whl-history-chip span {
    color: var(--text-soft);
    font-size: 10.5px;
}

.whl-history-chip.is-new {
    border-color: rgba(216, 169, 63, .7);
    animation: whl-chip-in .45s ease;
}

@keyframes whl-chip-in {
    from { opacity: 0; transform: translateY(-6px) scale(.94); }
    to   { opacity: 1; transform: none; }
}

.whl-about h2 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 900;
}

.whl-about p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.whl-disclaimer {
    margin: 16px 0 0;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.6;
}

@media (max-width: 360px) {
    .whl-slot {
        width: 46px;
        height: 52px;
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .whl-wheel {
        transition: none !important;
    }

    .whl-slot.is-filled,
    .whl-history-chip.is-new {
        animation: none;
    }
}
