:root {
  --bg: #0a0014;
  --bg2: #150024;
  --neon-pink: #ff2079;
  --neon-cyan: #05d9e8;
  --neon-purple: #c13cff;
  --neon-yellow: #ffe45e;
  --neon-green: #39ff88;
  --text: #f4f0ff;
  --text-dim: #9a8bb8;
  --card-bg: rgba(21, 0, 36, 0.75);
  --card-border: rgba(193, 60, 255, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Orbitron', system-ui, sans-serif;
  min-height: 100vh;
}

.synth-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(193, 60, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(193, 60, 255, 0.18) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: perspective(500px) rotateX(60deg) scale(2);
  transform-origin: bottom;
  opacity: 0.35;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0) 2px
  );
  pointer-events: none;
}

.screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
}

.hidden { display: none !important; }

.home-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding: 8px 12px;
  background: linear-gradient(to bottom, rgba(10, 0, 20, 0.96) 70%, rgba(10, 0, 20, 0));
}

.home-logo-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.home-logo-img {
  display: block;
  height: 34px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(255, 32, 121, 0.4));
  transition: filter 0.15s ease;
}

.home-logo-btn:hover .home-logo-img {
  filter: drop-shadow(0 0 10px rgba(255, 32, 121, 0.7));
}

.home-logo-fallback {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--neon-pink);
  text-shadow: 0 0 6px var(--neon-pink);
}

.wrap {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wrap.wide { max-width: 720px; }

.brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-mark {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(22px, 6vw, 36px);
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan), 0 0 24px rgba(5, 217, 232, 0.6);
  letter-spacing: 2px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.manager-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.manager-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 22px 8px 0;
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--accent, var(--neon-purple)) 55%, var(--bg2)) 0%,
      color-mix(in srgb, var(--accent, var(--neon-purple)) 18%, var(--bg2)) 45%,
      var(--bg) 100%);
  border: 3px solid var(--accent, var(--card-border));
  border-radius: 6px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 4px 0 rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* Corner brackets — the "selection cursor" flashing in on hover/focus,
   like locking onto a fighter on the roster screen. */
.manager-card::after {
  content: "";
  position: absolute;
  inset: -3px;
  opacity: 0;
  background:
    linear-gradient(var(--neon-yellow), var(--neon-yellow)) top left / 16px 4px no-repeat,
    linear-gradient(var(--neon-yellow), var(--neon-yellow)) top left / 4px 16px no-repeat,
    linear-gradient(var(--neon-yellow), var(--neon-yellow)) top right / 16px 4px no-repeat,
    linear-gradient(var(--neon-yellow), var(--neon-yellow)) top right / 4px 16px no-repeat,
    linear-gradient(var(--neon-yellow), var(--neon-yellow)) bottom left / 16px 4px no-repeat,
    linear-gradient(var(--neon-yellow), var(--neon-yellow)) bottom left / 4px 16px no-repeat,
    linear-gradient(var(--neon-yellow), var(--neon-yellow)) bottom right / 16px 4px no-repeat,
    linear-gradient(var(--neon-yellow), var(--neon-yellow)) bottom right / 4px 16px no-repeat;
  filter: drop-shadow(0 0 5px var(--neon-yellow));
  animation: bracket-flash 0.6s steps(2, end) infinite;
  transition: opacity 0.1s ease;
  pointer-events: none;
}

.manager-card:hover::after,
.manager-card:focus-visible::after {
  opacity: 1;
}

@keyframes bracket-flash {
  50% { opacity: 0.4; }
}

.player-tag {
  position: absolute;
  top: 6px;
  left: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #0a0014;
  background: var(--accent, var(--neon-purple));
  padding: 2px 5px;
  border-radius: 3px;
}

.manager-card.defending-champ {
  border-color: var(--neon-yellow);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 4px 0 rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 228, 94, 0.4);
}

