:root {
  --bg: #14121f;
  --ink: #fff4e0;
  --orange: #f08a2c;
  --orange-d: #b4561a;
  --panel: rgba(20, 18, 31, 0.86);
  --line: #3a3352;
  --muted: #a89fc0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at center, rgba(20, 18, 31, 0.55), rgba(20, 18, 31, 0.9));
  text-align: center;
  padding: 16px;
}

.hidden { display: none; }

.logo {
  margin: 0;
  font-size: clamp(56px, 12vw, 120px);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--orange);
  text-shadow:
    4px 4px 0 var(--orange-d),
    8px 8px 0 #000;
  line-height: 1;
}
.logo span { color: var(--ink); }

.tagline {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 18px;
  letter-spacing: 6px;
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(320px, 90vw);
}
.buttons.row { flex-direction: row; justify-content: center; width: auto; }

button {
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  background: #2b2540;
  border: 3px solid #000;
  box-shadow: inset 0 -4px 0 #1b1729, 4px 4px 0 #000;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.06s;
}
button:hover:not(:disabled), button:focus-visible:not(:disabled) {
  background: var(--orange);
  color: #1b1220;
  box-shadow: inset 0 -4px 0 var(--orange-d), 4px 4px 0 #000;
  outline: none;
}
button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: inset 0 -4px 0 var(--orange-d), 2px 2px 0 #000; }
button.soon { opacity: 0.45; cursor: default; }
button small { font-size: 13px; font-weight: 400; margin-left: 6px; }

.keys { color: var(--muted); font-size: 15px; margin-top: 8px; }

#result h2 { margin: 0; font-size: 44px; color: var(--orange); text-shadow: 4px 4px 0 #000; }
#result p { margin: 0; font-size: 22px; line-height: 1.7; white-space: pre-line; }

/* ---------- 창(로그인·로비·방·순위표) ---------- */
.panel {
  background: var(--panel);
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000, inset 0 0 0 2px var(--line);
  padding: 22px 26px;
  width: min(420px, 92vw);
  max-height: 92vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.panel.wide { width: min(640px, 94vw); }
.panel h2 { margin: 0; font-size: 30px; color: var(--orange); text-shadow: 3px 3px 0 #000; }
.panel .sub { margin: 0; color: var(--muted); font-size: 15px; }
.panel label { display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: 15px; color: var(--muted); }
.panel input {
  font: inherit; font-size: 20px; padding: 8px 10px;
  background: #0f0d18; color: var(--ink);
  border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--line);
}
.panel input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--orange); }
.panel .buttons.row { gap: 10px; flex-wrap: wrap; }
.msg { margin: 0; min-height: 1.3em; color: #ff8a7a; font-size: 15px; }
.msg.ok { color: #7ee08a; }
.hello { margin: -4px 0 4px; color: #7ee08a; font-size: 16px; min-height: 1.2em; }

button.small { font-size: 15px; padding: 6px 12px; }
button.link { background: none; border: none; box-shadow: none; color: var(--muted); font-size: 15px; padding: 4px; align-self: center; }
button.link:hover { background: none; color: var(--ink); box-shadow: none; text-decoration: underline; }
button.on { background: var(--orange); color: #1b1220; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; min-height: 60px; }
.list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #221d33; border: 2px solid #000; padding: 8px 12px; font-size: 16px;
}
.list li.empty { justify-content: center; color: var(--muted); background: none; border: 2px dashed var(--line); }
.list li .tag { font-size: 13px; color: var(--muted); }
ol.list { counter-reset: rank; }
ol.list li::before { counter-increment: rank; content: counter(rank) '위'; color: var(--orange); font-weight: 900; min-width: 42px; }
ol.list li span.name { flex: 1; }

.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.teams { display: flex; gap: 12px; align-items: stretch; }
.team { flex: 1; background: #1c1829; border: 3px solid #000; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.team h3 { margin: 0; font-size: 18px; }
.team.red h3 { color: #ff6a5a; }
.team.blue h3 { color: #6aa0ff; }
.team ul { list-style: none; margin: 0; padding: 0; min-height: 84px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.team li { background: #2b2540; padding: 4px 8px; border: 2px solid #000; font-size: 15px; }
.team li.bot { opacity: 0.55; border-style: dashed; }
.vs { align-self: center; font-weight: 900; font-size: 22px; color: var(--muted); }
button:disabled { opacity: 0.45; cursor: default; }
