/*
Theme Name: Game Coacher
Theme URI: https://gamecoacher.example
Description: Walkthroughs for games. Levels with embedded YouTube tutorials, board pictures and a search that understands "1 orange suv up".
Author: Game Coacher
Version: 1.4.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: game-coacher
*/

:root {
  --bg: #0f1218;
  --panel: #171c26;
  --panel-2: #1f2633;
  --line: #2a3344;
  --text: #e8edf5;
  --muted: #9aa6ba;
  --accent: #ffb020;
  --accent-ink: #1a1200;
  --link: #7cc4ff;
  --radius: 12px;
  --max: 1120px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6f9;
    --panel: #ffffff;
    --panel-2: #eef1f6;
    --line: #d9dee8;
    --text: #151a24;
    --muted: #556075;
    --accent: #e89400;
    --accent-ink: #1a1200;
    --link: #0b63c5;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1218;
  --panel: #171c26;
  --panel-2: #1f2633;
  --line: #2a3344;
  --text: #e8edf5;
  --muted: #9aa6ba;
  --accent: #ffb020;
  --accent-ink: #1a1200;
  --link: #7cc4ff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

img, iframe { max-width: 100%; height: auto; display: block; }

a { color: var(--link); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; }

/* Header */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -.01em;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 40px; flex: 0 0 auto; }
.brand-name span { color: var(--accent); }

.main-nav ul { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.main-nav a:hover, .main-nav a:focus { color: var(--text); }

.header-cta { margin-left: auto; text-decoration: none; }

.gc-button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.gc-button:hover { filter: brightness(1.05); }
.gc-button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Hero */
.hero {
  padding: 56px 0 32px;
  background: radial-gradient(1200px 400px at 50% -10%, var(--panel-2), transparent);
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 18ch; }
.hero p.lead { color: var(--muted); font-size: 1.1rem; max-width: 60ch; }
.hero .gc-finder-form { margin-top: 24px; }

/* Sections */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head a { font-weight: 600; }
.muted { color: var(--muted); }

.game-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
.game-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
}
.game-card:hover { border-color: var(--accent); }
.game-card p { margin: 0; color: var(--muted); }

/* Level grid and cards */
.gc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.gc-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  height: 100%;
}
.gc-card:hover { border-color: var(--accent); }
.gc-card-media { position: relative; aspect-ratio: 3 / 4; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; }
.gc-card-blur { position: absolute; inset: -12px; background-size: cover; background-position: center; filter: blur(14px) brightness(.7); }
.gc-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.gc-card-empty { color: var(--muted); font-size: .9rem; }
.gc-card-body { padding: 14px 16px 16px; }
.gc-card-body h3 { margin-bottom: 4px; }
.gc-card-meta { margin: 0; color: var(--muted); font-size: .92rem; }

.gc-match-list { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .92rem; }
.gc-match-list li + li { margin-top: 2px; }

/* Level page */
.crumbs { font-size: .9rem; color: var(--muted); margin: 20px 0 8px; }
.crumbs a { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--accent); font-weight: 700; margin: 0 0 4px; }

.gc-video {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0 24px;
  border: 1px solid var(--line);
}
.gc-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gc-video.is-empty { display: grid; place-items: center; color: var(--muted); background: var(--panel); }

.gc-level-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.gc-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.gc-board-img { border-radius: 8px; border: 1px solid var(--line); width: auto; max-width: 100%; max-height: 85vh; margin: 0 auto; }
.gc-board-empty { aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--muted); background: var(--panel-2); border-radius: 8px; }
.gc-vehicles-list { margin: 0; padding-left: 20px; }
.gc-vehicles-list li { margin-bottom: 6px; }
.gc-total { margin: 0 0 12px; font-weight: 700; }

.entry-content { margin-top: 24px; }
.entry-content > :first-child { margin-top: 0; }

.gc-level-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 8px;
  flex-wrap: wrap;
}
.gc-level-nav a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.gc-level-nav a:hover { border-color: var(--accent); }

/* Finder */
.gcf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.gcf-panel-board { grid-column: 1 / -1; }
.gcf-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
.gcf-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 0 0 4px; }
.gcf-step {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: .85rem; font-weight: 800; flex: 0 0 auto;
}
.gcf-hint { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }

