/* RuneCake shared theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    overflow-x: hidden;
}

:root {
    --gold: #d4af37;
    --gold-dark: #b8941f;
    --brown: #2d1810;
    --brown-light: #4a2c20;
    --parchment: #f0e68c;
    --muted: #b8941f;
    --green: #51cf66;
    --red: #ff6b6b;
    --orange: #f7931a;
    --border: #8b7355;
}

body {
    font-family: 'Cinzel', serif;
    background: linear-gradient(rgba(20, 15, 10, 0.88), rgba(20, 15, 10, 0.92)),
                url('https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=1920') center/cover;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--gold);
    overflow-x: hidden;
    width: 100%;
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

a { color: var(--gold); }

.header {
    background: linear-gradient(90deg, #2d1810 0%, #4a2c20 50%, #2d1810 100%);
    border-bottom: 3px solid var(--gold);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    gap: 1rem;
}

.logo {
    font-family: 'MedievalSharp', cursive;
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: var(--gold);
    text-shadow: 2px 2px 4px #000;
    text-decoration: none;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}
/* Let links injected into #navAuth become direct flex items of .nav */
#navAuth {
    display: contents;
}

.nav a, .nav button {
    font-family: 'Cinzel', serif;
    background: linear-gradient(145deg, #4a2c20, #2d1810);
    color: var(--gold);
    border: 2px solid var(--gold);
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    white-space: nowrap;
    text-decoration: none;
}

.nav a:hover, .nav button:hover {
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #2d1810;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.nav .nav-user {
    color: var(--parchment);
    font-size: 0.85rem;
    padding: 0.4rem 0.2rem;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem 4rem;
}

.hero {
    text-align: center;
    background: linear-gradient(rgba(45, 24, 16, 0.96), rgba(45, 24, 16, 0.96));
    padding: clamp(1.5rem, 5vw, 3rem) 1rem;
    border: 3px solid var(--gold);
    margin-bottom: 1.5rem;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.35);
}

.hero h1 {
    font-family: 'MedievalSharp', cursive;
    font-size: clamp(1.8rem, 6vw, 3rem);
    margin-bottom: 0.75rem;
    text-shadow: 3px 3px 6px #000;
}

