:root {
  --ink: #3a2a1c;
  --cream: rgba(255, 248, 236, 0.9);
  --line: rgba(122, 78, 42, 0.28);
  --wood: #9a5a32;
  --wood-deep: #6e3e22;
  --chalk: #f6f1e4;
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
  background: url("/assets/bg.jpg?v=1") center / cover no-repeat fixed;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, .call {
  font-family: "Gowun Batang", serif;
  font-weight: 700;
  margin: 0;
}
h1 { font-size: 48px; line-height: 1.2; }
h2 { font-size: 32px; line-height: 1.25; }
.hidden { display: none !important; }

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

.panel, .slate, .guess-row, .seats, .log, .play .actions {
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(62, 36, 16, 0.2);
}

.panel {
  width: min(440px, 100%);
  background: var(--cream);
  border-radius: 28px;
  padding: 28px 24px 24px;
}
.panel.wide { width: min(720px, 100%); }
.mark {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 8px 18px rgba(62, 36, 16, 0.18);
}
.eyebrow {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--wood);
}
.eyebrow.light { color: #e7c89a; margin-top: 0; }
.lead, .me, .empty { color: #5c4636; line-height: 1.55; }
label { display: grid; gap: 6px; margin: 16px 0; font-weight: 700; }
input {
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.92);
  border-radius: 12px;
  padding: 12px 14px;
}
.primary, .ghost {
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid transparent;
}
.primary { background: var(--wood); color: var(--chalk); font-weight: 700; }
.primary:hover:not(:disabled) { background: var(--wood-deep); }
.primary:disabled { opacity: 0.45; cursor: default; }
.ghost {
  background: rgba(255, 250, 242, 0.55);
  border-color: var(--line);
}
.row, .create-row, .actions, .guess-row { display: flex; gap: 10px; align-items: center; }
.row { justify-content: space-between; }
.create-row { margin: 14px 0; }
.create-row input, .guess-row input { flex: 1; margin: 0; }
.actions { margin-top: 8px; flex-wrap: wrap; }
.rooms, .people, .seats { display: grid; gap: 8px; }
.rooms { list-style: none; margin: 0; padding: 0; }
.rooms li, .person, .seat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: rgba(255, 250, 242, 0.78);
  border-radius: 16px;
  padding: 12px;
}
.rooms button {
  border: 0;
  background: var(--wood);
  color: var(--chalk);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
.rooms button:disabled { opacity: 0.45; cursor: default; }
.meta { color: #6a5344; font-size: 14px; margin-top: 2px; }
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.rules { margin: 8px 0 16px; }
.rules summary { cursor: pointer; font-weight: 700; }
.rules ul { margin: 8px 0 0; padding-left: 18px; color: #5c4636; line-height: 1.55; }

.play {
  width: min(760px, 100%);
  display: grid;
  gap: 12px;
}
.slate {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(165deg, rgba(42, 92, 74, 0.84), rgba(20, 52, 44, 0.8));
  color: var(--chalk);
  border-radius: 28px;
  padding: 22px 22px 18px;
  text-align: center;
  border-color: rgba(255, 228, 196, 0.28);
}
.call {
  font-size: clamp(64px, 12vw, 104px);
  line-height: 1.05;
  margin: 8px 0 0;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
.call[data-word="업"] { color: #d9f5c4; }
.call[data-word="다운"] { color: #f7c7b6; }
.call[data-word="정답"] { color: #ffe08a; }
.call[data-word="거절"] { color: #f3b7ae; }
.call[data-word="무승부"] { color: #f6f1e4; }
.call-note, .range, .status { margin: 6px 0 0; }
.range { color: #e7d7bf; }
.status { font-weight: 700; min-height: 1.4em; }
.guess-row, .seats, .log, .play .actions {
  background: var(--cream);
  border-radius: 20px;
  padding: 12px;
}
.guess-row label { margin: 0; flex: 1; }
.seats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.seat.on { box-shadow: inset 0 0 0 2px var(--wood); }
.seat b { font-weight: 700; }
.log {
  list-style: none;
  margin: 0;
  max-height: 180px;
  overflow: auto;
}
.log li {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(122, 78, 42, 0.12);
}
.log li:last-child { border-bottom: 0; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--wood-deep);
  color: var(--chalk);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 10px 24px rgba(62, 36, 16, 0.28);
}
input:focus, button:focus-visible {
  outline: 2px solid #c4783a;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  #app { padding: 12px; }
  h1 { font-size: 40px; }
  .guess-row { align-items: stretch; flex-direction: column; }
}