.gcf-chips { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gcf-chip, .gcf-add {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 4px 14px 4px 6px;
  font: inherit; font-size: .9rem;
  cursor: pointer;
}
.gcf-chip .gcf-veh { width: 44px; height: 16px; }
.gcf-chip.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.gcf-chip.is-blank span { color: var(--muted); }
.gcf-add { padding: 4px 14px; color: var(--link); border-style: dashed; }

.gcf-editor { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 16px; }
.gcf-field { display: grid; gap: 8px; min-width: 0; }
.gcf-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.gcf-picked {
  margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--panel-2); color: var(--text);
  font-weight: 700; text-transform: none; letter-spacing: 0;
}
.gcf-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.gcf-note { color: var(--muted); font-size: .8rem; }

.gcf-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.gcf-flag {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
  font: inherit; font-size: .9rem; cursor: pointer;
}
.gcf-flag.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.gcf-more {
  min-height: 40px; padding: 6px 12px; border-radius: 10px;
  border: 1px dashed var(--line); background: none; color: var(--link);
  font: inherit; font-size: .9rem; cursor: pointer;
}

.gcf-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.gcf-swatch {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, .25);
  background: var(--sw);
  cursor: pointer; padding: 0;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.gcf-swatch.is-any {
  width: auto; padding: 0 12px; border-radius: 999px;
  background: var(--bg); color: var(--text); border-color: var(--line);
  font: inherit; font-size: .85rem; box-shadow: none;
}
.gcf-swatch.is-on { outline: 3px solid var(--text); outline-offset: 2px; }
.gcf-swatch.is-any.is-on { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.gcf-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gcf-type {
  display: grid; justify-items: center; align-content: center; gap: 4px;
  min-height: 82px; padding: 8px 4px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
  font: inherit; cursor: pointer;
}
.gcf-type small { color: var(--muted); font-size: .75rem; }
.gcf-type-name { font-weight: 700; }
.gcf-type.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--panel-2); }

.gcf-compass { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; }
.gcf-dir {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0;
}
.gcf-dir.is-any { font-size: .7rem; color: var(--muted); }
.gcf-dir.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

.gcf-count { display: inline-flex; align-items: center; gap: 8px; }
.gcf-count button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: 1.3rem; cursor: pointer; padding: 0;
}
.gcf-count output { min-width: 32px; text-align: center; font-size: 1.4rem; font-weight: 800; }

.gcf-remove {
  justify-self: start; background: none; border: 0; padding: 4px 0;
  color: var(--muted); text-decoration: underline; font: inherit; font-size: .88rem; cursor: pointer;
}


.gcf-number, .gcf-board-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 10px;
}
.gcf-number { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.gcf-number-label, .gcf-board-label { font-size: .9rem; flex: 1 1 auto; }
.gcf-board-row:first-child { margin-top: 0; }
.gcf-number .gcf-count button { width: 36px; height: 36px; font-size: 1.1rem; }
.gcf-num-input {
  width: 92px; height: 40px; text-align: center;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 1.2rem; font-weight: 800;
  -moz-appearance: textfield; appearance: textfield;
}
.gcf-num-input::placeholder { font-size: .8rem; font-weight: 600; color: var(--muted); }
.gcf-num-input::-webkit-outer-spin-button, .gcf-num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gcf-num-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.gcf-unsure { font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.gcf-count output { min-width: 32px; }

.gcf-lines-count { display: grid; gap: 6px; margin: 0 0 14px; }
.gcf-line-block + .gcf-line-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.gcf-line-label { margin: 0 0 8px; font-weight: 700; font-size: .95rem; }

/* On the board: a grid of tiles */
.gcf-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; align-items: start; }
.gcf-tile {
  display: grid; gap: 6px; align-content: start;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  min-width: 0;
}
.gcf-tile.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.gcf-tile-name {
  display: flex; align-items: center; gap: 8px; min-height: 46px; width: 100%;
  padding: 8px 12px; background: none; border: 0; color: var(--text);
  font: inherit; font-size: .92rem; text-align: left;
}
button.gcf-tile-name { cursor: pointer; border-radius: 10px; }
.gcf-tick {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--line); font-size: .75rem; font-weight: 800;
}
.gcf-tile.is-on .gcf-tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.gcf-tile-more { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 8px 12px; }
.gcf-tile-more small { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.gcf-tile .gcf-count button { width: 32px; height: 32px; font-size: 1.05rem; }
.gcf-tile .gcf-count output { font-size: 1.1rem; min-width: 28px; }
.gc-line-side { margin: 8px 0 0; font-size: .78rem; color: var(--muted); }

.gcf-line-options { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.gcf-line-options:empty { display: none; }
.gcf-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; justify-self: start; flex-wrap: wrap; }
.gcf-seg button {
  border: 0; background: var(--bg); color: var(--text);
  padding: 9px 14px; font: inherit; font-size: .88rem; cursor: pointer;
}
.gcf-seg button.is-on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.gcf-check { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); }
.gcf-check input { width: 18px; height: 18px; accent-color: var(--accent); }

