/* ─────────────────────────────────────────────────────────────
   Liberty ROW Field Guide Challenge
   Built on the shared GWT HTML module engine (theme tokens + components),
   reskinned to the GWT green brand. The --brand-* slots are the single
   reskin point, exactly as in the module engine.
───────────────────────────────────────────────────────────── */

:root {
  /* GWT green — primary accent (fills the engine's --brand-* slots) */
  --brand-purple:      #2E7D46;  /* primary */
  --brand-purple-dark: #256A3B;
  --brand-purple-deep: #1C5230;  /* headings / eyebrow text */
  --brand-purple-soft: #E4F1E8;  /* pill / tint backgrounds */
  --brand-purple-tint: #F1F8F3;  /* subtle callout backgrounds */
  --brand-cyan:        #6FB98C;  /* mid accent */
  --brand-green:       #BFE3CC;  /* pale tint */

  /* Neutrals */
  --ink:       #221F1F;
  --ink-soft:  #4b5563;
  --muted:     #6b7280;
  --line:      #e5e7eb;
  --line-soft: #f3f4f6;
  --surface:   #ffffff;
  --canvas:    #f4f5f7;
  --canvas-2:  #f9fafb;

  /* Status */
  --success:      #15803d;
  --success-soft: #dcfce7;
  --danger:       #b91c1c;
  --danger-soft:  #fee2e2;

  /* Gradients */
  --brand-gradient: linear-gradient(135deg, #2E7D46 0%, #6FB98C 55%, #BFE3CC 100%);
  --brand-gradient-hero: linear-gradient(135deg, #1C5230 0%, #1C5230 58%, #2E7D46 82%, #6FB98C 100%);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.10);

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px;

  /* Type scale */
  --step-0: 1rem; --step-1: 1.125rem; --step-2: 1.25rem;
  --step-3: 1.5rem; --step-4: 1.875rem;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; color: var(--ink); }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-2); font-weight: 600; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
.ic { width: 1em; height: 1em; fill: currentColor; display: inline-block; vertical-align: -.125em; }
button { font-family: inherit; cursor: pointer; }

/* ─── Top bar ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 8px; padding: 10px 14px; min-height: 52px;
}
.tb-slot { display: flex; align-items: center; min-width: 0; }
.tb-right { justify-self: end; }
.tb-logo {
  justify-self: center; display: flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.01em;
}
.tb-logo .ic { font-size: 20px; color: var(--brand-purple); }
.tb-logo span { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; }
.team-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78rem; font-weight: 700; color: var(--brand-purple-deep);
  background: var(--brand-purple-soft); padding: 5px 11px; border-radius: 100px;
  white-space: nowrap;
}
.team-badge .sw { width: 9px; height: 9px; border-radius: 50%; }
.stepcount { font-size: 0.8rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ─── Shell ─────────────────────────────────────────────── */
.module-shell { max-width: 620px; margin: 0 auto; padding: 22px 16px 48px; }

/* ─── Eyebrow ───────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--brand-purple-deep); background: var(--brand-purple-soft);
  padding: 5px 13px; border-radius: 100px; margin-bottom: 14px;
}
.eyebrow .ic { font-size: 14px; }

/* ─── Progress ──────────────────────────────────────────── */
.progress { height: 6px; background: var(--line-soft); border-radius: 100px; overflow: hidden; margin-bottom: 22px; }
.progress-fill { height: 100%; background: var(--brand-gradient); transition: width 0.4s ease; border-radius: 100px; }

/* ─── Card ──────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px 22px; box-shadow: var(--shadow-sm);
}
.card.brand-bar { position: relative; overflow: hidden; }
.card.brand-bar::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--brand-gradient);
}
.card h2:first-of-type { margin-top: 6px; }
.card .body { font-size: 1rem; color: var(--ink-soft); }
.card .body b { color: var(--ink); font-weight: 700; }
.card .body p { margin: 0 0 0.8em; }

/* the "send this message" / callout block, engine work-script style */
.sendblock {
  background: var(--brand-purple-tint); border-left: 3px solid var(--brand-purple);
  border-radius: var(--r-md); padding: 12px 14px; margin: 14px 0;
}
.sendblock .lbl { font-size: 0.68rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--brand-purple-deep); margin-bottom: 6px; }
.sendblock .msg { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.98rem; font-weight: 700; color: var(--ink); letter-spacing: .02em; }

