html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #0e1014;
    color: #e8edf2;
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    overflow: hidden;
}

#scene {
    position: fixed;
    inset: 0;
}
#scene canvas { display: block; }

/* ---- HUD (score / coins) ---- */
#hud {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 5;
    pointer-events: none;
}
#hud .title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
#hud .stats {
    margin-top: 8px;
    display: flex;
    gap: 10px;
}
#hud .chip {
    background: rgba(20,24,32,0.72);
    border: 1px solid #2c333f;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 18px;
    font-weight: 800;
    backdrop-filter: blur(6px);
}
#hud .chip b { color: #4be39b; }
#hud #toast {
    margin-top: 10px;
    min-height: 22px;
    font-size: 18px;
    font-weight: 800;
    color: #ffd23f;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

/* ---- Webcam control panel ---- */
#cam-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 280px;
    background: rgba(29,34,43,0.82);
    border: 1px solid #2c333f;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
}
#cam-panel h1 {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 800;
}
#cam-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #0c0e12;
    border-radius: 12px;
    overflow: hidden;
    transform: scaleX(-1); /* mirror like a real mirror */
}
#cam-video, #cam-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#cam-overlay { pointer-events: none; }
#cam-status {
    margin: 10px 0;
    min-height: 18px;
    font-size: 13px;
    font-weight: 600;
    color: #9fe7c8;
    text-align: center;
}
#cam-start {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 700;
    color: #14171c;
    background: linear-gradient(180deg, #4be39b, #28c07f);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: filter 0.15s ease;
}
#cam-start:hover { filter: brightness(1.07); }
#cam-start:disabled { filter: grayscale(0.6) brightness(0.8); cursor: default; }
#cam-help {
    margin: 14px 0 0;
    padding-left: 16px;
    font-size: 12px;
    line-height: 1.7;
    color: #aab4c0;
}
#cam-help b { color: #e8edf2; }

#loading {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #9fe7c8;
    background: #0e1014;
}
