:root {
  --ink: #1c2430;
  --paper: rgba(244, 246, 248, 0.96);
  --line: rgba(28, 36, 48, 0.14);
  --red: #d4532b;
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
  background: #3c3024;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: #3c3024;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/assets/room.jpg") center / cover no-repeat;
}
#app { position: relative; z-index: 1; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2 { font-family: "Gowun Batang", serif; 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-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  padding: 28px 24px;
}
.panel.wide { width: min(720px, 100%); }
.mark { width: 84px; height: 84px; object-fit: cover; border-radius: 18px; }
.eyebrow {
  margin: 10px 0 0;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
}
.lead, .me, .empty { color: #526070; }
label { display: grid; gap: 6px; margin: 16px 0; font-weight: 700; }
input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
}
.primary, .ghost {
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid transparent;
}
.primary { background: var(--red); color: #fff; font-weight: 700; }
.primary:disabled { opacity: 0.45; cursor: default; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.row, .create-row, .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; }
.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rooms li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
}
.rooms button { border: 0; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 12px; }
.wait-players { display: grid; gap: 8px; margin: 14px 0; }
.person {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
}
.rules { margin: 8px 0 16px; }
.rules li { margin: 4px 0; }

.play {
  position: fixed;
  inset: 0;
  z-index: 2;
}
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, calc(100vh * 16 / 9));
  height: max(100vh, calc(100vw * 9 / 16));
  transform: translate(-50%, -50%);
}
.tv { width: 100%; height: 100%; display: block; user-select: none; pointer-events: none; }
canvas {
  position: absolute;
  left: 23.52%;
  top: 21.81%;
  width: 42.03%;
  height: 56.39%;
  border-radius: 8px;
  touch-action: none;
}
.result {
  position: absolute;
  left: 23.52%;
  top: 21.81%;
  width: 42.03%;
  height: 56.39%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: rgba(6, 16, 40, 0.55);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px;
}
.result .eyebrow { color: #ffd0c0; }
.result .ghost { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 3;
  margin: 0;
  text-align: center;
  color: #f6f1e8;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(40, 24, 10, 0.85);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  margin: 0;
}

@media (max-width: 720px) {
  #app { padding: 10px; }
  .result .actions { flex-wrap: wrap; justify-content: center; }
}