.steps { margin: 10px 0 14px; padding-left: 22px; display: grid; gap: 6px; }
.steps li { font-size: 0.96rem; color: var(--ink-soft); line-height: 1.5; padding-left: 2px; }
.fieldnotes { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.fieldnotes li { position: relative; padding-left: 22px; font-size: 0.96rem; color: var(--ink-soft); line-height: 1.5; }
.fieldnotes li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-cyan); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 1rem; font-weight: 600; padding: 12px 20px;
  border-radius: var(--r-md); border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, transform 0.05s; text-decoration: none; min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-purple); color: #fff; border-color: var(--brand-purple); }
.btn-primary:hover { background: var(--brand-purple-dark); color: #fff; }
.btn-block { width: 100%; }

/* ─── Answer input ──────────────────────────────────────── */
.answer { margin-top: 22px; }
.answer label { display: block; font-size: 0.72rem; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.answer input {
  width: 100%; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.1rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 13px 15px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--canvas-2); color: var(--ink); margin-bottom: 12px;
}
.answer input::placeholder { color: var(--muted); text-transform: none; letter-spacing: 0; font-family: inherit; font-weight: 400; }
.answer input:focus { outline: none; border-color: var(--brand-purple); background: #fff; }
.answer input.wrong { border-color: var(--danger); animation: shake .4s; }

.wrongmsg { margin-top: 12px; font-size: 0.9rem; font-weight: 600; color: var(--danger); }
.wrongmsg.hidden { display: none; }

/* callouts (engine style) */
.callout { border-radius: var(--r-md); padding: 12px 15px; margin-top: 14px; font-size: 0.93rem; line-height: 1.5; border-left: 4px solid var(--brand-purple); background: var(--brand-purple-tint); color: var(--ink-soft); }
.callout.danger { border-left-color: var(--danger); background: var(--danger-soft); color: #7f1d1d; font-weight: 600; }
.callout b { color: var(--ink); }
.callout.hidden { display: none; }

/* ─── Finale (engine scenario-complete style) ───────────── */
.finale-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); text-align: center;
}
.finale-head { background: var(--brand-gradient-hero); color: #fff; padding: 30px 24px 26px; }
.finale-head .trophy { font-size: 56px; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.finale-head h2 { color: #fff; margin: 0 0 6px; }
.finale-head .sub { color: rgba(255,255,255,0.9); font-size: 0.98rem; margin: 0 auto; max-width: 52ch; }
.finale-body { padding: 24px 22px 22px; }
.fragwrap { background: var(--canvas-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; }
.fraglabel { font-size: 0.7rem; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.fragnum { font-family: ui-monospace, Menlo, monospace; font-size: 3.4rem; font-weight: 700; letter-spacing: .08em; color: var(--brand-purple); line-height: 1; }
.boxtag { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 700; font-size: 0.95rem; padding: 7px 15px; border-radius: 100px; border: 1px solid var(--line); color: var(--ink); }

/* numbered combine steps (engine ol.reminders) */
ol.reminders { list-style: none; padding: 0; margin: 24px 0 0; text-align: left; counter-reset: reminders; }
ol.reminders li {
  position: relative; padding: 12px 14px 12px 46px; background: var(--canvas-2);
  border-radius: var(--r-md); margin-bottom: 8px; counter-increment: reminders;
  font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5;
}
ol.reminders li::before {
  content: counter(reminders); position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; background: var(--brand-purple); color: #fff; font-size: 0.8rem; font-weight: 700;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
ol.reminders li b { color: var(--ink); }
.prize { margin-top: 22px; font-size: 0.92rem; color: var(--brand-purple-deep); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.prize .ic { font-size: 18px; }
.restart { margin-top: 20px; }
.restart button { background: none; border: none; color: var(--muted); font-size: 0.82rem; text-decoration: underline; }

/* ─── Unlocked toast (engine part-gate-toast style) ─────── */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 10px);
  z-index: 200; display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; background: var(--brand-purple); color: #fff;
  font-size: 0.95rem; font-weight: 700; border-radius: 100px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { font-size: 18px; }

/* ─── Organizer hub (root index) ────────────────────────── */
.hub { max-width: 620px; margin: 0 auto; padding: 30px 18px 44px; }
.hub h2 { font-size: var(--step-3); margin: 12px 0 6px; }
.hub .lede { color: var(--ink-soft); font-size: 0.98rem; margin: 0 0 22px; }
.hub .teamlist { display: grid; gap: 10px; }
.hub a.teamrow {
  display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; font-weight: 700; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s;
}
.hub a.teamrow:hover { border-color: var(--brand-purple); box-shadow: var(--shadow-md); }
.hub a.teamrow .sw { width: 13px; height: 13px; border-radius: 50%; flex: none; }
.hub a.teamrow .slug { margin-left: auto; font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.hub .note { margin-top: 22px; font-size: 0.86rem; color: var(--ink-soft); background: var(--brand-purple-tint); border-left: 4px solid var(--brand-purple); border-radius: var(--r-md); padding: 12px 15px; }

/* ─── Intro / hero (engine onboarding hero) ─────────────── */
.hero {
  position: relative; overflow: hidden;
  background: var(--brand-gradient-hero); color: #fff;
  border-radius: var(--r-xl); padding: 30px 24px 28px; margin-bottom: 16px;
}
.hero .eyebrow { background: rgba(255,255,255,0.18); color: #fff; }
.hero h1 { color: #fff; font-size: var(--step-4); margin: 4px 0 10px; line-height: 1.12; }
.hero .lede { color: rgba(255,255,255,0.95); font-size: 1.02rem; margin: 0; max-width: 34rem; }
.hero .lede b { color: #fff; }
.hero .grass-deco {
  position: absolute; right: -12px; bottom: -18px; width: 150px; height: 150px;
  color: #fff; opacity: 0.12; transform: rotate(8deg); pointer-events: none;
}
.outcome-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 9px; }
.outcome-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.97rem; color: #fff; line-height: 1.45; }
.outcome-list li::before {
  content: ""; flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: rgba(255,255,255,0.22);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 13px 13px; background-repeat: no-repeat; background-position: center;
}
#intro .card + .card { margin-top: 14px; }
#intro .card h3 { margin: 0 0 8px; }
#intro .card h3 + p { margin-bottom: 0; }
.rolechips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rolechip { font-size: 0.82rem; font-weight: 600; padding: 6px 12px; border-radius: 100px; background: var(--brand-purple-soft); color: var(--brand-purple-deep); }

/* ─── Unlock splash (correct-answer animation) ──────────── */
.unlock-splash {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(241, 248, 243, 0.97);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.unlock-splash.show { opacity: 1; }
.lock-stage { position: relative; width: 110px; height: 110px; display: grid; place-items: center; }
.lock-icon { position: absolute; font-size: 78px; color: var(--brand-purple); }
.lock-ring {
  position: absolute; width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid var(--brand-purple); opacity: 0;
}
.lock-ring.go { animation: ringPulse 0.65s ease-out; }
.lock-closed.shake { animation: lockShake 0.5s ease-in-out; transform-origin: 50% 30%; }
.lock-open.pop { animation: lockPop 0.4s cubic-bezier(.2,.9,.3,1.25); }
.unlock-word { margin-top: 20px; font-weight: 800; font-size: 1.15rem; color: var(--brand-purple-deep); opacity: 0; }
.unlock-word.go { animation: wordIn 0.3s ease forwards; }
@keyframes lockShake {
  0%,100% { transform: rotate(0) translateX(0); }
  15% { transform: rotate(-10deg) translateX(-3px); }
  30% { transform: rotate(9deg) translateX(3px); }
  45% { transform: rotate(-7deg) translateX(-2px); }
  60% { transform: rotate(6deg) translateX(2px); }
  78% { transform: rotate(-4deg); }
}
@keyframes lockPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
@keyframes ringPulse { 0% { transform: scale(.5); opacity: .55; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes wordIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
:focus-visible { outline: 2px solid var(--brand-purple-deep); outline-offset: 2px; border-radius: 4px; }

@media (min-width: 768px) {
  html { font-size: 17px; }
  :root { --step-4: 2.25rem; }
  .module-shell { padding: 30px 24px 56px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0.01ms !important; }
}

/* ─── Team badges (Lindsey's emblem set, badges/*.png) ──── */
.team-badge { padding: 3px 11px 3px 4px; max-width: 100%; }
/* Wrap long names (Sycamore Syndicate) onto two lines instead of clipping them at 320-390 px:
   the bar is where a team checks it is on its own page. */
.topbar .team-badge { white-space: normal; line-height: 1.15; }
.team-badge img { width: 26px; height: 26px; flex: none; }
.hero-badge {
  float: right; width: 112px; height: 112px; margin: -6px -6px 6px 12px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}
.finale-badge { display: block; width: 120px; height: 120px; margin: 0 auto 10px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); }
b.target { color: var(--brand-purple-deep); background: var(--brand-purple-soft); padding: 1px 7px; border-radius: 6px; letter-spacing: .02em; }
.hub a.teamrow img { width: 40px; height: 40px; flex: none; }
/* The team name and the logo share one bar; on a phone the name wins. */
@media (max-width: 440px) {
  .tb-logo span { display: none; }
  .hero-badge { width: 88px; height: 88px; }
}
