/* Wheel of Fortune — FunDash */

:root {
    --bg: #080f1e;
    --surface: #111b30;
    --purple: #7c5cff;
    --cyan: #22d3ee;
    --gold: #f59e0b;
    --text: #f0f5ff;
    --muted: #94a3b8;
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: Inter, Roboto, system-ui, sans-serif;
    background: radial-gradient(circle at 50% -10%, #112048 0%, #0b1630 36%, var(--bg) 74%);
    color: var(--text);
}

body { padding: 0; }

.wheel-app {
    height: 100dvh;
    max-height: 100dvh;
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    gap: 0.34rem;
    overflow: hidden;
    padding:
        calc(0.45rem + env(safe-area-inset-top))
        calc(0.55rem + env(safe-area-inset-right))
        calc(0.45rem + env(safe-area-inset-bottom))
        calc(0.55rem + env(safe-area-inset-left));
    box-sizing: border-box;
    justify-items: center;
}

.wheel-header {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    z-index: 120;
}

.wheel-brand {
    display: inline-flex;
    align-self: flex-start;
    line-height: 0;
    text-decoration: none;
}

.prize-line {
    margin: 0;
    width: 100%;
    text-align: center;
    color: var(--gold);
    font-weight: 800;
    font-size: clamp(0.78rem, 3.1vw, 0.95rem);
    text-shadow: 0 0 12px rgba(255, 204, 0, 0.5);
}

.meta-strip {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(12, 10, 22, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.35rem 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--muted);
    gap: 0.45rem;
}

.meta-strip a {
    color: #9be3ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wheel-stage {
    width: 100%;
    max-width: 420px;
    height: 100%;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(25, 18, 48, 0.8), rgba(8, 8, 16, 0.92));
    box-shadow: inset 0 0 80px rgba(140, 59, 255, 0.14), 0 16px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.wheel-pointer {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 24px solid #ffcc00;
    filter: drop-shadow(0 0 10px rgba(255, 204, 0, 0.75));
    z-index: 4;
}

#wheel-canvas {
    width: min(90vw, 360px);
    height: min(90vw, 360px);
    max-width: 360px;
    max-height: 360px;
    display: block;
    touch-action: none;
}

.spin-overlay {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    justify-content: center;
    padding-bottom: 0.65rem;
    pointer-events: none;
}

.spin-btn {
    pointer-events: auto;
    min-width: 154px;
    min-height: 46px;
    border-radius: 12px;
    border: 0;
    font-family: Orbitron, Inter, sans-serif;
    font-weight: 800;
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    color: #170f00;
    background: linear-gradient(180deg, #ffe98a 0%, #ffcc00 45%, #cf9600 100%);
    box-shadow: 0 4px 0 #8f6400, 0 12px 24px rgba(255, 204, 0, 0.34);
    cursor: pointer;
    text-transform: uppercase;
}

.spin-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #8f6400, 0 7px 14px rgba(255, 204, 0, 0.22);
}

.spin-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.status-pill {
    width: 100%;
    max-width: 420px;
    text-align: center;
    border-radius: 999px;
    padding: 0.38rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(6, 6, 12, 0.65);
    color: var(--muted);
    font-size: clamp(0.72rem, 2.9vw, 0.84rem);
}

.ad-slot {
    width: min(320px, 100%);
    max-width: 320px;
    min-height: 50px;
    max-height: 50px;
    margin-top: 0.08rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(17, 17, 17, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--muted);
    z-index: 90;
}

/* ─── Short-phone + small-phone optimizations (Phase 2) ───────────── */
@media (max-height: 680px) {
    .wheel-stage { max-width: 360px; border-radius: 14px; }
    .spin-btn { min-height: 52px; padding: 0.85rem 1.25rem; }
}
@media (max-width: 360px) {
    .wheel-stage { max-width: calc(100% - 24px); border-radius: 12px; }
    .spin-btn { font-size: 0.95rem; padding: 0.8rem 1rem; }
}
