* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #1c1b1a; overflow: hidden; overscroll-behavior: none; }
body { font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif; color: #fff; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

#stage { position: fixed; inset: 0; margin: auto; width: 100vw; height: 100dvh; overflow: hidden; touch-action: none; background: #d9d6d0; container-type: size; }
@media (min-aspect-ratio: 9/15) { #stage { width: calc(100dvh * 9 / 16); } }
#gl, #cam { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#cam { object-fit: cover; background: #000; }
#cam[hidden] { display: none; }

.top { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 10px); display: flex; align-items: center; gap: 6px; }
.picks { display: flex; gap: 6px; flex: 1 1 0; min-width: 0; }
.pick { flex: 0 1 46px; min-width: 0; aspect-ratio: 1; border-radius: 50%; background: #fffdf8; overflow: hidden; box-shadow: 0 0 0 2px rgba(0, 0, 0, .28); transition: transform .12s; }
.pick img { width: 100%; height: 100%; display: block; pointer-events: none; }
.pick.on { box-shadow: 0 0 0 3px #4b4b30, 0 0 0 5px #fff; transform: scale(1.04); }
.chip { flex: 0 1 40px; min-width: 0; aspect-ratio: 1; border-radius: 50%; background: #4b4b30; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.chip:disabled { opacity: .55; }
.chip[aria-pressed="true"] { background: #fff; color: #4b4b30; }

.joy { position: absolute; left: max(8px, calc(25% - 66px)); top: calc(70% - 66px); width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(circle, rgba(95, 95, 70, .28) 0%, rgba(95, 95, 70, .22) 62%, rgba(95, 95, 70, .06) 100%); touch-action: none; }
.knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: rgba(255, 252, 232, .72); box-shadow: 0 0 14px 4px rgba(255, 252, 232, .32); pointer-events: none; }

.loading { position: absolute; inset: 0; display: grid; place-items: center; background: #d9d6d0; color: #4b4b30; font-weight: 700; }
.toast { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 44px); transform: translateX(-50%); background: #000; color: #fff; font-size: 14px; padding: 8px 14px; border-radius: 6px; max-width: 86%; text-align: center; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; }
.hchip { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%); background: #000; color: #fff; font-size: 14px; font-weight: 700; padding: 6px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.hchip[hidden], .rchip[hidden] { display: none; }
.rchip { position: absolute; right: 14px; top: calc(70% - 16px); background: #4b4b30; color: #fff; font-size: 14px; font-weight: 700; padding: 6px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }
.rchip.full { background: #ff7aa8; }
.rchip.pop { animation: rpop .32s ease-out; }
@keyframes rpop { 40% { transform: scale(1.25); } }
.foot { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 6px); margin: 0; text-align: center; font-size: 11px; color: rgba(40, 38, 20, .72); pointer-events: none; }
.cammode .foot { color: rgba(255, 255, 255, .8); }
@media (prefers-reduced-motion: reduce) { .pick { transition: none; } .rchip.pop { animation: none; } }

.out { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: #000a; }
.out[hidden] { display: none; }
.outcard { width: 100%; max-width: 300px; padding: 20px 18px 12px; border-radius: 18px; background: #fff; color: #33282b; text-align: center; font-size: 14px; }
.outcard b { font-size: 16px; } .outcard p { margin: 8px 0 14px; color: #6b5b60; }
.outgo { display: block; padding: 13px; border-radius: 12px; background: #5a5a30; color: #fff; font-weight: 700; text-decoration: none; }
.outcard button { display: block; width: 100%; min-height: 44px; border: 0; background: none; color: #6b5b60; font: inherit; }
