/* ============================================================
   footy party games - shared theme
   Dark "floodlit pitch" palette. Every page sets --accent.
   No image assets anywhere: all motifs are CSS-drawn.
   ============================================================ */

:root {
  --bg:        #090c0f;
  --bg-2:      #0f1419;
  --panel:     #141b22;
  --panel-2:   #1b242d;
  --panel-3:   #223039;
  --line:      rgba(255,255,255,.085);
  --line-2:    rgba(255,255,255,.16);
  --ink:       #eaf2f7;
  --ink-2:     #c3d2dc;
  --muted:     #8698a5;
  --muted-2:   #5e6f7b;

  --good:      #35d39a;
  --warn:      #f2b134;
  --bad:       #ee5a5a;
  --good-bg:   rgba(53,211,154,.14);
  --warn-bg:   rgba(242,177,52,.14);
  --bad-bg:    rgba(238,90,90,.13);

  --accent:    #35d39a;
  --accent-ink:#04120c;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow:    0 2px 4px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.42);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.3);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 620px at 50% -12%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    radial-gradient(900px 500px at 88% 6%, rgba(255,255,255,.035), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: break-word;
}

/* faint pitch striping, drawn not loaded */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    90deg, rgba(255,255,255,.014) 0 64px, transparent 64px 128px);
}
body > * { position: relative; z-index: 1; }

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.02em; font-weight: 750; }
h1 { font-size: clamp(1.7rem, 5.2vw, 2.9rem); }
h2 { font-size: clamp(1.15rem, 3vw, 1.5rem); }
h3 { font-size: 1.02rem; font-weight: 700; }
p  { margin: 0 0 1em; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- layout ---------------- */

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.wrap-narrow { max-width: 720px; }

.stack   { display: flex; flex-direction: column; gap: 14px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer  { flex: 1 1 auto; }
.center  { text-align: center; }
.hidden  { display: none !important; }

/* ---------------- top bar ---------------- */

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  max-width: var(--maxw); margin: 0 auto;
  min-height: 62px;
}
.topbar .title {
  font-weight: 760; font-size: 1.06rem; letter-spacing: -.015em;
  display: flex; align-items: center; gap: 9px; min-width: 0;
}
.topbar .title .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  flex: none;
}
.topbar .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* back-to-hub link, injected by backlink.js */
.backlink {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .84rem; font-weight: 620; color: var(--muted);
  padding: 7px 13px 7px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.03);
  white-space: nowrap;
}
.backlink:hover { color: var(--ink); border-color: var(--line-2); text-decoration: none; background: rgba(255,255,255,.06); }
.backlink .arw { font-size: 1.05em; line-height: 1; margin-top: -1px; }

/* ---------------- surfaces ---------------- */

.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.panel-flat { background: var(--panel); box-shadow: none; }
.panel-pad-lg { padding: 24px; }

.hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* ---------------- buttons ---------------- */

.btn {
  appearance: none; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--ink);
  font: inherit; font-weight: 650; font-size: .95rem;
  padding: 12px 18px; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.btn:hover { background: var(--panel-3); border-color: rgba(255,255,255,.26); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent); border-color: transparent; color: var(--accent-ink);
  font-weight: 750;
  box-shadow: 0 3px 14px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-lg { padding: 16px 30px; font-size: 1.06rem; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-block { display: flex; width: 100%; }

/* ---------------- inputs ---------------- */

.field {
  width: 100%; font: inherit; font-size: 1rem;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  color: var(--ink);
}
.field::placeholder { color: var(--muted-2); }
.field:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field-lg { padding: 16px 18px; font-size: 1.08rem; }

label.lbl { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

/* ---------------- chips & pills ---------------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 650; letter-spacing: .01em;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-accent {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  color: color-mix(in srgb, var(--accent) 72%, white);
}
.chip-good { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 36%, transparent); color: var(--good); }
.chip-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 36%, transparent); color: var(--warn); }
.chip-bad  { background: var(--bad-bg);  border-color: color-mix(in srgb, var(--bad) 34%, transparent);  color: var(--bad); }

/* ---------------- messages ---------------- */

.msg {
  padding: 12px 15px; border-radius: var(--r);
  font-size: .92rem; font-weight: 560; line-height: 1.42;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  display: flex; gap: 10px; align-items: flex-start;
}
.msg .ic { flex: none; font-weight: 800; line-height: 1.35; }
.msg-good { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 32%, transparent); color: color-mix(in srgb, var(--good) 85%, white); }
.msg-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 32%, transparent); color: color-mix(in srgb, var(--warn) 85%, white); }
.msg-bad  { background: var(--bad-bg);  border-color: color-mix(in srgb, var(--bad) 32%, transparent);  color: color-mix(in srgb, var(--bad) 88%, white); }

