/* ============================================================
   WikiRace — visual identity
   ------------------------------------------------------------
   Concept: a stopwatch UI wrapped around an authentic encyclopedia.
   The game shell (header, cards, win screens) gets its own racing
   identity — ink navy + signal amber, a condensed sporty display face.
   The article view itself stays true to Wikipedia's own quiet serif
   styling, so the contrast between "game" and "encyclopedia" is the
   whole point: you feel the clock ticking against something calm.
   ============================================================ */

:root {
  /* Game-shell palette */
  --ink:        #13233D;   /* deep navy — shell background, headers */
  --ink-2:      #1C3257;   /* lighter navy panel */
  --paper:      #F7F5EF;   /* warm off-white — start/win card bg */
  --paper-2:    #FFFFFF;
  --signal:     #E8590C;   /* amber-orange — timer, primary CTA, urgency */
  --signal-dim: #C44C0A;
  --go:         #2E8B57;   /* sea green — success accents */
  --line:       #DFD9C9;   /* hairline on paper */
  --line-dark:  rgba(255,255,255,0.14);
  --ink-soft:   #56627A;   /* secondary text on paper */
  --paper-soft: #AEB9CF;   /* secondary text on navy */

  /* Wikipedia-native palette (article view only) */
  --wiki-bg:    #FFFFFF;
  --wiki-text:  #202122;
  --wiki-link:  #0645AD;
  --wiki-link-visited: #0b0080;
  --wiki-border:#A2A9B1;
  --wiki-muted: #54595D;

  --display-font: "Oswald", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body-font: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --wiki-font: "Linux Libertine", Georgia, "Times New Roman", serif;
  --mono-font: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

@font-face {
  font-family: "Oswald";
  src: local("Oswald");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--wiki-text);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ============================================================
   RACE BAR (sticky header)
   ============================================================ */

.racebar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  border-bottom: 1px solid var(--line-dark);
}

.racebar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
}

.brand-mark {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--paper);
}
.brand-mark-accent { color: var(--signal); }

.brand-name {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-soft);
  display: none;
}
@media (min-width: 480px) {
  .brand-name { display: inline; }
}

.howto-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--paper-soft);
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.howto-btn:hover {
  color: var(--signal);
  border-color: var(--signal);
}

.race-status {
  display: flex;
  align-items: center;
  gap: 16px;
}
.race-status[hidden] { display: none; }

.clock {
  font-family: var(--mono-font);
  font-weight: 600;
  font-size: 22px;
  color: var(--signal);
  letter-spacing: 0.02em;
  min-width: 96px;
  text-align: right;
}

.click-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  color: var(--paper);
}
.click-count-num {
  font-family: var(--display-font);
  font-size: 18px;
  font-weight: 600;
}
.click-count-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-soft);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-dark);
  color: var(--paper-soft);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.btn-ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
}

/* Trail of visited pages, builds under the race bar during play */
.trail {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px 12px;
  flex-wrap: wrap;
}
.trail[hidden] { display: none; }
.trail-item {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--paper-soft);
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trail-item.current {
  color: var(--ink);
  background: var(--signal);
  border-color: var(--signal);
  font-weight: 600;
}
.trail-sep {
  color: var(--paper-soft);
  opacity: 0.5;
  font-size: 11px;
}

/* ============================================================
   SCREENS — shared
   ============================================================ */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* The .screen class's display:flex above otherwise wins the cascade over
   the browser's built-in [hidden] rule, since author styles beat the UA
   stylesheet regardless of selector type. Without this, hidden screens
   still render at full height and stack on the page. */
.screen[hidden] {
  display: none;
}

/* ============================================================
   START SCREEN
   ============================================================ */

.screen-start {
  align-items: center;
  justify-content: center;
  padding: 40px 20px 64px;
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(232,89,12,0.10), transparent 60%),
    var(--ink);
}

.start-card {
  max-width: 620px;
  width: 100%;
  text-align: center;
}

/* ---------- Mode toggle (Daily / Practice) ---------- */

