:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-muted: #F1ECE4;
  --ink: #18181B;
  --ink-soft: #52525B;
  --border: #18181B;
  --accent: #E85D04;
  --accent-hover: #D04E00;
  --shadow: 4px 4px 0 #18181B;
  --shadow-sm: 2px 2px 0 #18181B;
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.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;
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.brand-tagline {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.stat-label {
  color: var(--ink-soft);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.stat-value {
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--border);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface-muted);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--border);
}

/* Controls */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 22px;
}

.search-wrap {
  flex: 1 1 260px;
  max-width: 380px;
}

.search-input {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: box-shadow 0.14s ease;
}

.search-input:focus {
  box-shadow: var(--shadow-sm);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.filter-chip:hover {
  background: var(--surface-muted);
}

.filter-chip.is-active {
  background: var(--ink);
  color: #FFFFFF;
}

/* Section Head */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.section-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.game-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.game-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--border);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.card-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.card-desc {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1.5px solid var(--surface-muted);
}

.card-score {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.card-score strong {
  color: var(--ink);
}

.play-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--card-accent, var(--accent));
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.play-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--border);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

.empty-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding-top: 40px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.site-footer a {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 600px) {
  .page-shell {
    padding: 20px 14px 36px;
  }

  .brand-text {
    font-size: 1.35rem;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}

/* Make Game Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 27, 0.55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--border);
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.modal-close {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal-desc {
  margin: 10px 0 18px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.5;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  font-weight: 600;
  font-size: 0.88rem;
}

.field-hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.modal-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.94rem;
  background: var(--bg);
  color: var(--ink);
}

.modal-input:focus {
  outline: none;
  box-shadow: var(--shadow-sm);
}

.modal-status {
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 0.88rem;
  line-height: 1.45;
}

.modal-status a {
  color: var(--ink);
  font-weight: 700;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

