/* === Game Page — Long Shot specific === */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --card: #0f3460;
  --accent: #e94560;
  --text: #eee;
  --text-muted: #aab;
  --success: #53d769;
  --warning: #f5a623;
  --radius: 10px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

h1 { font-size: 2rem; margin-bottom: 0.25rem; }

/* === Game Page === */
.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.back-link:hover { text-decoration: underline; }

.game-header { margin-bottom: 2rem; }
.game-header h1 { font-size: 1.75rem; }
.game-header .meta { color: var(--text-muted); font-size: 0.95rem; }

.cover-banner {
  width: 100%;
  max-height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}
.cover-banner img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

/* BGG Stats Bar */
.bgg-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.bgg-stat {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  text-align: center;
  flex: 1 1 0;
  min-width: 80px;
}
.bgg-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}
.bgg-value small { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.bgg-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.15rem;
}

/* Sections */
details {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
details[open] { border-color: rgba(233,69,96,0.3); }

summary {
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: '▸';
  transition: transform 0.2s;
  font-size: 0.8rem;
  color: var(--accent);
}
details[open] > summary::before { transform: rotate(90deg); }

.section-body {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
}
.section-body p { margin-bottom: 0.6rem; }
.section-body ul, .section-body ol {
  margin: 0.5rem 0 0.75rem 1.25rem;
}
.section-body li { margin-bottom: 0.35rem; }

/* Tables */
.section-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}
.section-body th, .section-body td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.section-body th {
  background: rgba(255,255,255,0.04);
  font-weight: 600;
  color: var(--accent);
}
.section-body tr:last-child td { border-bottom: none; }

/* Highlight boxes */
.tip, .warning {
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.tip { background: rgba(83,215,105,0.1); border-left: 3px solid var(--success); }
.warning { background: rgba(245,166,35,0.1); border-left: 3px solid var(--warning); }

/* Tags */
.tag {
  display: inline-block;
  background: var(--card);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.3rem;
}

/* === SVG Graphics === */
.svg-diagram {
  width: 100%;
  margin: 1rem 0;
  overflow-x: auto;
}
.svg-diagram svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* Flow diagram */
.flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.flow-step {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.flow-step.highlight { border-color: var(--accent); color: var(--accent); }
.flow-arrow { color: var(--accent); font-size: 1.2rem; font-weight: bold; }

/* Concession grid visual */
.concession-grid-visual {
  display: inline-grid;
  grid-template-columns: repeat(4, 44px);
  gap: 4px;
  margin: 0.75rem 0;
}
.cg-cell {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid rgba(255,255,255,0.15);
  background: var(--card);
  color: var(--text);
}
.cg-cell.marked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: line-through;
}
.cg-cell.start-marked {
  background: rgba(83,215,105,0.25);
  border-color: var(--success);
  color: var(--success);
  text-decoration: line-through;
}

/* Scoring flow */
.score-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}
.score-box {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  min-width: 100px;
  flex: 1 1 100px;
  max-width: 150px;
}
.score-box .score-icon { font-size: 1.4rem; display: block; margin-bottom: 0.25rem; }
.score-box .score-label { color: var(--text-muted); }
.score-plus { display: flex; align-items: center; color: var(--accent); font-weight: bold; font-size: 1.2rem; }

/* Mobile */
@media (max-width: 600px) {
  .container { padding: 1.25rem 1rem; }
  h1 { font-size: 1.5rem; }
  .concession-grid-visual { grid-template-columns: repeat(4, 38px); }
  .cg-cell { width: 38px; height: 38px; font-size: 0.75rem; }
  .flow-step { padding: 0.4rem 0.6rem; font-size: 0.78rem; }
  .score-box { min-width: 80px; font-size: 0.75rem; }
}