.mode-toggle {
  display: inline-flex;
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 2px;
}
.mode-btn {
  background: transparent;
  border: none;
  color: var(--paper-soft);
  font-family: var(--display-font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 18px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.mode-btn-active {
  background: var(--signal);
  color: #1A0A00;
  font-weight: 600;
}
.mode-btn:not(.mode-btn-active):hover {
  color: var(--paper);
}

/* ---------- Hard mode toggle (practice only) ---------- */

.hard-mode-toggle {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 24px;
  cursor: pointer;
  user-select: none;
}
/* display:grid above otherwise wins the cascade over the browser's
   built-in [hidden] rule, since author styles beat the UA stylesheet
   regardless of selector type — same issue fixed for .screen earlier. */
.hard-mode-toggle[hidden] {
  display: none;
}

.hard-mode-label {
  font-family: var(--display-font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--paper);
}

.hard-mode-hint {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--paper-soft);
  max-width: 360px;
  text-align: center;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch-track {
  position: absolute;
  inset: 0;
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper-soft);
  transition: transform 0.18s cubic-bezier(0.3, 1.4, 0.5, 1), background 0.15s ease;
}
.switch input:checked ~ .switch-track {
  background: var(--signal);
  border-color: var(--signal);
}
.switch input:checked ~ .switch-track .switch-thumb {
  transform: translateX(18px);
  background: #1A0A00;
}
.switch input:focus-visible ~ .switch-track {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ---------- Archived-day banner ---------- */

.archived-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(232,89,12,0.12);
  border: 1px solid rgba(232,89,12,0.35);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--paper);
}
.archived-banner[hidden] { display: none; }
.archived-banner-link {
  color: var(--signal);
  text-decoration-color: rgba(232,89,12,0.4);
  white-space: nowrap;
}
.archived-banner-link:hover { color: #ff7a2e; }

/* ---------- Already-played panel ---------- */

.already-played {
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  padding: 28px 24px;
  margin-top: 8px;
}
.already-played-title {
  font-family: var(--display-font);
  font-size: 18px;
  font-weight: 600;
  color: var(--paper);
  margin: 0 0 20px;
}
.already-played-stats {
  margin-bottom: 24px;
  gap: 40px;
}

.eyebrow {
  font-family: var(--display-font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 18px;
}

.start-title {
  font-family: var(--display-font);
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 600;
  line-height: 1.18;
  color: var(--paper);
  margin: 0 0 16px;
  letter-spacing: 0.01em;
}
.hl-from { color: var(--paper-soft); }
.hl-to { color: var(--signal); }

.start-sub {
  font-size: 16px;
  color: var(--paper-soft);
  margin: 0 0 36px;
  line-height: 1.5;
}

.route-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.route-card {
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 200px;
  flex: 1;
  max-width: 260px;
  text-align: left;
}
.route-card-label {
  display: block;
  font-family: var(--display-font);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-soft);
  margin-bottom: 6px;
}
.route-card-from .route-card-label { color: var(--paper-soft); }
.route-card-to .route-card-label { color: var(--signal); }

.route-card-title {
  display: block;
  font-family: var(--display-font);
  font-size: 20px;
  font-weight: 600;
  color: var(--paper);
  line-height: 1.25;
}

.route-arrow {
  color: var(--signal);
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.route-arrow svg { width: 100%; height: 100%; }

.start-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.start-actions[hidden] { display: none; }

.btn-primary {
  background: var(--signal);
  color: #1A0A00;
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
  border: none;
  padding: 15px 38px;
  border-radius: 8px;
  box-shadow: 0 4px 0 var(--signal-dim), 0 8px 20px rgba(232,89,12,0.25);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--signal-dim), 0 4px 10px rgba(232,89,12,0.2);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--paper-soft);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--line-dark);
  padding: 6px;
}
.btn-text:hover { color: var(--paper); }

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  color: var(--paper);
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  padding: 11px 20px;
  border-radius: 8px;
  transition: border-color 0.15s ease, transform 0.08s ease;
}
.btn-share:hover {
  border-color: var(--go);
  color: var(--go);
}
.btn-share:active { transform: translateY(1px); }
.btn-share svg { flex-shrink: 0; }
.btn-share.copied {
  border-color: var(--go);
  color: var(--go);
  background: rgba(46,139,87,0.12);
}

/* Secondary share action (path sharing) — visually quieter than the
   primary "Share results" button so it doesn't compete with it, but
   still clearly a real action. */
.btn-share-secondary {
  background: transparent;
  border-color: transparent;
  color: var(--paper-soft);
  font-size: 13px;
  padding: 9px 16px;
}
.btn-share-secondary:hover {
  color: var(--paper);
  border-color: var(--line-dark);
}
.btn-share-secondary.copied {
  color: var(--go);
  border-color: var(--go);
  background: rgba(46,139,87,0.1);
}

.start-footnote {
  margin-top: 32px;
  font-size: 12px;
  color: var(--paper-soft);
  opacity: 0.7;
}

