/* =========================
   BASE
========================= */

body{
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
    background:linear-gradient(#f8fafc,#eef2f7);
    margin:0;
    padding:20px;
}

h2{
    font-size:20px;
    font-weight:700;
}



/* =========================
   HOME BUTTONS
========================= */

.home-btn{
    display:inline-block;
    margin:10px;
    padding:16px 28px;

    background:#6366f1;
    color:white;

    border-radius:12px;
    text-decoration:none;
    font-weight:bold;

    box-shadow:0 6px 16px rgba(0,0,0,.2);

    transition:all .2s ease;
}

.home-btn:hover{
    background:#4f46e5;
    transform:translateY(-2px);
}

/* =========================
   HEADER
========================= */

.app-header{
    background:white;
    box-shadow:0 6px 20px rgba(0,0,0,.08);
    padding:16px 0;
    border-bottom:1px solid #eee;
}

.header-inner{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
}

.logo{
    font-size:20px;
    margin:0;
}

.nav{
    display:flex;
    align-items:center;
    gap:16px;
    flex-wrap:wrap;
}

.nav a{
    text-decoration:none;
    color:#333;
    font-weight:500;
}

/* =========================
   LAYOUT
========================= */




/* =========================
   BUTTONS
========================= */

.roll-btn{
    margin-top:10px;
    width:100%;
    padding:10px;
    border:none;
    border-radius:10px;
    background:#6366f1;
    color:white;
    font-weight:bold;
    cursor:pointer;
}

.roll-btn:hover{
    background:#4f46e5;
}

.add-toggle-btn{
    margin:20px 0;
    padding:12px 20px;

    background:linear-gradient(135deg,#6366f1,#4338ca);
    color:white;

    border:none;
    border-radius:14px;

    font-weight:600;
    font-size:15px;

    cursor:pointer;

    box-shadow:
        0 6px 14px rgba(0,0,0,.15),
        inset 0 -2px 4px rgba(0,0,0,.2);

    transition:all .2s ease;
}

.add-toggle-btn:hover{
    transform:translateY(-2px);
    box-shadow:
        0 10px 20px rgba(0,0,0,.2);
}

/* =========================
   FORM
========================= */

.add-form{
    display:flex;
    gap:10px;
    margin-bottom:20px;
}

.add-form input{
    flex:1;
    padding:10px;
    border-radius:8px;
    border:1px solid #ddd;
}

.add-form button{
    padding:10px 16px;
    border:none;
    border-radius:8px;
    background:#10b981;
    color:white;
}

/* =========================
   BOARD
========================= */

.board-wrapper{
    width:96vw;
    max-width:720px;
    margin:10px auto;

    padding:10px;

    background:linear-gradient(145deg,#fde68a,#facc15);
    border-radius:24px;

    box-shadow:
        0 25px 60px rgba(0,0,0,.25),
        inset 0 3px 8px rgba(255,255,255,.5),
        inset 0 -10px 25px rgba(0,0,0,.18);
    outline:2px solid rgba(255,255,255,.25);
}

.board{
    display:grid;
    grid-template-columns:repeat(8,1fr);
    grid-template-rows:repeat(8,1fr);

    width:100%;
    aspect-ratio:1/1;

    gap:4px;
    position:relative;
}

.square{
    background:linear-gradient(160deg,#fde68a,#fcd34d);
    border-radius:8px;

    position:relative;

    box-shadow:
        inset 0 2px 4px rgba(255,255,255,0.5),
        inset 0 -3px 6px rgba(0,0,0,0.15);
}

.square[data-pos="1"]::after{
    content:"START";
    position:absolute;
    bottom:4px;
    left:4px;
    font-size:9px;
    font-weight:700;
    color:#065f46;
}

.square[data-pos="64"]::after{
    content:"FINISH";
    position:absolute;
    bottom:4px;
    right:4px;
    font-size:9px;
    font-weight:700;
    color:#7c2d12;
}

.square:nth-child(n+55){
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,0.5),
        inset 0 -3px 6px rgba(0,0,0,0.15),
        0 0 8px rgba(234,179,8,.4);
}

.square:nth-child(even){
    background:linear-gradient(145deg,#fef08a,#fde047);
}

.square-number{
    position:absolute;
    top:4px;
    left:6px;
    font-size:11px;
    font-weight:600;
    color:#92400e;
}

.token-container{
    position:absolute;
    bottom:4px;
    right:4px;
}

.board-overlay{
    position:absolute;
    inset:0;
    pointer-events:none;
    z-index:1;
}

/* =========================
   TOKENS
========================= */

.token{
    width:28px;
    height:28px;
    border-radius:50%;

    display:flex;
    align-items:center;
    justify-content:center;

    color:white;
    font-size:12px;
    font-weight:bold;

    border:2px solid white;

    box-shadow:0 4px 10px rgba(0,0,0,.35);
    position:relative;
    z-index:2;
}

.token-container{
    position:absolute;
    bottom:4px;
    right:4px;

    display:flex;
    gap:3px;
    flex-wrap:wrap;
}

/* =========================
   CHILD BIG BUTTON
========================= */

.big-roll{
    padding:18px 28px;
    font-size:18px;
    font-weight:bold;

    border:none;
    border-radius:16px;

    background:linear-gradient(135deg,#22c55e,#16a34a);
    color:white;

    box-shadow:0 8px 20px rgba(0,0,0,.3);

    cursor:pointer;
    margin:10px;
}

.big-roll:active{
    transform:scale(0.95);
}

.big-roll:disabled{
    background:linear-gradient(135deg,#e5e7eb,#d1d5db);
    color:#9ca3af;
    cursor:not-allowed;
    box-shadow:none;
    transform:none;
}

.big-roll:not(:disabled):hover{
    transform:translateY(-2px) scale(1.02);
    box-shadow:
        0 12px 28px rgba(0,0,0,.35),
        0 0 12px rgba(34,197,94,.5);
}

/* =========================
   CHILD CARDS
========================= */
.section-card{
    background:white;
    padding:24px;
    border-radius:22px;

    margin-bottom:30px;

    box-shadow:
        0 20px 40px rgba(0,0,0,.08),
        0 6px 12px rgba(0,0,0,.05);

    transition:all .2s ease;
}

.section-card:hover{
    box-shadow:
        0 30px 60px rgba(0,0,0,.12),
        0 10px 18px rgba(0,0,0,.08);
}

.card-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:16px;
    margin-bottom:10px;
}
.card{
    background: white;
    padding:18px;
    border-radius:18px;

    box-shadow:
        0 10px 25px rgba(0,0,0,.08),
        0 2px 6px rgba(0,0,0,.05);

    display:flex;
    flex-direction:column;
    gap:8px;

    transition:all .2s ease;
}

.card:hover{
    transform:translateY(-3px);
    box-shadow:
        0 18px 35px rgba(0,0,0,.12),
        0 6px 12px rgba(0,0,0,.08);
}

.child-header{
    display:flex;
    align-items:center;
    gap:10px;
}

.color-dot{
    width:18px;
    height:18px;
    border-radius:50%;
    border:2px solid white;
    box-shadow:0 2px 6px rgba(0,0,0,.3);
}

.card strong{
    font-size:16px;
}

.card div{
    font-size:14px;
    color:#555;
}

.child-info{
    margin-top:6px;
    font-size:14px;
    color:#444;
}

.container{
    max-width:1100px;
    margin:auto;
    padding:10px;
}


/* COLOR PICKER FIX */

.color-picker{
    display:flex;
    gap:12px;
    margin-top:6px;
}

.color-option{
    position:relative;
    width:34px;
    height:34px;
}

/* hide radio */
.color-option input{
    position:absolute;
    inset:0;
    opacity:0;
    cursor:pointer;
}

/* color circle */
.color-option span{
    display:block;
    width:100%;
    height:100%;
    border-radius:50%;

    border:3px solid transparent;

    box-shadow:0 4px 10px rgba(0,0,0,.15);

    transition:all .2s ease;
}

/* hover */
.color-option span:hover{
    transform:scale(1.15);
}

/* selected = premium ring */
.color-option input:checked + span{
    transform:scale(1.2);
    border:3px solid white;
    box-shadow:
        0 0 0 3px #6366f1,
        0 6px 16px rgba(0,0,0,.25);
}

/* ADD BUTTON */
.add-toggle-btn{
    margin:20px 0;
    padding:12px 18px;

    background:#4f46e5;
    color:white;

    border:none;
    border-radius:12px;

    font-weight:600;
    cursor:pointer;
}

/* HIDDEN FORM */
.add-child-form{
    margin-top:16px;

    background:linear-gradient(145deg,#ffffff,#f8fafc);
    padding:22px;
    border-radius:20px;

    box-shadow:
        0 20px 40px rgba(0,0,0,.08),
        0 4px 10px rgba(0,0,0,.05);

    display:flex;
    flex-direction:column;
    gap:16px;

    border:1px solid #eef2f7;

    animation:fadeSlide .25s ease;
}

/* smooth entrance */
@keyframes fadeSlide{
    from{
        opacity:0;
        transform:translateY(-10px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.add-child-form input{
    padding:14px 16px;
    border-radius:12px;
    border:1px solid #e5e7eb;

    font-size:15px;

    background:#f9fafb;

    transition:all .2s ease;
}

.add-child-form input:focus{
    outline:none;
    border-color:#6366f1;
    box-shadow:0 0 0 3px rgba(99,102,241,.15);
    background:white;
}

.add-child-form button{
    margin-top:4px;

    padding:14px;
    border:none;
    border-radius:14px;

    background:linear-gradient(135deg,#10b981,#059669);
    color:white;

    font-size:15px;
    font-weight:600;

    cursor:pointer;

    box-shadow:
        0 10px 20px rgba(16,185,129,.3),
        inset 0 -2px 4px rgba(0,0,0,.2);

    transition:all .2s ease;
}

.add-child-form button:hover{
    transform:translateY(-2px);
    box-shadow:
        0 14px 26px rgba(16,185,129,.4);
}

.add-child-form button:active{
    transform:scale(.97);
}
.hidden{
    display:none;
}

/* FORM LAYOUT FIX */
.add-child-form form{
    display:flex;
    flex-direction:column;
    gap:16px;
}

/* COLOR PICKER FIX */
.color-picker{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

/* BUTTON FIX */
.form-actions{
    margin-top:8px;
}

.add-child-form button{
    width:100%;
}

.remove-btn{
    margin-top:8px;

    background:none;      /* ❌ remove background */
    border:none;          /* ❌ remove border */

    color:#ef4444;
    font-size:13px;
    font-weight:600;

    padding:0;            /* ❌ remove padding */
    cursor:pointer;

    box-shadow:none;      /* ❌ remove shadow */

    align-self:flex-start;

    transition:all .2s ease;
}

.remove-btn:hover{
    color:#dc2626;
    text-decoration:underline;
}

.logo{
    display:flex;
    align-items:center;
    gap:10px;

    font-weight:700;
    font-size:18px;
}

.logo img{
    width:40px;
    height:40px;

    border-radius:12px;

    box-shadow:
        0 6px 14px rgba(0,0,0,.25),
        inset 0 2px 4px rgba(255,255,255,.3);
}

.home-container{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

    text-align:center;

    margin-top:60px;
}

/* 🔥 BIG LOGO */
.home-logo{
    width:140px;
    height:140px;

    border-radius:28px;

    box-shadow:
        0 20px 50px rgba(0,0,0,.25),
        inset 0 3px 6px rgba(255,255,255,.4);

    margin-bottom:20px;

    animation:popIn .5s ease;
}

/* ✨ subtle animation */
@keyframes popIn{
    from{
        transform:scale(.8);
        opacity:0;
    }
    to{
        transform:scale(1);
        opacity:1;
    }
}

.home-title{
    font-size:28px;
    font-weight:700;
    margin-bottom:6px;
}

.home-subtitle{
    color:#666;
    margin-bottom:30px;
}

.home-buttons{
    display:flex;
    gap:14px;
}

.home-btn{
    padding:14px 22px;
    border-radius:14px;

    background:linear-gradient(135deg,#6366f1,#4338ca);
    color:white;

    text-decoration:none;
    font-weight:600;

    box-shadow:0 8px 20px rgba(0,0,0,.2);

    transition:all .2s ease;
}

.home-btn:hover{
    transform:translateY(-3px);
}

/* secondary button */
.home-btn.secondary{
    background:linear-gradient(135deg,#10b981,#059669);
}

.reward-section{
    margin-top:12px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.add-reward-toggle{
    margin-top:20px;
    padding:12px 20px;

    background:linear-gradient(135deg,#6366f1,#4338ca);
    color:white;

    border:none;
    border-radius:14px;

    font-weight:600;
    font-size:15px;

    cursor:pointer;

    box-shadow:
        0 6px 14px rgba(0,0,0,.15),
        inset 0 -2px 4px rgba(0,0,0,.2);

    transition:all .2s ease;
}

.add-reward-toggle:hover{
    transform:translateY(-2px);
    box-shadow:
        0 10px 20px rgba(0,0,0,.2);
}

.add-reward-toggle:active{
    transform:scale(.97);
}

.reward-select,
.reward-input{
    width:100%;
    padding:10px;
    border-radius:10px;
    border:1px solid #e5e7eb;
    font-size:14px;
}

.reward-select:focus,
.reward-input:focus{
    outline:none;
    border-color:#4f46e5;
    box-shadow:0 0 0 2px rgba(79,70,229,.15);
}

.reward-btn{
    margin-top:4px;

    padding:14px;
    border:none;
    border-radius:14px;

    background:linear-gradient(135deg,#10b981,#059669);
    color:white;

    font-size:15px;
    font-weight:600;

    cursor:pointer;

    box-shadow:
        0 10px 20px rgba(16,185,129,.3),
        inset 0 -2px 4px rgba(0,0,0,.2);

    transition:all .2s ease;
}

.reward-btn:hover{
    transform:translateY(-2px);
    box-shadow:
        0 14px 26px rgba(16,185,129,.4);
}

.reward-btn:active{
    transform:scale(.97);
}

/* =========================
   REWARD HISTORY (PREMIUM STYLE)
========================= */

.reward-history{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:10px;
}

.reward-item{
    background:white;
    padding:14px 16px;
    border-radius:14px;

    display:flex;
    justify-content:space-between;
    align-items:center;

    box-shadow:
        0 8px 20px rgba(0,0,0,.06);

    transition:all .2s ease;
}

.reward-item:hover{
    transform:translateY(-2px);
}

.reward-left{
    display:flex;
    align-items:center;
    gap:10px;
}

.history-dot{
    width:12px;
    height:12px;
    border-radius:50%;
}

.reward-text{
    display:flex;
    flex-direction:column;
}

.reward-reason{
    font-size:13px;
    color:#555;
}

.reward-right{
    text-align:right;
}

.reward-date{
    font-size:13px;
    font-weight:600;
}

.reward-time{
    font-size:12px;
    color:#888;
}

.empty-history{
    text-align:center;
    padding:20px;
    color:#9ca3af;
}

.roll-btn:disabled{
    background:#e5e7eb;
    color:#9ca3af;
    cursor:not-allowed;
    box-shadow:none;
    transform:none;
}

.reward-count{
    font-size:13px;
    font-weight:600;
    color:#2563eb;
}

.card{
    transition:all .25s cubic-bezier(.2,.8,.2,1);
}


.header-token{
    width:18px;
    height:18px;
    border-radius:50%;

    box-shadow:
        0 3px 8px rgba(0,0,0,.3),
        0 0 8px rgba(0,0,0,.15);
}

.append-reward-msg{
    margin-top:8px;
    color:#9ca3af;
    font-size:13px;
}

button:focus-visible{
    outline:2px solid #6366f1;
    outline-offset:2px;
}


/* =========================
   NAV CHILD ACTIVE STATE
========================= */

.child-nav{
    display:flex;
    align-items:center;
    gap:8px;
}

.child-link{
    display:flex;
    align-items:center;
    gap:6px;

    padding:4px 8px;
    border-radius:10px;

    text-decoration:none;
    color:#333;

    background:#f3f4f6;
    font-size:13px;

    transition:all .2s ease;
}

.child-link:hover{
    background:#e5e7eb;
}

.nav-dot{
    width:8px;
    height:8px;
    border-radius:50%;
}

.active-child{
    background:linear-gradient(135deg,#6366f1,#4338ca);
    color:white;

    box-shadow:0 6px 16px rgba(0,0,0,.2);
}

.active-child .nav-dot{
    border:2px solid white;
}


/* =========================
   USER NAV
========================= */

.user-nav{
    display:flex;
    align-items:center;
    gap:10px;
    margin-left:16px;
}

.user-name{
    font-size:13px;
    font-weight:600;
    color:#374151;
}

.logout-btn{
    padding:6px 10px;
    border-radius:8px;
    text-decoration:none;

    background:#ef4444;
    color:white;
    font-size:12px;
    font-weight:600;

    transition:all .2s ease;
}

.logout-btn:hover{
    background:#dc2626;
    transform:translateY(-1px);
}

.user-nav a{
    font-size:13px;
    font-weight:500;
    color:#4f46e5;
}

.user-nav a:hover{
    text-decoration:underline;
}


/* =========================
   ✨ ADVANCED PREMIUM EFFECTS
========================= */

/* Glass subtle effect for cards */
.section-card{
    backdrop-filter: blur(6px);
}

/* Smooth hover lift for all interactive elements */
.card,
.home-btn,
.add-toggle-btn,
.reward-btn,
.add-reward-toggle{
    transition:all .25s cubic-bezier(.2,.8,.2,1);
}

.card:hover{
    transform:translateY(-4px) scale(1.01);
}

/* Soft glow on active child nav */
.active-child{
    box-shadow:
        0 6px 16px rgba(0,0,0,.2),
        0 0 10px rgba(99,102,241,.4);
}

/* Button press effect */
button:active{
    transform:scale(.96);
}

/* Token subtle bounce on move (for JS animation hook) */
.token.moving{
    animation:bounceMove .3s ease;
}

@keyframes bounceMove{
    0%{ transform:scale(1); }
    50%{ transform:scale(1.3); }
    100%{ transform:scale(1); }
}

/* Dice animation placeholder */
.dice-roll{
    animation:diceSpin .4s ease;
}

@keyframes diceSpin{
    0%{ transform:rotate(0deg) scale(1); }
    50%{ transform:rotate(180deg) scale(1.2); }
    100%{ transform:rotate(360deg) scale(1); }
}

/* Reward pulse highlight */
.reward-highlight{
    animation:pulseGlow 1s ease;
}

@keyframes pulseGlow{
    0%{ box-shadow:0 0 0 rgba(16,185,129,0); }
    50%{ box-shadow:0 0 16px rgba(16,185,129,.6); }
    100%{ box-shadow:0 0 0 rgba(16,185,129,0); }
}

/* Smooth page fade-in */
body{
    animation:fadeIn .3s ease;
}

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

/* Hover glow for buttons */
.home-btn:hover,
.add-toggle-btn:hover,
.reward-btn:hover{
    box-shadow:0 12px 30px rgba(0,0,0,.25);
}

/* Premium scrollbar */
::-webkit-scrollbar{
    width:8px;
}

::-webkit-scrollbar-track{
    background:#f1f5f9;
}

::-webkit-scrollbar-thumb{
    background:linear-gradient(#6366f1,#4338ca);
    border-radius:10px;
}


/* =========================
   PROGRESS BAR
========================= */

.progress-wrapper{
    width:260px;
    margin:10px auto 20px auto;
    text-align:center;
}

.progress-bar{
    width:100%;
    height:14px;

    background:#e5e7eb;
    border-radius:999px;

    overflow:hidden;

    box-shadow:inset 0 2px 4px rgba(0,0,0,.1);
}

.progress-fill{
    height:100%;
    border-radius:999px;

    transition:width .4s ease;
}

.progress-text{
    margin-top:6px;
    font-size:13px;
    font-weight:600;
    color:#374151;
}

/* =========================
   AUTH PAGES (PREMIUM)
========================= */

.auth-wrapper{
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:70vh;
}

.auth-card{
    width:100%;
    max-width:400px;

    background:linear-gradient(145deg,#ffffff,#f8fafc);
    padding:30px;

    border-radius:24px;

    box-shadow:
        0 25px 60px rgba(0,0,0,.15),
        inset 0 2px 4px rgba(255,255,255,.5);

    display:flex;
    flex-direction:column;
    gap:16px;

    text-align:center;

    animation:fadeSlide .3s ease;
}


.auth-card form{
    display:flex;
    flex-direction:column;
    gap:12px;
}

/* two inputs on same row */
.auth-row{
    display:flex;
    gap:10px;
}

.auth-row input{
    flex:1;
}

.auth-card input{
    padding:14px;
    border-radius:14px;
    border:1px solid #e5e7eb;
    font-size:15px;

    background:#f9fafb;

    transition:all .2s ease;
}

.auth-card input:focus{
    outline:none;
    border-color:#6366f1;
    background:white;
    box-shadow:0 0 0 3px rgba(99,102,241,.15);
}

/* center password nicely */
.auth-card input[name="password"]{
    max-width:260px;
    margin:0 auto;
}

.auth-card input[name="confirm_password"]{
    max-width:260px;
    margin:0 auto;
}

/* button center + premium */
.auth-card button{
    width:200px;
    margin:10px auto 0 auto;

    padding:14px;
    border:none;
    border-radius:16px;

    background:linear-gradient(135deg,#6366f1,#4338ca);
    color:white;

    font-size:15px;
    font-weight:600;

    cursor:pointer;

    box-shadow:0 12px 24px rgba(99,102,241,.35);

    transition:all .2s ease;
}

.auth-card button:hover{
    transform:translateY(-2px) scale(1.02);
}

/* subtitle spacing */
.auth-sub{
    margin-bottom:10px;
}

/* logo polish */
.auth-logo{
    width:70px;
    margin:auto;
    border-radius:18px;

    box-shadow:
        0 10px 25px rgba(0,0,0,.2),
        inset 0 2px 4px rgba(255,255,255,.4);
}

.auth-footer{
    margin-top:10px;
    font-size:14px;
}

.auth-footer a{
    color:#4f46e5;
    font-weight:600;
    text-decoration:none;
}

.auth-error{
    background:#fee2e2;
    color:#b91c1c;
    padding:10px;
    border-radius:10px;
}

.auth-hint{
    font-size:12px;
    color:#6b7280;
    margin-top:-8px;
    margin-bottom:6px;
}
.pin-input{
    text-align:center;
    letter-spacing:10px;
    font-size:22px;
    font-weight:600;

    padding:16px;
    border-radius:16px;

    background:#f9fafb;
    border:1px solid #e5e7eb;

    max-width:220px;
    margin:0 auto;

    transition:all .2s ease;
}

.pin-input:focus{
    outline:none;
    border-color:#6366f1;
    background:white;
    box-shadow:0 0 0 4px rgba(99,102,241,.15);
}

.pin-title{
    font-size:20px;
    font-weight:700;
}

.pin-sub{
    font-size:13px;
    color:#6b7280;
    margin-top:-6px;
}

.pin-card{
    max-width:320px;
}

.pin-button{
    width:180px;
    margin:10px auto 0 auto;

    padding:14px;
    border:none;
    border-radius:14px;

    background:linear-gradient(135deg,#6366f1,#4338ca);
    color:white;

    font-weight:600;

    cursor:pointer;

    box-shadow:0 10px 20px rgba(99,102,241,.3);

    transition:all .2s ease;
}

.pin-button:hover{
    transform:translateY(-2px);
}

.hidden{
    display:none;
}

.pin-settings{
    transition:all .3s ease;
}

.board-overlay line{
    opacity:0.85;
}

.board-overlay path{
    opacity:0.9;
    stroke-linecap:round;
    stroke-linejoin:round;
}

/* =========================
   PREMIUM LADDERS
========================= */

.board-overlay line{
    stroke-linecap:round;
}

/* ladder rails */
.board-overlay .ladder-rail{
    stroke:#8b5a2b;
    stroke-width:5;
    stroke-linecap:round;
    stroke-linejoin:round;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.25));
}

/* ladder rungs */
.board-overlay .ladder-rung{
    stroke:#b45309; /* stronger brown for visibility */
    stroke-width:4;
    stroke-linecap:round;
    stroke-linejoin:round;
    filter:drop-shadow(0 1px 1px rgba(0,0,0,.2));
}

/* subtle hover glow (optional premium feel) */
.board-overlay .ladder-rail:hover{
    filter:drop-shadow(0 3px 6px rgba(0,0,0,.3));
}

/* =========================
   PREMIUM SNAKES
========================= */

/* main snake body */
.board-overlay .snake-body{
    stroke-width:3.5;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
    transition:all .3s ease;
}

/* outline (soft depth, not heavy) */
.board-overlay .snake-outline{
    stroke:#14532d;
    stroke-width:6;
    opacity:0.25;
}

/* snake head */
.board-overlay .snake-head{
    fill:#166534;
    stroke:white;
    stroke-width:1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}

/* eyes */
.board-overlay .snake-eye{
    fill:white;
}

/* tail */
.board-overlay .snake-tail{
    opacity:0.5;
}

/* forked tongue */
.board-overlay .snake-tongue{
    stroke:#ef4444;
    stroke-width:1.5;
    animation: tongueFlick 2.5s ease-in-out infinite;
}

/* subtle breathing glow */
.board-overlay .snake-body{
    animation: snakeGlow 3s ease-in-out infinite;
}

@keyframes snakeGlow{
    0%,100%{ filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
    50%{ filter: drop-shadow(0 3px 6px rgba(34,197,94,.35)); }
}


/* =========================
   WINNER ANIMATION
========================= */

.token.winner{
    animation: winnerBounce 1s ease infinite;
    box-shadow:
        0 0 20px rgba(34,197,94,.8),
        0 0 40px rgba(34,197,94,.5),
        0 6px 12px rgba(0,0,0,.4);
}

@keyframes winnerBounce{
    0%{ transform:scale(1); }
    30%{ transform:scale(1.4); }
    60%{ transform:scale(1.1); }
    100%{ transform:scale(1); }
}

/* 🎉 Confetti */
.confetti-piece{
    position: fixed;
    width: 8px;
    height: 12px;
    opacity: 0.9;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    animation: confettiFall 1200ms ease-out forwards;
}

@keyframes confettiFall{
    0%{
        transform: translate(-50%, -50%) rotate(0deg);
        opacity: 1;
    }
    100%{
        transform: translate(var(--dx), var(--dy)) rotate(360deg);
        opacity: 0;
    }
}

@media (max-width:600px){
    .board-wrapper{
        width:98vw;
        padding:8px;
    }
}

body {
    background: #7ec5e3;
}

.danger-btn {
    background: #ef4444;
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

.ios-install-hint {
    display:none;
    position:fixed;
    bottom:20px;
    left:50%;
    transform:translateX(-50%);
    background:rgba(0,0,0,0.85);
    color:white;
    padding:12px 18px;
    border-radius:12px;
    font-size:13px;
    z-index:9999;
    backdrop-filter: blur(8px);
}