/* Reserved on every card, champion or not, so a badge on one card
   never makes its whole grid row taller than the rest — every tile
   ends up the same height regardless of which row it lands in. */
.badge-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  margin-top: 4px;
}

.champ-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
  white-space: nowrap;
}

.manager-card:hover, .manager-card:focus-visible {
  transform: translateY(-3px) scale(1.04);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 6px 0 rgba(0, 0, 0, 0.5), 0 0 22px color-mix(in srgb, var(--accent, var(--neon-pink)) 65%, transparent);
}

.manager-avatar-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-top: 4px;
}

.manager-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent, var(--neon-purple)) 70%, white), var(--accent, var(--neon-purple)));
  border: 3px solid #0a0014;
  color: #0a0014;
  box-shadow: 0 0 0 2px var(--accent, var(--neon-purple)), 0 3px 0 rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.manager-name-plate {
  width: 100%;
  margin-top: 8px;
  padding: 6px 4px 8px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 2px solid color-mix(in srgb, var(--accent, var(--neon-purple)) 70%, transparent);
  text-align: center;
}

.manager-name {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.manager-pick-status {
  display: block;
  font-size: 9px;
  letter-spacing: 0.5px;
  min-height: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.manager-card.has-picks .manager-pick-status {
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
}

.manager-card.partial-picks {
  border-color: var(--neon-yellow);
}

.manager-card.partial-picks .manager-pick-status {
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--neon-cyan);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 10px 4px;
  white-space: nowrap;
}

.manager-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
}

.locked-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(57, 255, 136, 0.1);
  border: 2px solid var(--neon-green);
  text-align: center;
}

.locked-banner-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: var(--neon-green);
  text-shadow: 0 0 8px var(--neon-green);
}

.locked-banner-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.game-card {
  position: relative;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--neon-pink), var(--neon-purple), var(--neon-cyan), var(--neon-pink));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  animation: card-edge-shift 6s linear infinite;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.game-card:hover::before {
  opacity: 0.9;
}

.game-card.game-submitted::before {
  opacity: 0.55;
}

@keyframes card-edge-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.game-card.game-locked {
  opacity: 0.6;
  border-color: rgba(255, 32, 121, 0.4);
}

.game-card.game-locked::before {
  display: none;
}

.game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.game-status {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  letter-spacing: 1px;
}

.game-status.open {
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
}

.game-status.locked {
  color: var(--neon-pink);
  border: 1px solid var(--neon-pink);
}

.matchup-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: stretch;
}

.team-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: 12px 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  line-height: 1.3;
}

.team-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(5, 217, 232, 0.35));
  transition: filter 0.15s ease, transform 0.15s ease;
}

.team-btn .team-name {
  display: block;
}

.team-btn .team-spread {
  display: block;
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
  font-weight: 500;
}

.team-btn:hover:not(:disabled) {
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

.team-btn:hover:not(:disabled) .team-logo {
  filter: drop-shadow(0 0 10px rgba(5, 217, 232, 0.7));
  transform: scale(1.06);
}

.team-btn.selected {
  border-color: var(--neon-purple);
  background: rgba(193, 60, 255, 0.22);
  box-shadow: 0 0 16px rgba(193, 60, 255, 0.55);
}

.team-btn.selected .team-logo {
  filter: drop-shadow(0 0 12px rgba(193, 60, 255, 0.8));
  transform: scale(1.08);
}

.team-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--neon-yellow);
}

.vs-bolt {
  font-size: 16px;
  filter: drop-shadow(0 0 6px var(--neon-yellow));
  animation: vs-pulse 1.6s ease-in-out infinite;
}

