:root {
  --ink: #2a1c3a;
  --peach: #ff7a4a;
  --mint: #3ecfb4;
  --gold: #ffc65c;
  --glass: rgba(255, 246, 240, 0.9);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #140c1c;
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
}

body {
  display: grid;
  place-items: center;
  min-height: 100%;
}

#stage {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(20, 8, 30, 0.55);
  border-radius: 8px;
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  background: #2a1440;
}

#overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(20, 8, 28, 0.12), rgba(20, 8, 28, 0.42));
  padding: 24px;
}

#overlay.dim {
  pointer-events: none;
  background: transparent;
}

#overlay.dim .panel {
  display: none !important;
}

.panel {
  width: min(520px, 100%);
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  padding: 26px 28px 22px;
  box-shadow: 0 18px 50px rgba(80, 20, 40, 0.22);
}

.panel.wide {
  width: min(640px, 100%);
}

.title-panel {
  text-align: center;
}

.hero {
  width: 100%;
  height: 148px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(80, 20, 40, 0.18);
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 800;
  color: #e05a2a;
}

h1,
h2 {
  font-family: "Jua", sans-serif;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 52px;
  background: linear-gradient(180deg, #ff8a4a, #e23d6a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 0 18px;
  line-height: 1.55;
  color: #6a3d4a;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: left;
}

input {
  height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  background: #fff8f3;
  box-shadow: inset 0 0 0 2px rgba(255, 122, 74, 0.22);
  outline: none;
}

input:focus {
  box-shadow: inset 0 0 0 2px var(--peach);
}

button {
  font: inherit;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  height: 48px;
  padding: 0 18px;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.primary {
  width: 100%;
  background: linear-gradient(180deg, #ff9a5c, #ef4d4a);
  color: white;
  box-shadow: 0 8px 0 #c43432;
}

.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.ghost {
  background: transparent;
  color: #8a4a52;
  width: 100%;
  margin-top: 8px;
}

.lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 14px;
}

.me {
  margin: 0;
  color: #8a4a52;
}

.create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

.create-row .primary {
  width: auto;
  padding: 0 22px;
}

.rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.rooms li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 10px 12px;
}

.rooms .meta {
  font-size: 12px;
  color: #8a4a52;
}

.join {
  height: 36px;
  background: linear-gradient(180deg, #6ee0c8, #2bb89a);
  color: #07362d;
  box-shadow: 0 4px 0 #1a8a72;
  border-radius: 10px;
}

.empty {
  text-align: center;
  color: #8a4a52;
}

.wait-players {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 18px;
}

.chip {
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 16px;
  background: white;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 6px 0 rgba(255, 122, 74, 0.25);
}

.chip.mint {
  box-shadow: 0 6px 0 rgba(62, 207, 180, 0.28);
}

.chip.ghost {
  opacity: 0.55;
  font-weight: 600;
}

.chip .sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #8a4a52;
  font-weight: 700;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#hud .ghost,
#hud button {
  pointer-events: auto;
}

.topbar {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px 0;
}

.pill {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: rgba(255, 248, 240, 0.88);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 8px 24px rgba(40, 10, 30, 0.14);
}

.pill .k {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #e05a2a;
}

.pill strong {
  font-family: "Jua", sans-serif;
  font-size: 22px;
}

.banner {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-family: "Jua", sans-serif;
  font-size: 64px;
  color: white;
  text-shadow: 0 6px 0 rgba(80, 20, 40, 0.35), 0 12px 30px rgba(20, 8, 20, 0.35);
  pointer-events: none;
  white-space: nowrap;
}

.bottombar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 0 16px;
}

.hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 8px rgba(20, 8, 20, 0.55);
  font-size: 13px;
  font-weight: 700;
}

.bottom-actions {
  display: flex;
  gap: 8px;
}

.bottom-actions .ghost {
  width: auto;
  margin: 0;
  height: 40px;
  background: rgba(255, 248, 240, 0.88);
  color: #8a4a52;
}

.hidden {
  display: none !important;
}

.theme-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 40;
  display: flex;
  gap: 0;
  pointer-events: auto;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(20, 8, 20, 0.28);
  background: rgba(255, 248, 240, 0.92);
}

.theme-toggle button {
  height: 36px;
  padding: 0 14px;
  border-radius: 0;
  font-size: 13px;
  background: transparent;
  color: #8a4a52;
  box-shadow: none;
}

.theme-toggle button.on {
  background: linear-gradient(180deg, #ff9a5c, #ef4d4a);
  color: white;
}

body.zombie {
  background: #07090a;
}

body.zombie .panel {
  background: rgba(18, 24, 20, 0.88);
  border-color: rgba(120, 180, 90, 0.28);
  color: #d7e8c8;
  box-shadow: 0 18px 50px rgba(0, 20, 0, 0.45);
}

body.zombie .eyebrow {
  color: #8fbf4a;
}

body.zombie h1 {
  background: linear-gradient(180deg, #b8e05a, #4a8a2a);
  -webkit-background-clip: text;
  background-clip: text;
}

body.zombie .lead,
body.zombie .me,
body.zombie .empty,
body.zombie .ghost,
body.zombie label {
  color: #a8c090;
}

body.zombie input {
  background: #121814;
  color: #e4f0d4;
  box-shadow: inset 0 0 0 2px rgba(143, 191, 74, 0.28);
}

body.zombie .primary {
  background: linear-gradient(180deg, #7cb83a, #3d6a18);
  box-shadow: 0 8px 0 #2a4a10;
}

body.zombie .pill {
  background: rgba(16, 24, 16, 0.86);
  color: #d7e8c8;
}

body.zombie .pill .k {
  color: #8fbf4a;
}

body.zombie .theme-toggle {
  background: rgba(16, 24, 16, 0.92);
}

body.zombie .theme-toggle button {
  color: #a8c090;
}

body.zombie .theme-toggle button.on {
  background: linear-gradient(180deg, #7cb83a, #3d6a18);
  color: white;
}

body.zombie .rooms li {
  background: rgba(20, 28, 20, 0.78);
}

body.zombie .chip {
  background: #182018;
  color: #d7e8c8;
  box-shadow: 0 6px 0 rgba(90, 140, 40, 0.35);
}

body.zombie .bottom-actions .ghost {
  background: rgba(16, 24, 16, 0.88);
  color: #a8c090;
}
