:root {
  --ink: #3a2340;
  --peach: #ff7b8a;
  --mint: #3ecfb4;
  --gold: #ffc65c;
  --glass: rgba(255, 246, 252, 0.88);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #1a1024;
  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(40, 10, 50, 0.5);
  border-radius: 8px;
}

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

#overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(40, 12, 48, 0.12), rgba(40, 12, 48, 0.38));
  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(90, 20, 70, 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, 60, 0.18);
}

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

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

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

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

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: #fff8fb;
  box-shadow: inset 0 0 0 2px rgba(255, 107, 138, 0.2);
  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, #ff8aa0, #ef4d78);
  color: white;
  box-shadow: 0 8px 0 #c43462;
}

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

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

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

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

.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: #8a4a72;
}

.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: #8a4a72;
}

.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, 123, 138, 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: #8a4a72;
  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, 252, 0.86);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 8px 24px rgba(60, 10, 50, 0.12);
}

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

.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, 70, 0.35), 0 12px 30px rgba(40, 10, 40, 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(40, 10, 40, 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, 252, 0.88);
  color: #8a4a72;
}

.hidden {
  display: none !important;
}
