@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
/* =========================
   BASE
========================= */

body{
    font-family:'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:#7ec5e3;
    margin:0;
    padding:0;
    overflow-x:hidden;
    animation:fadeIn .3s ease;
    /* FIX: visibility:hidden removed — fadeIn animation handles appearance */
}
button{
    cursor:pointer;
    -webkit-tap-highlight-color: transparent;
}

button:disabled{
    opacity:0.6;
    cursor:not-allowed;
    transform:none !important;
    box-shadow:none !important;
}

*{
    transition:background .2s ease, box-shadow .2s ease, transform .15s ease;
}
.btn{
    padding:12px 16px;
    border:none;
    border-radius:12px;
    font-weight:600;
    cursor:pointer;
    transition:all .2s ease;
}

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

h1, h2, h3 {
    letter-spacing: -0.3px;
}

p {
    line-height: 1.6;
}

button, a {
    font-family: inherit;
}



/* =========================
   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);
}

/* =========================
   MODERN NAVBAR
========================= */

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

    padding: 12px 18px;

    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-bottom: 1px solid rgba(255,255,255,0.3);

    box-shadow: 0 8px 30px rgba(0,0,0,.08);

    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar:hover{
    background: rgba(255,255,255,0.85);
}

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

.nav-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.nav-title {
    font-weight: 700;
    font-size: 18px;
}

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

.nav-right a {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    color: #4f46e5;
}

.nav-btn {
    padding: 8px 14px;
    border-radius: 10px;

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

    font-weight: 600;

    box-shadow: 0 6px 14px rgba(99,102,241,.3);
    transition: all .2s ease;
}

.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(99,102,241,.4);
}

.nav-user {
    font-size: 13px;
    opacity: 0.8;
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
    }
}

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

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

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

/* =========================
   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);
}

.play-btn{
    display:inline-block;
    margin-top:10px;
    padding:10px 16px;

    width:100%;
    text-align:center;

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

    border-radius:10px;
    text-decoration:none;
    font-weight:600;

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

    transition:all .2s ease;
}

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

.play-btn:active{
    transform:scale(.96);
}

/* =========================
   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
========================= */

* {
    box-sizing: border-box;
}

.board-wrapper{
    width:100%;
    max-width:92vw;
    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-square="1"]::after{
    content:"START";
    position:absolute;
    bottom:4px;
    left:4px;
    font-size:9px;
    font-weight:700;
    color:#065f46;
}

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

.square[data-square="64"]{
    position:relative;
    z-index:3;
    overflow: visible;
}

.square[data-square="64"]::before{
    content:"";
    position:absolute;
    inset:-14px;
    border-radius:16px;

    background: radial-gradient(
        circle at center,
        rgba(34,197,94,1) 0%,
        rgba(34,197,94,0.8) 30%,
        rgba(34,197,94,0.4) 60%,
        transparent 85%
    );

    filter: blur(12px);
    animation: winGlow 2s ease-in-out infinite;
    z-index:-1;
}

.square[data-square="64"] > *{
    position:relative;
    z-index:2;
}

@keyframes winGlow{
    0%,100%{
        opacity:0.6;
        transform:scale(1);
    }
    50%{
        opacity:1;
        transform:scale(1.12);
    }
}

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

/* =========================
   BIG ROLL 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),
        0 0 12px rgba(34,197,94,.3);

    cursor:pointer;
    margin:10px;

    transition:all .2s ease;
}

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

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

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

.big-roll.roll-btn:not(:disabled){
    animation:rollPulse 2s ease-in-out infinite;
}

@keyframes rollPulse{
    0%,100%{
        box-shadow:
            0 8px 20px rgba(0,0,0,.3),
            0 0 10px rgba(34,197,94,.3);
    }
    50%{
        box-shadow:
            0 12px 28px rgba(0,0,0,.35),
            0 0 20px rgba(34,197,94,.7);
    }
}

.big-roll:disabled:active{
    animation:shake .3s ease;
}

@keyframes shake{
    0%{ transform:translateX(0); }
    25%{ transform:translateX(-3px); }
    50%{ transform:translateX(3px); }
    75%{ transform:translateX(-2px); }
    100%{ transform:translateX(0); }
}

/* =========================
   CHILD CARDS
========================= */

