:root{
    --bg:#0b0e11;
    --card:#141a20;
    --card2:#0f141a;
    --text:#eaecef;
    --muted:#b7bdc6;
    --muted2:#848e9c;
    --line:rgba(234,236,239,.08);
    --yellow:#f0b90b;
    --yellow2:#ffd33d;
    --shadow: 0 24px 80px rgba(0,0,0,.55);
    --radius:18px;
    --blue:#6d8fff;
}

*{box-sizing:border-box}
body{
    margin:0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color:var(--text);
    background:
        radial-gradient(900px 500px at 50% 20%, rgba(240,185,11,.10), rgba(11,14,17,0) 60%),
        radial-gradient(900px 500px at 20% 70%, rgba(120,90,255,.06), rgba(11,14,17,0) 60%),
        var(--bg);
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.wrap{ width:min(520px, 100%); }

.card{
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)) , var(--card);
    border:1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding:22px 22px 18px;
    position:relative;
    overflow:hidden;
}
.card:before{
    content:"";
    position:absolute; inset:-120px -120px auto -120px;
    height:260px;
    background: radial-gradient(circle at 50% 50%, rgba(240,185,11,.18), rgba(240,185,11,0) 65%);
    pointer-events:none;
    filter: blur(1px);
}

.topRow{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    position:relative;
    z-index:1;
    margin-bottom:12px;
}

.iconBtn{
    border:1px solid var(--line);
    background:rgba(255,255,255,.06);
    color:var(--text);
    border-radius:12px;
    padding:10px 12px;
    font-weight:900;
    cursor:pointer;
}
.iconBtn:hover{ filter:brightness(1.05); }
.iconBtn:active{ transform: translateY(1px); }

.header{
    text-align:center;
    position:relative;
    z-index:1;
}
.title{
    margin:0;
    font-size:34px;
    font-weight:900;
    letter-spacing:.2px;
}

.pill{
    display:inline-flex;
    align-items:center;
    gap:10px;
    margin-top:10px;
    padding:8px 12px;
    border-radius:999px;
    background:rgba(255,255,255,.06);
    border:1px solid var(--line);
    color:var(--text);
    font-weight:800;
    font-size:14px;
}
.pill .eth{
    width:18px; height:18px;
    display:inline-grid; place-items:center;
    border-radius:6px;
    background:rgba(109,143,255,.18);
    border:1px solid rgba(109,143,255,.22);
    font-size:12px;
}

.clock{
    margin:18px auto 0;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    position:relative;
    z-index:1;
}
.digit{
    width:62px;
    height:72px;
    border-radius:14px;
    background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0)) , #1b222b;
    border:1px solid rgba(234,236,239,.10);
    display:grid;
    place-items:center;
    position:relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.digit:after{
    content:"";
    position:absolute;
    left:10px; right:10px;
    top:50%;
    height:1px;
    background:rgba(0,0,0,.55);
    box-shadow: 0 1px 0 rgba(255,255,255,.06);
    transform: translateY(-.5px);
    opacity:.9;
}
.digit span{
    font-size:44px;
    font-weight:950;
    letter-spacing:1px;
    color:var(--text);
    text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.colon{
    font-size:42px;
    font-weight:950;
    color:rgba(234,236,239,.85);
    transform: translateY(-2px);
    user-select:none;
}

.btnArea{
    margin:22px auto 6px;
    display:flex;
    justify-content:center;
    position:relative;
    z-index:1;
}

.bigBtn{
    width:210px;
    height:210px;
    border-radius:999px;
    border:0;
    cursor:pointer;
    background:
        radial-gradient(circle at 50% 35%, rgba(255,255,255,.22), rgba(255,255,255,0) 55%),
        radial-gradient(circle at 50% 60%, rgba(0,0,0,.35), rgba(0,0,0,0) 60%),
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)),
        #0f141a;
    box-shadow:
        0 22px 50px rgba(0,0,0,.55),
        inset 0 0 0 10px rgba(255,255,255,.05),
        inset 0 0 0 22px rgba(255,255,255,.04);
    position:relative;
    display:grid;
    place-items:center;
    transition: transform .08s ease, filter .12s ease, opacity .12s ease;
}
.bigBtn:active{ transform: scale(.985); }

