:root {
  --ink: #3e2a1c;
  --paper: rgba(255, 248, 236, 0.9);
  --line: rgba(120, 78, 42, 0.24);
  --wood: #c47a3a;
  --moss: #3f6b4e;
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
  background: #cbb89a url("/assets/bg.jpg") center / cover no-repeat fixed;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, .clock, .press {
  font-family: "Gowun Batang", serif;
  font-weight: 700;
}
h1, h2 { margin: 0; }
.hidden { display: none !important; }

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

.panel {
  width: min(440px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(70, 40, 16, 0.22);
  padding: 28px 24px;
  backdrop-filter: blur(6px);
}
.panel.wide { width: min(720px, 100%); }
.mark {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 8px 18px rgba(90, 50, 20, 0.2);
}
.eyebrow {
  margin: 12px 0 0;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--wood);
}
.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, 250, 242, 0.92);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
}
.primary, .ghost {
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid transparent;
}
.primary { background: var(--wood); color: #fffaf2; font-weight: 700; }
.primary:disabled { opacity: 0.45; cursor: default; }
.ghost {
  background: rgba(255, 250, 242, 0.72);
  border-color: var(--line);
  color: var(--ink);
}
.row, .create-row, .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row { justify-content: space-between; }
.create-row { margin: 12px 0; }
.create-row input { flex: 1; min-width: 180px; margin: 0; }
.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rooms li, .person, .seat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: rgba(255, 250, 242, 0.78);
  border-radius: 14px;
  padding: 12px;
}
.rooms button {
  border: 0;
  background: var(--moss);
  color: #fffaf2;
  border-radius: 999px;
  padding: 8px 14px;
}
.rooms button:disabled { background: #b7a898; cursor: default; }
.wait-players { display: grid; gap: 8px; margin: 14px 0; }
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}
.rules { margin: 8px 0 16px; }
.rules ul { margin: 8px 0 0; padding-left: 18px; color: #5c4636; line-height: 1.55; }

.stage {
  width: min(980px, 100%);
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}
.stage-bar, .stage-main, .seats { position: relative; z-index: 1; }
.stage-bar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  color: #fffaf2;
  text-shadow: 0 2px 12px rgba(40, 22, 8, 0.45);
}
.stage-bar .eyebrow { color: #ffe3bf; }
.stage-main {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  padding: 12px;
  border-radius: 36px;
  background: radial-gradient(ellipse at center, rgba(48, 26, 10, 0.42), rgba(48, 26, 10, 0) 72%);
}
.clock {
  margin: 0;
  font-size: clamp(84px, 16vw, 148px);
  line-height: 0.9;
  color: #fffaf2;
  text-shadow: 0 8px 28px rgba(48, 24, 8, 0.45);
}
.hint {
  margin: 0 0 8px;
  color: #fff6e8;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(48, 24, 8, 0.45);
}
.press {
  width: min(68vw, 280px);
  height: min(68vw, 280px);
  border-radius: 50%;
  border: 8px solid rgba(255, 236, 210, 0.9);
  background: radial-gradient(circle at 35% 30%, #f3c892, #d4843c 46%, #8a4b22 80%);
  color: #fffaf2;
  font-size: clamp(40px, 7vw, 64px);
  letter-spacing: -0.04em;
  text-shadow: 0 3px 0 rgba(90, 42, 12, 0.35);
  box-shadow: 0 16px 0 #6b3918, 0 28px 40px rgba(70, 36, 12, 0.35);
  touch-action: manipulation;
}
.press:active:not(:disabled) {
  transform: translateY(10px);
  box-shadow: 0 6px 0 #6b3918, 0 14px 24px rgba(70, 36, 12, 0.28);
}
.press:disabled {
  filter: saturate(0.7);
  opacity: 0.78;
  cursor: default;
}
.press.again { font-size: clamp(28px, 5vw, 42px); }
.seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.seat {
  display: grid;
  justify-items: start;
  color: var(--ink);
  min-height: 84px;
}
.seat.me { outline: 2px solid rgba(255, 236, 210, 0.9); }
.seat.win { background: rgba(255, 236, 196, 0.94); }
.seat.bust { background: rgba(255, 228, 220, 0.88); }
.seat span, .seat em { font-style: normal; color: #6a5140; font-size: 14px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(62, 42, 28, 0.92);
  color: #fffaf2;
  border-radius: 999px;
  padding: 12px 18px;
  z-index: 5;
}

@media (max-width: 640px) {
  #app { padding: 12px; }
  .stage { min-height: calc(100vh - 24px); }
  .press { border-width: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .press { transition: none; }
}
