/* 참가자 폰 화면 — 모바일 우선 */
:root {
  --bg-base: #FFF9F4; --bg-card: #fff; --bg-soft: #FFF1E6;
  --text-primary: #3D3D3D; --text-secondary: #7A7A7A; --text-muted: #B5B5B5;
  --accent-coral: #FFB5A7; --accent-mint: #B5EAD7; --accent-lemon: #FFE5B4; --accent-lavender: #C7CEEA; --accent-peach: #FFDAC1;
  --border-soft: #F0E6DC; --border-medium: #E0D5C9;
  --shadow-card: 0 4px 16px rgba(80,60,40,.08); --ease: cubic-bezier(.4,0,.2,1);
  --tc: var(--accent-coral);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-base); color: var(--text-primary);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  display: flex; flex-direction: column; min-height: 100dvh; overscroll-behavior: none; touch-action: manipulation; word-break: keep-all;
  -webkit-user-select: none; user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
.hidden { display: none !important; }

.p-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: #fff; border-bottom: 2px solid var(--border-soft);
  position: sticky; top: 0; z-index: 5;
}
.p-me { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; min-width: 0; }
.p-me #meName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-team-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--tc); flex: none; }
.p-team { font-size: 13px; color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.p-score { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.p-link { width: 10px; height: 10px; border-radius: 50%; background: #D9534F; display: inline-block; }
.p-link.on { background: #6CCB8E; }

.p-main { flex: 1; display: flex; flex-direction: column; padding: 16px; gap: 14px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.p-card { background: #fff; border: 2px solid var(--border-soft); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-card); }
.p-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.p-sub { color: var(--text-secondary); font-size: 15px; line-height: 1.5; }
.p-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.p-big { font-size: 64px; line-height: 1; }
.p-q { font-size: 21px; font-weight: 700; line-height: 1.4; text-align: center; }
.p-q.small { font-size: 17px; }
.p-emoji { font-size: 56px; text-align: center; line-height: 1.3; }

.p-input { width: 100%; font: inherit; font-size: 19px; padding: 14px 16px; border: 2px solid var(--border-medium); border-radius: 14px; background: #fff; color: inherit; }
.p-input:focus { outline: none; border-color: var(--accent-coral); }
.p-btn { font: inherit; font-weight: 800; font-size: 18px; border: none; border-radius: 16px; padding: 16px 18px; background: var(--bg-soft); color: var(--text-primary); width: 100%; cursor: pointer; transition: transform .1s; }
.p-btn:active { transform: scale(.97); }
.p-btn:disabled { opacity: .45; }
.p-btn.primary { background: var(--accent-coral); }
.p-btn.ghost { background: #fff; border: 2px solid var(--border-medium); }
.p-btn.sm { padding: 10px 14px; font-size: 15px; width: auto; }
.p-answer { display: flex; flex-direction: column; gap: 10px; }
.p-row { display: flex; gap: 10px; align-items: center; }

.p-status { text-align: center; font-weight: 700; font-size: 17px; padding: 12px; border-radius: 14px; background: var(--bg-soft); }
.p-status.ok { background: #D8F5E4; color: #2E6B53; }
.p-status.bad { background: #FFE1E1; color: #B03A2E; }

.p-timer { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.p-timer span { min-width: 44px; text-align: right; }
.p-timer span.danger { color: #D9534F; }
.p-timer i { --progress: 1; flex: 1; height: 10px; border-radius: 100px; background: linear-gradient(to right, var(--accent-coral) calc(var(--progress) * 100%), var(--bg-soft) 0); }

.p-choices { display: grid; gap: 10px; }
.p-choices.cols-2 { grid-template-columns: 1fr 1fr; }
.p-choice { display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; font-size: 18px; font-weight: 700; padding: 16px; border-radius: 16px; border: 3px solid var(--border-soft); background: #fff; color: inherit; min-height: 64px; position: relative; }
.p-choice .k { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 14px; background: var(--bg-soft); }
.p-choice.c0 .k { background: var(--accent-coral); } .p-choice.c1 .k { background: var(--accent-mint); } .p-choice.c2 .k { background: var(--accent-lemon); } .p-choice.c3 .k { background: var(--accent-lavender); }
.p-choice.mine { border-color: var(--text-primary); }
.p-choice.correct { border-color: #6CCB8E; background: #EAF9F0; }
.p-choice.dim { opacity: .4; }
.p-choice:disabled { cursor: default; }
.p-choice .tick { margin-left: auto; font-weight: 800; }
.p-choice.big { min-height: 120px; font-size: 24px; justify-content: center; }
.p-choice.big .k { display: none; }

.p-words { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.p-word { font: inherit; font-size: 19px; font-weight: 700; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--border-soft); background: #fff; color: inherit; }
.p-word.mine { border-color: var(--text-primary); background: var(--bg-soft); }
.p-word.wrong { background: #FFD1D1; text-decoration: line-through; }
.p-word.right { background: #D8F5E4; }

.p-people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-people .p-choice { min-height: 52px; padding: 10px 12px; font-size: 16px; }

.tap-pad { flex: 1; min-height: 50vh; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 40px; font-weight: 800; color: #fff; user-select: none; }
.tap-pad.wait { background: #D9534F; } .tap-pad.go { background: #4CAF50; } .tap-pad.idle { background: var(--bg-soft); color: var(--text-secondary); } .tap-pad.done { background: var(--accent-lavender); color: var(--text-primary); }
.tap-pad .small { font-size: 16px; font-weight: 600; opacity: .9; }
.tap-pad .cnt { font-size: 96px; line-height: 1; }

.card-word { text-align: center; padding: 26px 18px; }
.card-word .w { font-size: 44px; font-weight: 800; line-height: 1.2; }
.card-word .f { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.card-word .f span { background: #FFE1E1; color: #B03A2E; padding: 8px 14px; border-radius: 100px; font-weight: 700; font-size: 16px; }

.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--tc, #fff); font-weight: 700; }
.rank-row .sc { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; }
.rank-row.me { outline: 3px solid var(--text-primary); }

.bet-slider { width: 100%; }
.bet-val { font-size: 44px; font-weight: 800; text-align: center; }
.mates { display: flex; flex-wrap: wrap; gap: 6px; }
.mates span { background: rgba(255,255,255,.85); padding: 6px 12px; border-radius: 100px; font-size: 14px; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; background: rgba(61,61,61,.94); color: #fff; padding: 12px 20px; border-radius: 100px; font-weight: 700; font-size: 15px; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.confetti { position: fixed; top: -60px; z-index: 40; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(120vh) rotate(720deg); opacity: .9; } }
.pulse { animation: pulse .8s ease-in-out infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.04); } }
