/* ─────────────────────────────── 토큰 ─────────────────────────────── */
:root {
  --bg: #0e1013;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #272d38;
  --text: #e8eaed;
  --muted: #8b929f;

  --correct: #3d9970;
  --present: #cfa02f;
  /* 채점된 '없음' 타일. 빈 칸과 확실히 구분되도록 충분히 밝게 둔다 */
  --absent: #454d5e;
  --empty-border: #2e3540;

  --accent: #5b7cfa;
  --accent-hover: #6f8bfb;
  --danger: #e05263;

  --radius: 12px;
  --radius-sm: 8px;
  --gap: 16px;

  --font: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard',
    'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ─────────────────────────────── 화면 전환 ─────────────────────────────── */
.screen {
  display: none;
  min-height: 100dvh;
}
.screen.is-active {
  display: block;
}

/* ─────────────────────────────── 공통 요소 ─────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: #262b35;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn--block {
  width: 100%;
}
.btn--lg {
  padding: 15px 18px;
  font-size: 16px;
}
.btn--sm {
  padding: 8px 12px;
  font-size: 13px;
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus {
  border-color: var(--accent);
}
.input::placeholder {
  color: #5c6472;
}
.input--code {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-weight: 700;
  text-align: center;
}

.select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  outline: none;
  cursor: pointer;
}
.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field {
  display: block;
  margin-bottom: 16px;
}
.field__label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─────────────────────────────── 시작 화면 ─────────────────────────────── */
.home {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 20px 40px;
}
.home__head {
  text-align: center;
  margin-bottom: 28px;
}
.home__logo {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--correct), var(--present));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home__tag {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.join-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

/* 초대 링크로 들어왔음을 먼저 알려준다 — 방 코드를 다시 칠 필요가 없다는 뜻 */
.invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.invite__label {
  font-size: 13px;
  color: var(--muted);
}
.invite__code {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

/* 부차 동작 — 버튼처럼 보이지 않게 눌러둔다 */
.linkbtn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkbtn:hover {
  color: var(--text);
}

/* 홈 화면의 규칙 진입점 — 게임 화면의 FAB와 같은 모달을 연다 */
.rules-link {
  display: block;
  width: 100%;
  margin-top: 22px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.rules-link:hover {
  color: var(--text);
  border-color: #39404d;
}

.chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.chip--correct {
  background: var(--correct);
}
.chip--present {
  background: var(--present);
}
.chip--absent {
  background: var(--absent);
}

/* ─────────────────────────────── 대기실 ─────────────────────────────── */
.lobby {
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  display: grid;
  gap: var(--gap);
}
.lobby__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.lobby__label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}
.room-code {
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.15em;
  cursor: pointer;
  padding: 0;
  line-height: 1.1;
}
.room-code:hover {
  color: var(--accent);
}
.lobby__hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: -10px;
}

.player-list {
  list-style: none;
  display: grid;
  gap: 8px;
}
.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.player-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--correct);
  flex-shrink: 0;
}
.player-row__dot.is-off {
  background: #4b5262;
}
.player-row__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
}
.badge--me {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

.settings {
  display: grid;
  gap: 12px;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.setting__hint {
  color: var(--muted);
  font-size: 12px;
}
.setting__note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

/* ─────────────────────────────── 게임 화면 ─────────────────────────────── */
.gamebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.gamebar__left,
.gamebar__right {
  flex: 1;
}
.gamebar__right {
  text-align: right;
}
.pill {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
}
.gamebar__timer {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.gamebar__timer.is-urgent {
  color: var(--danger);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  align-items: start;
}

.game__main {
  display: grid;
  gap: 18px;
  justify-items: center;
}

/* ── 보드 ── */
/* --jamo 는 방 설정(자모 수)에 따라 JS가 넣는다 */
.board {
  display: grid;
  gap: 7px;
  width: 100%;
  max-width: min(100%, calc(var(--jamo, 6) * 62px));
}

.board__row {
  display: grid;
  grid-template-columns: repeat(var(--jamo, 6), 1fr);
  gap: 6px;
}

.tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--absent);
  border: 1px solid transparent;
  /* 글자 수가 늘면 칸이 좁아지므로 글자도 같이 줄인다 */
  font-size: clamp(11px, 3.6vw, 22px);
  font-weight: 700;
  color: #e2e6ee;
  user-select: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tile--empty {
  background: transparent;
  border-color: var(--empty-border);
  color: #3a4150;
}
.tile--correct {
  background: var(--correct);
  border-color: var(--correct);
  color: #fff;
}
.tile--present {
  background: var(--present);
  border-color: var(--present);
  color: #fff;
}
.tile--absent {
  background: var(--absent);
  border-color: var(--absent);
  color: #aab2c0;
}
.tile--typing {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
}
/* 자모 수를 넘겨서 친 부분 — 왜 거부되는지 눈에 보여야 한다 */
.tile--over {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.board__row--reveal .tile {
  animation: flip 0.4s ease both;
}
.board__row--reveal .tile:nth-child(2) { animation-delay: 0.05s; }
.board__row--reveal .tile:nth-child(3) { animation-delay: 0.1s; }
@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

/* ── 입력 ── */
.guess {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}
.input--guess {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.15em;
}
.guess__status {
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
  text-align: center;
}
.guess__status.is-error {
  color: var(--danger);
}
.guess__status.is-success {
  color: var(--correct);
  font-weight: 600;
}

/* ── 자모 현황판 ── */
.keyboard {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 10px;
}
/* 라벨을 위에 두어야 자음 14개가 한 줄에 들어간다 */
.keyboard__group {
  display: grid;
  gap: 5px;
}
.keyboard__label {
  font-size: 11px;
  color: var(--muted);
}
.keyboard__keys {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 4px;
}
.key {
  height: 26px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: transparent;
  border: 1px solid var(--empty-border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
/* 아직 안 써본 자모 — 남은 후보라는 뜻이라 또렷하게 둔다 */
.key--unused {
  color: #96a0b0;
}
.key--correct {
  background: var(--correct);
  border-color: var(--correct);
  color: #fff;
}
.key--present {
  background: var(--present);
  border-color: var(--present);
  color: #fff;
}
/* 걸러낸 자모 — 흐리게 죽여서 남은 것만 눈에 들어오게 */
.key--absent {
  background: transparent;
  border-color: #23282f;
  color: #3d434e;
}

/* ── 상대 화면 ── */
.game__side {
  position: sticky;
  top: 76px;
}
.side__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.side__mode {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.opponents {
  display: grid;
  gap: 10px;
}

.opp {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  transition: border-color 0.2s;
}
.opp.is-solved {
  border-color: var(--correct);
}
.opp.is-off {
  opacity: 0.45;
}

.opp__head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  font-size: 13px;
}
.opp__name {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opp__score {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.opp__rank {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--correct);
  color: #fff;
}

/* 상대 미니보드 — 음절 묶음을 그대로 축소해서 보여준다 */
.mini {
  display: grid;
  gap: 3px;
}
.mini__row {
  display: grid;
  grid-template-columns: repeat(var(--jamo, 6), 1fr);
  gap: 2px;
}
.mini__tile {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}
.mini__tile--correct { background: var(--correct); }
.mini__tile--present { background: var(--present); }
.mini__tile--absent { background: var(--absent); }
/* 아직 안 낸 시도 — 내 보드의 빈 칸과 같은 외곽선 언어를 쓴다 */
.mini__tile--pending {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--empty-border);
}

/* ─────────────────────────────── 오버레이 ─────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 11, 0.82);
  backdrop-filter: blur(6px);
  z-index: 60;
  padding: 20px;
  overflow-y: auto;
}
.overlay.is-active {
  display: grid;
  place-items: center;
}
.overlay__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 24px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: rise 0.25s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
}
.overlay__kicker {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.overlay__title {
  font-size: 24px;
  font-weight: 800;
  margin: 6px 0 4px;
  letter-spacing: -0.02em;
}
.overlay__answer {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 20px;
}
.overlay__answer strong {
  color: var(--correct);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.scoreboard {
  list-style: none;
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
  text-align: left;
}
.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.score-row.is-me {
  border: 1px solid var(--accent);
}
.score-row__rank {
  width: 22px;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-row__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.score-row__detail {
  color: var(--muted);
  font-size: 12px;
}
.score-row__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.overlay__wait {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

/* ─────────────────────────────── 알림 ─────────────────────────────── */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -24px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.disconnect {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--danger);
  color: #fff;
  padding: 11px;
  font-size: 14px;
  text-align: center;
  z-index: 90;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.disconnect.is-active {
  display: flex;
}
.disconnect__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1s ease-in-out infinite;
}

/* ─────────────────────────────── 규칙 버튼 / 모달 ─────────────────────────────── */

/*
 * 우하단 고정 버튼. 라운드 결과 오버레이(z-index 60)보다 아래에 둬서
 * 결과 화면을 가리지 않는다.
 */
.fab {
  display: none;
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 50;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.fab.is-visible {
  display: flex;
}
.fab:hover {
  background: #2b313c;
  color: var(--text);
  transform: translateY(-2px);
}
.fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* 재연결 배너가 뜨면 그 위로 밀어 올린다 */
.disconnect.is-active ~ .fab {
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 44px);
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 11, 0.82);
  backdrop-filter: blur(6px);
  z-index: 70;
  padding: 20px;
  overflow-y: auto;
}
.modal.is-active {
  display: grid;
  place-items: center;
}
.modal__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px 24px;
  width: 100%;
  max-width: 440px;
  animation: rise 0.2s ease both;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.modal__close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal__close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.rules__list {
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 9px;
  font-size: 14px;
  line-height: 1.55;
}
.rules__list strong {
  color: var(--text);
}

.rules__legend {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
}
.rules__legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
}
.rules__legend-row .chip {
  flex-shrink: 0;
  min-width: 46px;
  text-align: center;
}

.rules__note {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.rules__note strong {
  color: var(--text);
}

/* ─────────────────────────────── 반응형 ─────────────────────────────── */
@media (max-width: 860px) {
  .game {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 18px 16px 40px;
  }
  .game__side {
    position: static;
  }
  /* 좁은 화면에서는 상대 보드를 가로 스크롤 카드로 */
  .opponents {
    grid-auto-flow: column;
    grid-auto-columns: 148px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }
  .opp {
    scroll-snap-align: start;
  }
}

@media (max-width: 420px) {
  .home {
    padding: 32px 16px;
  }
  .lobby {
    padding: 20px 16px 36px;
  }
  .room-code {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ─────────────────────────────── 채팅 ─────────────────────────────── */
.chat-mount {
  width: 100%;
}
.chat {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  gap: 9px;
  width: 100%;
}
.chat__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.chat__log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 13px;
  line-height: 1.45;
}
.chat__empty {
  color: #5c6472;
  font-size: 12px;
  margin: auto;
}
.chat__msg {
  word-break: break-word;
}
.chat__from {
  font-weight: 700;
  color: var(--accent);
  margin-right: 5px;
}
.chat__msg--me .chat__from {
  color: var(--correct);
}
/* 입장·퇴장·정답 알림 — 사람 말과 구분되게 눌러둔다 */
.chat__msg--system {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  padding: 2px 0;
}
.chat__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.chat__input {
  font-size: 14px;
  padding: 8px 10px;
}

@media (max-width: 860px) {
  .chat__log {
    height: 150px;
  }
}
