* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%; overflow: hidden;
    background: #16101f;
    font-family: 'Inter', 'Trebuchet MS', Arial, sans-serif;
}

#gameCanvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#webcam { display: none; }

/* Selfie preview with lane guides, bottom-right out of the running line */
#pose-wrapper {
    position: fixed; right: 16px; bottom: 16px; z-index: 120;
    border-radius: 14px; overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    background: #000;
}
#pose-wrapper.hidden { display: none; }
#poseCanvas { display: block; width: 240px; height: 180px; }
.cam-tag {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 3px 0; text-align: center;
    background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; letter-spacing: 0.04em;
}

.overlay {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(6, 4, 12, 0.72);
    overflow-y: auto; padding: 24px 16px;
}
.overlay.hidden { display: none; }

.panel {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px; padding: 30px 38px; text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); max-width: 470px; width: 90%;
    margin: auto;
}
.panel h1 { font-size: 40px; color: #2a2a55; margin-bottom: 8px; }
.tag { color: #445; margin-bottom: 18px; font-size: 15px; line-height: 1.5; }

.choice { text-align: left; margin: 14px 0; padding: 14px 16px; background: #eef0fa; border-radius: 12px; }
.choice h3 { font-size: 15px; color: #2a2a55; margin-bottom: 8px; }
.choice label { display: block; padding: 5px 4px; font-size: 15px; color: #234; }

.buttons { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.btn {
    padding: 13px 22px; font-size: 16px; font-weight: bold; border: none;
    border-radius: 10px; cursor: pointer; background: #dfe2ef; color: #2a2a55;
    text-decoration: none; display: inline-block;
    transition: transform 0.12s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: #6a5acd; color: #fff; }
.hint { margin-top: 12px; font-size: 12px; color: #678; }

#cam-status {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
    z-index: 160; padding: 8px 16px; border-radius: 999px;
    background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 14px;
}
#cam-status.hidden { display: none; }

/* Score strip, top-centre so it never sits under the runner */
#hud {
    position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
    z-index: 120; text-align: center; pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.75);
}
#hud.hidden { display: none; }
.hud-main { font-size: 40px; font-weight: 800; color: #fff; line-height: 1; }
.hud-sub { margin-top: 4px; font-size: 16px; font-weight: 700; color: #ffd400; }
#hudWarn {
    margin-top: 8px; font-size: 15px; font-weight: 700; color: #ffd400;
    background: rgba(0,0,0,0.55); padding: 5px 12px; border-radius: 999px;
}
#hudWarn.hidden { display: none; }

/* Character picker on the start screen */
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.avatar-pick {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px; border-radius: 12px; cursor: pointer;
    border: 2px solid #d8dcec; background: #fff; color: #2a2a55;
    font-size: 12px; font-weight: 700; transition: transform 0.12s, border-color 0.15s;
}
.avatar-pick:hover { transform: translateY(-2px); border-color: #6a5acd; }
.avatar-pick.active { border-color: #6a5acd; background: #f2f0ff; }
.ap-emoji { font-size: 24px; line-height: 1; }

/* Stage announcement */
#stageBanner {
    position: fixed; top: 42%; left: 50%; transform: translateX(-50%);
    z-index: 130; pointer-events: none;
    font-size: 38px; font-weight: 800; letter-spacing: 0.06em; color: #fff;
    text-shadow: 0 3px 18px rgba(0,0,0,0.85), 0 0 30px rgba(255,200,120,0.5);
    animation: stagePop 0.4s ease-out;
}
#stageBanner.hidden { display: none; }
@keyframes stagePop { from { opacity: 0; transform: translateX(-50%) scale(0.85); }
                        to { opacity: 1; transform: translateX(-50%) scale(1); } }

/* Live pose readout under the camera panel — shows why a jump did or didn't
   register, so tuning is based on numbers rather than guesswork. */
#poseDebug {
    font: 11px/1.45 ui-monospace, Menlo, Consolas, monospace;
    color: #cfe8ff; background: rgba(0,0,0,0.72);
    padding: 5px 8px; white-space: pre;
}
#poseDebug .hit { color: #a3e635; font-weight: 700; }

#muteBtn {
    position: fixed; bottom: 16px; left: 16px; z-index: 160;
    width: 46px; height: 46px; border: none; border-radius: 50%;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 22px; cursor: pointer;
}

/* Milestone: how far to the next world */
#hudGoalWrap { margin-top: 6px; }
#hudGoal { font-size: 13px; font-weight: 700; color: #cfe8ff; letter-spacing: 0.02em; }
#hudGoalTrack {
    width: 190px; height: 5px; margin: 4px auto 0;
    background: rgba(0,0,0,0.55); border-radius: 999px; overflow: hidden;
}
#hudGoalBar { height: 100%; width: 0%; background: #a3e635; transition: width 0.25s linear; }

#hudLives { font-size: 20px; line-height: 1.1; letter-spacing: 2px; }
