/* ==========================================================================
   RuneCake — Golden Wheel presentation layer
   ========================================================================== */

.golden-hero {
    position: relative;
    overflow: hidden;
    border-color: rgba(232, 200, 115, 0.7);
    background:
        radial-gradient(circle at 50% -20%, rgba(255, 226, 150, 0.22), transparent 60%),
        linear-gradient(180deg, rgba(52, 34, 12, 0.97), rgba(20, 13, 6, 0.98));
}

.golden-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(115deg, transparent 0 28px, rgba(255, 240, 184, 0.03) 28px 29px);
}

.golden-hero > * { position: relative; z-index: 1; }

.golden-hero h1 {
    color: #ffe9a8;
    text-shadow: 0 1px 0 #6b4f10, 0 0 24px rgba(255, 214, 110, 0.4);
}

.golden-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid #f5e6a8;
    border-radius: 999px;
    background: linear-gradient(145deg, #d4af37, #8a6b17);
    color: #2d1810;
    font-family: 'Cinzel', serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.golden-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.golden-stage {
    position: relative;
    width: min(440px, 92vw);
    aspect-ratio: 1 / 1;
    isolation: isolate;
}

.golden-stage svg { width: 100%; height: 100%; display: block; cursor: pointer; }

.golden-stage svg:focus-visible {
    outline: 3px solid #f5e6a8;
    outline-offset: 4px;
    border-radius: 50%;
}

/* A slow light sweep across the whole disc — the same lustre the Wheel of
   Fortune gets from wheel-fab.css, tuned for the golden palette. */
.golden-stage::before {
    content: '';
    position: absolute;
    inset: 3.5%;
    z-index: 3;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        transparent 0deg,
        rgba(255, 250, 225, 0.04) 26deg,
        rgba(255, 250, 225, 0.26) 44deg,
        rgba(255, 250, 225, 0.04) 62deg,
        transparent 120deg,
        transparent 360deg);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: goldenSheen 7s linear infinite;
}

/* Fixed specular glints, like polished gold under a lamp. */
.golden-stage::after {
    content: '';
    position: absolute;
    inset: 3.5%;
    z-index: 4;
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(ellipse 44% 26% at 30% 16%, rgba(255, 255, 240, 0.3), transparent 70%),
        radial-gradient(ellipse 24% 14% at 72% 86%, rgba(255, 226, 150, 0.12), transparent 72%);
}

.golden-glow {
    position: absolute;
    inset: 7%;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
    box-shadow:
        0 0 80px rgba(255, 214, 110, 0.45),
        0 0 28px rgba(255, 240, 184, 0.3),
        inset 0 0 50px rgba(255, 230, 160, 0.18);
    animation: goldenBreathe 4s ease-in-out infinite;
}

#goldenRotor {
    transform-box: view-box;
    transform-origin: 200px 200px;
    will-change: transform;
}

@keyframes goldenBreathe {
    0%, 100% { opacity: 0.8; transform: scale(0.99); }
    50% { opacity: 1; transform: scale(1.015); }
}

@keyframes goldenSheen {
    to { transform: rotate(360deg); }
}

/* Rim bulbs twinkle out of phase, matching the Wheel of Fortune. */
#goldenLights circle { animation: goldenBulbTwinkle 2.1s ease-in-out infinite; }
#goldenLights circle:nth-child(2n) { animation-delay: 0.5s; }
#goldenLights circle:nth-child(3n) { animation-delay: 1s; }

@keyframes goldenBulbTwinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.mode-switch {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 440px;
}

