* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    overflow: hidden;
}


#main-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

#main-menu h1 {
    font-size: 72px;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #0000ff, #00ffff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#player-name {
    padding: 15px 30px;
    font-size: 18px;
    border: 2px solid #00aaff;
    background: transparent;
    color: #ffffff;
    border-radius: 5px;
    margin-bottom: 20px;
    width: 300px;
    text-align: center;
}

button {
    padding: 15px 40px;
    font-size: 20px;
    background: #00aaff;
    color: #000000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s;
}

button:hover {
    background: #00ccff;
    transform: scale(1.05);
}

/* Custom Google sign-in button matching the site's style */
.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #00aaff;
    color: #000;
    border-radius: 5px;
    padding: 12px 20px;
    font-size: 18px;
}
.btn-google:hover { background: #00ccff; }
.btn-google .g-logo {
    width: 20px;
    height: 20px;
    display: inline-block;
}

#leaderboard {
    margin-top: 40px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
    padding: 20px 18px;
    border-radius: 14px;
    min-width: 360px;
    border: 1px solid rgba(0,170,255,0.25);
    box-shadow: 0 8px 24px rgba(0,170,255,0.15), inset 0 0 24px rgba(0,170,255,0.08);
    color: #e9fbff;
}
#leaderboard h3 {
    margin: 0 0 12px 6px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(45deg, #00aaff, #66ffee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
#leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lb-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 6px 0;
    border-radius: 10px;
    background: rgba(0, 30, 50, 0.35);
    border: 1px solid rgba(0,170,255,0.20);
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.lb-item:hover {
    transform: translateY(-1px);
    background: rgba(0, 40, 70, 0.4);
    border-color: rgba(0,200,255,0.35);
}
.lb-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #001018;
    background: linear-gradient(135deg, #9ae7ff, #42d9ff);
    box-shadow: 0 2px 8px rgba(0,170,255,0.35);
}
.lb-item.top1 .lb-rank { background: linear-gradient(135deg, #ffe27a, #ffb800); color: #2b1f00; }
.lb-item.top2 .lb-rank { background: linear-gradient(135deg, #e0e7ef, #9aa8b8); color: #1a2027; }
.lb-item.top3 .lb-rank { background: linear-gradient(135deg, #ffcba6, #ff8a3d); color: #2b1200; }
.lb-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #eafcff;
}
.lb-score {
    font-weight: 700;
    color: #aaf2ff;
    min-width: 64px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.lb-empty { opacity: 0.8; padding: 8px 10px; }

#game-container {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 10;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: none;
    z-index: 11;
}

#game-ui {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 20px;
    z-index: 20;
    pointer-events: none;
}

#game-ui div {
    margin: 5px 0;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Prominent, on-brand score styling (top-left) */
#game-ui #score {
    /* ~50% larger than base 20px */
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
    /* Glassy card, matching leaderboard/modal aesthetic */
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
    border: 1px solid rgba(0,170,255,0.28);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 10px 32px rgba(0,170,255,0.18), inset 0 0 26px rgba(0,170,255,0.08);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    /* Neon-ish readable text */
    color: #e9fbff;
    text-shadow: 0 0 12px rgba(0,200,255,0.45), 0 0 24px rgba(0,200,255,0.18);
}

/* Room leaderboard (overlay, top-right) */
#room-leaderboard {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 21;
    min-width: 260px;
    max-width: 32vw;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
    border: 1px solid rgba(0,170,255,0.28);
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(0,170,255,0.18), inset 0 0 26px rgba(0,170,255,0.08);
    color: #e9fbff;
    padding: 10px 12px 8px;
}
#room-leaderboard h4{
    margin: 0 0 6px 4px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .3px;
    background: linear-gradient(45deg, #00aaff, #66ffee);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
#room-lb-list{
    list-style: none;
    margin: 0; padding: 0;
}
.room-lb-item{
    display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px;
    padding: 6px 8px; margin: 4px 0; border-radius: 8px;
    background: rgba(0, 30, 50, 0.35);
    border: 1px solid rgba(0,170,255,0.18);
}
.room-lb-rank{
    width: 22px; height: 22px; border-radius: 50%; display:flex; align-items:center; justify-content:center;
    font-weight: 800; font-size: 12px; color: #001018;
    background: linear-gradient(135deg, #9ae7ff, #42d9ff);
}
.room-lb-item.top1 .room-lb-rank{ background: linear-gradient(135deg, #ffe27a, #ffb800); color:#2b1f00; }
.room-lb-item.top2 .room-lb-rank{ background: linear-gradient(135deg, #e0e7ef, #9aa8b8); color:#1a2027; }
.room-lb-item.top3 .room-lb-rank{ background: linear-gradient(135deg, #ffcba6, #ff8a3d); color:#2b1200; }
.room-lb-name{ overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-weight:600; color:#eafcff; }
.room-lb-score{ font-weight:800; color:#aaf2ff; font-variant-numeric: tabular-nums; min-width: 56px; text-align:right; }

.ad-container {
    position: absolute;
    width: 728px;
    max-width: 90%;
    left: 50%;
    transform: translateX(-50%);
}

.top-ad {
    top: 10px;
}

/* Guard against any sticky bottom bars (e.g., auto-ads anchors) */
ins.adsbygoogle[data-anchor-status],
.google-auto-placed,
.google-auto-placed iframe[anchor="bottom"],
.google-auto-placed.impact-loading,
iframe[id^="google_ads_iframe"][name*="anchored"],
div[id^="google_ads_iframe"][name*="anchored"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
}

/* Death overlay */
#death-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 300ms ease;
    z-index: 30;
    pointer-events: none; /* visual only */
}

#death-overlay.show { opacity: 1; }

#death-text {
    color: #fff;
    font: 700 36px/1.2 Arial, sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 18px 28px;
}

/* Stats Modal */
#stats-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
}
.stats-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 180ms ease;
}
.stats-dialog {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -46%) scale(0.98);
    background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.045));
    border: 1px solid rgba(0,170,255,0.28);
    box-shadow: 0 16px 60px rgba(0,170,255,0.20), inset 0 0 36px rgba(0,170,255,0.10);
    border-radius: 16px;
    width: min(460px, 92vw);
    color: #e9fbff;
    padding: 14px;
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
}
#stats-modal.show .stats-backdrop { opacity: 1; }
#stats-modal.show .stats-dialog { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.stats-header {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 6px 6px 10px;
}
.stats-header h3 {
    margin: 0; font-size: 20px; letter-spacing: .3px; font-weight: 800;
    background: linear-gradient(45deg, #00aaff, #66ffee);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stats-close {
    background: transparent; color: #aaf2ff; border: 1px solid rgba(0,170,255,0.35);
    width: 36px; height: 36px; border-radius: 10px; font-size: 20px; line-height: 1;
}
.stats-close:hover { background: rgba(0,170,255,0.12); }
.stats-body { padding: 8px 6px 2px; }
.stat-row {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px;
    padding: 10px 12px; margin: 8px 0; border-radius: 10px;
    background: rgba(0, 30, 50, 0.35);
    border: 1px solid rgba(0,170,255,0.20);
}
.stat-label { opacity: .9; font-weight: 600; color: #dffaff; }
.stat-value { font-weight: 800; color: #aaf2ff; font-variant-numeric: tabular-nums; }
.stats-footer { display:flex; justify-content:flex-end; padding: 10px 6px 4px; }
.stats-ok { padding: 10px 18px; font-weight: 700; }