/* ══════════════════════════════════════════════════════════════
   라이어게임 v3 — 학생/교사 공용 스타일 (밝고 장난기 있는 테마)
   ══════════════════════════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg1: #eef3ff;
  --bg2: #fdf0ff;
  --card: #ffffff;
  --card2: #f6f7fe;
  --ink: #2f3542;
  --ink2: #6b7280;
  --ink3: #9aa3b2;
  --line: #e8eaf3;
  --purple: #6c5ce7;
  --purple2: #8b7cf7;
  --pink: #ff6b9d;
  --yellow: #ffc048;
  --green: #23c469;
  --red: #ff4757;
  --sky: #38bdf8;
  --shadow: 0 10px 30px rgba(80, 70, 180, .12);
  --shadow-sm: 0 4px 14px rgba(80, 70, 180, .10);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;
  --font-fun: 'Jua', 'Noto Sans KR', sans-serif;
}

html, body { height: 100%; }
body {
  font-family: 'Noto Sans KR', -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  min-height: 100dvh;
  overflow-x: hidden;
}

/* 떠다니는 배경 방울 */
.bg-blob {
  position: fixed; border-radius: 50%; filter: blur(60px); opacity: .5;
  pointer-events: none; z-index: 0;
}
.bg-blob.b1 { width: 320px; height: 320px; background: #d6ccff; top: -80px; left: -90px; }
.bg-blob.b2 { width: 260px; height: 260px; background: #ffd9e8; bottom: -60px; right: -70px; }
.bg-blob.b3 { width: 200px; height: 200px; background: #fff2c9; top: 40%; right: -100px; }

/* ── 화면 전환 ── */
.screen { display: none; position: relative; z-index: 1; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; align-items: center; animation: screenIn .35s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.col { width: 100%; max-width: 540px; padding: 18px 16px 30px; display: flex; flex-direction: column; gap: 14px; }
.col.wide { max-width: 1100px; }

/* ── 공용 요소 ── */
h1, h2, h3, .fun { font-family: var(--font-fun); font-weight: 400; }
.card {
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 18px; border: 1px solid #fff;
}
.btn {
  font-family: var(--font-fun); font-size: 1.05rem; border: none; cursor: pointer;
  border-radius: var(--r-md); padding: 14px 20px; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  box-shadow: 0 6px 0 #5346c9, var(--shadow-sm);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  user-select: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #5346c9; }
.btn:disabled { filter: grayscale(.7) opacity(.6); cursor: not-allowed; box-shadow: 0 6px 0 #9b9b9b; }
.btn.pink { background: linear-gradient(135deg, #ff6b9d, #ff8fb3); box-shadow: 0 6px 0 #d94f7f, var(--shadow-sm); }
.btn.pink:active { box-shadow: 0 2px 0 #d94f7f; }
.btn.green { background: linear-gradient(135deg, #23c469, #3edb85); box-shadow: 0 6px 0 #189a51, var(--shadow-sm); }
.btn.green:active { box-shadow: 0 2px 0 #189a51; }
.btn.yellow { background: linear-gradient(135deg, #ffb833, #ffcf5c); box-shadow: 0 6px 0 #e09612, var(--shadow-sm); color: #6b4a00; }
.btn.yellow:active { box-shadow: 0 2px 0 #e09612; }
.btn.ghost { background: #fff; color: var(--ink2); box-shadow: 0 4px 0 var(--line), var(--shadow-sm); border: 1px solid var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.big { font-size: 1.25rem; padding: 17px 24px; border-radius: 18px; }
.btn.sm { font-size: .88rem; padding: 8px 14px; border-radius: 12px; box-shadow: 0 3px 0 #5346c9; }
.btn.sm:active { box-shadow: 0 1px 0 #5346c9; }
.btn.red { background: linear-gradient(135deg, #ff4757, #ff6b81); box-shadow: 0 6px 0 #d63146, var(--shadow-sm); }
.btn.red:active { box-shadow: 0 2px 0 #d63146; }
.btn.sm.red { box-shadow: 0 3px 0 #d63146; }
.btn.sm.ghost { box-shadow: 0 3px 0 var(--line); }
.btn.sm.green { box-shadow: 0 3px 0 #189a51; }

input[type=text], input[type=password], input[type=number], input[type=time], textarea, select {
  width: 100%; background: var(--card2); border: 2px solid var(--line); border-radius: var(--r-md);
  padding: 13px 15px; font-size: 1rem; color: var(--ink); outline: none; font-family: inherit;
  transition: border-color .15s, background .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--purple2); background: #fff; }
label.fld { font-size: .82rem; color: var(--ink2); font-weight: 600; margin-bottom: 6px; display: block; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card2); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; font-size: .82rem; color: var(--ink2); font-weight: 600;
}
.badge.purple { background: #efeaff; border-color: #ddd3ff; color: var(--purple); }
.badge.pink { background: #ffe9f1; border-color: #ffd2e2; color: #e0447c; }
.badge.green { background: #e3f9ec; border-color: #bff0d4; color: #17954e; }

/* ── 토스트 ── */
#toast-wrap { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #33334b; color: #fff; font-size: .92rem; padding: 11px 20px; border-radius: 999px;
  box-shadow: var(--shadow); animation: toastIn .25s ease; max-width: 88vw; text-align: center;
}
.toast.err { background: var(--red); }
.toast.okc { background: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.9); } to { opacity: 1; transform: none; } }

/* ══════════════ 입장 화면 ══════════════ */
.logo-wrap { text-align: center; padding: 26px 0 4px; }
.logo-emoji { font-size: 4.2rem; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
.logo-title { font-family: var(--font-fun); font-size: 2.5rem; letter-spacing: 1px; color: var(--ink);
  text-shadow: 3px 3px 0 #e6dcff; }
.logo-sub { color: var(--ink2); font-size: .95rem; margin-top: 2px; }

.tab-row { display: flex; background: var(--card2); border-radius: var(--r-md); padding: 5px; gap: 5px; }
.tab-row button {
  flex: 1; border: none; background: transparent; font-family: var(--font-fun); font-size: 1rem;
  padding: 11px; border-radius: 12px; color: var(--ink3); cursor: pointer; transition: all .15s;
}
.tab-row button.active { background: #fff; color: var(--purple); box-shadow: var(--shadow-sm); }

.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.avatar-pick {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: var(--card2); border: 2px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: all .12s;
}
.avatar-pick:hover { transform: scale(1.08); }
.avatar-pick.on { border-color: var(--purple); background: #efeaff; transform: scale(1.12); box-shadow: var(--shadow-sm); }

.howto summary { font-family: var(--font-fun); color: var(--ink2); cursor: pointer; font-size: .95rem; padding: 4px 2px; }
.howto-steps { display: flex; flex-direction: column; gap: 8px; padding: 12px 2px 4px; }
.howto-step { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink2); }
.howto-step b { color: var(--ink); }
.howto-num { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: #efeaff; color: var(--purple);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-fun); font-size: .85rem; }

.quick-hint {
  margin-top: 8px; font-size: .8rem; color: var(--ink2); line-height: 1.55;
  background: #fff8e1; border: 1px solid #ffe9a8; border-radius: 10px; padding: 9px 12px;
}
.quick-count {
  font-family: var(--font-fun); font-size: 2.2rem; color: var(--purple); margin-top: 8px; min-height: 1em;
  animation: popIn .3s ease;
}

.teacher-link { text-align: center; font-size: .85rem; color: var(--ink3); padding-bottom: 10px; }
.teacher-link a { color: var(--purple); font-weight: 700; text-decoration: none; }

/* ══════════════ 자율방 슬롯 ══════════════ */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.slot-card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); padding: 18px 12px;
  text-align: center; cursor: pointer; transition: all .15s; box-shadow: var(--shadow-sm);
}
.slot-card:hover { transform: translateY(-3px); border-color: var(--purple2); }
.slot-card.full, .slot-card.playing { opacity: .55; cursor: not-allowed; }
.slot-num { font-size: 1.9rem; }
.slot-name { font-family: var(--font-fun); margin: 4px 0 8px; color: var(--ink); }
.slot-state { font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; display: inline-block; }
.slot-state.empty { background: #e3f9ec; color: #17954e; }
.slot-state.some { background: #efeaff; color: var(--purple); }
.slot-state.full { background: #ffe1e5; color: var(--red); }
.slot-state.playing { background: #fff3d6; color: #b07800; }

/* ══════════════ 대기실 ══════════════ */
.room-code-hero { text-align: center; padding: 10px 0 2px; }
.room-code-hero .lbl { font-size: .85rem; color: var(--ink2); }
.code-box {
  display: inline-flex; gap: 6px; margin-top: 8px; background: #fff; padding: 12px 18px;
  border-radius: var(--r-lg); box-shadow: var(--shadow); border: 2px dashed #d8ccff;
}
.code-box span { font-family: var(--font-fun); font-size: 2rem; color: var(--purple); letter-spacing: 2px; }

.player-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.p-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px;
  animation: popIn .3s cubic-bezier(.5, 1.8, .5, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
.p-face {
  width: 58px; height: 58px; border-radius: 20px; background: #fff; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; box-shadow: var(--shadow-sm);
  position: relative;
}
.p-chip.me .p-face { border-color: var(--purple); background: #f3efff; }
.p-chip.off { opacity: .4; }
.p-crown { position: absolute; top: -14px; right: -8px; font-size: 1.1rem; transform: rotate(18deg); }
.p-name { font-size: .8rem; font-weight: 700; color: var(--ink2); max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-score { font-size: .72rem; color: var(--purple); font-weight: 800; }

/* ══════════════ 게임 상단 바 ══════════════ */
.game-top {
  display: flex; align-items: center; gap: 8px; width: 100%;
}
.game-top .spacer { flex: 1; }
.timer-wrap { position: relative; width: 54px; height: 54px; flex-shrink: 0; }
.timer-wrap svg { transform: rotate(-90deg); }
.timer-ring-bg { fill: #fff; stroke: var(--line); stroke-width: 5; }
.timer-ring { fill: none; stroke: var(--green); stroke-width: 5; stroke-linecap: round; transition: stroke .3s; }
.timer-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-fun); font-size: 1.05rem; color: var(--ink);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  font-size: 1.1rem; cursor: pointer; box-shadow: var(--shadow-sm);
}

/* ══════════════ 단어 카드 (플립) ══════════════ */
.phase-title { text-align: center; font-family: var(--font-fun); font-size: 1.4rem; color: var(--ink); }
.phase-sub { text-align: center; color: var(--ink2); font-size: .9rem; margin-top: -6px; }

.flip-zone { perspective: 1200px; display: flex; justify-content: center; padding: 6px 0; }
.flip-card {
  width: min(330px, 86vw); height: 210px; position: relative; cursor: pointer;
  transform-style: preserve-3d; transition: transform .6s cubic-bezier(.4, 1.4, .5, 1);
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow); padding: 16px; text-align: center;
}
.flip-front {
  background: linear-gradient(135deg, #6c5ce7, #8b7cf7 60%, #a99bfd);
  color: #fff; border: 4px solid #fff;
}
.flip-front .q { font-size: 3rem; animation: bob 2s ease-in-out infinite; }
.flip-front .t { font-family: var(--font-fun); font-size: 1.2rem; }
.flip-back { background: #fff; border: 4px solid #d8ffde; transform: rotateY(180deg); }
.flip-back.liar { border-color: #ffd2da; background: linear-gradient(160deg, #fff, #fff0f3); }
.flip-back .topic { font-size: .85rem; color: var(--ink2); }
.flip-back .word { font-family: var(--font-fun); font-size: 2.4rem; color: var(--green); }
.flip-back.liar .word { color: var(--red); font-size: 1.9rem; }
.flip-back .hint { font-size: .82rem; color: var(--ink2); background: var(--card2); border-radius: 10px; padding: 7px 12px; }

.confirm-progress { text-align: center; color: var(--ink2); font-size: .9rem; }
.confirm-progress b { color: var(--purple); font-size: 1.05rem; }

/* ══════════════ 발표 단계 ══════════════ */
.order-track { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.order-stop {
  display: flex; align-items: center; gap: 4px; background: #fff; border: 2px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 7px; font-size: .82rem; font-weight: 700; color: var(--ink3);
  transition: all .2s;
}
.order-stop .fc { font-size: 1.05rem; }
.order-stop.now { border-color: var(--yellow); background: #fff8e1; color: #9c6f00; transform: scale(1.08); box-shadow: var(--shadow-sm); }
.order-stop.done { border-color: #bff0d4; background: #f0fcf5; color: #17954e; }

.speaker-spot {
  text-align: center; padding: 20px 16px;
  background: linear-gradient(160deg, #fffceb, #fff); border: 2px solid #ffe9a8;
}
.speaker-face { font-size: 3.2rem; display: inline-block; animation: bob 1.6s ease-in-out infinite; }
.speaker-name { font-family: var(--font-fun); font-size: 1.5rem; color: var(--ink); margin-top: 2px; }
.speaker-name b { color: #d98e00; }

.bubble-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding-right: 2px; }
.bubble { display: flex; gap: 8px; align-items: flex-start; animation: riseIn .3s ease; }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bubble .bf { font-size: 1.5rem; flex-shrink: 0; width: 38px; height: 38px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.bubble .bt { background: #fff; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 9px 13px; font-size: .92rem; box-shadow: var(--shadow-sm); }
.bubble .bn { font-size: .74rem; color: var(--ink3); font-weight: 700; margin-bottom: 2px; }
.bubble.auto .bt { color: var(--ink3); font-style: italic; }

.exp-input-row { display: flex; gap: 8px; }
.exp-input-row input { flex: 1; }

/* ══════════════ 투표 ══════════════ */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.vote-card {
  background: #fff; border: 3px solid var(--line); border-radius: var(--r-lg); padding: 14px 6px 10px;
  text-align: center; cursor: pointer; transition: all .15s; position: relative;
}
.vote-card:hover { transform: translateY(-3px); }
.vote-card .vf { font-size: 2.2rem; }
.vote-card .vn { font-family: var(--font-fun); font-size: .95rem; margin-top: 4px; color: var(--ink); }
.vote-card.sel { border-color: var(--red); background: #fff5f6; transform: scale(1.06); box-shadow: 0 8px 20px rgba(255, 71, 87, .25); }
.vote-card.sel::after { content: '🔍'; position: absolute; top: -12px; right: -6px; font-size: 1.5rem; transform: rotate(15deg); }
.vote-card.me { opacity: .35; cursor: not-allowed; }
.vote-card.off .vf { filter: grayscale(1) opacity(.5); }

.vote-status { text-align: center; font-size: .92rem; color: var(--ink2); }
.voted-overlay { text-align: center; padding: 26px 10px; }
.voted-overlay .big { font-size: 3rem; animation: popIn .4s cubic-bezier(.5, 1.8, .5, 1); }

/* ══════════════ 라이어 추측 ══════════════ */
.accused-hero { text-align: center; padding: 18px 12px; }
.accused-face { font-size: 3.6rem; display: inline-block; animation: shake .5s ease infinite; }
@keyframes shake { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.drum { font-size: .95rem; color: var(--ink2); animation: blink 1s ease infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ══════════════ 결과 연출 ══════════════ */
.tally-list { display: flex; flex-direction: column; gap: 8px; }
.tally-row { display: flex; align-items: center; gap: 8px; }
.tally-row .tn { width: 84px; font-size: .85rem; font-weight: 700; color: var(--ink2); text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.tally-bar-wrap { flex: 1; background: var(--card2); border-radius: 999px; height: 26px; overflow: hidden; }
.tally-bar {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--purple2), var(--purple));
  transition: width .8s cubic-bezier(.3, 1, .4, 1);
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
  color: #fff; font-size: .8rem; font-weight: 800; min-width: 0;
}
.tally-row.top .tally-bar { background: linear-gradient(90deg, #ff8aad, var(--red)); }

.reveal-card {
  text-align: center; padding: 22px 14px; border-radius: var(--r-lg);
  animation: flipIn .55s cubic-bezier(.3, 1.4, .4, 1);
}
@keyframes flipIn { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.reveal-face { font-size: 3.4rem; }
.reveal-name { font-family: var(--font-fun); font-size: 1.7rem; margin-top: 4px; }
.reveal-word { margin-top: 6px; font-size: .95rem; color: var(--ink2); }
.reveal-word b { font-family: var(--font-fun); font-size: 1.4rem; color: var(--purple); }

.win-banner {
  text-align: center; font-family: var(--font-fun); font-size: 1.9rem; padding: 18px;
  border-radius: var(--r-lg); animation: popIn .45s cubic-bezier(.5, 1.8, .5, 1); color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.win-banner.citizen { background: linear-gradient(135deg, #23c469, #3edb85); }
.win-banner.liar { background: linear-gradient(135deg, #ff6b81, #ff4757); }
.win-banner .sub { font-size: .95rem; font-family: 'Noto Sans KR'; text-shadow: none; opacity: .95; margin-top: 4px; }

.delta-list { display: flex; flex-direction: column; gap: 6px; }
.delta-row {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 9px 12px; animation: riseIn .3s ease both;
}
.delta-row .df { font-size: 1.4rem; }
.delta-row .dn { font-family: var(--font-fun); font-size: .98rem; flex-shrink: 0; }
.delta-row .dr { font-size: .76rem; color: var(--ink3); flex: 1; text-align: right; }
.delta-pts { font-family: var(--font-fun); font-size: 1rem; color: var(--green); flex-shrink: 0; }
.delta-pts.zero { color: var(--ink3); }
.delta-total { font-size: .8rem; color: var(--ink2); font-weight: 700; flex-shrink: 0; }

/* ══════════════ 시상대 ══════════════ */
.podium-wrap { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 24px 0 4px; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 92px; }
.podium-face { font-size: 2.6rem; animation: bob 2s ease-in-out infinite; }
.podium-name { font-family: var(--font-fun); font-size: .95rem; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-size: .8rem; color: var(--purple); font-weight: 800; }
.podium-block {
  width: 100%; border-radius: 14px 14px 0 0; display: flex; align-items: flex-start; justify-content: center;
  font-family: var(--font-fun); font-size: 1.5rem; color: #fff; padding-top: 8px;
  animation: growUp .7s cubic-bezier(.3, 1.2, .4, 1) both; transform-origin: bottom;
}
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.podium-1 { height: 110px; background: linear-gradient(180deg, #ffd35c, #ffb833); }
.podium-2 { height: 82px; background: linear-gradient(180deg, #c9d6e8, #a8bcd4); }
.podium-3 { height: 60px; background: linear-gradient(180deg, #f0b58e, #e09a6b); }

.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 14px; }
.rank-no { font-family: var(--font-fun); width: 30px; color: var(--ink2); }
.rank-face { font-size: 1.3rem; }
.rank-name { flex: 1; font-weight: 700; font-size: .95rem; }
.rank-score { font-family: var(--font-fun); color: var(--purple); }

/* ══════════════ 채팅 & 반응 ══════════════ */
.chat-box { display: flex; flex-direction: column; gap: 8px; }
.chat-msgs { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding: 2px; }
.chat-line { font-size: .88rem; line-height: 1.45; word-break: break-word; }
.chat-line .cs { font-weight: 800; color: var(--purple); }
.chat-line.sys { color: var(--ink3); font-size: .8rem; }
.chat-line.tch .cs { color: #d98e00; }
.chat-input-row { display: flex; gap: 6px; }
.chat-input-row input { flex: 1; padding: 10px 14px; }
.chat-input-row .btn { padding: 10px 16px; font-size: .95rem; }

.react-bar { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.react-btn {
  font-size: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  width: 44px; height: 40px; cursor: pointer; transition: transform .1s; box-shadow: var(--shadow-sm);
}
.react-btn:active { transform: scale(1.25); }

.float-react {
  position: fixed; bottom: 80px; font-size: 2rem; z-index: 500; pointer-events: none;
  animation: floatUp 2.2s ease-out forwards;
}
.float-react .who { font-size: .68rem; background: rgba(255,255,255,.9); border-radius: 999px; padding: 1px 7px; color: var(--ink2); display: block; text-align: center; margin-top: -4px; font-weight: 700; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(20px) scale(.6); }
  12% { opacity: 1; transform: translateY(0) scale(1.15); }
  100% { opacity: 0; transform: translateY(-46vh) scale(.9) rotate(8deg); }
}

/* ══════════════ 컨페티 ══════════════ */
.confetti { position: fixed; top: -14px; z-index: 800; pointer-events: none; animation: confFall linear forwards; }
@keyframes confFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .9; }
}

/* ══════════════ 오버레이 (강퇴 등) ══════════════ */
.overlay {
  position: fixed; inset: 0; background: rgba(40, 36, 70, .55); z-index: 900;
  display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px);
}
.overlay.show { display: flex; }
.overlay .panel { background: #fff; border-radius: var(--r-lg); padding: 28px 24px; text-align: center; max-width: 380px; width: 100%; box-shadow: var(--shadow); }
.overlay .panel .big { font-size: 3rem; margin-bottom: 8px; }

/* ══════════════ 교사 대시보드 ══════════════ */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; width: 100%; }
.dash-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 2px; flex-wrap: wrap; }
.dash-head h1 { font-size: 1.5rem; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px;
  font-size: .84rem; cursor: pointer; color: var(--ink2); font-weight: 600; transition: all .12s;
}
.topic-chip.on { border-color: var(--purple); background: #efeaff; color: var(--purple); }
.preset-row { display: flex; gap: 6px; flex-wrap: wrap; }
.preset-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px;
  font-size: .86rem; cursor: pointer; color: var(--ink2); font-weight: 700;
}
.preset-btn.on { border-color: var(--purple); background: #efeaff; color: var(--purple); }
.list-row {
  display: flex; align-items: center; gap: 8px; background: var(--card2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 9px 12px; margin-bottom: 7px; font-size: .88rem; flex-wrap: wrap;
}
.list-row .grow { flex: 1; min-width: 120px; }
.list-row .meta { font-size: .75rem; color: var(--ink3); }
.mini-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px;
  font-size: .78rem; cursor: pointer; color: var(--ink2); font-weight: 600;
}
.mini-btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.mini-btn.danger { color: var(--red); border-color: #ffd2d8; }
.mini-btn.warn { color: #b07800; border-color: #ffe3a3; background: #fffaf0; }

.obs-word-banner {
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  background: #33334b; color: #fff; border-radius: var(--r-lg); padding: 14px 18px;
}
.obs-word-banner .w { font-family: var(--font-fun); font-size: 1.5rem; color: #ffd35c; }
.obs-word-banner .l { font-family: var(--font-fun); font-size: 1.2rem; color: #ff8aad; }
.obs-players { display: flex; flex-wrap: wrap; gap: 8px; }
.obs-p {
  display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px 6px 8px; font-size: .86rem; font-weight: 600;
}
.obs-p.liar { border-color: #ffb3c2; background: #fff5f7; }
.obs-p.off { opacity: .45; }
.obs-p .kick { border: none; background: #ffeef0; color: var(--red); border-radius: 999px; font-size: .7rem; padding: 3px 8px; cursor: pointer; }

.qr-hero { text-align: center; }
.qr-hero .code-big { font-family: var(--font-fun); font-size: 3.2rem; color: var(--purple); letter-spacing: 6px; }

/* 반응형 미세 조정 */
@media (max-width: 420px) {
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
  .logo-title { font-size: 2.1rem; }
  .flip-card { height: 190px; }
}
