* { box-sizing: border-box; }
:root {
  --bg: #07111f;
  --panel: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.10);
  --text: #eef2ff;
  --muted: #cbd5e1;
  --accent: #7dd3fc;
  --accent-2: #34d399;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: radial-gradient(circle at top, #10233f 0%, var(--bg) 62%);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.5;
}
.bg-glow {
  position: fixed; inset: auto; width: 420px; height: 420px; border-radius: 999px;
  filter: blur(80px); opacity: .18; pointer-events: none; z-index: 0;
}
.glow-a { top: -100px; left: -120px; background: #38bdf8; }
.glow-b { right: -120px; top: 120px; background: #8b5cf6; }
.container { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; }
.hero, .notes, .game-card, .manifesto, .featured-card, .request-card, .hero-panel, .stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.24);
  backdrop-filter: blur(12px);
}
.hero {
  display: grid; grid-template-columns: 1.45fr .95fr; gap: 22px;
  padding: 24px; margin-bottom: 20px;
}
.hero-copy h1 { margin: 0 0 10px; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; max-width: 720px; }
.eyebrow, .mini-label { letter-spacing: .18em; font-size: .7rem; color: var(--accent); margin: 0 0 8px; text-transform: uppercase; }
.subtitle { color: var(--muted); max-width: 720px; line-height: 1.6; font-size: 1rem; margin: 0 0 14px; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top: 12px; }
.hero-panel { padding: 16px; align-self: stretch; display:flex; flex-direction:column; gap:14px; }
.stat-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-card { padding: 14px; min-height: 90px; display:flex; flex-direction:column; justify-content:flex-end; }
.stat-card.wide { grid-column: 1 / -1; }
.stat-value { font-size: 1.3rem; font-weight: 800; }
.stat-label { color: var(--muted); margin-top: 4px; font-size: .85rem; }
.hero-panel input {
  padding: 11px 12px; border-radius: 11px; width:100%; min-height: 44px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(15,23,42,.7); color: white;
  font-size: 1rem;
}
.split-card { display:grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; margin-bottom: 20px; }
.split-card p, .split-card li { color: #dbeafe; line-height: 1.6; font-size: .95rem; }
.section-head { margin: 10px 0 16px; }
.section-head.compact { display:flex; justify-content:space-between; align-items:end; gap:14px; flex-wrap: wrap; }
.section-head h2, .notes h3, .request-card h3 { margin: 0 0 6px; font-size: 1.4rem; }
.section-head p, footer p, .notes li, .request-card li, .request-card p { color: var(--muted); font-size: .9rem; }
.featured { margin-bottom: 24px; }
.featured-card { display:grid; grid-template-columns: 200px 1fr; gap: 18px; padding: 18px; }
.featured-visual {
  min-height: 160px; display:flex; align-items:center; justify-content:center;
  font-size: 4rem; border-radius: 16px; background: linear-gradient(135deg,#38bdf8,#1d4ed8);
}
.featured-copy { display:flex; flex-direction:column; justify-content:center; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.game-card { overflow: hidden; transition: transform .2s ease, border-color .2s ease; }
.game-card:hover { transform: translateY(-3px); border-color: rgba(125,211,252,.45); }
.card-image { height: 160px; display: flex; align-items: center; justify-content: center; }
.card-image.sky { background: linear-gradient(135deg, #38bdf8, #1d4ed8); }
.card-image.neon { background: linear-gradient(135deg, #111827, #14532d); }
.card-image.arcade { background: linear-gradient(135deg, #1f2937, #7c3aed); }
.card-image.danger { background: linear-gradient(135deg, #7c2d12, #b91c1c); }
.emoji { font-size: 4rem; }
.card-body { padding: 16px; }
.tag-row { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tag {
  font-size: .7rem; padding: 3px 8px; border-radius: 999px;
  background: rgba(125,211,252,0.14); color: #bae6fd;
}
.game-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.game-card p { color: var(--muted); line-height: 1.5; min-height: 60px; font-size: .9rem; }
.btn {
  display: inline-block; margin-top: 6px; text-decoration: none; font-weight: 700;
  padding: 11px 14px; border-radius: 11px; transition: transform .15s ease, opacity .15s ease;
  font-size: .9rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #04111d; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn-secondary { color: #dbeafe; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,.12); }
.request-section { margin-top: 24px; }
.request-card { padding: 20px; }
.request-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 16px 0; }
.request-grid ul { padding-left: 18px; margin: 0; }
.notes { margin-top: 24px; padding: 20px 22px; }
footer { margin-top: 18px; text-align: center; font-size: .85rem; }
@media (max-width: 900px) {
  .hero, .split-card, .featured-card, .request-grid { grid-template-columns: 1fr; }
  .section-head.compact { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 680px) {
  .container { padding: 20px 14px 32px; }
  .hero { padding: 18px; gap: 16px; }
  .hero-copy h1 { font-size: 1.8rem; }
  .subtitle { font-size: .95rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 80px; }
  .stat-value { font-size: 1.1rem; }
  .stat-label { font-size: .8rem; }
  .hero-panel input { font-size: .95rem; }
  .split-card { gap: 16px; padding: 16px; }
  .split-card p, .split-card li { font-size: .9rem; }
  .section-head h2, .notes h3, .request-card h3 { font-size: 1.2rem; }
  .section-head p, .notes li, .request-card p { font-size: .85rem; }
  .featured-card { gap: 16px; padding: 16px; }
  .featured-visual { min-height: 140px; font-size: 3rem; }
  .featured-copy p { font-size: .9rem; }
  .games-grid { grid-template-columns: 1fr; gap: 16px; }
  .game-card { display: flex; flex-direction: row; align-items: center; gap: 14px; }
  .card-image { width: 140px; height: 140px; flex-shrink: 0; }
  .card-body { padding: 12px; flex: 1; }
  .game-card h2 { font-size: 1.1rem; }
  .game-card p { min-height: auto; font-size: .85rem; }
  .tag-row { gap: 5px; }
  .tag { font-size: .65rem; padding: 2px 7px; }
  .btn { padding: 10px 12px; font-size: .85rem; }
  .request-card { padding: 16px; }
  .request-grid { gap: 16px; }
  .notes { padding: 16px 18px; }
  footer { font-size: .8rem; }
}
@media (max-width: 480px) {
  .container { padding: 18px 12px 28px; }
  .hero { gap: 14px; padding: 16px; }
  .hero-copy h1 { font-size: 1.6rem; }
  .eyebrow, .mini-label { font-size: .65rem; }
  .subtitle { font-size: .9rem; }
  .hero-actions { gap: 8px; }
  .stat-card { padding: 12px; min-height: 70px; }
  .stat-value { font-size: 1rem; }
  .stat-label { font-size: .75rem; }
  .hero-panel input { font-size: .9rem; padding: 10px 11px; min-height: 40px; }
  .section-head h2, .notes h3, .request-card h3 { font-size: 1.1rem; }
  .featured-card { gap: 14px; padding: 14px; }
  .featured-visual { min-height: 120px; font-size: 2.5rem; }
  .game-card { flex-direction: column; align-items: stretch; }
  .card-image { width: 100%; height: 140px; }
  .btn { width: 100%; }
}

/* ========== SCORE SUBMISSION OVERLAY ========== */
body.modal-open { overflow: hidden; }
.score-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.score-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(6px);
}
.score-overlay-card {
  position: relative;
  z-index: 1;
  width: min(94vw, 460px);
  background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(8,15,31,0.98));
  border: 1px solid rgba(125,211,252,0.35);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 45px rgba(125,211,252,.18);
  text-align: left;
  animation: overlayPop .16s ease-out;
}
@keyframes overlayPop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.overlay-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.8rem;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay-close:hover { color: var(--text); }
.overlay-eyebrow { margin-bottom: 6px; }
.score-overlay-card h2 { margin: 0 0 10px; font-size: 1.35rem; }
.overlay-score { color: var(--muted); margin: 0 0 14px; font-size: .95rem; }
.overlay-score strong { color: #fff; font-size: 1.35rem; }
.overlay-form { display: grid; gap: 11px; }
.overlay-form label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
.overlay-form input[type="text"] {
  width: 100%; padding: 12px 13px; border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(15,23,42,.85); color: white;
  font-size: 1rem; min-height: 44px;
}
.overlay-form input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125,211,252,.16); }
.overlay-submit {
  width: 100%; padding: 12px 16px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 800;
  color: #04111d; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(52,211,153,.2);
  min-height: 44px;
}
.overlay-checkbox-row { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; color: var(--muted); font-size: .9rem; }
.overlay-status { margin: 10px 0 0; min-height: 1.2em; text-align: center; font-size: .9rem; }

/* ========== GAME METADATA PANEL ========== */
.game-meta-panel {
  max-width: 780px;
  margin: 28px auto 0;
}

/* Scoreboard card - arcade-style with glow and refined borders */
.scoreboard-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
  border: 1px solid rgba(125,211,252,0.25);
  border-radius: 18px;
  padding: 20px;
  text-align: left;
  box-shadow: 
    0 20px 50px rgba(0,0,0,0.35),
    0 0 40px rgba(125,211,252,0.12);
}

/* Scoreboard header - clean two-column layout */
.scoreboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 14px;
}

.scoreboard-head h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Player chip - refined player name display */
.player-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  background: rgba(125,211,252,0.08);
  border: 1px solid rgba(125,211,252,0.20);
  border-radius: 11px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: .85rem;
}

.player-chip strong {
  color: var(--text);
  font-weight: 600;
  min-width: 55px;
  text-align: right;
}

#change-player-name {
  padding: 5px 11px;
  font-size: .8rem;
  background: rgba(125,211,252,0.15);
  color: var(--accent);
  border: 1px solid rgba(125,211,252,0.30);
  border-radius: 7px;
  transition: all 0.15s ease;
  min-height: 34px;
}

#change-player-name:hover {
  background: rgba(125,211,252,0.22);
  border-color: rgba(125,211,252,0.45);
  transform: translateY(-1px);
}

/* Highscore list - clean, arcade-style */
.score-list {
  padding-left: 16px;
  display: grid;
  gap: 7px;
  margin: 10px 0;
  list-style: none;
}

.score-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 9px;
  color: var(--muted);
  font-size: .88rem;
  transition: all 0.15s ease;
}

.score-list li:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

.score-list li strong {
  color: var(--accent-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Score submission form - compact inline */
.score-form-inline {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto;
  gap: 9px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.score-form-inline button {
  padding: 11px 18px;
  font-size: .88rem;
  color: #04111d;
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
  transition: all 0.15s ease;
  box-shadow: 0 4px 16px rgba(52,211,153,0.25);
  min-height: 40px;
}

.score-form-inline button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52,211,153,0.35);
}

/* Status messages */
#score-status {
  color: var(--muted);
  font-size: .85rem;
  margin: 8px 0 0;
  min-height: 1.2em;
}

/* Feedback link */
.scoreboard-card a {
  color: var(--accent);
  text-decoration: none;
  font-size: .85rem;
  transition: color 0.15s ease;
}

.scoreboard-card a:hover {
  color: var(--accent-2);
}

/* Mobile responsiveness for game page */
@media (max-width: 760px) {
  .score-form-inline {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .score-form-inline input, .score-form-inline button {
    min-height: 42px;
  }

  .scoreboard-card {
    padding: 16px;
  }

  .scoreboard-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .player-chip {
    padding: 7px 10px;
    font-size: .8rem;
  }

  .score-list li {
    padding: 7px 10px;
    font-size: .85rem;
  }
  
  .score-overlay-card {
    padding: 20px;
    width: 94vw;
  }
}

@media (max-width: 480px) {
  .game-meta-panel { margin: 24px auto 0; }
  
  .scoreboard-card {
    padding: 14px;
    border-radius: 16px;
  }

  .scoreboard-head h3 {
    font-size: 1.1rem;
  }

  .player-chip {
    font-size: .78rem;
    padding: 6px 9px;
  }

  #change-player-name {
    padding: 4px 9px;
    font-size: .75rem;
    min-height: 32px;
  }

  .score-list li {
    padding: 6px 10px;
    font-size: .82rem;
  }

  .score-form-inline {
    gap: 7px;
  }

  .score-form-inline input {
    padding: 10px 11px;
    font-size: .9rem;
    min-height: 40px;
  }

  .score-form-inline button {
    padding: 10px 16px;
    font-size: .85rem;
    min-height: 40px;
  }

  .scoreboard-card a {
    font-size: .8rem;
  }
}

.card-image.matrix { background: linear-gradient(135deg, #0f172a, #0ea5e9); }
.card-image.pulse { background: linear-gradient(135deg, #3b0764, #db2777); }


.container.narrow { max-width: 860px; }
.stack-form { display: grid; gap: 13px; }
.stack-form label { display: grid; gap: 7px; color: var(--muted); font-size: .9rem; }
.stack-form input, .stack-form select, .stack-form textarea,
.score-form-inline input {
  width: 100%; padding: 11px 12px; border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(15,23,42,.7); color: white;
  font-size: 1rem; min-height: 44px;
}
.stack-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cbd5e1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.stack-form textarea { resize: vertical; min-height: 120px; font-family: inherit; }
.score-form-inline button, #change-player-name {
  border: 0; cursor: pointer; font-weight: 700; border-radius: 11px;
}

/* Feedback page mobile tweaks */
@media (max-width: 680px) {
  .container.narrow { max-width: 100%; padding: 0 14px; }
  
  .section-head.compact {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-head h1 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .stack-form {
    gap: 12px;
  }

  .stack-form label {
    gap: 6px;
    font-size: .88rem;
  }

  .stack-form input, .stack-form select, .stack-form textarea {
    padding: 10px 11px;
    font-size: .95rem;
    min-height: 42px;
  }

  .stack-form textarea {
    min-height: 100px;
  }

  .btn {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    font-size: .88rem;
  }
}

@media (max-width: 400px) {
  .section-head h1 {
    font-size: 1.25rem;
  }

  .stack-form input, .stack-form select, .stack-form textarea {
    font-size: .9rem;
    min-height: 40px;
  }

  .stack-form textarea {
    min-height: 80px;
  }
}