.gcf-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 16px 0 0;
  position: sticky; bottom: 0; z-index: 5;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
}
.gcf-submit { padding: 13px 26px; font-size: 1.05rem; }
.gcf-reset { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; }
.gcf-status { color: var(--muted); font-size: .9rem; }

.gcf-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: .92rem; }
.gcf-jump input {
  width: 110px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit;
}
.gcf-jump-go {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 14px; font: inherit; cursor: pointer;
}

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

.gc-results { margin-top: 32px; }
.gc-results-title { margin: 28px 0 12px; }
.gc-results-empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; color: var(--muted); }
.gc-results-empty p { margin: 0; }
.gc-match-list li.is-miss { color: #e5484d; }

/* Lines of people (level pages and result cards) */
.gc-line {
  list-style: none; margin: 8px 0 0; padding: 8px 10px 14px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 10px;
  position: relative; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .12);
  background-color: #dfe1e6;
  background-image: linear-gradient(rgba(0,0,0,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 24px 12px;
}
.gc-line::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 5px; height: 3px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, #d63638 0 18px, #f2f2f2 18px 21px);
}
.gc-line li { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; }
.gc-line-people { display: flex; align-items: flex-end; }
.gc-line-people .gc-person { margin: 0 -1.5px; }
.gc-line-n { font-size: .72rem; font-weight: 800; color: #1d2327; line-height: 1.2; }
.gc-line-plus { align-self: center; font-size: .7rem; font-weight: 800; color: #3c434a; margin-left: 3px; }
.gc-line li.gc-line-more { align-self: center; color: #3c434a; font-weight: 800; }
.gc-line-block + .gc-line-block { margin-top: 14px; }
.gc-line-title { margin: 0; font-weight: 600; }
.gc-level-side { display: grid; gap: 16px; }

.gc-notice {
  border-left: 3px solid var(--accent);
  background: var(--panel);
  padding: 12px 14px;
  border-radius: 8px;
  margin: 0 0 16px;
  color: var(--muted);
}

.gc-result-count { margin: 0 0 12px; color: var(--muted); }
.gc-result-count strong { color: var(--text); }
.gc-exact { display: inline-block; font-size: .75rem; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; font-weight: 700; }

/* Generic pages */
.page-head { padding: 32px 0 8px; }
.page-head p { color: var(--muted); }
.entry { padding: 16px 0 40px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: .9rem;
}
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--muted); }

/* Small screens */
@media (max-width: 760px) {
  .gc-level-body { grid-template-columns: 1fr; }
  .main-nav { order: 3; width: 100%; }
  .hero { padding: 32px 0 24px; }
  .gcf-grid { grid-template-columns: 1fr; }
  .gcf-panel { padding: 14px; }
  .gcf-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gcf-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gcf-actions { padding: 10px 12px; }
  .gcf-seg { display: flex; flex-wrap: nowrap; justify-self: stretch; }
  .gcf-seg button { flex: 1 1 0; padding: 9px 6px; }
  .gcf-submit { flex: 1 1 auto; padding: 11px 18px; }
}

@media (max-width: 1000px) and (min-width: 761px) {
  .gcf-grid { grid-template-columns: 1fr; }
}
