:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #18181b;
  --surface-2: #27272a;
  --text: #fff;
  --muted: #a1a1aa;
  --accent: #22c55e;
  --accent-2: #3b82f6;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
}

#root {
  max-width: 480px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.topbar h1 .accent { color: var(--accent); }
.topbar-right {
  font-size: 13px;
  color: var(--muted);
}

.screen {
  display: block;
  padding: 8px 0;
}
.hidden { display: none !important; }

h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
.footer-note { color: var(--muted); font-size: 12px; margin-top: 16px; }

input[type="email"], input[type="text"] {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  margin-bottom: 10px;
  font-family: inherit;
}
#party-code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 6px;
  text-transform: uppercase;
}

button, .primary-button {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background: var(--accent);
  color: #062b15;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: inherit;
}
button:hover, .primary-button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.secondary-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--surface-2);
  margin-top: 12px;
}

.status {
  margin-top: 14px;
  font-size: 13px;
  min-height: 18px;
  color: var(--muted);
}
.status.error { color: var(--danger); }
.status.success { color: var(--accent); }

/* Card */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.event-name {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.marked-counter {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.marked-counter #marked-count {
  color: var(--text);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 16px;
  aspect-ratio: 1 / 1;
}
.tile {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  padding: 6px;
  font-size: 10px;
  line-height: 1.15;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 80ms ease;
}
.tile.cat-gameplay { background: #1e3a8a; }
.tile.cat-referee { background: #9a3412; }
.tile.cat-broadcast { background: #4c1d95; }
.tile.cat-crowd { background: #166534; }
.tile.cat-coaching { background: #991b1b; }
.tile.cat-meta { background: #3f3f46; }
.tile.cat-free { background: var(--accent); color: #062b15; font-weight: 800; }
.tile.marked {
  position: relative;
  filter: brightness(1.25);
}
.tile.marked::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.tile.collectible {
  border-color: #facc15;
  border-width: 2px;
}
.tile:active {
  transform: scale(0.96);
}

.claim-button {
  background: #facc15;
  color: #422006;
  font-size: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 6px;
}
