:root {
  --ink: #f6f0e6;
  --muted: #d7c7b4;
  --paper: #f4e7d2;
  --paper-ink: #2c221c;
  --line: rgba(228, 194, 122, 0.38);
  --gold: #e4c27a;
  --wine: #8d303c;
  --glass: rgba(16, 10, 10, 0.72);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
  background:
    linear-gradient(180deg, rgba(12, 8, 8, 0.22), rgba(8, 5, 5, 0.48)),
    url("/assets/bg.jpg") center / cover no-repeat fixed;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, .secret strong, .secret .word {
  font-family: "Gowun Batang", serif;
  font-weight: 700;
  margin: 0;
}
h3 { font-size: 18px; }
.hidden { display: none !important; }

#app { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px 40px; }

.panel, .play {
  width: min(440px, 100%);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 28px 24px;
}
.panel.wide, .play { width: min(920px, 100%); }
.mark {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--line);
}
.eyebrow {
  margin: 12px 0 0;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--gold);
}
.lead, .me, .empty, .status, .turn-line { color: var(--muted); }
label { display: grid; gap: 6px; margin: 16px 0; font-weight: 700; }
input {
  border: 1px solid var(--line);
  background: rgba(255, 246, 232, 0.94);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--paper-ink);
}
.primary, .ghost {
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid transparent;
}
.primary { background: var(--wine); color: #fff8f4; font-weight: 700; }
.primary:disabled { opacity: 0.45; cursor: default; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.row, .create-row, .actions, .hint-actions { display: flex; gap: 10px; align-items: center; }
.row { justify-content: space-between; }
.create-row { margin: 12px 0; }
.create-row input { flex: 1; margin: 0; }
.actions { flex-wrap: wrap; margin-top: 8px; }
.rooms, .hints { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rooms li, .person, .seat, .hint, .ballot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: rgba(255, 246, 232, 0.08);
  border: 1px solid rgba(228, 194, 122, 0.16);
  border-radius: 14px;
  padding: 12px;
}
.rooms button, .vote {
  border: 0;
  background: var(--wine);
  color: #fff8f4;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
.rooms button:disabled, .vote:disabled { opacity: 0.45; cursor: default; }
.wait-players, .seats { display: grid; gap: 8px; margin: 14px 0; }
.rules { margin: 8px 0 16px; color: var(--muted); }
.rules summary { cursor: pointer; color: var(--gold); }
.rules li { margin: 6px 0; }

.play-top, .layout { display: flex; gap: 18px; }
.play-top { justify-content: space-between; align-items: end; margin-bottom: 16px; }
.layout { align-items: start; }
.stage { flex: 1; min-width: 0; }
.side {
  width: 250px;
  flex: none;
  background: rgba(8, 5, 5, 0.28);
  border-radius: 20px;
  padding: 14px;
}
.pill {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.secret {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 250, 240, 0.95), transparent 46%),
    linear-gradient(165deg, #f8edd9, #e6d0ad);
  color: var(--paper-ink);
  border-radius: 22px;
  padding: 22px 22px 18px;
  min-height: 168px;
}
.secret p { margin: 0; letter-spacing: 0.16em; font-size: 12px; color: #8a5a3a; }
.secret .topic, .secret .word {
  font-family: "Gowun Batang", serif;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 4px;
}
.secret .topic { font-size: 34px; }
.secret .word { font-size: 42px; }
.secret .role {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #3a2420;
  color: #f6e7cf;
  letter-spacing: 0.08em;
  font-size: 13px;
}
.turn-line { min-height: 1.4em; }
.hint { display: block; }
.hint b { color: var(--gold); font-weight: 700; }
.hint-form label { margin-bottom: 8px; }
.hint-actions { justify-content: space-between; }
#hintCount { color: var(--muted); font-size: 13px; }
.vote-box, .result-box { display: grid; gap: 8px; margin-top: 12px; }
.vote { width: 100%; border-radius: 14px; text-align: left; }
.vote.chosen { outline: 2px solid var(--gold); }
.seat.me { border-color: var(--gold); }
.seat.speak { background: rgba(228, 194, 122, 0.16); }
.seat.liar { box-shadow: inset 0 0 0 1px #e07a86; }
.outcome {
  margin: 0;
  font-family: "Gowun Batang", serif;
  font-size: 28px;
}
.outcome.citizen { color: #f0d48a; }
.outcome.liar { color: #f0a0a8; }
.note { margin: 0; color: var(--muted); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #2a1718;
  color: #fff6ea;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  .layout, .play-top { display: grid; }
  .side { width: auto; }
  .secret .word { font-size: 34px; }
}