@keyframes vs-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.tiebreaker-card {
  background: var(--card-bg);
  border: 2px dashed var(--card-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tiebreaker-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.tiebreaker-input {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  padding: 10px;
  width: 120px;
}

.tiebreaker-input:disabled { opacity: 0.6; }

.submit-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.picks-progress {
  font-size: 11px;
  color: var(--text-dim);
}

.primary-btn {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  padding: 16px 24px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(255, 32, 121, 0.5);
  transition: transform 0.15s ease, opacity 0.15s ease;
  width: 100%;
}

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

.primary-btn:not(:disabled):hover {
  transform: translateY(-2px);
}

.scoreboard-note {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin: 0;
}

/* --- Live scores (ESPN, proxied through the Worker) ------------------- */

.live-scores-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-scores-heading {
  display: block;
  text-align: center;
}

.live-scores-empty {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin: 0;
}

.live-score-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-score-card.in-progress {
  border-color: var(--neon-green);
  box-shadow: 0 0 10px rgba(57, 255, 136, 0.25);
}

.live-score-card.final {
  opacity: 0.75;
}

.live-score-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
}

.live-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  text-align: center;
}

.live-score-col.leading .live-score-team-name,
.live-score-col.leading .live-score-number {
  color: var(--neon-green);
  text-shadow: 0 0 4px var(--neon-green);
}

.live-score-team-name {
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.live-score-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.live-score-number {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: var(--neon-yellow);
  text-shadow: 0 0 4px var(--neon-yellow);
}

.live-score-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 10px;
}

.live-score-status {
  font-size: 8px;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
}

.live-score-vs {
  font-size: 9px;
  color: var(--text-dim);
  opacity: 0.6;
}

.live-score-pickers {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 2px;
}

.picker-line {
  font-size: 8px;
  line-height: 1.4;
  color: var(--text-dim);
}

.picker-line strong {
  color: var(--neon-cyan);
  margin-right: 3px;
}

.picker-line.none {
  opacity: 0.4;
}

.win-prob-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.win-prob-fill.away {
  background: var(--neon-cyan);
}

.win-prob-fill.home {
  background: var(--neon-pink);
}

.win-prob-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-dim);
}

.rankings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 12px;
}

.ranking-row.rank-1 {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 12px rgba(255, 228, 94, 0.35);
}

.ranking-place {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--neon-yellow);
  width: 28px;
  flex-shrink: 0;
}

.ranking-name {
  flex: 1;
  font-weight: 700;
  font-size: 13px;
}

.ranking-score {
  font-size: 12px;
  color: var(--neon-green);
  font-weight: 700;
}

.ranking-lock {
  font-size: 10px;
  color: var(--text-dim);
}

.scoreboard-table-wrap {
  overflow-x: auto;
  border: 2px solid var(--card-border);
  border-radius: 10px;
}

.scoreboard-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
  min-width: 640px;
}

.scoreboard-table th,
.scoreboard-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.scoreboard-table th {
  background: rgba(193, 60, 255, 0.12);
  color: var(--neon-cyan);
  font-size: 10px;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
}

.scoreboard-table td.manager-col {
  text-align: left;
  font-weight: 700;
}

.pick-cell-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}

.pick-cell.correct { color: var(--neon-green); }
.pick-cell.incorrect { color: var(--neon-pink); }
.pick-cell.pending { color: var(--text-dim); }
.pick-cell.hidden-pick { color: var(--text-dim); font-style: italic; }

/* --- Logo / splash screen ------------------------------------------- */

.logo-screen {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at center 32%, #2a0045 0%, var(--bg) 68%);
}

/* Synthwave striped sun, Miami-Vice sunset palette */
.arcade-sun {
  position: absolute;
  left: 50%;
  top: 36%;
  width: min(72vw, 400px);
  height: min(72vw, 400px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd23f 0%, var(--neon-pink) 45%, var(--neon-purple) 100%);
  box-shadow: 0 0 90px 24px rgba(255, 32, 121, 0.4);
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0px, #000 6px, transparent 6px, transparent 12px);
  mask-image: repeating-linear-gradient(to bottom, #000 0px, #000 6px, transparent 6px, transparent 12px);
  animation: sun-pulse 4s ease-in-out infinite;
  z-index: 0;
}

@keyframes sun-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Animated cyan horizon grid, scrolling toward the viewer (outrun style) */
.arcade-horizon-grid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background-image:
    linear-gradient(rgba(5, 217, 232, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(5, 217, 232, 0.55) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(280px) rotateX(65deg);
  transform-origin: bottom;
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 92%);
  mask-image: linear-gradient(to top, black 0%, transparent 92%);
  animation: grid-scroll 1.2s linear infinite;
  z-index: 0;
}

@keyframes grid-scroll {
  from { background-position: 0 0; }
  to { background-position: 0 46px; }
}

.logo-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
}