/* ============================================================
   LOADING BAR
   ============================================================ */

.loading-bar {
  height: 3px;
  background: var(--ink-2);
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%;
  width: 40%;
  background: var(--signal);
  animation: loadingSlide 1s ease-in-out infinite;
}
@keyframes loadingSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ============================================================
   GAME SCREEN
   ============================================================ */

.screen-game {
  background: var(--wiki-bg);
}

/* Destination reminder — lives inside the sticky .racebar header (see
   index.html), so it scrolls with the header as one unit and is always
   visible during a race regardless of article scroll position or how
   long the trail below it grows. */
.destination-pill {
  max-width: 760px;
  margin: 0 auto;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body-font);
  font-size: 13px;
  text-align: center;
  padding: 9px 20px;
  border-top: 1px solid var(--line-dark);
}
.destination-pill strong {
  color: var(--signal);
  font-weight: 700;
}

/* ============================================================
   WIKI ARTICLE — intentionally faithful to Wikipedia itself
   ============================================================ */

.wiki-article {
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 24px 80px;
  font-family: var(--wiki-font);
  color: var(--wiki-text);
  font-size: 17px;
  line-height: 1.65;
}

.wiki-loading {
  font-family: var(--body-font);
  color: var(--wiki-muted);
  font-size: 15px;
  padding: 60px 0;
  text-align: center;
}

.wiki-article h1.wiki-title {
  font-family: var(--wiki-font);
  font-size: 30px;
  font-weight: 400;
  border-bottom: 1px solid var(--wiki-border);
  padding-bottom: 8px;
  margin: 0 0 18px;
  color: var(--wiki-text);
}

.wiki-article h2, .wiki-article h3 {
  font-family: var(--wiki-font);
  font-weight: 400;
  border-bottom: 1px solid #eaecf0;
  padding-bottom: 4px;
  margin-top: 28px;
  color: var(--wiki-text);
}
.wiki-article h2 { font-size: 22px; }
.wiki-article h3 { font-size: 18px; border-bottom: none; }

.wiki-article p { margin: 0 0 16px; }

.wiki-article a {
  color: var(--wiki-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
}
.wiki-article a:hover {
  text-decoration: underline;
  background: #fff6d8;
}
.wiki-article a.wr-visited-link {
  color: var(--wiki-link-visited);
}
.wiki-article a.wr-disabled-link {
  color: var(--wiki-muted);
  cursor: not-allowed;
  text-decoration: none;
}
.wiki-article a.wr-disabled-link:hover { background: transparent; }

.wiki-article img { max-width: 100%; height: auto; }

.wiki-article table {
  font-size: 14px;
  margin: 0 0 16px;
  border-collapse: collapse;
}
.wiki-article .infobox {
  float: right;
  margin: 0 0 16px 16px;
  max-width: 280px;
  font-size: 13px;
  border: 1px solid var(--wiki-border);
  background: #f8f9fa;
}
.wiki-article .infobox th, .wiki-article .infobox td {
  padding: 5px 8px;
  border-top: 1px solid #eaecf0;
}
@media (max-width: 600px) {
  .wiki-article .infobox { float: none; max-width: 100%; margin: 0 0 16px; }
}

.wiki-article .reference, .wiki-article sup.reference {
  font-size: 12px;
  vertical-align: super;
}
.wiki-article .mw-editsection,
.wiki-article .navbox,
.wiki-article .vertical-navbox,
.wiki-article .sistersitebox,
.wiki-article .metadata,
.wiki-article .ambox,
.wiki-article .hatnote,
.wiki-article style,
.wiki-article .noprint,
.wiki-article .mw-empty-elt,
.wiki-article .shortdescription {
  display: none !important;
}

/* ============================================================
   WIN / GAVE UP — modal overlays
   ------------------------------------------------------------
   These render as a fixed, full-viewport overlay so the result is
   impossible to miss regardless of scroll position when the race ends.
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 900px 500px at 50% 0%, rgba(46,139,87,0.18), transparent 60%),
    rgba(10, 17, 30, 0.92);
  animation: overlayFadeIn 0.25s ease;
}
.modal-overlay-muted {
  background:
    radial-gradient(ellipse 900px 500px at 50% 0%, rgba(174,185,207,0.08), transparent 60%),
    rgba(10, 17, 30, 0.92);
}
.modal-overlay[hidden] { display: none; }

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.modal-card {
  position: relative;
  z-index: 2;
  background: var(--ink);
  border: 1px solid var(--line-dark);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  animation: cardPopIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  margin: auto;
}

@keyframes cardPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- How it works ---------- */

.win-card.howto-card {
  max-width: 540px;
  text-align: left;
}
.howto-card .win-eyebrow,
.howto-card .howto-title {
  text-align: center;
}
.howto-title {
  font-size: clamp(22px, 4.5vw, 30px);
  margin-bottom: 28px;
}

.howto-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.howto-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.howto-step-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  color: var(--signal);
  display: flex;
  align-items: center;
  justify-content: center;
}
.howto-step-icon svg { width: 19px; height: 19px; }