.mode-option {
    flex: 1 1 0;
    padding: 0.6rem 0.5rem;
    border: 1px solid rgba(232, 200, 115, 0.5);
    border-radius: 8px;
    background: rgba(20, 13, 6, 0.85);
    color: #e8d49b;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.mode-option:hover:not(:disabled) { border-color: #f5e6a8; color: #fff6cf; }

.mode-option.is-selected {
    background: linear-gradient(145deg, #f5e6a8, #d4af37 60%, #a87c16);
    border-color: #fff3c8;
    color: #241406;
    box-shadow: 0 0 20px rgba(255, 214, 110, 0.35);
}

.mode-option:disabled { opacity: 0.45; cursor: not-allowed; }

.golden-spin-btn {
    width: 100%;
    max-width: 440px;
    font-size: 1.05rem;
}

.golden-balance {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.84rem;
    color: var(--parchment);
}

.golden-balance strong { color: #ffe9a8; }

.prize-result {
    text-align: center;
    padding: 0.8rem;
    border: 1px dashed rgba(232, 200, 115, 0.65);
    background: rgba(212, 175, 55, 0.06);
}

#goldenRotor image { image-rendering: pixelated; }

/* Keep segment names sharp: geometricPrecision avoids the browser's
   speed-oriented glyph rounding, and the dark halo is painted behind the
   fill so bright segment colours cannot wash the letters out. */
#goldenRotor text {
    text-rendering: geometricPrecision;
    paint-order: stroke fill;
}

.prize-result img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}

.prize-result .prize-name {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffe9a8;
    margin: 0.4rem 0;
}

.prize-result .claim-code {
    font-family: monospace;
    font-size: 1rem;
    color: var(--parchment);
    letter-spacing: 1px;
    word-break: break-all;
}

.claim-row {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(139, 115, 85, 0.3);
}

.claim-row img { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; }
.claim-row .claim-main { flex: 1 1 160px; min-width: 0; }
.claim-row .claim-main strong { display: block; font-size: 0.9rem; color: var(--parchment); }
.claim-row .claim-main small { display: block; font-size: 0.75rem; color: var(--muted); }
.claim-row.is-fulfilled { opacity: 0.6; }

.odds-thumb { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; vertical-align: middle; margin-right: 0.4rem; }

.golden-prize-overlay [hidden] { display: none !important; }

.golden-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #ffe9a8;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 620px) {
    .mode-switch { flex-direction: column; }
    .prize-result img { width: 76px; height: 76px; }
}

/* Reward popup — shown as soon as the wheel settles on the server-picked prize. */
.golden-prize-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1rem;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 40%, rgba(90, 62, 16, 0.82), rgba(8, 5, 3, 0.94));
    backdrop-filter: blur(6px);
}

.golden-prize-overlay[hidden] { display: none; }

.golden-prize-card {
    position: relative;
    width: min(420px, 100%);
    padding: 2.1rem 1.6rem 1.5rem;
    border: 2px solid #f5e6a8;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% -10%, rgba(255, 226, 150, 0.22), transparent 62%),
        linear-gradient(180deg, #34220e, #150e07);
    box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.22), 0 24px 70px rgba(0, 0, 0, 0.7);
    text-align: center;
    animation: goldenPrizeIn 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

@keyframes goldenPrizeIn {
    from { opacity: 0; transform: scale(0.82) translateY(18px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.golden-prize-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: 0;
    background: none;
    color: #f5e6a8;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.golden-prize-close:hover { color: #fff6cf; }

.golden-prize-kicker {
    color: #ffe9a8;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.golden-prize-art {
    display: grid;
    place-items: center;
    min-height: 132px;
    margin: 0.9rem 0 0.3rem;
}

.golden-prize-art img {
    width: 132px;
    height: 132px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 18px rgba(255, 214, 110, 0.55)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.6));
    animation: goldenPrizeFloat 2.6s ease-in-out infinite;
}

@keyframes goldenPrizeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

.golden-prize-card h2 {
    margin: 0.2rem 0 0.4rem;
    color: #fff3c8;
    font-family: 'Cinzel', serif;
    font-size: 1.65rem;
    text-shadow: 0 0 18px rgba(255, 214, 110, 0.45);
}

.golden-prize-blurb {
    margin: 0 auto 1rem;
    max-width: 32ch;
    color: var(--parchment);
    font-size: 0.92rem;
}

.golden-prize-code-wrap {
    display: grid;
    gap: 0.3rem;
    margin: 0 auto 0.85rem;
    padding: 0.7rem;
    border: 1px dashed rgba(232, 200, 115, 0.6);
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.07);
}

.golden-prize-code-wrap span {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.golden-prize-code-wrap code {
    color: #ffe9a8;
    font-size: 1.15rem;
    letter-spacing: 2px;
    word-break: break-all;
}

.golden-prize-card .btn { min-width: 190px; margin-bottom: 0.7rem; }

.golden-prize-foot {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.76rem;
}

@media (max-width: 620px) {
    .golden-prize-art img { width: 104px; height: 104px; }
    .golden-prize-card h2 { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .golden-glow,
    .golden-stage::before,
    #goldenLights circle { animation: none; }
    .golden-stage::before { opacity: 0.5; }
    #goldenRotor { transition: none !important; }
    .golden-prize-card, .golden-prize-art img { animation: none; }
}
