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

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

/* Camera behind (dimmed), the sheet on top */
#camCanvas  { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; opacity: 0.55; }
#gameCanvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
#webcam { display: none; }

#hud {
    position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
    z-index: 120; display: flex; gap: 18px; align-items: center;
    font-size: 22px; font-weight: 700; color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.45); padding: 8px 18px; border-radius: 999px;
}
#hud.hidden { display: none; }
#hudLeft { font-size: 15px; color: #a3e635; }

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

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

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

.pick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pick {
    flex: 1 1 auto; padding: 10px 14px; border-radius: 10px; cursor: pointer;
    border: 2px solid #d8dcec; background: #fff; color: #2a2a55;
    font-size: 14px; font-weight: 700;
}
.pick.active { border-color: #6a5acd; background: #f2f0ff; }

.sheet-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sheet-card {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 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;
}
.sheet-card:hover { transform: translateY(-2px); border-color: #6a5acd; }
.sc-emoji { font-size: 26px; line-height: 1; }

.buttons { display: flex; gap: 12px; justify-content: center; margin-top: 18px; 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;
}
.btn.primary { background: #6a5acd; color: #fff; }
.hint { margin-top: 10px; 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; }

/* Photo booth. The shot is wide, so cap it by width and let height follow —
   on a phone in portrait the panel is the limiting dimension. */
.photo-shot {
    display: block;
    width: 100%;
    max-height: 48vh;
    object-fit: contain;
    margin: 14px auto 4px;
    border-radius: 12px;
    background: #12121c;
}
.photo-shot.hidden { display: none; }
.photo-count {
    font-size: 72px;
    font-weight: bold;
    line-height: 1.1;
    min-height: 84px;
    color: #2a2a55;
}