.arcade-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
  text-align: center;
  line-height: 1.6;
}

.logo-text {
  position: relative;
  margin: 0;
  max-width: 100%;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(30px, 10vw, 68px);
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--neon-cyan);
  text-shadow:
    0 0 6px var(--neon-cyan),
    0 0 16px var(--neon-cyan),
    0 0 34px var(--neon-purple);
  animation:
    neon-color-cycle 3.2s ease-in-out infinite,
    neon-buzz 2.6s linear infinite;
}

/* Chromatic-aberration glitch layers, like a mistuned CRT/VHS attract screen */
.logo-text::before,
.logo-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0.65;
  pointer-events: none;
}

.logo-text::before {
  color: var(--neon-cyan);
  mix-blend-mode: screen;
  animation: glitch-shift-1 5s infinite linear;
}

.logo-text::after {
  color: var(--neon-pink);
  mix-blend-mode: screen;
  animation: glitch-shift-2 5s infinite linear;
}

@keyframes glitch-shift-1 {
  0%, 90%, 100% { transform: translate(-2px, 0); }
  92% { transform: translate(-7px, 1px); }
  94% { transform: translate(-1px, -1px); }
  96% { transform: translate(-4px, 0); }
}

@keyframes glitch-shift-2 {
  0%, 90%, 100% { transform: translate(2px, 0); }
  92% { transform: translate(7px, -1px); }
  94% { transform: translate(1px, 1px); }
  96% { transform: translate(4px, 0); }
}

.logo-hint {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan);
  animation: neon-buzz 1.4s steps(2, end) infinite;
}

.logo-hint.blink {
  animation:
    neon-buzz 1.4s steps(2, end) infinite,
    hint-blink 1s steps(1, end) infinite;
}

@keyframes hint-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

.arcade-copyright {
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

@keyframes neon-color-cycle {
  0%, 100% {
    color: var(--neon-cyan);
    text-shadow:
      0 0 6px var(--neon-cyan),
      0 0 16px var(--neon-cyan),
      0 0 34px var(--neon-purple);
  }
  50% {
    color: var(--neon-pink);
    text-shadow:
      0 0 6px var(--neon-pink),
      0 0 16px var(--neon-pink),
      0 0 34px var(--neon-purple);
  }
}

/* Mimics a flickering neon tube: mostly steady, with a couple of quick
   dropouts and one longer buzz per cycle. */
@keyframes neon-buzz {
  0%, 3%, 6%, 100% { opacity: 1; }
  4% { opacity: 0.4; }
  5% { opacity: 0.85; }
  42% { opacity: 1; }
  43% { opacity: 0.3; }
  44% { opacity: 0.9; }
  45% { opacity: 0.5; }
  46% { opacity: 1; }
}

/* --- Picks screen: per-game submit flow ------------------------------ */

.picks-hint {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin: 0;
}

.ghost-btn {
  background: transparent;
  border: 2px solid var(--card-border);
  border-radius: 8px;
  color: var(--neon-cyan);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 11px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ghost-btn:hover:not(:disabled) {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(5, 217, 232, 0.4);
}

.ghost-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.game-card.game-submitted {
  border-color: var(--neon-green);
}

.game-status.submitted {
  color: var(--neon-yellow);
  border: 1px solid var(--neon-yellow);
}

.game-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-submit-note {
  font-size: 10px;
  color: var(--neon-green);
}

.tiebreaker-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tiebreaker-status {
  font-size: 10px;
  color: var(--neon-green);
}

/* --- Matchup hero cards: team vs team, 2 pick buttons each ----------- */

.matchup-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 8px 10px;
}

.team-card-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(5, 217, 232, 0.35));
  margin-bottom: 2px;
}