/* ---------------- misc text ---------------- */

.muted    { color: var(--muted); }
.small    { font-size: .85rem; }
.tiny     { font-size: .75rem; }
.mono     { font-family: var(--mono); }
.upper    { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 750; }
.tabnum   { font-variant-numeric: tabular-nums; }
.lede     { font-size: 1.03rem; color: var(--ink-2); }

/* ---------------- data-missing state ---------------- */

.datawarn {
  margin: 24px auto; max-width: 620px;
  padding: 20px 22px; border-radius: var(--r-lg);
  background: var(--bad-bg);
  border: 1px solid color-mix(in srgb, var(--bad) 34%, transparent);
  color: var(--ink);
}
.datawarn code { font-family: var(--mono); font-size: .88em; background: rgba(0,0,0,.32); padding: 2px 6px; border-radius: 5px; }

/* ---------------- animation ---------------- */

@keyframes pop   { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise  { from { transform: translateY(9px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 10%,90%{transform:translateX(-2px)} 30%,70%{transform:translateX(4px)} 50%{transform:translateX(-5px)} }

.anim-pop  { animation: pop .22s cubic-bezier(.2,1.3,.4,1) both; }
.anim-rise { animation: rise .3s ease both; }
.anim-shake{ animation: shake .4s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

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

/* ---------------- option cards ----------------
   The "which players can come up?" choice, asked on a game's setup screen
   before anyone is put on the spot. Also reusable for any other up-front
   either/or a game needs. */

.optcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
/* Two options carrying a sentence each read better stacked full width. */
.optcards.stack { grid-template-columns: 1fr; }
.optcards.stack .oc-sub { font-size: .8rem; }

.optcard {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 13px 14px; border-radius: var(--r);
  background: var(--bg-2); border: 1.5px solid var(--line-2);
  color: inherit; font: inherit; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.optcard:hover { border-color: rgba(255,255,255,.3); background: var(--panel-2); }
.optcard:active { transform: translateY(1px); }
.optcard[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-2));
}
.oc-title { font-weight: 760; font-size: .98rem; letter-spacing: -.01em; }
.optcard[aria-pressed="true"] .oc-title { color: var(--accent); }
.oc-sub { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.oc-count {
  font-size: .68rem; color: var(--muted-2); margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .optcards { grid-template-columns: 1fr; gap: 7px; }
  .optcard { padding: 11px 13px; }
}

/* A game with no setup screen asks the same question on a start gate. */
.gate { max-width: 520px; margin: 0 auto; padding: 8px 0 0; }
.gate h2 { margin-bottom: 4px; }
.gate .sub { color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.gate .btn { margin-top: 20px; }
.gatebar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .76rem; color: var(--muted-2); margin-bottom: 16px;
}
.gatebar b { color: var(--ink-2); font-weight: 680; }
.gatebar button {
  appearance: none; background: none; border: 0; padding: 0;
  font: inherit; font-size: .76rem; font-weight: 680;
  color: var(--accent); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------- scope picker ----------------
   Compact variant, used on the hub where it sets the default rather than
   asking a question. Lives on its own row so it still fits a 375px phone. */

.scopebar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: var(--maxw); margin: 0 auto; padding: 0 18px 14px;
}
.scopebar .cap3 {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted-2); font-weight: 750;
}
.scopeseg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.scopeseg button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: .8rem; font-weight: 680; cursor: pointer;
  padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.scopeseg button:hover { color: var(--ink); }
.scopeseg button[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-ink); font-weight: 760;
}
.scopecount {
  font-size: .74rem; color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .scopebar { gap: 8px; padding-bottom: 12px; }
  .scopebar .cap3 { display: none; }
  .scopeseg { flex: 1 1 auto; }
  .scopeseg button { flex: 1 1 0; padding: 8px 6px; text-align: center; }
}