.section-card{
    background:white;
    padding:24px;
    border-radius:22px;

    margin-bottom:30px;

    box-shadow:
        0 10px 25px rgba(0,0,0,.1),
        0 4px 10px rgba(0,0,0,.05);

    backdrop-filter: blur(6px);
    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;
    justify-content:space-between;

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

.card form{
    width:100%;
}

.card .play-btn,
.card .add-reward-btn{
    width:100%;
}

.card .remove-btn{
    margin-top:6px;
}

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

.card:active{
    transform:scale(.97);
}

.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{
    width:100%;
    max-width:100%;
    margin:auto;
    padding:10px;
    padding-bottom:80px;
}

/* =========================
   COLOUR PICKER
========================= */

.color-picker{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

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

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

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

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

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

.colour-picker{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:8px;
}

.colour-circle{
    width:38px;
    height:38px;
    border-radius:50%;
    cursor:pointer;
    border:3px solid transparent;
    box-shadow:0 6px 14px rgba(0,0,0,.2);
    transition:all .2s ease;
}

.colour-circle:hover{
    transform:scale(1.12);
}

.colour-circle.selected{
    transform:scale(1.18);
    border:3px solid white;
    box-shadow:
        0 0 0 3px #6366f1,
        0 8px 20px rgba(0,0,0,.25);
}

.colour-circle.disabled{
    opacity:0.25;
    filter:grayscale(0.6);
    cursor:not-allowed;
    box-shadow:none;
}

.colour-circle:active{
    transform:scale(.95);
}

/* =========================
   ADD CHILD 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;
}

.add-child-form form{
    display:flex;
    flex-direction:column;
    gap:16px;
}

@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{
    width:100%;
    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);
}

.form-actions{
    margin-top:8px;
}

.hidden{
    display:none;
}

/* =========================
   MODAL
========================= */

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    display:none; /* default hidden */
    justify-content:center;
    align-items:center;
    z-index:9999;
    pointer-events:none; /* prevent blocking when hidden */
}

.modal.hidden{
    display:none !important;
    pointer-events:none;
}

.modal.show{
    display:flex !important;
    pointer-events:auto;
}

.modal-content{
    background:white;
    padding:20px;
    border-radius:16px;
    width:90%;
    max-width:320px;
    display:flex;
    flex-direction:column;
    gap:12px;
    animation:fadeSlide .2s ease;
    pointer-events:auto;
}

.modal-content input{
    padding:12px;
    border-radius:10px;
    border:1px solid #ddd;
}

.remove-btn{
    margin-top:8px;
    background:none;
    border:none;
    color:#ef4444;
    font-size:13px;
    font-weight:600;
    padding:0;
    cursor:pointer;
    box-shadow:none;
    align-self:flex-start;
    transition:all .2s ease;
}

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

/* =========================
   LOGO
========================= */

.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
========================= */

.home-container{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    margin-top:60px;
}

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

@keyframes popIn{
    from{ transform:scale(.8); opacity:0; }
    to{ transform:scale(1); opacity:1; }
}

@keyframes logoPop{
    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.secondary{
    background:linear-gradient(135deg,#10b981,#059669);
}

/* =========================
   REWARD SECTION
========================= */

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

.helper-text {
    font-size: 13px;
    color: #374151;
    opacity: 0.85;
    margin-bottom: 4px;
}

.helper-text strong {
    color: #4f46e5;
}

.helper-steps{
    background: rgba(255,255,255,0.92);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    border: 1px solid rgba(99,102,241,0.15);
    animation:fadeSlide .25s ease;
}

.helper-steps strong{
    display:block;
    margin-bottom:4px;
    color:#4f46e5;
    font-weight:600;
}

.empty-hint {
    font-size: 13px;
    color: #dc2626;
    font-weight: 600;
    margin-top: 6px;
}

.no-rewards {
    font-size: 14px;
    color: #991b1b;
    font-weight: 700;
    text-align: center;
    padding: 12px;
    background: #fee2e2;
    border-radius: 12px;
    border: 1px solid #fecaca;
}

/* =========================
   ROLL STATUS
========================= */

.roll-status{
    margin-top:14px;
    font-size:16px;
    font-weight:700;
    text-align:center;
    letter-spacing:0.2px;
    max-width:90%;
    margin-left:auto;
    margin-right:auto;
}

.roll-status.available{
    color:#0f172a;
    background:rgba(255,255,255,0.85);
    padding:10px 14px;
    border-radius:12px;
    display:inline-block;
    box-shadow:0 6px 14px rgba(0,0,0,.15);
}

.roll-status.empty{
    color:#ffffff !important;
    background:#dc2626 !important;
    padding:16px 20px;
    border-radius:16px;
    font-weight:800;
    font-size:17px;
    border:2px solid #b91c1c;
    box-shadow:0 12px 30px rgba(0,0,0,.4);
    display:inline-block;
    text-shadow:0 1px 2px rgba(0,0,0,.4);
    animation: rollAlert 1.2s ease-in-out infinite;
}

.roll-status.empty::before{
    content:"⚠️ ";
}

.roll-status.empty:hover{
    animation: rollBounce .4s ease;
}

.child-view .roll-status.empty{
    color:#ffffff !important;
    background:#dc2626 !important;
    border:2px solid #b91c1c;
    box-shadow:0 16px 40px rgba(0,0,0,.5);
    text-shadow:0 1px 2px rgba(0,0,0,.5);
}

/* =========================
   REWARD SELECT / INPUT
========================= */

.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{
    width:100%;
    padding:12px 14px;
    border-radius:12px;
    border:1px solid #e5e7eb;
    font-size:14px;
    font-weight:500;
    background:linear-gradient(145deg,#ffffff,#f3f4f6);
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,.05),
        0 4px 10px rgba(0,0,0,.05);
    appearance:none;
    cursor:pointer;
    transition:all .2s ease, transform .12s ease;
    background-image:url("data:image/svg+xml;utf8,<svg fill='%236366f1' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5'/></svg>");
    background-repeat:no-repeat;
    background-position:right 12px center;
}

.reward-select:hover{
    transform:translateY(-1px);
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,.05),
        0 8px 18px rgba(99,102,241,.25);
}

.reward-select:active{ transform:scale(0.97); }

.reward-select:focus{
    outline:none;
    border-color:#6366f1;
    box-shadow:0 0 0 3px rgba(99,102,241,.25);
}

.reward-select.homework{ border-color:#3b82f6; background:linear-gradient(145deg,#eff6ff,#dbeafe); }
.reward-select.behaviour{ border-color:#22c55e; background:linear-gradient(145deg,#ecfdf5,#d1fae5); }
.reward-select.helping{ border-color:#a855f7; background:linear-gradient(145deg,#faf5ff,#ede9fe); }
.reward-select.reading{ border-color:#f59e0b; background:linear-gradient(145deg,#fffbeb,#fef3c7); }
.reward-select.exercise{ border-color:#ef4444; background:linear-gradient(145deg,#fef2f2,#fee2e2); }

.reward-select.animate{ animation:selectPop .2s ease; }

@keyframes selectPop{
    0%{ transform:scale(1); }
    50%{ transform:scale(1.05); }
    100%{ transform:scale(1); }
}

.reward-input{
    width:100%;
    padding:12px 14px;
    border-radius:12px;
    border:1px solid #e5e7eb;
    font-size:14px;
    margin-top:4px;
}

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

.reward-input.active{
    border-color:#4f46e5;
    box-shadow:0 0 0 3px rgba(79,70,229,.2);
    background:white;
}

.reward-select.active{
    border-color:#6366f1;
    box-shadow:0 0 0 3px rgba(99,102,241,.2);
}

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

/* =========================
   ADD REWARD BUTTON
========================= */

.add-reward-btn{
    margin-top:10px;
    width:100%;
    padding:10px;
    background:linear-gradient(135deg,#6366f1,#4f46e5);
    color:white;
    border:none;
    border-radius:10px;
    font-weight:600;
    cursor:pointer;
    box-shadow:0 6px 14px rgba(0,0,0,.2);
    transition:all .2s ease;
}

.add-reward-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 20px rgba(0,0,0,.25);
    animation:pulseBtn .4s ease;
}

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

.add-reward-btn.success{ animation:rewardSuccess .6s ease; }

@keyframes pulseBtn{
    0%{ transform:scale(1); }
    50%{ transform:scale(1.06); }
    100%{ transform:scale(1); }
}

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

/* =========================
   REWARD TIER BUTTONS
========================= */

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

.bronze-btn{ background:linear-gradient(135deg,#b45309,#92400e); color:white; }
.bronze-btn:hover{ box-shadow:0 0 14px rgba(180,83,9,.6); transform:translateY(-2px); }

.silver-btn{ background:linear-gradient(135deg,#9ca3af,#6b7280); color:white; }
.silver-btn:hover{ box-shadow:0 0 14px rgba(156,163,175,.6); transform:translateY(-2px); }

.gold-btn{
    background:linear-gradient(135deg,#facc15,#ca8a04);
    color:#1f2937;
    font-weight:700;
    position:relative;
    overflow:hidden;
}

.gold-btn:hover{ box-shadow:0 0 18px rgba(250,204,21,.9); transform:translateY(-2px) scale(1.02); }

.gold-btn::after{
    content:"";
    position:absolute;
    top:0;
    left:-100%;
    width:100%;
    height:100%;
    background:linear-gradient(120deg, transparent, rgba(255,255,255,.4), transparent);
    animation:goldShine 2.5s infinite;
}

@keyframes goldShine{
    0%{ left:-100%; }
    100%{ left:100%; }
}

/* =========================
   REWARD HISTORY
========================= */

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

.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-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),
        0 0 10px rgba(99,102,241,.4);
}

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

/* =========================
   ANIMATIONS
========================= */

.card,
.home-btn,
.add-toggle-btn,
.reward-btn,
.add-reward-toggle{
    transition:all .25s cubic-bezier(.2,.8,.2,1);
}

.token.moving{ animation:bounceMove .3s ease; }

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

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

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

.home-btn:hover,
.add-toggle-btn:hover,
.reward-btn:hover{
    box-shadow:0 12px 30px rgba(0,0,0,.25);
}

button:active{ transform:scale(.96); }

.nav-item:active,
.home-btn:active,
.reward-btn:active,
.add-reward-btn:active{
    transform:scale(.94);
}

/* =========================
   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:90%;
    max-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
========================= */

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

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

/* password inputs sit inside .password-wrap — no centering needed */
.auth-card input[name="password"],
.auth-card input[name="confirm_password"]{
    max-width:100%;
    margin:0;
}

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

.auth-sub{ margin-bottom:10px; }

.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
========================= */

.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); }
.pin-settings{ transition:all .3s ease; }

/* =========================
   BOARD OVERLAY (SNAKES & LADDERS)
========================= */

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

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

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

.board-overlay .snake-body{
    stroke-width:3.5;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
    animation: snakeGlow 3s ease-in-out infinite;
}

.board-overlay .snake-outline{
    stroke:#14532d;
    stroke-width:6;
    opacity:0.25;
}

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

.board-overlay .snake-eye{ fill:white; }
.board-overlay .snake-tail{ opacity:0.5; }

.board-overlay .snake-tongue{
    stroke:#ef4444;
    stroke-width:1.5;
}

@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
========================= */

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

/* =========================
   RESPONSIVE
========================= */

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

@media (max-width:480px){
    .header-inner{ flex-direction:column; align-items:flex-start; gap:10px; }
    .nav{ flex-wrap:wrap; gap:8px; }
    .big-roll{ width:90%; }
    .home-buttons{ flex-direction:column; width:100%; }
    .home-btn{ width:90%; text-align:center; }
}

/* =========================
   MISC
========================= */

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

/* =========================
   CHILD VIEW
========================= */

.child-view .app-header { display: none; }

html { height: 100%; }

body.child-view {
    background: radial-gradient(circle at center, #7ec5e3 0%, #4f9fc0 100%);
    overflow-x: hidden;
    overflow-y: hidden;
    margin: 0;
    padding: 0;
}

.child-view .container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
    padding-bottom: 80px !important;
    margin: 0;
}

.child-view .board-wrapper {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    background: linear-gradient(
        to right,
        transparent 70%,
        rgba(59,130,246,0.25) 85%,
        rgba(37,99,235,0.35) 100%
    );
}

.child-view .board-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 95% 50%, rgba(59,130,246,0.35), transparent 60%);
    opacity: 0.7;
}

.child-view .board {
    width: min(92vw, 92vh);
    height: min(92vw, 92vh);
    margin: 0 auto;
}

body.child-view::after {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, transparent 70%, rgba(0,0,0,0.12));
    pointer-events: none;
    z-index: 0;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* =========================
   DASHBOARD ACTIONS
========================= */

.dashboard-actions{ text-align:center; }

.action-buttons{
    display:flex;
    gap:12px;
    justify-content:center;
    flex-wrap:wrap;
}

.action-buttons button{ min-width:140px; }

/* =========================
   HOME SCREEN
========================= */

.home-screen {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
}

.welcome-title{
    margin-top:20px;
    margin-bottom:10px;
}

.welcome-sub{
    text-align:center;
    font-size:14px;
    opacity:0.75;
}

.game-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top:10px;
}

.game-card {
    background: linear-gradient(145deg,#ffffff,#f1f5f9);
    padding: 18px;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    box-shadow:
        0 15px 30px rgba(0,0,0,.1),
        0 4px 10px rgba(0,0,0,.05);
    transition: all .25s cubic-bezier(.2,.8,.2,1);
}

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

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

.game-card-header h3 { margin: 0; font-size: 18px; }

.game-card-body {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.continue-btn{
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg,#22c55e,#16a34a);
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0,0,0,.25);
    transition: all .2s ease;
    cursor: default;
}

.quick-actions {
    margin-top: 10px;
    text-align: center;
}

.action-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    background: #6366f1;
    color: white;
    text-decoration: none;
    font-weight: 600;
}

/* =========================
   EMPTY STATE
========================= */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.empty-state p {
    margin: 0 0 10px;
    color: #374151;
    font-size: 15px;
}

.empty-state p:first-child {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state .cta-btn {
    margin-top: 16px;
    display: inline-block;
}

/* =========================
   SPLASH
========================= */

.splash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #7ec5e3 0%, #4f9fc0 100%);
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    text-align:center;
    color:white;
    z-index:9999;
    transition:opacity .4s ease, transform .4s ease;
}

.splash.fade-out{
    opacity:0;
    transform:scale(1.05);
}

.splash-logo {
    width:100px;
    margin-bottom:20px;
    animation: logoPop .6s ease;
}

.splash-tagline {
    font-size:14px;
    opacity:0.9;
    margin-top:10px;
}

.splash h1 {
    font-size:22px;
    margin:0;
}

#app{
    display:none;
    opacity:0;
}

#app.fade-in{
    animation:appFade .4s ease forwards;
}

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

/* =========================
   GUEST HOME
========================= */

.guest-home {
    text-align: center;
    padding: 40px 20px;
}

.guest-home h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.guest-home p {
    max-width: 420px;
    margin: 20px auto;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

.cta-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 14px 22px;
    background: linear-gradient(135deg,#6366f1,#4338ca);
    color: white;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(99,102,241,.35);
    transition: all .2s ease;
}

.cta-btn:hover { transform: translateY(-2px) scale(1.03); }

.cta-secondary {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: #4f46e5;
}

.cta-secondary:hover { text-decoration: underline; }

.onboard-card {
    background: white;
    padding: 20px 24px;
    border-radius: 18px;
    margin: 20px auto;
    max-width: 340px;
    box-shadow: 0 12px 25px rgba(0,0,0,.1);
    text-align: left;
}

.onboard-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
    text-align: center;
}

/* How it works ordered list */
.how-it-works {
    margin: 0;
    padding: 0 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.how-it-works li {
    padding-left: 4px;
}

/* =========================
   TOAST
========================= */

.toast{
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all .3s ease;
    cursor: default;
}

.toast.show{
    opacity: 1;
    transform: translate(-50%, -10px);
}

/* Clickable toast (used for update notification) */
.toast[style*="cursor: pointer"]{
    pointer-events: auto;
}

/* =========================
   BOTTOM NAV
========================= */

.bottom-nav{
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    background:linear-gradient(to top, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
    backdrop-filter:blur(12px);
    display:flex;
    justify-content:space-around;
    padding:10px 0;
    box-shadow:0 -4px 20px rgba(0,0,0,.1);
    z-index:1000;
}

.nav-item{
    display:flex;
    flex-direction:column;
    align-items:center;
    font-size:12px;
    color:#374151;
    text-decoration:none;
    gap:2px;
    padding:6px 10px;
    min-width:60px;
}

.nav-item span{ font-size:10px; }
.nav-item:active{ transform:scale(.92); }

.nav-item.active{
    color:#6366f1;
    font-weight:600;
}

.nav-item.active span{ font-weight:600; }

/* =========================
   PAGE TRANSITION
========================= */

.page{ animation:pageIn .25s ease; }

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

/* =========================
   ROLL ANIMATIONS
========================= */

@keyframes rollAlert{
    0%{ transform:scale(1); }
    50%{ transform:scale(1.06); }
    100%{ transform:scale(1); }
}

@keyframes rollBounce{
    0%{ transform:translateY(0); }
    30%{ transform:translateY(-4px); }
    60%{ transform:translateY(2px); }
    100%{ transform:translateY(0); }
}

/* FIX: body.loaded rule removed — no longer needed */

/* =========================
   WIN SQUARE PULSE
========================= */

.square[data-square="64"]{
    box-shadow:
        0 0 25px rgba(34,197,94,0.9),
        0 0 50px rgba(34,197,94,0.7),
        0 0 80px rgba(34,197,94,0.5);
    outline: 2px solid rgba(34,197,94,0.6);
    animation: winPulse 1.8s ease-in-out infinite;
}

@keyframes winPulse{
    0%,100%{
        box-shadow:
            0 0 25px rgba(34,197,94,0.9),
            0 0 50px rgba(34,197,94,0.7),
            0 0 80px rgba(34,197,94,0.5);
    }
    50%{
        box-shadow:
            0 0 40px rgba(34,197,94,1),
            0 0 70px rgba(34,197,94,0.9),
            0 0 120px rgba(34,197,94,0.7);
    }
}

/* =========================
   AUTH LABELS + PASSWORD TOGGLE
========================= */

.auth-label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    margin-top: 4px;
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    flex: 1;
    padding-right: 44px;
    max-width: 100%;
    margin: 0;
}

.show-pw-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    color: #6b7280;
    transition: opacity .2s ease;
    box-shadow: none;
}

.show-pw-btn:hover {
    opacity: 0.7;
}

.show-pw-btn:active {
    transform: none;
}

.forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: #4f46e5;
    text-decoration: none;
    margin-top: -4px;
    margin-bottom: 4px;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Fix: show-pw-btn must not inherit .auth-card button styles */
.auth-card .show-pw-btn {
    width: auto;
    margin: 0;
    padding: 4px 8px;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-size: 16px;
    color: #6b7280;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity .2s ease;
}

.auth-card .show-pw-btn:hover {
    opacity: 0.7;
    transform: translateY(-50%);
    box-shadow: none;
}

.auth-card .show-pw-btn:active {
    transform: translateY(-50%);
}

.chest-feedback {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}
.chest-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.chest-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* =========================
   CHESTS
========================= */

.chests-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
}

.chest-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 6px 16px rgba(0,0,0,.2);
    min-width: 80px;
}

.chest-bronze { background: linear-gradient(135deg, #b45309, #92400e); color: white; }
.chest-silver { background: linear-gradient(135deg, #9ca3af, #6b7280); color: white; }
.chest-gold   { background: linear-gradient(135deg, #facc15, #ca8a04); color: #1f2937; }

.chest-btn:hover { transform: translateY(-3px) scale(1.05); }
.chest-btn:active { transform: scale(.95); }

.chest-icon { font-size: 28px; }
.chest-label { font-size: 13px; font-weight: 700; }
.chest-tap { font-size: 11px; opacity: 0.8; }

/* Enhanced chest animations */
.chest-opening {
    animation: chestShake .4s ease, chestGlow .6s ease;
}

@keyframes chestShake {
    0%  { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-8deg) scale(1.1); }
    50% { transform: rotate(8deg) scale(1.15); }
}

@keyframes chestGlow {
    0% { box-shadow: 0 0 0 rgba(255,255,255,0); }
    50% {
        box-shadow: 0 0 25px rgba(255,255,255,0.9),
                    0 0 50px rgba(255,255,255,0.6);
    }
    100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
}

.chest-opened {
    animation: chestPop .35s ease forwards;
}

@keyframes chestPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3) rotate(4deg); }
    100% { transform: scale(0); opacity: 0; }
}

.reward-float {
    position: absolute;
    font-size: 18px;
    font-weight: 700;
    pointer-events: none;
    animation: rewardFloat 0.8s ease forwards;
}

@keyframes rewardFloat {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    30% { opacity: 1; transform: translateY(-10px) scale(1.2); }
    100% { opacity: 0; transform: translateY(-40px) scale(1); }
}

/* =========================
   GUEST HOME REDESIGN
========================= */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@700;800&display=swap');

body {
    background: linear-gradient(160deg, #fff8f0 0%, #fef3e8 40%, #fce8d8 100%);
}

.guest-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 0 80px;
}

.gh-hero {
    text-align: center;
    padding: 48px 24px 32px;
}

.gh-badge {
    display: inline-block;
    background: rgba(251,146,60,0.15);
    color: #c2410c;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 99px;
    border: 1px solid rgba(251,146,60,0.3);
    margin-bottom: 18px;
}

.gh-title {
    font-family: 'Baloo 2', sans-serif;
    font-size: clamp(28px, 7vw, 44px);
    font-weight: 800;
    color: #1c0a00;
    line-height: 1.2;
    margin-bottom: 14px;
}

.gh-highlight {
    color: #ea580c;
    position: relative;
    display: inline-block;
}

.gh-highlight::after {
    content: "";
    position: absolute;
    bottom: 2px; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fb923c, #ea580c);
    border-radius: 2px;
    opacity: 0.4;
}

.gh-sub {
    font-size: 15px;
    color: #7c3d14;
    max-width: 340px;
    margin: 0 auto 28px;
    line-height: 1.6;
    opacity: 0.9;
}

.gh-cta {
    display: inline-block;
    padding: 16px 32px;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: white;
    font-size: 17px;
    font-weight: 800;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(234,88,12,0.35);
    transition: all .2s ease;
}

.gh-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(234,88,12,0.4);
}

.gh-login {
    display: block;
    margin-top: 14px;
    font-size: 14px;
    color: #c2410c;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.8;
}

.gh-login:hover { opacity: 1; text-decoration: underline; }

.gh-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 24px 32px;
}

.gh-pill {
    background: white;
    padding: 9px 14px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    color: #5c2e00;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(251,146,60,0.15);
    display: flex;
    align-items: center;
    gap: 7px;
}

.gh-pill-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.gh-card {
    background: white;
    margin: 0 16px 20px;
    border-radius: 24px;
    padding: 26px 22px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    border: 1px solid rgba(251,146,60,0.1);
}

.gh-card-title {
    font-family: 'Baloo 2', sans-serif;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    color: #1c0a00;
    margin-bottom: 20px;
}

.gh-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gh-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.gh-step-num {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: white;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(234,88,12,0.25);
}

.gh-step-text strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: #1c0a00;
    margin-bottom: 2px;
}