.bigBtn[disabled]{
    cursor:not-allowed;
    opacity:.55;
    filter: grayscale(1) brightness(.9);
}

.bigBtn .inner{
    width:132px;
    height:132px;
    border-radius:999px;
    background:
        radial-gradient(circle at 40% 30%, rgba(255,255,255,.25), rgba(255,255,255,0) 60%),
        linear-gradient(180deg, rgba(109,143,255,.22), rgba(109,143,255,.08)),
        #243046;
    border:1px solid rgba(109,143,255,.28);
    box-shadow: inset 0 8px 30px rgba(0,0,0,.35);
    display:grid;
    place-items:center;
}

.ethLogo{
    width:54px;
    height:54px;
    filter: drop-shadow(0 10px 16px rgba(0,0,0,.35));
    opacity:.95;
}

.helper{
    text-align:center;
    margin-top:14px;
    position:relative;
    z-index:1;
}
.attempts{
    color:var(--text);
    font-weight:900;
    margin:0;
    font-size:18px;
}
.attempts .hi{ color:var(--yellow); }
.statusLine{
    margin:6px 0 0;
    color:var(--muted2);
    font-weight:700;
    font-size:13px;
}
.statusLine strong{ color:var(--text); }

.cta{
    margin:14px auto 0;
    display:flex;
    justify-content:center;
    position:relative;
    z-index:1;
}
.yellowBtn{
    width: 100%;
    max-width: 360px;
    border:0;
    border-radius:12px;
    padding:14px 16px;
    background: linear-gradient(180deg, var(--yellow2), var(--yellow));
    color:#111;
    font-weight:950;
    font-size:15px;
    cursor:pointer;
    box-shadow: 0 10px 24px rgba(240,185,11,.18);
    transition: filter .12s ease, transform .08s ease;
}
.yellowBtn:hover{ filter:brightness(1.02); }
.yellowBtn:active{ transform: translateY(1px); }
.yellowBtn:disabled{
    opacity:.45;
    cursor:not-allowed;
    filter:saturate(.4);
}

.details{
    margin-top:16px;
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)), var(--card2);
    border:1px solid var(--line);
    border-radius:14px;
    padding:14px 14px 12px;
    position:relative;
    z-index:1;
}
.detailsTop{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:10px;
}
.detailsTop .left{
    display:flex; align-items:center; gap:8px;
    color:rgba(234,236,239,.9);
    font-weight:900;
}
.infoDot{
    width:18px;height:18px;border-radius:999px;
    display:inline-grid;place-items:center;
    border:1px solid var(--line);
    background:rgba(255,255,255,.05);
    color:var(--muted);
    font-size:12px;
    font-weight:950;
}
.detailsTop a{
    color:var(--yellow);
    text-decoration:none;
    font-weight:950;
}
.grid{
    display:grid;
    grid-template-columns: 1fr auto;
    gap:10px 12px;
    align-items:center;
    font-weight:800;
    font-size:14px;
}
.grid .k{ color:var(--muted2); font-weight:800; }
.grid .v{ color:var(--text); font-weight:950; text-align:right; }

/* Modal */
/* Modal */
.modalOverlay{
    position:fixed;
    inset:0;
    background: rgba(0,0,0,.58);

    /* keep flex ALWAYS so centering always works */
    display:flex;
    align-items:center;
    justify-content:center;

    padding:22px;
    z-index:999;

    /* hide/show via opacity (NOT display) */
    opacity:0;
    pointer-events:none;
    transition: opacity .18s ease;
}