.hero p { color: var(--parchment); line-height: 1.6; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--gold);
    background: rgba(212, 175, 55, 0.12);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab {
    font-family: 'Cinzel', serif;
    background: linear-gradient(145deg, #4a2c20, #2d1810);
    color: var(--gold);
    border: 2px solid var(--border);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    flex: 1;
    min-width: 140px;
    text-align: center;
}

.tab.active, .tab:hover {
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #2d1810;
    border-color: var(--gold);
    font-weight: 700;
}

.panel {
    display: none;
    background: rgba(45, 24, 16, 0.98);
    border: 3px solid var(--gold);
    padding: clamp(1rem, 4vw, 2rem);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
}

.panel.active { display: block; }

.panel h2 {
    font-family: 'MedievalSharp', cursive;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: clamp(1.4rem, 5vw, 1.9rem);
    text-shadow: 2px 2px 4px #000;
}

.panel .subtitle {
    text-align: center;
    color: var(--parchment);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.card {
    background: rgba(139, 115, 85, 0.18);
    border: 2px solid var(--border);
    padding: 1.25rem;
}

.card h3 { margin-bottom: 0.75rem; color: var(--gold); }

.balance-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid var(--gold);
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
}

.balance-bar .amount { color: var(--parchment); font-size: 1.3rem; font-weight: 700; }

.form-group { margin-bottom: 1rem; }

.form-group label { display: block; margin-bottom: 0.5rem; color: var(--parchment); font-size: 0.9rem; }

input[type="text"], input[type="number"], input[type="password"], select, textarea {
    width: 100%;
    padding: 0.75rem;
    font-family: 'Cinzel', serif;
    background: rgba(139, 115, 85, 0.25);
    border: 2px solid var(--border);
    color: var(--parchment);
    font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }

.btn, button.btn {
    font-family: 'Cinzel', serif;
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #2d1810;
    border: 2px solid var(--gold);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.3s;
}

.btn:hover { box-shadow: 0 0 15px rgba(212, 175, 55, 0.6); transform: scale(1.02); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    background: linear-gradient(145deg, #4a2c20, #2d1810);
    color: var(--gold);
    border-color: var(--gold);
}

.btn-green { background: linear-gradient(145deg, #51cf66, #37a94a); border-color: #51cf66; color: #10240f; }
.btn-red { background: linear-gradient(145deg, #ff6b6b, #cc4c4c); border-color: #ff6b6b; color: #2d0f0f; }

.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 110px; }

.quick-bets { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }

.quick-bets button {
    font-family: 'Cinzel', serif;
    background: rgba(212, 175, 55, 0.12);
    color: var(--parchment);
    border: 1px solid var(--border);
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.quick-bets button:hover { border-color: var(--gold); color: var(--gold); }

.result-box {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 2px solid var(--border);
    background: rgba(20, 15, 10, 0.6);
    text-align: center;
    min-height: 64px;
}

.result-box.win { border-color: var(--green); background: rgba(81, 207, 102, 0.1); }
.result-box.lose { border-color: var(--red); background: rgba(255, 107, 107, 0.1); }
.result-box.push { border-color: var(--gold); background: rgba(212, 175, 55, 0.1); }

.result-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; }
.result-box.win .result-title { color: var(--green); }
.result-box.lose .result-title { color: var(--red); }
.result-box.push .result-title { color: var(--gold); }

.muted { color: var(--muted); font-size: 0.85rem; }
.parchment { color: var(--parchment); }
.green { color: var(--green); }
.red { color: var(--red); }
.orange { color: var(--orange); }

.table-list { margin-top: 1rem; }

.table-list .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.25rem;
    border-bottom: 1px solid rgba(139, 115, 85, 0.5);
    font-size: 0.88rem;
}

/* ---------------- Dice ---------------- */
.dice-stage {
    text-align: center;
    padding: 1.5rem 1rem;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.14), rgba(20, 15, 10, 0.2));
    border: 2px solid var(--border);
    margin-bottom: 1rem;
}

.dice-face {
    width: 110px;
    height: 110px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'MedievalSharp', cursive;
    font-size: 2.6rem;
    color: #2d1810;
    background: linear-gradient(145deg, #f5e6a8, #d4af37);
    border: 4px solid #8b6914;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.45), inset 0 0 18px rgba(0, 0, 0, 0.15);
}

.dice-face.rolling { animation: shake 0.12s linear infinite; }

@keyframes shake {
    0% { transform: rotate(-6deg) scale(1); }
    50% { transform: rotate(6deg) scale(1.04); }
    100% { transform: rotate(-6deg) scale(1); }
}

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1rem 0; }

.choice {
    padding: 0.9rem;
    border: 2px solid var(--border);
    background: rgba(20, 15, 10, 0.5);
    color: var(--parchment);
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.choice small { display: block; color: var(--muted); font-size: 0.72rem; margin-top: 0.2rem; }
.choice.selected { border-color: var(--gold); background: rgba(212, 175, 55, 0.2); color: var(--gold); box-shadow: 0 0 12px rgba(212, 175, 55, 0.4); }

/* ---------------- Blackjack ---------------- */
.felt {
    background: radial-gradient(ellipse at center, #14532d 0%, #0a2e19 70%, #071f11 100%);
    border: 3px solid #8b6914;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.65);
}

.hand { margin-bottom: 1rem; }
.hand-label { display: flex; justify-content: space-between; color: var(--parchment); font-size: 0.85rem; margin-bottom: 0.5rem; }
.cards { display: flex; gap: 0.4rem; flex-wrap: wrap; min-height: 96px; align-items: center; }

.card-face {
    width: 66px;
    height: 94px;
    background: linear-gradient(145deg, #fffdf3, #e8e0c8);
    color: #1a1a1a;
    border: 2px solid #d4af37;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.3rem 0.4rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
    animation: dealin 0.25s ease-out;
}

@keyframes dealin { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.card-face.red { color: #c1121f; }
.card-face .rank { font-size: 1.15rem; }
.card-face .suit { font-size: 1.4rem; text-align: right; }
.card-face.back {
    background: repeating-linear-gradient(45deg, #4a2c20, #4a2c20 6px, #2d1810 6px, #2d1810 12px);
    border-color: #d4af37;
    color: var(--gold);
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

/* ---------------- Raffle ---------------- */
.prize-panel {
    text-align: center;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.22), rgba(20, 15, 10, 0.5));
    border: 3px solid var(--gold);
    padding: 1.75rem 1rem;
    margin-bottom: 1.5rem;
}

.prize-amount {
    font-family: 'MedievalSharp', cursive;
    font-size: clamp(2rem, 8vw, 3.5rem);
    color: var(--parchment);
    text-shadow: 0 0 22px rgba(212, 175, 55, 0.7);
    margin: 0.5rem 0;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.countdown .unit {
    min-width: 68px;
    background: rgba(20, 15, 10, 0.7);
    border: 2px solid var(--border);
    padding: 0.5rem 0.6rem;
}

.countdown .num { font-size: 1.5rem; color: var(--gold); font-weight: 700; }
.countdown .lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.progress-track {
    height: 14px;
    background: rgba(20, 15, 10, 0.8);
    border: 1px solid var(--border);
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #b8941f, #f5e6a8);
    transition: width 0.6s ease;
}

.ticket-stepper { display: flex; align-items: center; gap: 0.5rem; }
.ticket-stepper button {
    width: 42px; height: 42px;
    font-size: 1.3rem;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    border: 2px solid var(--border);
    cursor: pointer;
}
.ticket-stepper input { text-align: center; }

.winner-row { border-left: 4px solid var(--gold); }
.winner-name { color: var(--parchment); font-weight: 700; }
.winner-prize { color: var(--green); font-weight: 700; }

/* ---------------- Guide ---------------- */
.guide-grid { display: grid; gap: 1rem; }

.method {
    background: linear-gradient(90deg, rgba(139, 115, 85, 0.24), rgba(74, 44, 32, 0.35));
    border: 2px solid var(--border);
    border-left: 5px solid var(--gold);
    padding: 1.1rem 1.25rem;
}

.method-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
.method h3 { color: var(--gold); font-size: 1.1rem; }
.gp-hour { color: var(--green); font-weight: 700; white-space: nowrap; }
.method p { color: var(--parchment); font-size: 0.9rem; margin: 0.5rem 0; line-height: 1.55; }
.tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.tag { font-size: 0.7rem; padding: 0.18rem 0.5rem; border: 1px solid var(--border); color: var(--muted); }

.callout {
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid var(--gold);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    color: var(--parchment);
    line-height: 1.6;
    font-size: 0.92rem;
}

.steps { padding-left: 1.4rem; color: var(--parchment); line-height: 1.8; }
.steps li { margin-bottom: 0.35rem; }

/* ---------------- Support widget ---------------- */
#rs-support-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    border-radius: 30px;
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #2d1810;
    border: 2px solid #f5e6a8;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

#rs-support-btn .dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #ff6b6b;
    box-shadow: 0 0 8px #ff6b6b;
    display: none;
}

#rs-support-btn.has-alert .dot { display: inline-block; }

#rs-support-panel {
    position: fixed;
    right: 18px;
    bottom: 76px;
    width: min(370px, calc(100vw - 24px));
    max-height: min(540px, calc(100vh - 110px));
    z-index: 901;
    display: none;
    flex-direction: column;
    background: linear-gradient(145deg, #2d1810, #1a0f08);
    border: 3px solid var(--gold);
    box-shadow: 0 10px 45px rgba(0, 0, 0, 0.8);
}

#rs-support-panel.open { display: flex; }

.rs-support-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0.9rem;
    background: rgba(212, 175, 55, 0.14);
    border-bottom: 1px solid var(--border);
    font-family: 'MedievalSharp', cursive;
    color: var(--gold);
    font-size: 1rem;
}

.rs-support-head .tools { display: flex; gap: 0.35rem; }
.rs-support-head button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--gold);
    width: 30px; height: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}
.rs-support-head button:hover { border-color: var(--gold); }

.rs-support-body {
    padding: 0.8rem;
    overflow-y: auto;
    flex: 1;
    min-height: 180px;
    max-height: 340px;
    background: rgba(20, 15, 10, 0.6);
}

.rs-msg {
    margin-bottom: 0.7rem;
    padding: 0.55rem 0.65rem;
    background: rgba(139, 115, 85, 0.22);
    border-left: 3px solid var(--green);
    font-size: 0.82rem;
    color: var(--parchment);
    line-height: 1.45;
    word-break: break-word;
}

.rs-msg.support { border-left-color: var(--red); background: rgba(255, 107, 107, 0.09); }
.rs-msg .who { color: var(--gold); font-weight: 700; font-size: 0.75rem; margin-bottom: 0.2rem; }
.rs-msg .when { color: var(--muted); font-size: 0.66rem; margin-top: 0.2rem; }
.rs-msg .replybtn {
    margin-top: 0.4rem;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    background: rgba(212, 175, 55, 0.16);
    color: var(--gold);
    border: 1px solid var(--border);
    cursor: pointer;
}

.rs-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.6rem 0.7rem 0;
    border-top: 1px solid var(--border);
}

.rs-quick-replies[hidden] { display: none; }

.rs-quick-reply {
    font-family: 'Cinzel', serif;
    font-size: 0.68rem;
    padding: 0.28rem 0.5rem;
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
    border: 1px solid var(--border);
    cursor: pointer;
}

.rs-quick-reply:hover {
    background: rgba(212, 175, 55, 0.28);
    border-color: var(--gold);
}

.rs-support-form {
    display: flex;
    gap: 0.4rem;
    padding: 0.7rem;
    border-top: 1px solid var(--border);
}

.rs-support-form input {
    flex: 1;
    padding: 0.55rem;
    font-size: 0.82rem;
}

.rs-support-form button {
    font-family: 'Cinzel', serif;
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #2d1810;
    border: 2px solid var(--gold);
    padding: 0.45rem 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.8rem;
}

.rs-support-note {
    padding: 0.55rem 0.8rem;
    font-size: 0.72rem;
    color: var(--muted);
    border-top: 1px solid rgba(139, 115, 85, 0.4);
    line-height: 1.4;
}

.rs-sound-fab {
    position: fixed;
    left: 16px;
    bottom: 18px;
    z-index: 899;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(20, 15, 10, 0.85);
    border: 2px solid var(--gold);
    color: var(--gold);
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.site-footer {
    background: linear-gradient(90deg, #2d1810 0%, #4a2c20 50%, #2d1810 100%);
    border-top: 3px solid var(--gold);
    padding: 2rem 1.5rem;
    margin-top: 2rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-inner > p {
    color: var(--parchment);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
}

.footer-links a {
    color: var(--gold);
    text-decoration: none;
    font-size: 0.88rem;
}

.footer-links a:hover {
    color: var(--parchment);
    text-decoration: underline;
}

.footer-legal {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
    border-top: 1px solid rgba(139, 115, 85, 0.6);
    padding-top: 1rem;
}

@media (max-width: 640px) {
    .header { flex-direction: column; text-align: center; }
    .nav { justify-content: center; width: 100%; }
    .nav a, .nav button { flex: 1; min-width: calc(50% - 0.4rem); text-align: center; }
    .choice-row { grid-template-columns: 1fr; }
    .btn-row .btn { min-width: 100%; }
    .countdown .unit { min-width: 58px; }
    #rs-support-panel { right: 12px; bottom: 72px; }
}

/* ================================================================
   VISUAL POLISH — glow, motion and hover feedback
   ================================================================ */
:root {
    --glow-gold: rgba(212, 175, 55, 0.55);
    --glow-gold-soft: rgba(212, 175, 55, 0.24);
    --glow-green: rgba(81, 207, 102, 0.45);
    --glow-red: rgba(255, 107, 107, 0.45);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }

::selection { background: rgba(212, 175, 55, 0.38); color: #fff9db; }

/* ---------- Page entrance ---------- */
.container { animation: rsPageIn 0.45s var(--ease-out) backwards; }

.header {
    animation: rsHeaderIn 0.5s var(--ease-out) backwards, rsHeaderGlow 6s ease-in-out 1s infinite;
}

.logo { animation: rsLogoGlow 5s ease-in-out infinite; }

.hero {
    position: relative;
    overflow: hidden;
    animation: rsRiseIn 0.65s var(--ease-out) backwards;
}

.hero::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto;
    height: 120%;
    pointer-events: none;
    background: radial-gradient(circle at 35% 12%, rgba(245, 230, 168, 0.16), transparent 55%),
                radial-gradient(circle at 70% 5%, rgba(255, 190, 90, 0.1), transparent 50%);
    animation: rsHeroDrift 9s ease-in-out infinite alternate;
    z-index: 0;
}

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

.balance-bar, .tabs, .duel-stats, .callout {
    animation: rsRiseIn 0.6s var(--ease-out) backwards;
}

.panel.active { animation: rsPanelIn 0.38s var(--ease-out); }

.card, .method, .listing-card, .feature-card, .record-cell,
.side-card, .prize-panel, .my-challenge-card {
    animation: rsRiseIn 0.55s var(--ease-out) backwards;
}

.card:nth-child(2), .feature-card:nth-child(2), .method:nth-child(2) { animation-delay: 0.055s; }
.card:nth-child(3), .feature-card:nth-child(3), .method:nth-child(3) { animation-delay: 0.11s; }
.card:nth-child(4), .feature-card:nth-child(4), .method:nth-child(4) { animation-delay: 0.165s; }
.card:nth-child(5), .feature-card:nth-child(5), .method:nth-child(5) { animation-delay: 0.22s; }
.card:nth-child(6), .feature-card:nth-child(6), .method:nth-child(6) { animation-delay: 0.275s; }

/* ---------- Buttons ---------- */
.btn, button.btn, .nav a, .nav button, .tab, .quick-bets button,
.mini-btn, .ticket-stepper button, .choice, .rs-support-form button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
}

.btn::after, button.btn::after, .nav a::after, .nav button::after,
.tab::after, .quick-bets button::after, .mini-btn::after,
.ticket-stepper button::after, .choice::after, .rs-support-form button::after {
    content: '';
    position: absolute;
    top: -70%;
    bottom: -70%;
    left: -85%;
    width: 45%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-22deg);
    opacity: 0;
}

.btn:hover::after, button.btn:hover::after, .nav a:hover::after, .nav button:hover::after,
.tab:hover::after, .quick-bets button:hover::after, .mini-btn:hover::after,
.ticket-stepper button:hover::after, .choice:hover::after, .rs-support-form button:hover::after {
    animation: rsSheen 0.75s var(--ease-out);
}

.btn, button.btn {
    transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out), background 0.24s;
}

.btn:not(:disabled):not(.btn-secondary):not(.btn-green):not(.btn-red) {
    animation: rsGoldPulse 4s ease-in-out infinite;
}

.btn:hover, button.btn:hover {
    box-shadow: 0 0 0 1px rgba(245, 230, 168, 0.5), 0 6px 18px rgba(0, 0, 0, 0.42), 0 0 26px var(--glow-gold);
    transform: translateY(-1px) scale(1.02);
}

.btn-secondary:hover {
    box-shadow: 0 0 0 1px rgba(245, 230, 168, 0.35), 0 0 22px var(--glow-gold-soft);
}

.btn-green:hover {
    box-shadow: 0 0 0 1px rgba(149, 245, 167, 0.45), 0 0 24px var(--glow-green);
}

.btn-red:hover {
    box-shadow: 0 0 0 1px rgba(255, 160, 160, 0.45), 0 0 24px var(--glow-red);
}

.btn:active, button.btn:active {
    transform: translateY(0) scale(0.985);
}

.btn:focus-visible, button.btn:focus-visible, .nav a:focus-visible, .nav button:focus-visible,
.tab:focus-visible, .quick-bets button:focus-visible, .mini-btn:focus-visible,
.ticket-stepper button:focus-visible, .choice:focus-visible {
    outline: 2px solid #f5e6a8;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18), 0 0 22px var(--glow-gold);
}

.nav a, .nav button {
    transition: transform 0.22s var(--ease-out), box-shadow 0.25s var(--ease-out),
                background 0.25s, color 0.25s;
}

.nav a:hover, .nav button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(245, 230, 168, 0.3), 0 0 18px var(--glow-gold);
}

.tab { transition: transform 0.22s var(--ease-out), box-shadow 0.25s, background 0.25s, color 0.25s, border-color 0.25s; }
.tab:hover { transform: translateY(-1px); box-shadow: 0 0 16px var(--glow-gold-soft); }
.tab.active { box-shadow: 0 0 0 1px rgba(245, 230, 168, 0.35), 0 0 22px rgba(212, 175, 55, 0.32); }

.quick-bets button:hover, .mini-btn:hover, .ticket-stepper button:hover, .choice:hover {
    box-shadow: 0 0 14px var(--glow-gold-soft);
}

/* ---------- Cards and panels ---------- */
.card, .method, .listing-card, .feature-card, .challenge-row,
.record-cell, .prize-panel, .side-card, .my-challenge-card {
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out),
                border-color 0.28s var(--ease-out), background 0.28s;
}

.card:hover, .method:hover, .listing-card:hover, .feature-card:hover,
.challenge-row:hover, .record-cell:hover, .prize-panel:hover,
.side-card:hover, .my-challenge-card:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 230, 168, 0.85);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), 0 0 22px var(--glow-gold-soft);
}