.gh-step-text span {
    font-size: 13px;
    color: #7c3d14;
    opacity: 0.8;
}

.gh-free {
    text-align: center;
    padding: 0 24px 20px;
}

.gh-free-inner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 16px;
    padding: 14px 22px;
    font-size: 14px;
    font-weight: 700;
    color: #166534;
}

.gh-free-check {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(34,197,94,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
}

.chest-spawn {
    animation: chestSpawn .4s ease;
}

@keyframes chestSpawn {
    0% { opacity: 0; transform: translateY(20px) scale(0.6); }
    60% { opacity: 1; transform: translateY(-6px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}
/* =========================
   CHEST OVERLAY FIX
========================= */

#chest-overlay {
    position: fixed;
    inset: 0;
    display: none !important;
    justify-content: center;
    align-items: center;
    z-index: -1 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

#chest-overlay.show {
    display: flex !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#chest-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
    z-index: -1 !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* =========================
   CHEST CLICK FIX (FORCE)
========================= */

/* Bring chests above EVERYTHING */
.chests-row {
    position: relative !important;
    z-index: 9999 !important;
}

/* Ensure buttons are always clickable */
.chest-btn {
    position: relative !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
}

/* Force all children clickable */
.chests-row * {
    pointer-events: auto !important;
}

/* Kill ANY overlay blocking clicks */
.board-overlay,
#chest-overlay,
.modal:not(.show) {
    pointer-events: none !important;
}

/* Only allow overlay interaction when visible */
#chest-overlay.show {
    pointer-events: auto !important;
    z-index: 99999 !important;
}