: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:6px;
}

.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;
}