.howto-step-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 4px;
}
.howto-step-text strong {
  font-family: var(--display-font);
  font-size: 15px;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: 0.01em;
}
.howto-step-text span {
  font-size: 13.5px;
  color: var(--paper-soft);
  line-height: 1.5;
}

/* ---------- Spoiler confirmation (before sharing click path) ---------- */

.spoiler-confirm-card {
  max-width: 460px;
  text-align: center;
}
.spoiler-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(232,89,12,0.14);
  border: 1px solid rgba(232,89,12,0.35);
  color: var(--signal);
  display: flex;
  align-items: center;
  justify-content: center;
}
.spoiler-confirm-title {
  font-size: clamp(20px, 4vw, 25px);
  margin-bottom: 14px;
}
.spoiler-confirm-sub {
  margin-bottom: 28px;
}

/* ---------- Manual copy fallback ---------- */

.manual-copy-card {
  max-width: 480px;
}
.manual-copy-title {
  font-size: clamp(20px, 4vw, 26px);
  margin-bottom: 20px;
}
.manual-copy-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  color: var(--paper);
  font-family: var(--mono-font);
  font-size: 13px;
  line-height: 1.5;
  padding: 14px;
  margin-bottom: 24px;
}
.manual-copy-textarea:focus {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay { animation: none; }
  .modal-card { animation: none; }
}

.win-card {
  max-width: 560px;
  width: 100%;
  text-align: center;
}

.win-eyebrow { color: var(--go); }

.win-title {
  font-family: var(--display-font);
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 600;
  color: var(--paper);
  margin: 0 0 32px;
}

.win-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 36px;
}
.win-stat {
  display: flex;
  flex-direction: column;
}
.win-stat-value {
  font-family: var(--mono-font);
  font-size: 36px;
  font-weight: 700;
  color: var(--signal);
}
.win-stat-label {
  font-family: var(--display-font);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-soft);
  margin-top: 4px;
}

.win-path-wrap {
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 36px;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
}
.win-path-label {
  font-family: var(--display-font);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-soft);
  margin: 0 0 12px;
}
.win-path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.win-path li {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--line-dark);
  padding: 5px 10px;
  border-radius: 6px;
}
.win-path li::after {
  content: "→";
  margin-left: 8px;
  color: var(--paper-soft);
}
.win-path li:last-child::after { content: ""; margin: 0; }
.win-path li:last-child {
  background: var(--go);
  border-color: var(--go);
  color: #06210F;
  font-weight: 600;
}

/* ============================================================
   TOAST
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-2);
  color: var(--paper);
  border: 1px solid var(--signal);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  max-width: 90vw;
  text-align: center;
}

/* ---------- Copy success banner (Worldle-style confirmation) ---------- */
/* A light, friendly success banner — distinct from the dark warning
   .toast above — confirming a clipboard copy. Anchored near the top of
   the viewport so it reads clearly above any open results modal. */

.copy-success-banner {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e9f8ee;
  border: 1px solid #b8e6c4;
  border-radius: 10px;
  padding: 14px 16px 14px 14px;
  max-width: min(420px, 90vw);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  animation: copyBannerIn 0.2s ease;
}
.copy-success-banner[hidden] { display: none; }

@keyframes copyBannerIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.copy-success-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--go);
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-success-text {
  flex: 1;
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 14.5px;
  color: #14532d;
}

.copy-success-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #5a8a6a;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.copy-success-close:hover {
  background: rgba(20,83,45,0.1);
  color: #14532d;
}

@media (prefers-reduced-motion: reduce) {
  .copy-success-banner { animation: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
  .route-preview { flex-direction: column; }
  .route-arrow { transform: rotate(90deg); width: 28px; height: 16px; }
  .win-stats { gap: 28px; }
  .clock { font-size: 18px; min-width: 80px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .loading-bar-fill { animation: none; }
  .btn-primary { transition: none; }
}

/* Visible keyboard focus throughout */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
