:root {
  --bg-1: #0f172a;
  --bg-2: #1e293b;
  --card: rgba(15, 23, 42, 0.82);
  --border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --success: #34d399;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg-1);
}

body {
  line-height: 1.5;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.16), transparent 28%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  z-index: -1;
}

.layout {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem 1.75rem;
}

.hero-badge {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.25));
  border: 1px solid var(--border);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.28);
}

.lang-picker-icon {
  font-size: 1rem;
  line-height: 1;
}

.lang-picker select {
  border: none;
  background: transparent;
  color: #e0e7ff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding-right: 0.15rem;
}

.lang-picker select:focus {
  outline: none;
}

.lang-picker select option {
  color: #0f172a;
  background: #f8fafc;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #e0f2fe;
  font-size: 0.92rem;
  white-space: nowrap;
}

.panel {
  padding: 1.25rem 1.5rem 1.5rem;
}

.panel-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel h2 {
  margin: 0;
  font-size: 1.2rem;
}

.search {
  flex: 1 1 220px;
  max-width: 360px;
}

.search input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  font: inherit;
}

.search input:focus {
  outline: 2px solid rgba(56, 189, 248, 0.45);
  border-color: rgba(56, 189, 248, 0.55);
}

.game-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.game-card {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.28);
}

.game-card-head {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.game-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  border-radius: 14px;
  background: rgba(129, 140, 248, 0.14);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.game-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.game-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.game-creator {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
}

.game-desc {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.94rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #dbeafe;
  background: rgba(129, 140, 248, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.22);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.72rem 1rem;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn.primary {
  color: #082f49;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
}

.btn.primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  filter: grayscale(0.35);
}

.btn.primary:disabled:hover {
  transform: none;
  filter: grayscale(0.35);
}

.game-card--locked {
  opacity: 0.92;
}

.game-card--locked:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.empty {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.footer {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer code {
  color: #e2e8f0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-badge,
  .hero-actions {
    justify-self: center;
  }

  .panel-top {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    max-width: none;
  }
}