.team-card-spread {
  font-family: 'Press Start 2P', monospace;
  font-size: 17px;
  color: var(--text);
  line-height: 1;
}

.team-card-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: var(--text-dim);
  line-height: 1.3;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.team-card-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.pick-mini-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  padding: 7px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pick-mini-btn.su.risk-low { border-bottom-color: var(--neon-green); border-bottom-width: 3px; }
.pick-mini-btn.su.risk-high { border-bottom-color: var(--neon-pink); border-bottom-width: 3px; }
.pick-mini-btn.ats { border-bottom-color: var(--neon-yellow); border-bottom-width: 3px; }

.pick-mini-label {
  font-size: 7px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.pick-mini-value {
  font-size: 11px;
  font-weight: 700;
}

.pick-mini-pts {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--neon-yellow);
  text-shadow: 0 0 4px var(--neon-yellow);
}

.pick-mini-btn:hover:not(:disabled) {
  border-top-color: var(--neon-cyan);
  border-left-color: var(--neon-cyan);
  border-right-color: var(--neon-cyan);
}

.pick-mini-btn.selected {
  border-color: var(--neon-purple);
  background: rgba(193, 60, 255, 0.25);
  box-shadow: 0 0 12px rgba(193, 60, 255, 0.5);
}

/* Pixel-badge checkmark, top-right corner — a second, unmissable signal
   for "this is picked" beyond the border/glow, which can be hard to
   spot at a glance across a whole row of similar buttons. */
.pick-mini-btn.selected::after {
  content: "✓";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neon-purple);
  color: #0a0014;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  line-height: 1;
  border: 2px solid var(--bg);
  border-radius: 4px;
  box-shadow: 0 0 8px var(--neon-purple);
  z-index: 2;
}

.pick-mini-btn.selected.su.risk-low { border-bottom-color: var(--neon-green); }
.pick-mini-btn.selected.su.risk-high { border-bottom-color: var(--neon-pink); }
.pick-mini-btn.selected.ats { border-bottom-color: var(--neon-yellow); }

.pick-mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ghost-btn.small {
  padding: 6px 10px;
  font-size: 10px;
}

/* --- Rules modal -------------------------------------------------- */

.rules-link {
  display: block;
  margin: 4px auto 0;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 0, 12, 0.82);
  backdrop-filter: blur(2px);
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg2);
  border: 2px solid var(--neon-purple);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 0 30px rgba(193, 60, 255, 0.45);
}

.modal-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  text-align: center;
}

.modal-subtext {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
}

.avatar-hint {
  display: block;
  text-align: center;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-top: -8px;
}

.avatar-edit-preview {
  align-self: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent, var(--neon-purple)) 70%, white), var(--accent, var(--neon-purple)));
  border: 3px solid #0a0014;
  box-shadow: 0 0 0 2px var(--accent, var(--neon-purple)), 0 3px 0 rgba(0, 0, 0, 0.5);
  color: #0a0014;
  font-family: 'Press Start 2P', monospace;
}

.avatar-emoji-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  text-align: center;
  padding: 10px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .ghost-btn,
.modal-actions .primary-btn {
  flex: 1;
}

.rules-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--card-border);
}

.rules-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
}

.section-heading {
  display: block;
  text-align: center;
  margin-top: 6px;
}

.rules-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.rules-list strong {
  color: var(--neon-green);
}

.rules-example {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.5;
}

.rules-max {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--neon-pink);
  text-shadow: 0 0 6px var(--neon-pink);
  padding-top: 6px;
  border-top: 1px dashed var(--card-border);
}
