@font-face {
  font-family: 'Anybody';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/anybody.woff2) format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/dm-mono-light.woff2) format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/dm-mono-regular.woff2) format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/dm-mono-medium.woff2) format('woff2');
}

:root {
  --bg: #0c0c14;
  --card-bg: #14141f;
  --card-border: #2a2a3d;
  --text: #e8e6e3;
  --text-dim: #a09faf;
  --accent: #ff3c5f;
  --accent-glow: rgba(255, 60, 95, 0.3);
  --win: #2ddc6f;
  --lose: #ff3c5f;
  --draw: #f5c542;
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  font-size: 14px;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  left: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 60, 95, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.game-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
}

header { text-align: center; margin-bottom: 8px; }

h1 {
  font-family: 'Anybody', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 5vw, 48px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #ff3c5f, #ff8a5c, #f5c542);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

h1 span {
  display: block;
  font-size: 0.35em;
  letter-spacing: 0.25em;
  font-weight: 400;
  font-family: 'DM Mono', monospace;
  -webkit-text-fill-color: var(--text-dim);
  margin-top: 4px;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 8px;
  font-family: 'Anybody', sans-serif;
}

.score-item { text-align: center; }

.score-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
}

.score-value { font-size: 32px; font-weight: 900; line-height: 1.2; }

.score-item.you .score-value { color: var(--win); }
.score-item.cpu .score-value { color: var(--lose); }
.score-item.draws .score-value { color: var(--draw); }

.cards-left {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
  letter-spacing: 0.1em;
}

.battle-area {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 0;
  align-items: start;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .battle-area { grid-template-columns: 1fr; gap: 12px; }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cat-color, var(--accent)), transparent);
}

.card.winner {
  border-color: var(--win);
  box-shadow: 0 0 30px rgba(45, 220, 111, 0.15);
}

.card.loser {
  border-color: var(--lose);
  box-shadow: 0 0 30px rgba(255, 60, 95, 0.1);
  opacity: 0.7;
}

.card-header { margin-bottom: 10px; }

.card-category {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 3px 10px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 15%, transparent);
  color: var(--cat-color, var(--accent));
  border: 1px solid color-mix(in srgb, var(--cat-color, var(--accent)) 30%, transparent);
  margin-bottom: 8px;
}

.card-name {
  font-family: 'Anybody', sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 2.5vw, 22px);
  line-height: 1.2;
  height: 44px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.card-owner {
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 4px;
  font-family: 'DM Mono', monospace;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: default;
}

.card.player .stat-row.clickable { cursor: pointer; }

.card.player .stat-row.clickable:hover {
  background: rgba(255, 60, 95, 0.08);
  border-color: rgba(255, 60, 95, 0.2);
}

.stat-row.selected {
  background: rgba(255, 60, 95, 0.12) !important;
  border-color: var(--accent) !important;
}

.stat-row.won .stat-value { color: var(--win); }
.stat-row.lost .stat-value { color: var(--lose); }
.stat-row.drew .stat-value { color: var(--draw); }

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-family: 'Anybody', sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-align: right;
  transition: color 0.3s;
}

.stat-value.hidden-value { color: var(--text-dim); }

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.vs-text {
  font-family: 'Anybody', sans-serif;
  font-weight: 900;
  font-size: 24px;
  color: var(--text-dim);
  text-shadow: 0 0 20px rgba(255, 60, 95, 0.3);
}

.result-banner {
  text-align: center;
  margin-bottom: 8px;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-text {
  font-family: 'Anybody', sans-serif;
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: resultPulse 0.5s ease-out;
}

.result-text.win { color: var(--win); }
.result-text.lose { color: var(--lose); }
.result-text.draw { color: var(--draw); }

.result-detail { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

@keyframes resultPulse {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.actions { text-align: center; }

.btn {
  font-family: 'Anybody', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
}

.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.intro-screen { text-align: center; padding: 60px 20px; }

.intro-screen p {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.8;
  max-width: 500px;
  margin: 20px auto;
}

.game-over { text-align: center; padding: 40px 20px; }

.game-over h2 {
  font-family: 'Anybody', sans-serif;
  font-weight: 900;
  font-size: 36px;
  margin-bottom: 12px;
}

.final-score {
  font-size: 48px;
  font-family: 'Anybody', sans-serif;
  font-weight: 900;
  margin: 20px 0;
}

.pick-prompt {
  text-align: center;
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
  animation: pickBlink 1.5s ease-in-out infinite;
}

@keyframes pickBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.site-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 12px 0 8px;
  border-top: 1px solid var(--card-border);
  margin-top: 12px;
}

.site-footer a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover { color: var(--text); }

.wdtk-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--card-border);
  transition: color 0.2s, border-color 0.2s;
}

.wdtk-link:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* Focus styles */
.btn:focus-visible,
.stat-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Stat buttons (replacing div stat rows for player) */
.stat-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-align: left;
}

.stat-btn:hover {
  background: rgba(255, 60, 95, 0.08);
  border-color: rgba(255, 60, 95, 0.2);
}

.stat-btn.selected {
  background: rgba(255, 60, 95, 0.12);
  border-color: var(--accent);
}

.stat-btn.won .stat-value { color: var(--win); }
.stat-btn.lost .stat-value { color: var(--lose); }
.stat-btn.drew .stat-value { color: var(--draw); }

/* Privacy page */
body.privacy { max-width: 600px; margin: 0 auto; padding: 40px 20px; line-height: 1.8; }
body.privacy h1 { font-size: 24px; margin-bottom: 20px; background: none; -webkit-text-fill-color: inherit; }
body.privacy p { margin-bottom: 16px; color: #b0b0b0; font-size: 14px; }
body.privacy a { color: #7ec8e3; }
body.privacy a:hover { color: #e8e6e3; }
body.privacy .back { display: inline-block; margin-top: 20px; font-size: 13px; }

/* Category colours */
.cat-government  { --cat-color: #e04040; }
.cat-council     { --cat-color: #3b82f6; }
.cat-police      { --cat-color: #6366f1; }
.cat-health      { --cat-color: #10b981; }
.cat-university  { --cat-color: #f59e0b; }
.cat-fire-rescue { --cat-color: #ef4444; }
.cat-school      { --cat-color: #8b5cf6; }
.cat-parish      { --cat-color: #6ee7b7; }
.cat-parliament  { --cat-color: #c084fc; }
.cat-charity     { --cat-color: #fb923c; }
.cat-other       { --cat-color: #94a3b8; }

/* Utility colour classes */
.text-win  { color: var(--win); }
.text-lose { color: var(--lose); }
.text-draw { color: var(--draw); }
.text-dim  { color: var(--text-dim); }

.game-over-detail { color: var(--text-dim); margin-bottom: 24px; font-size: 13px; }
.final-score-divider { color: var(--text-dim); }

.pick-prompt-hidden { visibility: hidden; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pick-prompt { animation: none; }
  .result-text { animation: none; }
  .btn-primary:hover { transform: none; }
}