/* add this class in JS when opening */
.modalOverlay.is-visible{
    opacity:1;
    pointer-events:auto;
}

/* optional: modal entrance animation */
.modal{
    width:min(720px, 100%);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)), var(--card);
    border:1px solid var(--line);
    border-radius:18px;
    box-shadow: var(--shadow);
    padding:18px;

    transform: translateY(10px) scale(.98);
    transition: transform .18s ease, opacity .18s ease;
}
.modalOverlay.is-visible .modal{
    transform: translateY(0) scale(1);
}

.modalHeader{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}
.modalHeader h3{
    margin:0;
    font-size:18px;
    font-weight:950;
}
.closeX{
    border:1px solid var(--line);
    background:rgba(255,255,255,.06);
    color:var(--text);
    border-radius:10px;
    padding:8px 10px;
    cursor:pointer;
    font-weight:950;
}

.modal p{
    margin:6px 0 0;
    color:var(--muted);
    font-weight:650;
    line-height:1.35;
}

.modalActions{
    margin-top:14px;
    display:flex;
    gap:10px;
    justify-content:flex-end;
}

.ghostBtn{
    border-radius:12px;
    padding:12px 14px;
    background: rgba(255,255,255,.06);
    border:1px solid var(--line);
    color:var(--text);
    font-weight:900;
    cursor:pointer;
}

.spinnerRow{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:12px;
    color:var(--muted);
    font-weight:800;
}
.spinner{
    width:18px;height:18px;
    border-radius:999px;
    border:2px solid rgba(255,255,255,.18);
    border-top-color: var(--yellow);
    animation: spin .9s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* Rules content */
.rulesBody{
    margin-top:12px;
    max-height:min(70vh, 540px);
    overflow:auto;
    padding-right:6px;
}
.sectionTitle{
    margin:12px 0 8px;
    font-size:14px;
    font-weight:950;
    color:rgba(234,236,239,.92);
}
.stepCard{
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    border-radius:14px;
    padding:12px;
    margin:10px 0;
}
.stepHead{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
}
.stepTag{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-weight:950;
}
.badge{
    background:rgba(240,185,11,.12);
    border:1px solid rgba(240,185,11,.22);
    color:var(--yellow2);
    padding:3px 8px;
    border-radius:999px;
    font-size:12px;
    font-weight:950;
}
.imgPh{
    height:120px;
    border-radius:12px;
    border:1px dashed rgba(234,236,239,.18);
    display:grid;
    place-items:center;
    color:var(--muted2);
    font-weight:900;
    letter-spacing:.2px;
    background:
        radial-gradient(400px 140px at 30% 20%, rgba(109,143,255,.12), rgba(0,0,0,0) 60%),
        rgba(0,0,0,.10);
    margin-top:8px;
}
ul{
    margin:8px 0 0 18px;
    padding:0;
    color:var(--muted);
    font-weight:650;
    line-height:1.45;
}
li{ margin:6px 0; }

.fine{
    margin-top:10px;
    font-size:12px;
    color:var(--muted2);
    font-weight:650;
}

/* --- WIN FX LAYER --- */
.winFX{
    position:relative;
    margin-top:14px;
    border-radius:16px;
    overflow:hidden;
    border:1px solid rgba(240,185,11,.18);
    background:
        radial-gradient(900px 280px at 50% 10%, rgba(240,185,11,.22), rgba(0,0,0,0) 55%),
        radial-gradient(600px 240px at 15% 70%, rgba(109,143,255,.14), rgba(0,0,0,0) 60%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)),
        rgba(0,0,0,.10);
    padding:16px;
}

.winGlow{
    position:absolute;
    inset:-40px -40px auto -40px;
    height:220px;
    background: radial-gradient(circle at 50% 50%, rgba(240,185,11,.35), rgba(240,185,11,0) 60%);
    filter: blur(2px);
    pointer-events:none;
    animation: winGlowPulse 1.8s ease-in-out infinite;
    opacity:.9;
}
@keyframes winGlowPulse{
    0%,100%{ transform: scale(1); opacity:.75; }
    50%{ transform: scale(1.06); opacity:1; }
}