.panel h2, .seo-content h2 {
    text-shadow: 2px 2px 4px #000, 0 0 18px rgba(212, 175, 55, 0.22);
}

/* ---------- Forms ---------- */
input[type="text"]:focus, input[type="number"]:focus,
input[type="password"]:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12), 0 0 16px rgba(212, 175, 55, 0.25);
}

/* ---------- Footer + support ---------- */
.footer-links a {
    display: inline-block;
    transition: color 0.2s, text-shadow 0.25s, transform 0.2s var(--ease-out);
}

.footer-links a:hover {
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.8);
    transform: translateY(-1px);
}

#rs-support-btn { transition: transform 0.22s var(--ease-out), box-shadow 0.25s; }
#rs-support-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 24px var(--glow-gold); }
#rs-support-btn.has-alert { animation: rsAttention 1.8s ease-in-out infinite; }

.rs-sound-fab { transition: transform 0.2s var(--ease-out), box-shadow 0.25s; }
.rs-sound-fab:hover { transform: scale(1.06); box-shadow: 0 0 16px var(--glow-gold); }

/* ---------- Keyframes ---------- */
@keyframes rsPageIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes rsHeaderIn {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rsHeaderGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 4px 32px rgba(212, 175, 55, 0.55); }
}

@keyframes rsLogoGlow {
    0%, 100% { text-shadow: 2px 2px 4px #000, 0 0 6px rgba(212, 175, 55, 0.15); }
    50% { text-shadow: 2px 2px 4px #000, 0 0 18px rgba(212, 175, 55, 0.55); }
}

@keyframes rsRiseIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rsPanelIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rsHeroDrift {
    from { transform: translate3d(-2%, 0, 0) scale(1); opacity: 0.7; }
    to { transform: translate3d(3%, 4%, 0) scale(1.06); opacity: 1; }
}

@keyframes rsSheen {
    0% { left: -85%; opacity: 0; }
    12% { opacity: 0.9; }
    100% { left: 115%; opacity: 0; }
}

@keyframes rsGoldPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.2)); }
    50% { filter: drop-shadow(0 0 11px rgba(212, 175, 55, 0.52)); }
}

@keyframes rsAttention {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 107, 107, 0.35); }
    50% { box-shadow: 0 0 24px rgba(255, 107, 107, 0.75); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Page-specific finishing touches ---------- */
.dice-face:not(.rolling) { animation: rsDiceGlow 4.5s ease-in-out infinite; }

.method:hover .gp-hour { text-shadow: 0 0 12px rgba(81, 207, 102, 0.55); }

.prize-amount { animation: rsPrizeGlow 3.5s ease-in-out infinite; }

@keyframes rsDiceGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.45), inset 0 0 18px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 0 44px rgba(212, 175, 55, 0.72), inset 0 0 18px rgba(0, 0, 0, 0.15); }
}

@keyframes rsPrizeGlow {
    0%, 100% { text-shadow: 0 0 22px rgba(212, 175, 55, 0.7); }
    50% { text-shadow: 0 0 34px rgba(245, 230, 168, 0.92), 0 0 12px rgba(255, 190, 90, 0.5); }
}
