:root {
  --bg: #0f1020;
  --card: #1e2142;
  --card-hover: #262a54;
  --text: #e8e9f3;
  --muted: #9aa0c3;
  --accent: #6c7bff;
  --accent-2: #a66bff;
  --bad: #fb7185;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(
      1200px 800px at 20% -10%,
      rgba(108, 123, 255, 0.25),
      transparent 60%
    ),
    radial-gradient(
      1000px 700px at 110% 10%,
      rgba(166, 107, 255, 0.2),
      transparent 55%
    ),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) 20px 80px;
}

/* ---------- Gate ---------- */
.gate {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
}

.lock-emoji {
  font-size: 3rem;
  margin-bottom: 8px;
}

.gate-card h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
}

.gate-sub {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 0.95rem;
}

.pw-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  margin-bottom: 12px;
}

.pw-input:focus {
  outline: none;
  border-color: var(--accent);
}

.gate-error {
  color: var(--bad);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin: 12px 0 0;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  width: 100%;
  padding: 14px 22px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  filter: grayscale(0.5) brightness(0.7);
  cursor: not-allowed;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

/* ---------- Menu ---------- */
.hero {
  text-align: center;
  margin-bottom: clamp(28px, 6vw, 48px);
  position: relative;
}

.hero h1 {
  font-size: clamp(2rem, 7vw, 3.2rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--text), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  margin: 0;
}

.lock-again {
  width: auto;
  padding: 8px 16px;
  font-size: 0.85rem;
  margin-top: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  min-height: 168px;
}

.card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: rgba(108, 123, 255, 0.5);
}

.card .emoji {
  font-size: 2.4rem;
  line-height: 1;
}

.card h2 {
  margin: 0;
  font-size: 1.3rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(108, 123, 255, 0.18);
  color: #c3caff;
}

/* "Single-Device" (local, no-server) games get a distinct tint. */
.tag--single-device {
  background: rgba(52, 211, 153, 0.16);
  color: #a7f3d0;
}
