:root {
  --bg: #0b0a08;
  --bg-soft: #12100d;
  --panel: #17150f;
  --line: rgba(232, 214, 176, 0.12);
  --text: #f4eee4;
  --muted: #9c9284;
  --accent: #d4b06a;
  --accent-dim: #8a6f38;
  --accent-ink: #1a1408;
  --ok: #8fca9a;
  --bad: #e08a7c;
  --radius: 14px;
  --font: "Outfit", "Noto Sans KR", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: #12110e;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("bg.jpg") center center / cover no-repeat;
  opacity: 0.42;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(18, 16, 12, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(10, 9, 7, 0.38) 0%, rgba(8, 7, 6, 0.62) 100%);
}

.hidden { display: none !important; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 12, 10, 0.62);
  backdrop-filter: blur(18px) saturate(1.05);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; gap: 0.85rem; align-items: center; }
.logo {
  height: 52px;
  width: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(212, 176, 106, 0.28);
}
.sub { margin: 0; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.02em; }
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.user-box { display: flex; align-items: center; gap: 0.55rem; }
.who {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 202, 154, 0.28);
  background: rgba(143, 202, 154, 0.08);
  color: var(--ok);
}

.lobby {
  padding: 1.5rem 1.75rem 3rem;
  max-width: 1320px;
  margin: 0 auto;
}

.banner {
  margin: 0 0 1.1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(224, 138, 124, 0.28);
  background: rgba(80, 28, 22, 0.45);
  color: #f0c4bb;
  font-size: 0.88rem;
}
.empty { color: var(--muted); margin: 3rem 0; text-align: center; letter-spacing: 0.02em; }

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.game-card {
  --hue: 38;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #100e0b;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.game-card:hover {
  border-color: rgba(212, 176, 106, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}
.thumb {
  padding: 10px 10px 0;
  background: #100e0b;
}
.thumb img {
  width: 100%;
  height: auto;
  display: block;
}
.thumb-id {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.meta {
  padding: 0.7rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: #16130e;
  border-top: 1px solid rgba(232, 214, 176, 0.1);
}
.meta strong {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #f6ecd8;
}
.meta span {
  color: #b5a88f;
  font-size: 0.72rem;
  font-family: var(--mono);
}

label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.75rem; color: var(--muted); font-weight: 500;
}
input, select, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.52rem 0.75rem;
}
input, select { min-height: 38px; }
input:focus, select:focus {
  outline: none;
  border-color: rgba(212, 176, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 176, 106, 0.12);
}
#gameSearch { min-width: 200px; }
#gameSearch::placeholder { color: #7d7568; }
button {
  cursor: pointer;
  background: linear-gradient(180deg, #e3c68a, var(--accent));
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 650;
  padding: 0.52rem 1.05rem;
  letter-spacing: 0.01em;
}
button:hover { filter: brightness(1.06); }
button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  font-weight: 550;
}

.stack { display: flex; flex-direction: column; gap: 0.7rem; }
.hint { margin: 0; color: var(--muted); font-size: 0.82rem; }
.error { margin: 0; min-height: 1.2em; color: var(--bad); font-size: 0.84rem; }

dialog {
  border: 1px solid rgba(212, 176, 106, 0.18);
  border-radius: 16px;
  background: #16140f;
  color: var(--text);
  padding: 1.4rem 1.35rem 1.25rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
dialog::backdrop { background: rgba(6, 5, 3, 0.72); }
dialog h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
dialog menu { display: flex; gap: 0.5rem; justify-content: flex-end; padding: 0; margin: 0.55rem 0 0; }

@media (max-width: 820px) {
  .top { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: stretch; }
  #gameSearch { flex: 1; min-width: 0; }
  .lobby { padding: 1rem; }
}