.winHeader{ position:relative; z-index:3; text-align:center; padding:8px 6px 6px; }

.winBadge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:6px 12px;
    border-radius:999px;
    background: rgba(240,185,11,.16);
    border:1px solid rgba(240,185,11,.26);
    color: var(--yellow2);
    font-weight:950;
    letter-spacing:.12em;
    font-size:12px;
    text-transform:uppercase;
    box-shadow: 0 10px 26px rgba(240,185,11,.12);
}

.winTitle{
    margin:12px 0 6px;
    font-weight:1000;
    font-size:34px;
    letter-spacing:.4px;
    line-height:1.05;
    background: linear-gradient(180deg, #fff, rgba(255,255,255,.78));
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
    text-shadow: 0 12px 50px rgba(0,0,0,.55);
}

.winSub{
    margin:0 auto;
    max-width:520px;
    color: rgba(234,236,239,.86);
    font-weight:800;
    font-size:13px;
    line-height:1.35;
}
.winSub b{ color: var(--yellow2); }

/* --- Burst confetti splash --- */
.winBurst{
    position:absolute;
    inset:0;
    pointer-events:none;
    z-index:2;
}
.spark{
    position:absolute;
    width:10px;
    height:10px;
    border-radius:999px;
    transform: translate(-50%,-50%);
    filter: drop-shadow(0 10px 12px rgba(0,0,0,.35));
    opacity:0;
    animation: sparkFly 900ms ease-out forwards;
}
@keyframes sparkFly{
    0%{ opacity:0; transform: translate(-50%,-50%) scale(.6); }
    10%{ opacity:1; }
    100%{ opacity:0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); }
}

/* --- ETH rain --- */
.winRain{
    position:absolute;
    inset:0;
    overflow:hidden;
    z-index:1;
    pointer-events:none;
}
.ethDrop{
    position:absolute;
    top:-60px;
    left:0;
    width:28px;
    height:28px;
    opacity:.92;
    filter: drop-shadow(0 14px 18px rgba(0,0,0,.45));
    animation: fall linear forwards;
    transform: translate3d(0,0,0);
}
.ethDrop svg{ width:100%; height:100%; }
@keyframes fall{
    to{ transform: translate3d(var(--drift), calc(100vh + 240px), 0) rotate(var(--rot)); opacity:.88; }
}

/* --- Make modal text area look like casino win --- */
.modal.winMode #modalDesc{
    color: rgba(234,236,239,.82);
    font-weight:800;
}
.modal.winMode #modalTitle{
    font-size:20px;
}

/* Extra big Claim button in win mode */
.modal.winMode #claimBtn{
    max-width: 100% !important;
    width: 100% !important;
    font-size:16px !important;
    padding:16px 16px !important;
    border-radius:14px !important;
    box-shadow: 0 14px 30px rgba(240,185,11,.22) !important;
}

/* ============================= */
/* GLOBAL (FULLSCREEN) WIN FX    */
/* ============================= */

.globalWinFX{
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998; /* BELOW modal (999), ABOVE page */
    overflow: hidden;
    opacity: 0;
    transition: opacity .25s ease;
}

.globalWinFX.is-active{
    opacity: 1;
}

/* Big golden glow wash */
.globalWinFX::before{
    content:"";
    position:absolute;
    inset:-20%;
    background:
        radial-gradient(800px 400px at 50% 20%, rgba(240,185,11,.25), transparent 60%),
        radial-gradient(600px 300px at 80% 70%, rgba(109,143,255,.18), transparent 60%);
    filter: blur(2px);
}

/* -------- ETH RAIN -------- */
.globalRain{
    position:absolute;
    inset:0;
}

