:root {
  --bg0: #0c0e14;
  --bg1: #12151f;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --accent: #6ee7b7;
  --accent-dim: rgba(110, 231, 183, 0.15);
  --danger: #fb7185;
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  font-family: "DM Sans", system-ui, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg0);
  color: var(--text);
  line-height: 1.5;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background: radial-gradient(
 1200px 600px at 10% -10%,
      rgba(110, 231, 183, 0.12),
      transparent 55%
    ),
    radial-gradient(
      900px 500px at 90% 20%,
      rgba(96, 165, 250, 0.1),
      transparent 50%
    ),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  z-index: -2;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.75rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.is-hidden {
  display: none !important;
}

.phrase-delete-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.phrase-delete-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg1);
}

.phrase-delete-text {
  flex: 1 1 12rem;
  font-weight: 500;
}

.phrase-delete-cat {
  color: var(--muted);
  font-size: 0.9rem;
}

.add-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  outline: none;
  resize: vertical;
  min-height: 5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus {
  border-color: rgba(110, 231, 183, 0.5);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.actions a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.hero {
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.panel {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  margin-bottom: 2.5rem;
}

.grid-controls {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-controls {
    grid-template-columns: 1fr 1.4fr;
    align-items: end;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

input,
select {
  font: inherit;
  color: var(--text);
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  border-color: rgba(110, 231, 183, 0.5);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.field-hint {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.35;
}

.field-hint strong {
  color: var(--text);
  font-weight: 600;
}

.field-hint.error {
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:not(:disabled):active {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(135deg, #34d399, #6ee7b7);
  color: #042f1f;
}

.btn.primary:not(:disabled):hover {
  filter: brightness(1.05);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.ghost:not(:disabled):hover {
  background: var(--surface-strong);
}

.status {
  margin: 1rem 0 0;
  min-height: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.preview-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.cards-host {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .cards-host {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-wrap header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-wrap h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.card-wrap .btn.small {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

.bingo-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #0a0c11;
}

.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;
}