.globalEth{
    position:absolute;
    top:-80px;
    width:36px;
    height:36px;
    opacity:.85;
    animation: globalFall linear forwards;
    filter: drop-shadow(0 16px 24px rgba(0,0,0,.45));
}

.globalEth svg{
    width:100%;
    height:100%;
}

@keyframes globalFall{
    to{
        transform:
            translate3d(var(--drift), calc(100vh + 200px), 0)
            rotate(var(--rot));
    }
}

/* -------- BURST -------- */
.globalBurst{
    position:absolute;
    inset:0;
}

.globalSpark{
    position:absolute;
    left:50%;
    top:50%;
    border-radius:999px;
    opacity:0;
    animation: globalSpark 1s ease-out forwards;
}

@keyframes globalSpark{
    0%{
        transform: translate(-50%,-50%) scale(.6);
        opacity:0;
    }
    10%{ opacity:1; }
    100%{
        transform:
            translate(calc(-50% + var(--dx)),
            calc(-50% + var(--dy)))
            scale(1.2);
        opacity:0;
    }
}


/* Casino “FLASH” for the Claim button (add to style.css) */
@keyframes claimPulse {
    0%   { transform: translateY(0) scale(1);   filter: brightness(1); }
    40%  { transform: translateY(-1px) scale(1.02); filter: brightness(1.08); }
    100% { transform: translateY(0) scale(1);   filter: brightness(1); }
}
@keyframes claimGlow {
    0%   { box-shadow: 0 14px 34px rgba(240,185,11,.22), 0 0 0 rgba(240,185,11,0); }
    35%  { box-shadow: 0 18px 44px rgba(240,185,11,.34), 0 0 28px rgba(240,185,11,.22); }
    70%  { box-shadow: 0 16px 40px rgba(255,211,61,.26), 0 0 44px rgba(255,211,61,.20); }
    100% { box-shadow: 0 14px 34px rgba(240,185,11,.22), 0 0 0 rgba(240,185,11,0); }
}
@keyframes claimShine {
    0%   { transform: translateX(-140%) skewX(-18deg); opacity: 0; }
    10%  { opacity: .9; }
    35%  { opacity: .9; }
    60%  { transform: translateX(140%) skewX(-18deg); opacity: 0; }
    100% { transform: translateX(140%) skewX(-18deg); opacity: 0; }
}

/* Apply flashy mode only when you add .claimFlash class */
#claimBtn.claimFlash{
    position: relative;
    overflow: hidden;
    animation: claimPulse 1.05s ease-in-out infinite, claimGlow 1.35s ease-in-out infinite;
    letter-spacing: .25px;
    text-transform: none;
}

/* moving “shine” sweep */
#claimBtn.claimFlash::after{
    content:"";
    position:absolute;
    top:-40%;
    left:0;
    width:55%;
    height:180%;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.55), rgba(255,255,255,0));
    opacity:0;
    animation: claimShine 1.9s ease-in-out infinite;
    pointer-events:none;
}

/* subtle marquee “sparkle” border */
#claimBtn.claimFlash::before{
    content:"";
    position:absolute;
    inset:-2px;
    border-radius:14px;
    background: conic-gradient(from 0deg, rgba(255,255,255,0), rgba(255,255,255,.45), rgba(255,255,255,0), rgba(255,255,255,.25), rgba(255,255,255,0));
    opacity:.35;
    filter: blur(.2px);
    animation: spin 2.2s linear infinite;
    pointer-events:none;
}

/* reuse your spinner keyframes name "spin" if already exists; if not, keep this */
@keyframes spin{ to{ transform: rotate(360deg); } }

.statusLine.hype {
    color: var(--yellow2);
    text-shadow: 0 0 12px rgba(240,185,11,.55);
    animation: hypePulse .6s ease-in-out infinite;
}
@keyframes hypePulse{
    0%,100%{ opacity:1 }
    50%{ opacity:.6 }
}