/* Run Dino Run single site stylesheet. Keep section order to preserve the existing cascade. */

/* ===== Homepage and game UI ===== */
/* ================================
   GLOBAL STYLES / VARIJABLE
   ================================ */

:root {
  /* Dino tema */
  --bg-page: #0f172a;
  --bg-page-soft: #020617;
  --bg-card: #020617;
  --bg-card-soft: #0b1220;
  --border-soft: rgba(148, 163, 184, 0.35);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --accent-2: #0ea5e9;
  --danger: #f97373;
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.7);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --transition-fast: 0.16s ease-out;
  --transition-med: 0.22s ease-out;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page-shell-max: 1040px;
  --page-shell-width: min(92%, var(--page-shell-max));

  /* Tema stranice */
  --bg-color:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.96), rgba(244, 249, 245, 0.9)),
    linear-gradient(180deg, #f1f6f2, #f7faf7);
  --text-color: #17231b;

  /* Shared navigation surface */
  --topbar-bg: rgba(250, 252, 250, 0.92);
  --topbar-border: rgba(33, 64, 42, 0.12);
  --topbar-text: #17231b;
  --accent-color: #159447;
}

/* Dark mode */
:root[data-theme="dark"] {
  --bg-color: #101812;
  --text-color: #eaf3eb;
  --accent-color: #52d477;
  --topbar-bg: rgba(16, 24, 18, 0.94);
  --topbar-border: rgba(148, 163, 184, 0.18);
  --topbar-text: #eaf3eb;
}

/* Global reset / osnovno */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: var(--font-main);
  background: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
}

/* da sadržaj ne ide ispod fiksne navigacije */
body {
  padding-top: 0;
}

.page-shell,
.chart-shell {
  width: var(--page-shell-width);
  max-width: var(--page-shell-max);
  margin-left: auto;
  margin-right: auto;
}

.chart-shell {
  margin-bottom: 40px;
}

/* Kbd tipka – za kontrole */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 7px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #f9fafb;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid #15803d;
  box-shadow:
    0 2px 0 #15803d,
    0 7px 20px rgba(22, 163, 74, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Ikone / utility */

.icon {
  -webkit-user-select: none;
  user-select: none;
  display: inline-block;
}

.icon-offline {
  content: -webkit-image-set(
    url(/assets/default_100_percent/100-error-offline.png) 1x,
    url(/assets/default_200_percent/200-error-offline.png) 2x
  );
  position: relative;
}

.medal {
  width: 32px;
  height: 32px;
}

.country-flag {
  
  
  display: inline-block;
  
  border-radius: 2px;
  
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.country-flag-fallback {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ================================
   GAME-FIRST ENTRY
   ================================ */





.sendmessage {
  position: absolute;
  z-index: 4;
  left: 50%;
  
  width: auto;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.start-game-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  
  border: 1px solid #15803d;
  
  color: #ffffff;
  background: linear-gradient(135deg, #16a34a, #0f766e);
  
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.start-game-button:hover,
.start-game-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

.start-hint {
  
  
  
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.start-hint kbd {
  padding: 2px 6px;
  font-size: 0.72rem;
  box-shadow: none;
}

.sendmessage.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
}

.offline .interstitial-wrapper {
  scroll-margin-top: 88px;
}

@media (max-width: 640px) {
  .sendmessage {
    bottom: 10px;
  }

  .start-game-button {
    min-height: 42px;
    padding: 9px 20px;
  }

  .start-hint {
    display: none;
  }
}

.home-seo-copy {
  
  
  background: #fff;
  
  
  
  
  
}
.home-seo-copy h2 { margin-bottom: 18px;   }

.home-seo-copy ul { margin-left: 20px; padding-left: 0; }
.home-seo-intro { margin: 0 auto 28px;  }
.home-seo-quick-links {
  display: flex;
  
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 26px;
}
.home-seo-quick-links a {
  
  border: 1px solid rgba(34, 197, 94, 0.24);
  
  
  background: #f0fdf4;
  
  font-weight: 800;
  text-decoration: none;
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.home-seo-quick-links a:hover,
.home-seo-quick-links a:focus-visible {
  transform: translateY(-1px);
  background: #dcfce7;
}
.home-seo-closing { margin-top: 35px; text-align: center; font-size: 18px; font-style: italic; }
[data-theme="dark"] .home-seo-copy { background: #121821; color: #edf2f7; box-shadow: 0 4px 20px rgba(0,0,0,.3); }
[data-theme="dark"] .home-seo-quick-links a { color: #bbf7d0; background: #123322; border-color: rgba(74, 222, 128, 0.32); }

@media (max-width: 640px) {
  .home-seo-copy { margin: 28px 10px; padding: 22px 18px; }
}

/* ================================
   OFFLINE PAGE LAYOUT / DINO
   ================================ */

.offline .interstitial-wrapper {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 auto;
  max-width: var(--page-shell-max);
  min-height: 190px;
  padding: 18px 20px 22px;
  width: 100%;
  position: relative;
}

/* Kontejner za dino canvas */

.offline .runner-container {
  height: 150px;
  max-width: 900px;
  overflow: hidden;
  position: absolute;
  top: 35px;
  width: 44px;
}

.offline .runner-canvas {
  height: 150px;
  max-width: 900px;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  top: 0;
  z-index: 2;
}

/* Overlay controller za kontrole tipkovnice */

.offline .controller {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.5), transparent 70%);
  height: 100vh;
  left: 0;
  position: absolute;
  top: 0;
  width: 100vw;
  z-index: 1;
}

#offline-resources {
  display: none;
}

/* ================================
   ARCADE MODE
   ================================ */

.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas {
  image-rendering: pixelated;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode #buttons,
.arcade-mode #main-content {
  opacity: 0;
  overflow: hidden;
}

.arcade-mode .interstitial-wrapper {
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode .runner-container {
  left: 0;
  right: 0;
  margin: auto;
  transform-origin: top center;
  transition: transform 250ms cubic-bezier(0.4, 0, 1, 1) 400ms;
  z-index: 2;
}

/* ================================
   LEADERBOARD NASLOVI
   ================================ */

#leaderboard-title,
#leaderboard-daily-title {
  
  
  
  
  
  
  
  
  opacity: 1;
}

.chart-section {
  width: 100%;
  margin: 34px auto 0;
}

.chart-section h2 {
  width: var(--page-shell-width);
  max-width: var(--page-shell-max);
  margin: 0 auto 10px;
}

.chart-shell {
  min-height: 320px;
  padding: 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  
}

.chart-shell canvas {
  display: block;
  width: 100% !important;
  max-height: 300px;
}

.chart-fallback {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.chart-fallback[hidden] {
  display: none;
}

/* Opcionalni podnaslov */


/* ================================
   ZAJEDNIČKI STIL ZA OBA LEADERBOARDA
   ================================ */

#leaderboard,
#leaderboard-daily {
  border-collapse: collapse;
  table-layout: fixed;
  width: var(--page-shell-width);
  max-width: var(--page-shell-max);
  margin: 10px auto 0;
  font-size: 14px;
  background: linear-gradient(145deg, #020617, #020617 40%, #020c1f 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(18px);
}

/* Header – gradient */

#leaderboard thead {
  background: linear-gradient(120deg, #0f766e, #14b8a6, #22c55e);
  color: #f9fafb;
}

#leaderboard-daily thead {
  background: linear-gradient(120deg, #4f46e5, #6366f1, #0ea5e9);
  color: #f9fafb;
}

#leaderboard th,
#leaderboard-daily th {
  padding: 11px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-bottom: 1px solid rgba(15, 23, 42, 0.4);
  opacity: 0.96;
}

/* Prvi stupac (#) – centriran */

#leaderboard th:first-child,
#leaderboard td:first-child,
#leaderboard-daily th:first-child,
#leaderboard-daily td:first-child {
  text-align: center;
  white-space: nowrap;
}

/* Tijelo tablice */

#leaderboard td,
#leaderboard-daily td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(30, 64, 175, 0.55);
  color: var(--text-main);
  font-size: 0.9rem;
}

/* Zebraste linije – malo svjetlije i jasnije */

#leaderboard tbody tr:nth-child(odd),
#leaderboard-daily tbody tr:nth-child(odd) {
  background: #020617;           /* tamniji */
}

#leaderboard tbody tr:nth-child(even),
#leaderboard-daily tbody tr:nth-child(even) {
  background: #0b1220;           /* mrvicu svjetliji */
}

/* Hover efekt – efektno, ali ne precrno */

#leaderboard tbody tr,
#leaderboard-daily tbody tr {
  transition:
    background var(--transition-med),
    transform var(--transition-fast),
    box-shadow var(--transition-med),
    border-color var(--transition-med);
  border-inline: 1px solid transparent;
}

#leaderboard tbody tr:hover,
#leaderboard-daily tbody tr:hover {
  background: radial-gradient(circle at left, rgba(56, 189, 248, 0.22), #020617);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.8);
  border-inline-color: rgba(56, 189, 248, 0.5);
}

/* Datumski stupac (4.) – malo svjetliji tekst */

#leaderboard td:nth-child(4),
#leaderboard-daily td:nth-child(4) {
  color: var(--text-muted);
  font-size: 13px;
}

/* 1., 2., 3. mjesto */

#leaderboard tbody tr:first-child td:first-child,
#leaderboard-daily tbody tr:first-child td:first-child {
  color: #facc15;
  font-weight: 700;
}

#leaderboard tbody tr:nth-child(2) td:first-child,
#leaderboard-daily tbody tr:nth-child(2) td:first-child {
  color: #e5e7eb;
  font-weight: 600;
}

#leaderboard tbody tr:nth-child(3) td:first-child,
#leaderboard-daily tbody tr:nth-child(3) td:first-child {
  color: #a3a3a3;
  font-weight: 600;
}

/* Tekst ograničenja */

#leaderboard td,
#leaderboard th,
#leaderboard-daily td,
#leaderboard-daily th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Širine stupaca */

#leaderboard th:nth-child(1),
#leaderboard td:nth-child(1),
#leaderboard-daily th:nth-child(1),
#leaderboard-daily td:nth-child(1) {
  width: 12%;
}

#leaderboard th:nth-child(2),
#leaderboard td:nth-child(2),
#leaderboard-daily th:nth-child(2),
#leaderboard-daily td:nth-child(2) {
  width: 44%;
}

#leaderboard th:nth-child(3),
#leaderboard td:nth-child(3),
#leaderboard-daily th:nth-child(3),
#leaderboard-daily td:nth-child(3) {
  width: 20%;
}

#leaderboard th:nth-child(4),
#leaderboard td:nth-child(4),
#leaderboard-daily th:nth-child(4),
#leaderboard-daily td:nth-child(4) {
  width: 24%;
}


/* ================================
   PAGINACIJA
   ================================ */

#pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px auto 48px;
  max-width: var(--page-shell-max);
}

#pagination button {
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: radial-gradient(circle at top, #020617, #020c1f);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    background var(--transition-med),
    color var(--transition-med),
    box-shadow var(--transition-med),
    transform var(--transition-fast),
    border-color var(--transition-med);
}

#pagination button:hover:not(:disabled) {
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.22), #020617);
  border-color: var(--accent-2);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.9);
  transform: translateY(-1px);
}

#pagination button.active {
  background: linear-gradient(120deg, #22c55e, #14b8a6, #0ea5e9);
  
  
  
  font-weight: 700;
}

#pagination button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* ================================
   RESPONSIVE – MOBITELI
   ================================ */

@media (max-width: 640px) {
  #leaderboard,
  #leaderboard-daily {
    font-size: 13px;
    margin: 12px auto 0;
    border-radius: 14px;
  }

  #leaderboard th,
  #leaderboard td,
  #leaderboard-daily th,
  #leaderboard-daily td {
    padding: 8px 8px;
  }

  #leaderboard-title,
#leaderboard-daily-title {
    font-size: 0.9rem;
    margin-top: 22px;
  }

  #pagination {
    gap: 4px;
  }

  #pagination button {
    padding: 5px 9px;
    font-size: 11px;
  }
}

/* Ostali media query-jevi */

@media (max-width: 420px) {
  
  .snackbar {
    left: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
  }
}

@media (max-height: 350px) {
  h1 {
    margin: 0 0 15px;
  }
  .icon-offline {
    margin: 0 0 10px;
  }
  .interstitial-wrapper {
    margin-top: 5%;
  }
  
}

@media (min-width: 600px) and (max-width: 736px) and (orientation: landscape) {
  .offline .interstitial-wrapper {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (min-width: 420px) and (max-width: 736px) and (min-height: 240px) and (max-height: 420px) and (orientation: landscape) {
  .interstitial-wrapper {
    margin-bottom: 100px;
  }
}

@media (min-height: 240px) and (orientation: landscape) {
  .icon-offline {
    margin-bottom: 20px;
  }
}

@media (max-height: 320px) and (orientation: landscape) {
  .icon-offline {
    margin-bottom: 0;
  }
  .offline .runner-container {
    top: 10px;
  }
}

@media (max-width: 240px) {
  .interstitial-wrapper {
    overflow: inherit;
    padding: 0 8px;
  }
}

/* ================================
   DINO INFO SEKCIJA / AKORDEON
   ================================ */



/* NASLOV – taman, čitljiv na light pozadini */







/* Akordeon – malo posvijetljen dark */





















/* Sadržaj panela */











/* Responsive za info sekciju */

@media (max-width: 600px) {
  
  
  
  
}

/* ================================
   CONTENT SECTION (SEO TEKST)
   ================================ */









.seo-articles {
  display: flex;
  justify-content: center;
  
}







/* GRID – automatski broj stupaca, unutar max 900px wrappera */
.seo-articles-grid {
  display: grid;
  
  
}

.seo-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  
  
  background: #ffffff;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  transition: 0.15s ease;
}

.seo-card-body h3 {
  margin: 0 0 0.4rem;
  
}



.seo-card:hover {
  transform: translateY(-3px);
  
  
  background: #f9fafb;
}

@media (max-width: 640px) {
  
}

/* Minimal visible FAQ section for matching FAQ schema */
.homepage-faq {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.homepage-faq-inner {
  width: 100%;
  max-width: var(--page-shell-max);
  margin: 0 auto;
}

.homepage-faq h2 {
  font-size: 1.6rem;
  margin: 0 0 1rem;
  color: #0f172a;
}

.homepage-faq details {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  
  
  margin-bottom: 0.75rem;
}

.homepage-faq summary {
  cursor: pointer;
  font-weight: 600;
  
}

.homepage-faq p {
  margin: 0.65rem 0 0;
  color: #6b7280;
  line-height: 1.6;
}

.homepage-faq-link {
  margin-top: 1.1rem !important;
  text-align: center;
}

.homepage-faq-link a {
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Keep secondary homepage sections readable when the game is in dark mode. */

:root[data-theme="dark"] .chart-shell {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(71, 85, 105, 0.72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .start-hint {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.9);
}






:root[data-theme="dark"] .homepage-faq h2 {
  color: #f8fafc;
}


:root[data-theme="dark"] .homepage-faq p {
  color: #cbd5e1;
}

:root[data-theme="dark"] .seo-card,
:root[data-theme="dark"] .homepage-faq details {
  color: #e5e7eb;
  background: #0f172a;
  border-color: #334155;
}

:root[data-theme="dark"] .seo-card-body h3,
:root[data-theme="dark"] .homepage-faq summary {
  color: #f8fafc;
}

:root[data-theme="dark"] .seo-card-body p {
  color: #cbd5e1;
}

:root[data-theme="dark"] .seo-card:hover {
  background: #162033;
  border-color: #4ade80;
}

/* Last saved run share card */
.last-saved-run-card {
  box-sizing: border-box;
  
  
  
  
  
  
  background:
    radial-gradient(circle at 12% 50%, rgba(34, 197, 94, 0.18), transparent 26%),
    linear-gradient(135deg, #111827 0%, #1f2937 58%, #273449 100%);
  border: 2px solid rgba(250, 204, 21, 0.45);
  
}

.last-run-header,
.last-run-body,
.last-run-actions {
  position: relative;
  z-index: 1;
}

.last-run-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  
}

.last-run-title {
  
  font-weight: 900;
  
  text-transform: uppercase;
  
}

.last-run-browser {
  
  
  
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(203, 213, 225, 0.25);
  
  font-weight: 800;
}

.last-run-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-width: 0;
}

.last-run-player {
  max-width: 520px;
  
  
  
  font-weight: 1000;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  
}

.last-run-rank {
  display: inline-block;
  
  
  
  
  background: rgba(15, 118, 110, 0.22);
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-weight: 900;
  text-transform: uppercase;
  
}

.last-run-side {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.last-run-country {
  
  
  
  overflow: hidden;
  border: 2px solid #facc15;
  background: rgba(255,255,255,0.06);
  
}

.last-run-country .country-flag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.last-run-score {
  
  
  
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.4), rgba(37, 99, 235, 0.32));
  border: 1px solid rgba(96, 165, 250, 0.5);
  
  font-weight: 1000;
  
  white-space: nowrap;
}

.last-run-actions {
  display: flex;
  
  flex-wrap: wrap;
  
  max-width: 520px;
}

.last-run-actions button,
.share-score-buttons button,
.share-score-play-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 0 rgba(0,0,0,0.18), 0 12px 26px rgba(0,0,0,0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.last-run-actions button:hover,
.share-score-buttons button:hover,
.share-score-play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 rgba(0,0,0,0.16), 0 16px 30px rgba(0,0,0,0.2);
}

.last-run-share-btn,
.share-score-primary {
  background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.last-run-facebook-btn,
.share-score-facebook {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* Standalone /share-score.php card */
.share-score-page {
  min-height: 100vh;
  background: radial-gradient(circle at top, #eef6ff 0%, #f8fafc 44%, #e5e7eb 100%);
}

.share-score-wrap {
  width: min(94%, 1180px);
  margin: 52px auto;
}

.share-score-card {
  padding: 30px;
  border-radius: 26px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 12% 50%, rgba(250, 204, 21, 0.18), transparent 28%),
    linear-gradient(135deg, #111827 0%, #1f2937 58%, #273449 100%);
  border: 3px solid rgba(250, 204, 21, 0.52);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255,255,255,0.08);
}

.share-score-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.share-score-card-title {
  color: #fef08a;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.share-score-card-pill {
  padding: 8px 16px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(203, 213, 225, 0.25);
  font-weight: 900;
}

.share-score-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.share-score-player {
  max-width: 680px;
  color: #ffffff;
  font-size: clamp(2.5rem, 8vw, 5.6rem);
  line-height: 0.92;
  font-weight: 1000;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}

.share-score-rank {
  display: inline-block;
  margin-top: 18px;
  padding: 9px 18px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(15, 118, 110, 0.22);
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.share-score-copy {
  max-width: 680px;
  margin: 18px 0 0;
  color: #dbeafe;
  font-size: 1.05rem;
}

.share-score-side {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.share-score-flag {
  width: 112px;
  height: 86px;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid #facc15;
  background: rgba(255,255,255,0.06);
}

.share-score-flag .country-flag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.share-score-points {
  padding: 12px 22px;
  border-radius: 16px;
  color: #ecfdf5;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.4), rgba(37, 99, 235, 0.32));
  border: 1px solid rgba(96, 165, 250, 0.5);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 1000;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.share-score-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.share-score-play-btn {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.share-score-card-error {
  text-align: center;
}

.share-score-card-error h1 {
  margin-top: 0;
  color: #fff;
}

@media (max-width: 980px) {
  .last-saved-run-card {
    width: min(92%, 980px);
    max-width: 980px;
    padding: 22px 24px;
  }

  .last-run-player {
    max-width: 460px;
  }

  .last-run-country {
    width: 78px;
    height: 58px;
  }

  .last-run-score {
    padding: 9px 16px;
  }
}

@media (max-width: 760px) {
  .last-saved-run-card,
  .share-score-card {
    padding: 22px;
  }

  .last-run-header,
  .last-run-body,
  .share-score-card-top,
  .share-score-card-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .last-run-side,
  .share-score-side {
    justify-items: start;
  }

  .last-run-actions,
  .share-score-buttons {
    flex-direction: column;
  }

  .last-run-actions button,
  .share-score-buttons button,
  .share-score-play-btn {
    width: 100%;
    text-align: center;
  }
}

/* Share score modal / hub */
body.share-score-modal-open {
  overflow: hidden;
}

.share-score-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.share-score-modal.is-open {
  display: flex;
}

.share-score-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(8px);
}

.share-score-modal-card {
  position: relative;
  z-index: 1;
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 34px;
  padding: clamp(26px, 4vw, 46px);
  border-radius: 28px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 82% 12%, rgba(250, 204, 21, 0.14), transparent 30%),
    radial-gradient(circle at 12% 72%, rgba(34, 197, 94, 0.13), transparent 28%),
    linear-gradient(135deg, #06101f 0%, #0c1325 55%, #111827 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.share-score-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.14);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.share-score-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px 18px;
  border-radius: 999px;
  color: #fef08a;
  background: rgba(113, 63, 18, 0.28);
  border: 1px solid rgba(250, 204, 21, 0.42);
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-score-modal-left h2 {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  line-height: 0.95;
  font-weight: 1000;
  letter-spacing: -0.045em;
}

.share-score-modal-left p {
  max-width: 640px;
  margin: 0 0 26px;
  color: #cbd5e1;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.share-score-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.share-score-modal-stats div {
  min-width: 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.share-score-modal-stats span {
  display: block;
  margin-bottom: 8px;
  color: #86efac;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.share-score-modal-stats strong {
  display: block;
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-score-modal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.share-score-modal-actions button {
  min-height: 62px;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  color: #fff;
  font-weight: 1000;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.18), 0 16px 30px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.share-score-modal-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 11px 0 rgba(0, 0, 0, 0.16), 0 20px 36px rgba(0, 0, 0, 0.2);
}

.share-facebook { background: linear-gradient(135deg, #22c55e, #16a34a); }
.share-x { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.share-whatsapp { background: linear-gradient(135deg, #15803d, #16a34a); }
.share-telegram { background: linear-gradient(135deg, #0284c7, #2563eb); }
.share-native { background: linear-gradient(135deg, #334155, #111827); }
.share-copy { background: linear-gradient(135deg, #9333ea, #7e22ce); }

.share-score-modal-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-preview-card {
  position: relative;
  width: min(100%, 430px);
  padding: 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 20%, rgba(250, 204, 21, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(31, 41, 55, 0.98), rgba(2, 6, 23, 0.98));
  border: 1px solid rgba(250, 204, 21, 0.38);
  box-shadow: 0 26px 55px rgba(0, 0, 0, 0.34);
}

.share-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.share-preview-trophy {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.42);
  font-size: 32px;
}

.share-preview-country {
  width: 84px;
  height: 58px;
  overflow: hidden;
  border-radius: 18px;
  border: 2px solid #facc15;
  background: #0f172a;
}

.share-preview-country .country-flag {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}

.share-preview-label {
  display: block;
  margin-bottom: 10px;
  color: #fde68a;
  font-weight: 1000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.share-preview-card strong {
  display: block;
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 3.3rem);
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-preview-score {
  margin-top: 18px;
  color: #ffffff;
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 1000;
  line-height: 0.95;
}

.share-preview-score small {
  color: #bbf7d0;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-preview-rank {
  display: inline-block;
  margin-top: 18px;
  padding: 9px 16px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(5, 150, 105, 0.22);
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-weight: 1000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.share-preview-open {
  display: inline-block;
  margin-top: 18px;
  color: #86efac;
  font-weight: 900;
  text-decoration: underline;
}

@media (max-width: 860px) {
  .share-score-modal-card {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .share-score-modal-stats,
  .share-score-modal-actions {
    grid-template-columns: 1fr;
  }
}

/* Country leaderboard / Country Battle */
.country-leaderboard-panel {
  
  
  
  
  
  color: #f8fafc;
  background:
    radial-gradient(circle at 12% 20%, rgba(250, 204, 21, 0.15), transparent 28%),
    radial-gradient(circle at 88% 76%, rgba(34, 197, 94, 0.16), transparent 30%),
    linear-gradient(135deg, #0b1220 0%, #111827 58%, #172033 100%);
  border: 2px solid rgba(250, 204, 21, 0.42);
  
}

.country-leaderboard-heading {
  display: grid;
  gap: 6px;
  text-align: center;
  
}

.country-leaderboard-kicker {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  
  border-radius: 999px;
  
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.38);
  
  font-weight: 1000;
  
  text-transform: uppercase;
}

.country-leaderboard-heading h2 {
  margin: 0;
  
  
  line-height: 1.05;
  font-weight: 1000;
  
  
  
}

.country-leaderboard-heading p {
  width: 100%;
  max-width: none;
  margin: 4px auto 0;
  
  font-size: 0.95rem;
  line-height: 1.55;
}

.country-leaderboard-list {
  display: grid;
  gap: 12px;
}

.country-leaderboard-card {
  display: grid;
  grid-template-columns: 54px 72px minmax(0, 1fr) minmax(120px, auto);
  grid-template-areas:
    "rank flag main score"
    "rank flag stats stats";
  align-items: center;
  gap: 10px 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.country-leaderboard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 212, 191, 0.42);
  background: rgba(15, 23, 42, 0.72);
}

.country-leaderboard-card.country-rank-1 {
  background:
    radial-gradient(circle at 10% 50%, rgba(250, 204, 21, 0.16), transparent 34%),
    rgba(2, 6, 23, 0.48);
  
}

.country-card-rank {
  grid-area: rank;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.32);
  font-weight: 1000;
}

.country-card-flag {
  grid-area: flag;
  width: 48px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: transparent;
  box-shadow: none;
}

.country-card-flag .country-flag {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

.country-card-main {
  grid-area: main;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.country-card-main strong {
  
  font-size: 1.08rem;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-card-main span,
.country-card-stats span,
.country-card-score span {
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 800;
}

.country-card-score {
  grid-area: score;
  justify-self: end;
  min-width: 132px;
  padding: 9px 14px;
  
  text-align: right;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.32), rgba(37, 99, 235, 0.28));
  border: 1px solid rgba(96, 165, 250, 0.38);
}

.country-card-score strong {
  display: block;
  
  font-size: 1.25rem;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0.04em;
}

.country-card-stats {
  grid-area: stats;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.country-card-stats span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.11);
  border: 1px solid rgba(148, 163, 184, 0.18);
  
  white-space: nowrap;
}

@media (max-width: 720px) {
  .country-leaderboard-panel {
    padding: 20px 16px;
  }

  .country-leaderboard-card {
    grid-template-columns: 42px 58px minmax(0, 1fr);
    grid-template-areas:
      "rank flag main"
      "score score score"
      "stats stats stats";
    gap: 10px;
  }

  .country-card-flag {
    width: 54px;
    height: 40px;
    border-radius: 12px;
  }

  .country-card-score {
    justify-self: stretch;
    min-width: 0;
    text-align: left;
  }

  .country-card-stats {
    justify-content: flex-start;
  }
}

/* Offline/PWA practice mode */
.offline-practice-banner {
  
  margin: 18px auto 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
  border-radius: 16px;
  border: 2px solid rgba(245, 158, 11, 0.75);
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(254, 215, 170, 0.92));
  color: #7c2d12;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.offline-practice-banner[hidden] {
  display: none !important;
}

.offline-practice-banner strong {
  color: #9a3412;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
}

.offline-practice-banner span {
  font-weight: 700;
}

.offline-leaderboard-row td {
  padding: 22px 16px !important;
  text-align: center !important;
  color: #7c2d12;
  background: rgba(255, 247, 237, 0.92);
}

.offline-data-card {
  width: 100%;
  padding: 22px 18px;
  border-radius: 18px;
  border: 2px dashed rgba(245, 158, 11, 0.75);
  background: rgba(255, 247, 237, 0.92);
  color: #7c2d12;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.offline-data-card strong,
.offline-data-card span {
  display: block;
}

.offline-data-card strong {
  margin-bottom: 6px;
  font-size: 1.05rem;
  font-weight: 900;
}

.offline-data-card span {
  font-weight: 700;
}

.is-offline-practice #pagination {
  display: none;
}

@media (max-width: 720px) {
  .offline-practice-banner {
    width: min(94%, 680px);
    margin-top: 12px;
    font-size: 0.88rem;
  }
}

/* Engagement / sharing upgrades */


.challenge-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(51, 65, 85, 0.94));
  color: #fff;
  
}
.challenge-banner p { margin: 4px 0 0; color: rgba(255,255,255,.82); }
.challenge-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.challenge-banner button {
  border: 0;
  
  padding: 11px 16px;
  font-weight: 900;
  cursor: pointer;
  background: #fff;
  
}

.gameover-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.gameover-stats-grid div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15,23,42,.06);
}
.gameover-stats-grid span {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  font-weight: 800;
}
.gameover-stats-grid strong { font-size: 1.2rem; }





.share-score-modal-actions .share-copy { background: #111827; color: #fff; }

/* Compact game-only view used inside the Daily Challenge page. */
body.daily-embed {
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
}

.daily-embed #offline-practice-banner,
.daily-embed .game-launch-header,
.daily-embed #site-main > * {
  display: none !important;
}

.daily-embed #site-main {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

.daily-embed #site-main > #main-frame-error {
  display: block !important;
  width: 100%;
  max-width: 100%;
  
  margin: 0;
  padding: 0 12px 12px;
  border: 0;
  box-shadow: none;
}

.daily-embed #main-frame-error .icon-offline {
  display: none;
}

/* Daily result/share dialogs are rendered by the parent page so they never
   become a tiny, scrollable popup inside the game iframe. */
.daily-embed #share-score-modal {
  display: none !important;
}

.challenge-page-wrap {
  width: min(92%, 920px);
  margin: 48px auto 70px;
}
.challenge-hero-card {
  overflow: hidden;
  border-radius: 30px;
  background: #fff;
  border: 1px solid rgba(148,163,184,.36);
  box-shadow: 0 22px 60px rgba(15,23,42,.14);
}
.challenge-hero-top {
  padding: 28px;
  background: linear-gradient(135deg, #111827, #334155);
  color: #fff;
}
.challenge-hero-top span {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  font-weight: 900;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.challenge-hero-top h1 { margin: 12px 0 8px; font-size: clamp(2rem, 5vw, 4rem); }
.challenge-hero-top p { margin: 0; color: rgba(255,255,255,.82); font-weight: 700; }
.challenge-score-target {
  padding: 30px;
  text-align: center;
}
.challenge-score-target strong {
  display: block;
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 1;
  color: #0f172a;
}
.challenge-score-target span { color: #64748b; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.challenge-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 30px 32px;
}
.challenge-actions a,
.challenge-actions button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.challenge-actions a { background: #111827; color: #fff; }
.challenge-actions button { background: #e2e8f0; color: #0f172a; }

@media (max-width: 720px) {
  .challenge-banner { align-items: flex-start; flex-direction: column; }
  .gameover-stats-grid { grid-template-columns: 1fr; }
}

/* Image sizing fixes */
img {
  max-width: 100%;
  height: auto;
}

#offline-resources-1x,
#offline-resources-2x {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}



/* Run Dino Run redesign: keep gameplay, rankings and guide pages on one scale. */
html, body { height: auto; min-height: 100%; }
body#t {
  min-height: 100vh;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
}
:where(#site-main) {
  width: min(1120px, 100%);
  margin: 0 auto;
  
}
.game-launch-header {
  width: var(--page-shell-width);
  max-width: var(--page-shell-max);
  margin: 22px auto 10px;
  text-align: center;
}
.game-launch-header h1 {
  margin: 0;
  color: var(--text-color);
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: -.045em;
}
.game-launch-subtitle {
  margin: 7px auto 0;
  color: var(--text-muted);
  font-size: .98rem;
  line-height: 1.5;
}
.offline #main-frame-error.interstitial-wrapper {
  width: 100%;
  max-width: var(--page-shell-max);
  min-height: 220px;
  margin: 12px auto 22px;
  padding: 22px 20px 26px;
  overflow: hidden;
  border: 1px solid rgba(39, 87, 51, .16);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,.97), rgba(241,248,242,.96));
  box-shadow: 0 14px 36px rgba(25, 55, 35, .09);
}
.sendmessage { bottom: 14px; }
.start-game-button {
  min-height: 42px;
  padding: 9px 20px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #159447, #16835c);
  box-shadow: 0 8px 18px rgba(21, 148, 71, .24);
  font-size: .96rem;
}
.start-game-button:hover, .start-game-button:focus-visible { transform: translateY(-1px); }
.start-hint { padding: 6px 10px; border: 1px solid rgba(23,35,27,.08); border-radius: 9px; color: #304137; background: rgba(255,255,255,.94); }
.challenge-banner {
  width: 100%;
  max-width: var(--page-shell-max);
  margin: 18px auto 22px;
}
.challenge-banner { border: 1px solid rgba(23,35,27,.12); border-radius: 16px; background: linear-gradient(135deg, #17291d, #244d30); box-shadow: 0 10px 26px rgba(25, 55, 35, .12); }
.challenge-banner button { min-height: 42px; border-radius: 11px; color: #fff; background: var(--accent-color); }
.last-saved-run-card {
  width: var(--page-shell-width);
  max-width: var(--page-shell-max);
  margin: 18px auto 26px;
  padding: 18px 20px;
  border: 1px solid rgba(39,87,51,.15);
  border-radius: 16px;
  background: #fff;
  color: #17231b;
  box-shadow: 0 8px 22px rgba(25,55,35,.06);
}
.last-run-header { margin-bottom: 12px; }
.last-run-title { color: #16743b; letter-spacing: .07em; text-shadow: none; }
.last-run-browser { padding: 5px 10px; border-color: #e0e9e1; border-radius: 9px; background: #f6f9f6; color: #5a6a5e; font-size: .78rem; }
.last-run-player { color: #17231b; font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1.1; text-shadow: none; }
.last-run-rank { margin-top: 8px; padding: 6px 10px; border-color: #d6ead9; border-radius: 9px; background: #eef8ef; color: #176b38; font-size: .75rem; letter-spacing: .05em; }
.last-run-country { width: 62px; height: 46px; border-color: #dce6de; border-radius: 10px; box-shadow: none; }
.last-run-score { padding: 8px 12px; border-color: #d6ead9; border-radius: 10px; background: #eef8ef; color: #176b38; font-size: clamp(1.25rem, 2.5vw, 1.8rem); letter-spacing: -.01em; }
.last-run-actions { gap: 8px; margin-top: 14px; }
.last-run-actions button { padding: 9px 13px; border-radius: 10px; box-shadow: none; font-size: .85rem; }
.last-run-actions button:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(0,0,0,.12); }
.chart-shell,
.offline-data-card { border-radius: 16px; }
#leaderboard-title,
#leaderboard-daily-title {
  width: var(--page-shell-width);
  max-width: var(--page-shell-max);
  margin: 28px auto 10px;
  color: var(--text-color);
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 850;
  letter-spacing: -.03em;
  text-align: left;
  text-transform: none;
}
#leaderboard, #leaderboard-daily {
  border: 1px solid var(--topbar-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(25,55,35,.07);
}
#leaderboard thead, #leaderboard-daily thead { background: linear-gradient(110deg, #16743b, #239b4e); }
#leaderboard td, #leaderboard-daily td { border-bottom: 1px solid #e5ece6; color: #233229; }
#leaderboard tbody tr:nth-child(odd), #leaderboard-daily tbody tr:nth-child(odd) { background: #fff; }
#leaderboard tbody tr:nth-child(even), #leaderboard-daily tbody tr:nth-child(even) { background: #f6f9f6; }
#leaderboard tbody tr:hover, #leaderboard-daily tbody tr:hover { background: #ecf8ee; box-shadow: none; }
#leaderboard td:nth-child(4), #leaderboard-daily td:nth-child(4) { color: #536257; }
#pagination { margin-bottom: 28px; }
#pagination button { border-color: #d6e1d8; background: #fff; color: #203126; box-shadow: none; }
#pagination button.active { border-color: var(--accent-color); background: var(--accent-color); color: #fff; box-shadow: none; }
.country-leaderboard-panel {
  width: var(--page-shell-width);
  max-width: var(--page-shell-max);
  margin: 26px auto 42px;
  padding: 20px;
  border: 1px solid rgba(39,87,51,.15);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(25,55,35,.07);
}
.country-leaderboard-heading { margin-bottom: 16px; }
.country-leaderboard-kicker { padding: 5px 11px; border-color: #d5ead9; background: #f1faf2; color: #16743b; font-size: .72rem; letter-spacing: .08em; }
.country-leaderboard-heading h2 { color: var(--text-color); font-size: clamp(1.25rem, 2.5vw, 1.6rem); letter-spacing: -.025em; text-shadow: none; text-transform: none; }
.country-leaderboard-heading p { color: var(--text-muted); }
.country-leaderboard-card, .country-leaderboard-card.country-rank-1 { border-color: #e1eae2; border-radius: 13px; background: #f7faf7; box-shadow: none; }
.country-leaderboard-card.country-rank-1 { border-color: #c9e8cf; background: #f1faf2; }
.country-card-rank { color: #176b38; background: #e8f5ea; border-color: #cfe6d3; }
.country-card-flag { border-color: #dce6de; border-radius: 10px; background: transparent; }
.country-card-main strong { color: #17231b; }
.country-card-main span, .country-card-stats span, .country-card-score span { color: #66756a; }
.country-card-score { border-color: #d6ead9; border-radius: 11px; background: #eef8ef; }
.country-card-score strong { color: #176b38; }
.country-card-stats span { border-color: #e1eae2; background: #fff; color: #536257; }
.chart-section { margin-top: 28px; }
.chart-shell { border-color: rgba(39,87,51,.15); background: #fff; box-shadow: 0 10px 26px rgba(25,55,35,.06); }
.home-seo-copy {
  width: var(--page-shell-width);
  max-width: var(--page-shell-max);
  margin: 30px auto;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(39,87,51,.14);
  border-radius: 18px;
  background: #fff;
  color: #26352b;
  box-shadow: 0 10px 26px rgba(25,55,35,.06);
  line-height: 1.68;
  font-size: 1rem;
}
.home-seo-copy h2 { margin: 0 0 .7rem; color: #17231b; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.03em; text-align: left; }
.home-seo-copy h3 { margin-top: 1.7rem; color: #24352a; font-size: 1.05rem; }
.home-seo-copy p,
.home-seo-copy li { color: #526157; }
.home-seo-intro { text-align: left; }
.home-seo-quick-links { justify-content: flex-start; margin-bottom: 1.3rem; }
.home-seo-quick-links a { padding: 7px 11px; border-color: #dbe9dd; border-radius: 9px; color: #176b38; background: #f3faf4; font-size: .84rem; }
.seo-articles { display: block; width: var(--page-shell-width); max-width: var(--page-shell-max); margin: 34px auto 28px; padding: 0; }




.seo-card {    border-radius: 14px; background: #fff;  }
.seo-card-body h3 {  font-size: 1rem; line-height: 1.35; }
.seo-card-body p {  line-height: 1.5; }
.seo-card:hover { transform: translateY(-2px); border-color: #a9d8b2; background: #fcfffc; box-shadow: 0 10px 22px rgba(25,55,35,.08); }
.homepage-faq { width: var(--page-shell-width); max-width: var(--page-shell-max); margin: 0 auto 28px; }
.homepage-faq-inner { padding: clamp(1.2rem, 3vw, 1.8rem); border: 1px solid rgba(39,87,51,.14); border-radius: 18px; background: #fff; box-shadow: 0 8px 22px rgba(25,55,35,.05); }
.homepage-faq-inner h2 { margin: 0 0 1rem; color: #17231b; font-size: 1.45rem; letter-spacing: -.025em; }
.homepage-faq details { margin: .65rem 0; padding: .82rem 1rem; border-color: #e0e9e1; border-radius: 11px; background: #f8faf8; color: #26352b; }
.homepage-faq summary { color: #1e3024; }
.homepage-faq details p { margin: .55rem 0 0; color: #59695e; }
.homepage-faq-link { margin-bottom: 0; }

:root[data-theme="dark"] .offline #main-frame-error.interstitial-wrapper { border-color: #344738; background: linear-gradient(160deg, #1b281e, #19241c); box-shadow: none; }
:root[data-theme="dark"] .last-saved-run-card,
:root[data-theme="dark"] #leaderboard,
:root[data-theme="dark"] .country-leaderboard-panel,
:root[data-theme="dark"] .chart-shell,
:root[data-theme="dark"] .home-seo-copy,
:root[data-theme="dark"] .seo-card,
:root[data-theme="dark"] .homepage-faq-inner { border-color: #344738; background: #19251c; color: #eaf3eb; box-shadow: none; }
:root[data-theme="dark"] .last-run-title,
:root[data-theme="dark"] .last-run-player,
:root[data-theme="dark"] .last-run-browser,
:root[data-theme="dark"] .last-run-rank,
:root[data-theme="dark"] .last-run-score,
:root[data-theme="dark"] .home-seo-copy h2,
:root[data-theme="dark"] .home-seo-copy h3,
:root[data-theme="dark"] .home-seo-copy p,
:root[data-theme="dark"] .home-seo-copy li,
:root[data-theme="dark"] .seo-card-body h3,
:root[data-theme="dark"] .seo-card-body p,
:root[data-theme="dark"] .homepage-faq-inner h2,
:root[data-theme="dark"] .homepage-faq summary,
:root[data-theme="dark"] .homepage-faq details p { color: #eaf3eb; }
:root[data-theme="dark"] #leaderboard td { border-color: #344738; color: #eaf3eb; }
:root[data-theme="dark"] #leaderboard tbody tr:nth-child(odd) { background: #19251c; }
:root[data-theme="dark"] #leaderboard tbody tr:nth-child(even) { background: #202e23; }
:root[data-theme="dark"] #leaderboard tbody tr:hover { background: #263a2b; }
:root[data-theme="dark"] .country-leaderboard-card,
:root[data-theme="dark"] .country-leaderboard-card.country-rank-1 { border-color: #344738; background: #202e23; }
:root[data-theme="dark"] .country-card-main strong,
:root[data-theme="dark"] .country-card-score strong { color: #eaf3eb; }
:root[data-theme="dark"] .country-card-main span,
:root[data-theme="dark"] .country-card-stats span,
:root[data-theme="dark"] .country-card-score span,
:root[data-theme="dark"] .country-leaderboard-heading p { color: #b6c5b9; }
:root[data-theme="dark"] .country-card-score,
:root[data-theme="dark"] .country-card-stats span,
:root[data-theme="dark"] .country-card-flag { border-color: #344738; background: #19251c; }
:root[data-theme="dark"] .homepage-faq details { border-color: #344738; background: #202e23; color: #eaf3eb; }
:root[data-theme="dark"] .home-seo-quick-links a { border-color: #344738; background: #202e23; color: #a4efb5; }
:root[data-theme="dark"] .last-run-browser { border-color: #344738; background: #202e23; }
:root[data-theme="dark"] .last-run-rank, :root[data-theme="dark"] .last-run-score { border-color: #344738; background: #203b28; }
.daily-embed #main-frame-error.interstitial-wrapper { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
@media (max-width: 720px) {
  :where(#site-main) { padding-right: .75rem; padding-left: .75rem; }
}
@media (max-width: 600px) {
  .game-launch-header { margin-top: 16px; }
  .game-launch-header h1 { font-size: 1.65rem; }
  .game-launch-subtitle { max-width: 30rem; font-size: .9rem; }
  .offline #main-frame-error.interstitial-wrapper { min-height: 204px; padding: 18px 10px 22px; border-radius: 16px; }
  #leaderboard-title,
#leaderboard-daily-title { font-size: 1.15rem; }
  #leaderboard th, #leaderboard td, #leaderboard-daily th, #leaderboard-daily td { padding: 8px 6px; font-size: .78rem; }
  #leaderboard th, #leaderboard-daily th { font-size: .65rem; letter-spacing: .05em; }
  .country-leaderboard-panel { padding: 14px; }
  .country-leaderboard-card { grid-template-columns: 38px 40px minmax(0,1fr); grid-template-areas: "rank flag main" "rank flag score" "rank stats stats"; gap: 8px; padding: 12px; }
  .country-card-flag { width: 40px; height: 28px; }
  .country-card-score { justify-self: stretch; min-width: 0; padding: 7px 9px; text-align: left; }
  .country-card-stats { justify-content: flex-start; }
  .home-seo-copy,
.seo-articles,
.homepage-faq { width: 100%; margin-top: 22px; }
  .seo-card { min-height: 0; }
}

/* ===== Content pages and shared article components ===== */
:root {
  color-scheme: light;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page-bg: #f1f6f2;
  --surface: #ffffff;
  --surface-soft: #f6f9f6;
  --text: #17231b;
  --muted: #5a6a5e;
  --border: #dce6de;
  --link: #11763c;
  --accent: #159447;
  --shadow: 0 12px 34px rgba(25, 55, 35, .08);
}

html.dark,
html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #101812;
  --surface: #19251c;
  --surface-soft: #202e23;
  --text: #eaf3eb;
  --muted: #b6c5b9;
  --border: #344738;
  --link: #83e7a0;
  --accent: #52d477;
  --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page-bg);
  
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  
}
a { color: var(--link); }
a:focus-visible, button:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }

.page {
  
  
  
  background: var(--surface);
  border: 1px solid var(--border);
  
  
}
.breadcrumb { margin: 0 0 1rem; color: var(--muted); font-size: .86rem; }
.breadcrumb a { text-decoration: none; }
h1 { margin: .2rem 0 .85rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin: 2rem 0 .55rem; font-size: clamp(1.3rem, 3vw, 1.55rem); line-height: 1.25; letter-spacing: -.015em; }
h3 { margin: 1.35rem 0 .35rem; font-size: 1.08rem; line-height: 1.35; }
p { margin: .6rem 0; }
ul, ol { padding-left: 1.3rem; }
li + li { margin-top: .35rem; }
code { padding: .12rem .35rem; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-soft); }


.answer-box, .tip-box, .cta-box, .related-guides, .article-callout, .tip-grid, .live-snapshot, .guide-group {
  margin: 1.45rem 0;
  padding: 1rem 1.1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  
}
.article-callout { border-left: 4px solid var(--accent); }
.answer-box > strong, .tip-box > strong, .cta-box > strong { display: block; margin-bottom: .3rem; }
.cta-button {
  display: inline-block;
  margin: .6rem .35rem 0 0;
  
  
  background: var(--text);
  
  font-weight: 750;
  text-decoration: none;
}
.related-guides h2, .guide-group h2 { margin-top: 0; }
.related-guides ul { columns: 2; gap: 2rem; }
.tip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.tip-card { padding: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tip-card h3 { margin-top: 0; }




details { margin: .75rem 0; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
summary { cursor: pointer; font-weight: 750; }

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin-top: 1rem; }
.guide-link { display: block;  color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.guide-link:hover {  transform: translateY(-1px); }
.guide-link strong { display: block; margin-bottom: .25rem; }
.guide-link span { color: var(--muted); font-size: .94rem; }

.live-snapshot h2 { margin-top: 0; }
.snapshot-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: .7rem; margin: 1rem 0; }
.snapshot-stat { padding: .75rem; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.snapshot-stat strong { display: block; font-size: 1.25rem; }
.snapshot-stat span { color: var(--muted); font-size: .84rem; }

.article-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.article-table th, .article-table td { padding: .65rem .55rem; border-bottom: 1px solid var(--border); text-align: left; }
.article-table th { color: var(--muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.country-flag { width: 22px; height: 16px; object-fit: cover; vertical-align: middle; }

@media (max-width: 650px) {
  .page { width: min(100% - 1rem, 920px); margin: .5rem auto 1rem; border-radius: 14px; }
  .guide-grid, .tip-grid { grid-template-columns: 1fr; }
  .related-guides ul { columns: 1; }
  
}

/* Shared Run Dino visual system: same spacing, surfaces and controls as the game. */
html { scroll-padding-top: 84px; }
body {
  background: radial-gradient(circle at 15% 0%, rgba(255,255,255,.9), transparent 34%), var(--page-bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.68;
}
.page {
  width: min(1040px, calc(100% - 2rem));
  max-width: 1040px;
  margin: 1.4rem auto 1rem;
  
  background: var(--surface);
  border: 1px solid var(--border);
  
  
}
.page > :is(.breadcrumb, h1, h2, h3, p, ul, ol, details, .article-callout, .answer-box, .tip-box, .cta-box, .related-guides) {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.page > .breadcrumb { margin-top: 0; margin-bottom: 1rem; }
.page > h1 { margin-top: .15rem; margin-bottom: .8rem; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -.04em; }
.page > h2 { margin-top: 2.25rem; font-size: clamp(1.25rem, 2.7vw, 1.55rem); letter-spacing: -.025em; }
.page > h3 { font-size: 1.08rem; }
.page > p, .page > ul, .page > ol { color: var(--text); }
.article-intro, .intro { color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.answer-box, .tip-box, .cta-box, .related-guides, .article-callout, .tip-grid, .live-snapshot, .guide-group {
  border-color: var(--border);
  border-radius: 15px;
  background: var(--surface-soft);
}
.answer-box, .tip-box, .cta-box, .article-callout { padding: 1.1rem 1.2rem; }
.guide-group { padding: 1.2rem; }
.guide-link, .tip-card, .snapshot-stat {
  border-color: var(--border);
  border-radius: 13px;
  background: var(--surface);
}
.guide-link { min-height: 116px; padding: 1rem 1.05rem; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.guide-link:hover { border-color: var(--accent); box-shadow: 0 8px 22px rgba(20, 70, 35, .08); }
.cta-button { padding: .7rem 1rem; border-radius: 10px; background: var(--accent);  transition: transform .16s ease, filter .16s ease; }
.cta-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.cookie-settings-panel {
  margin: 1.5rem 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border, #dce6de);
  border-radius: 14px;
  background: var(--surface-soft, #f6f9f6);
}
.cookie-settings-panel h2 { margin: 0 0 .45rem; font-size: 1.2rem; }
.cookie-settings-panel p { margin: 0 0 .85rem; color: var(--muted, #526257); line-height: 1.5; }
.cookie-settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .65rem 1rem;
  border: 1px solid var(--accent, #159447);
  border-radius: 10px;
  background: var(--accent, #159447);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.cookie-settings-button:hover { border-color: var(--accent-dark, #08743b); background: var(--accent-dark, #08743b); }
.cookie-settings-button:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }
html.dark .cookie-settings-panel, html[data-theme="dark"] .cookie-settings-panel { border-color: var(--border, #344738); background: var(--surface-soft, #202e23); }

.localized-page article > section { margin: 1.8rem 0; }
.localized-live-board { margin: 2rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
.localized-live-board h2 { margin-top: 0; }
.localized-live-board .leaderboard-scroll { margin-top: .85rem; }
html.dark .page { box-shadow: none; }
html.dark .guide-link:hover { box-shadow: 0 8px 22px rgba(0,0,0,.2); }
@media (max-width: 650px) {
  .page { width: calc(100% - 1rem); margin: .55rem auto 1rem; padding: 1.1rem .95rem 1.35rem; border-radius: 16px; }
  .page > :is(.breadcrumb, h1, h2, h3, p, ul, ol, details, .article-callout, .answer-box, .tip-box, .cta-box, .related-guides) { width: 100%; }
  .page > h1 { font-size: clamp(1.9rem, 8vw, 2.45rem); }
  .guide-group { padding: .9rem; }
}

/* ===== Daily challenge page ===== */
.daily-challenge-hero,
.daily-game-shell,
.daily-leaderboard-card,
.daily-how-it-works {
  margin: clamp(1rem, 2.2vw, 1.4rem) 0;
  padding: clamp(.8rem, 2.2vw, 1.3rem);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}
.daily-challenge-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 86%, #22c55e), var(--surface-soft));
}
.daily-challenge-status { display: grid; gap: .2rem; }
.daily-kicker {
  color: var(--accent);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.daily-challenge-status strong { font-size: 1.35rem; }
.daily-countdown, .daily-leaderboard-status { color: var(--muted); font-size: .9rem; }
.daily-challenge-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.daily-challenge-actions .cta-button { margin: 0; }
.daily-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .45rem .9rem; margin-bottom: .8rem; }
.daily-challenge-page .daily-section-heading h2, .daily-how-it-works h2 { margin: 0; }
.daily-game-shell, .daily-leaderboard-card { background: var(--surface); }
.daily-game-frame {
  display: block;
  width: 100%;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--play-track);
}
.daily-game-help { margin: .7rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.daily-game-help kbd { padding: .1rem .35rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-soft); color: var(--text); font-size: .8rem; box-shadow: none; }
.daily-leaderboard-table { margin-top: .4rem; }
.daily-leaderboard-table td, .daily-leaderboard-table th { white-space: nowrap; }
.daily-rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .75rem; margin-top: .75rem; }
.daily-rule-grid article { padding: .9rem; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.daily-rule-grid article strong { display: block; margin-bottom: .25rem; }
.daily-rule-grid article p { margin: 0; color: var(--muted); font-size: .92rem; }

@media (max-width: 700px) {
  .daily-challenge-hero { align-items: flex-start; flex-direction: column; }
  .daily-challenge-actions { justify-content: flex-start; }
}

@media (max-width: 440px) {
  .daily-challenge-actions { width: 100%; }
  .daily-challenge-actions .cta-button { flex: 1 1 auto; text-align: center; }
}

/* Localized content and the shared page shell */

.page > :is(.breadcrumb, h1) { width: 100%; max-width: none; }

.localized-page article { width: 100%; max-width: none; margin: 0 auto; }
.localized-page article > .article-intro,
.localized-page article > section:not(.localized-live-board),
.localized-page article > .related-guides { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
.localized-page article > h1 { width: 100%; max-width: none; }
.localized-page article > .localized-live-board { width: 100%; max-width: none; }

@media (max-width: 650px) {
  .page { width: calc(100% - 1.5rem); margin-top: .75rem; }
  .localized-page article > .localized-live-board { overflow: hidden; padding: .75rem; }
}

/* One shared content column for the homepage, articles and every localized page. */
:root {
  --page-shell-max: var(--site-content-max);
  --page-shell-width: min(100%, var(--site-content-max));
}

#site-main,
.page,
.challenge-page-wrap,
.share-score-wrap {
  box-sizing: border-box;
  width: min(var(--site-content-max), calc(100% - var(--site-desktop-gutter)));
  max-width: var(--site-content-max);
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
}

:where(#site-main) {
  padding: 0 0 2rem;
}

.challenge-page-wrap,
.share-score-wrap {
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

.page-shell,
.chart-shell,
#site-main > *,
.page > *,
.localized-page article,
.localized-page article > *,
.challenge-page-wrap > *,
.share-score-wrap > * {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
}

#site-main > *,
.page > *,
.localized-page article > * {
  margin-left: 0;
  margin-right: 0;
}

.page > :is(.breadcrumb, h1, h2, h3, p, ul, ol, details, .article-callout, .answer-box, .tip-box, .cta-box, .related-guides, .tip-grid, .keyword-grid, .live-snapshot, .guide-group, .article-intro, .intro),
.localized-page article > :is(.breadcrumb, h1, h2, h3, p, ul, ol, details, section, .article-callout, .answer-box, .tip-box, .cta-box, .related-guides, .article-intro, .intro) {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

#site-main :is(.game-launch-header, .challenge-banner, .last-saved-run-card, #leaderboard-title, #leaderboard, #pagination, .country-leaderboard-panel, .chart-section, .home-seo-copy, .seo-articles, .homepage-faq) {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
}

.offline-practice-banner {
  width: min(var(--site-content-max), calc(100% - var(--site-desktop-gutter)));
  max-width: var(--site-content-max);
  margin-left: auto;
  margin-right: auto;
}

.page-shell,
.chart-shell,
.leaderboard-scroll {
  margin-left: 0;
  margin-right: 0;
}

.leaderboard-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

#leaderboard,
#leaderboard-daily,
.article-table {
  width: 100%;
  max-width: 100%;
  min-width: 600px;
}

#leaderboard,
#leaderboard-daily {
  margin-left: 0;
  margin-right: 0;
}

#leaderboard-title,
#leaderboard-daily-title,
.chart-section h2 {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.tip-grid,
.guide-grid,
.snapshot-stats,
.daily-rule-grid {
  width: 100%;
  min-width: 0;
}

.tip-grid > *,
.guide-grid > *,
.snapshot-stats > *,
.daily-rule-grid > * {
  min-width: 0;
}

.share-score-card,
.challenge-hero-card {
  width: 100%;
  max-width: none;
  min-width: 0;
}

body.daily-embed #site-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 720px) {
  :root { --site-desktop-gutter: 24px; }
}

@media (max-width: 600px) {
  .share-score-card { padding: 18px; }
  .share-score-card-top { align-items: flex-start; }
}

@media (max-width: 420px) {
  #leaderboard,
  #leaderboard-daily,
  .article-table { min-width: 540px; }
}

@media (max-width: 720px) {
  :root { --site-desktop-gutter: 20px; }

  #site-main,
.page,
.challenge-page-wrap,
.share-score-wrap {
    width: calc(100% - 20px);
    max-width: 100%;
    min-width: 0;
  }

  :where(#site-main) { padding-right: 0; padding-left: 0; }
  #site-main > *, .page > *, .localized-page article > * { min-width: 0; }
  .page { margin-top: .8rem; }
  .page > h1 { font-size: clamp(1.9rem, 7.5vw, 2.65rem); line-height: 1.08; }
  .page > h2 { margin-top: 1.7rem; font-size: clamp(1.2rem, 5vw, 1.55rem); line-height: 1.2; }
  .page > h3 { line-height: 1.25; }
  .page p, .localized-page article p, .page li, .localized-page article li { overflow-wrap: anywhere; }

  .page-shell,
.chart-shell,
.leaderboard-scroll,
.chart-section,
.country-leaderboard-panel,
.home-seo-copy,
.seo-articles,
.homepage-faq { width: 100%; max-width: 100%; min-width: 0; }

  .game-launch-header { width: 100%; margin: 14px auto 8px; }
  .game-launch-header h1 { font-size: clamp(1.6rem, 7vw, 2rem); line-height: 1.1; }
  .game-launch-subtitle { max-width: 38rem; margin: .45rem auto 0; padding: 0 .25rem; font-size: .96rem; line-height: 1.5; }
  #main-frame-error.interstitial-wrapper { width: 100%; max-width: 100%; min-height: clamp(190px, 54vw, 250px); margin: .65rem auto .85rem; padding-inline: 8px; }
  .offline .runner-container { max-width: 100%; }
  .sendmessage { bottom: 10px; max-width: calc(100% - 16px); }
  .start-game-button { min-height: 46px; padding: 10px 20px; }

  .leaderboard-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  #leaderboard, #leaderboard-daily, .article-table { max-width: none; }
  #leaderboard th, #leaderboard td, #leaderboard-daily th, #leaderboard-daily td { padding: 9px 7px; }
  #pagination { gap: 6px; margin: 16px auto 28px; }
  #pagination button { min-width: 38px; min-height: 40px; padding: 8px 10px; font-size: .74rem; }
  .country-leaderboard-panel { margin: 20px auto 28px; padding: 14px; }
  .country-leaderboard-heading h2 { line-height: 1.2; }
  .country-leaderboard-card { grid-template-columns: 36px 44px minmax(0, 1fr); gap: 8px; padding: 11px; }
  .country-card-main, .country-card-stats, .country-card-score { min-width: 0; }
  .country-card-main span { overflow-wrap: anywhere; }

  .home-seo-copy,
.homepage-faq-inner { padding: 18px 16px; }
  .home-seo-copy h2,
.homepage-faq-inner h2 { font-size: clamp(1.25rem, 5.5vw, 1.6rem); line-height: 1.2; }
  .seo-articles { margin: 24px auto; }
  .guide-grid, .tip-grid { grid-template-columns: 1fr; }
  .seo-card { min-height: 0; }

  .share-score-modal { align-items: flex-start; padding: 10px; overflow-y: auto; }
  .share-score-modal-card { width: 100%; max-width: 100%; max-height: none; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 22px 14px 16px; border-radius: 18px; }
  .share-score-modal-left { min-width: 0; }
  .share-score-modal-left h2 { max-width: calc(100% - 28px); font-size: clamp(1.8rem, 8vw, 2.6rem); line-height: 1; }
  .share-score-modal-left p { margin-bottom: 16px; font-size: 1rem; }
  .share-score-modal-kicker { max-width: 100%; margin-bottom: 12px; padding: 8px 11px; font-size: .68rem; letter-spacing: .05em; }
  .share-score-modal-stats { gap: 7px; margin-bottom: 16px; }
  .share-score-modal-stats div { min-width: 0; padding: 10px 8px; }
  .share-score-modal-stats span { font-size: .62rem; letter-spacing: .06em; }
  .share-score-modal-stats strong { font-size: clamp(1rem, 4.5vw, 1.35rem); }
  .share-score-modal-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .share-score-modal-actions button { min-width: 0; min-height: 48px; padding: 10px 8px; font-size: .82rem; overflow-wrap: anywhere; }
  .share-score-modal-close { top: 10px; right: 10px; width: 38px; height: 38px; }
}

@media (max-width: 600px) {
  .last-saved-run-card, .share-score-card { width: 100%; padding: 16px; }
  
  
  input, select, textarea { max-width: 100%; font-size: 16px; }
}

@media (max-width: 420px) {
  .country-leaderboard-panel { padding: 12px; }
  .country-leaderboard-card { grid-template-columns: 32px 40px minmax(0, 1fr); gap: 7px; padding: 10px; }
  .country-card-flag { width: 36px; height: 26px; }
  .share-score-modal { padding: 7px; }
  .share-score-modal-card { padding: 20px 11px 13px; }
}

/* Share controls stay separate from game controls and remain easy to tap. */
.page-share {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(0, 1.7fr);
  align-items: center;
  gap: .75rem 1.25rem;
  width: min(var(--site-content-max, 1040px), calc(100% - 2rem));
  margin: 1.25rem auto;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border, #dce6de);
  border-radius: 16px;
  background: var(--surface, #fff);
  color: var(--text, #17231b);
  box-shadow: 0 8px 24px rgba(20, 50, 30, .06);
}
.page-share-copy { min-width: 0; color: inherit; background: transparent; }
.page-share-kicker { display: block; margin-bottom: .2rem; color: var(--accent, #159447); font-size: .72rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.page-share h2 { margin: 0; color: var(--text, #17231b); font-size: clamp(1.08rem, 2vw, 1.3rem); line-height: 1.2; }
.page-share-copy p { margin: .35rem 0 0; color: var(--muted, #5a6a5e); font-size: .9rem; line-height: 1.45; }
.page-share-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; min-width: 0; }
.page-share-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: .55rem .82rem;
  border: 1px solid var(--border, #dce6de);
  border-radius: 10px;
  background: var(--surface-soft, #f6f9f6);
  color: var(--text, #17231b) !important;
  font: inherit;
  font-size: .83rem;
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.page-share-button:hover { transform: translateY(-1px); border-color: var(--accent, #159447); background: var(--accent-soft, #edf5ee); }
.page-share-button:focus-visible, .cookie-consent-button:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }
.page-share-native, .page-share-copy-button { border-color: var(--accent, #159447); background: var(--accent, #159447); color: #fff !important; }
.page-share-native:hover, .page-share-copy-button:hover { background: var(--accent-dark, #08743b); color: #fff !important; }
.page-share-button[hidden] { display: none !important; }
.page-share-status { grid-column: 1 / -1; min-height: 0; margin: 0; color: var(--muted, #526257); font-size: .82rem; }

.cookie-consent {
  position: fixed;
  z-index: 3000;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  width: min(700px, calc(100% - 24px));
  margin-inline: auto;
  padding: 1.15rem 1.25rem 1.1rem;
  border: 1px solid var(--border, #dce6de);
  border-radius: 16px;
  background: var(--surface, #fff);
  color: var(--text, #17231b);
  box-shadow: 0 18px 52px rgba(12, 24, 16, .22);
}
.cookie-consent[hidden] { display: none !important; }
.cookie-consent h2 { margin: 0 0 .35rem; color: var(--text, #17231b); font-size: 1.12rem; line-height: 1.25; }
.cookie-consent > p { margin: .4rem 0; color: var(--muted, #5a6a5e); font-size: .9rem; line-height: 1.5; }
.cookie-consent-links { display: flex; gap: .75rem; font-size: .84rem !important; }
.cookie-consent a { color: var(--link, #11763c); font-weight: 700; }
.cookie-consent-state { min-height: 1.1em; font-size: .8rem !important; }
.cookie-consent-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .8rem; }
.cookie-consent-button { min-height: 46px; padding: .65rem .8rem; border: 1px solid var(--accent, #159447); border-radius: 10px; font: inherit; font-size: .9rem; font-weight: 800; cursor: pointer; }
.cookie-consent-accept { background: var(--accent, #159447); color: #fff; }
.cookie-consent-accept:hover { background: var(--accent-dark, #08743b); }
.cookie-consent-reject { background: var(--surface-soft, #f6f9f6); color: var(--text, #17231b); }
.cookie-consent-reject:hover { background: var(--accent-soft, #edf5ee); }
html.dark .page-share, html.dark .cookie-consent, html[data-theme="dark"] .page-share, html[data-theme="dark"] .cookie-consent { border-color: var(--border, #344738); background: var(--surface, #19251c); color: var(--text, #eaf3eb); box-shadow: 0 18px 52px rgba(0, 0, 0, .42); }
html.dark .page-share h2, html.dark .cookie-consent h2, html[data-theme="dark"] .page-share h2, html[data-theme="dark"] .cookie-consent h2 { color: var(--text, #eaf3eb); }
html.dark .page-share-button, html.dark .cookie-consent-reject, html[data-theme="dark"] .page-share-button, html[data-theme="dark"] .cookie-consent-reject { border-color: var(--border, #344738); background: var(--surface-soft, #202e23); color: var(--text, #eaf3eb) !important; }
html.dark .page-share-button:hover, html.dark .cookie-consent-reject:hover, html[data-theme="dark"] .page-share-button:hover, html[data-theme="dark"] .cookie-consent-reject:hover { border-color: var(--accent, #52d477); background: var(--accent-soft, #263b2c); }
html.dark .page-share-native, html.dark .page-share-copy-button, html[data-theme="dark"] .page-share-native, html[data-theme="dark"] .page-share-copy-button { border-color: var(--accent, #52d477); background: var(--accent, #52d477); color: #102116 !important; }

@media (max-width: 760px) {
  .page-share { grid-template-columns: 1fr; gap: .85rem; width: calc(100% - 20px); margin: 1rem auto; padding: 1rem; }
  .page-share-actions { justify-content: flex-start; gap: .45rem; }
  .page-share-button { flex: 1 1 auto; min-width: 92px; min-height: 46px; padding-inline: .65rem; }
  .page-share-status { grid-column: auto; margin: -.25rem 0 0; }
  .cookie-consent { width: calc(100% - 20px); padding: 1rem; }
}
@media (max-width: 420px) {
  .page-share-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-share-button { min-width: 0; width: 100%; }
  .cookie-consent-actions { grid-template-columns: 1fr; gap: .5rem; }
  .cookie-consent-button { min-height: 48px; }
}

/* Reading and game-control helpers */
.game-controls {
  width: var(--page-shell-width);
  margin: .75rem auto 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem 1.25rem;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
}
.game-controls > span { display: inline-flex; align-items: center; gap: .35rem; }
.game-controls kbd { box-shadow: none; text-transform: none; padding: .1rem .4rem; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text); font: inherit; }
.game-controls a { min-height: 36px; display: inline-flex; align-items: center; gap: .4rem; font-weight: 650; }
.game-controls .touch-control-hint { display: none; }
.daily-embed .game-controls { display: none; }
.article-contents { margin: 1.5rem 0 2rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.article-contents summary { cursor: pointer; font-weight: 700; color: var(--text); }
.article-contents ul { margin: .65rem 0 0; padding-left: 1.25rem; columns: 2; column-gap: 2rem; }
.article-contents li { break-inside: avoid; margin: .25rem 0; }
.article-contents a { display: inline-block; padding: .2rem 0; text-underline-offset: 3px; }
.page h2[id] { scroll-margin-top: 6.5rem; }
.skip-link { position: fixed; left: 1rem; top: .5rem; z-index: 10000; transform: translateY(-180%); padding: .65rem 1rem; background: var(--surface); color: var(--link); border: 2px solid currentColor; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
summary:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }
@media (pointer: coarse) {
  .game-controls > span:not(.touch-control-hint) { display: none; }
  .game-controls .touch-control-hint { display: inline-flex; }
}
@media (max-width: 600px) {
  .article-contents ul { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .start-game-button:hover,
.start-game-button:focus-visible { transform: none; }
}

.page .article-updated { color: var(--muted); font-size: .85rem; margin: .4rem 0 1rem; }

/* Link to the separate sword-runner mode. */
.swords-feature { width: var(--page-shell-width); margin: 1rem auto 1.4rem; display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; background: #18372e; color: #e7f6e7; border: 1px solid #426a51; border-radius: 15px; text-decoration: none; }
.swords-feature-icon { flex: 0 0 42px; font-size: 2.1rem; line-height: 1; color: #b6edc4; }
.swords-feature-copy { display: grid; gap: .15rem; }
.swords-feature-copy strong { color: #e7f6e7; font-size: 1rem; }
.swords-feature-copy > span { color: #b7cebe; font-size: .84rem; }
.swords-feature-cta { margin-left: auto; white-space: nowrap; color: #b8f7c9; font-size: .86rem; font-weight: 750; }
.swords-feature:hover { background: #21483a; }
.daily-embed .swords-feature { display: none; }
.page .swords-feature { width: 100%; }
@media (max-width: 600px) { .swords-feature { flex-wrap: wrap; padding: 1rem; gap: .7rem; } .swords-feature-copy { flex: 1; } .swords-feature-cta { width: 100%; margin-left: 0; padding-left: 3.3rem; } }

/* Portal layout and navigation */
:root {
  --site-content-max: 1080px;
  --site-desktop-gutter: 40px;
  --portal-bg: #f0f3ed;
  --portal-ink: #192b23;
  --portal-action: #176044;
  --portal-action-hover: #104c35;
  --portal-action-text: #fff;
  --portal-focus: #397b5f;
  --play-panel: #182f26;
  --play-panel-line: #365344;
  --play-panel-muted: #c4d5c9;
  --play-track: #f6f8f3;
  --play-button: #c9edaa;
}

html.dark,
html[data-theme="dark"] {
  --portal-bg: #111a16;
  --portal-ink: #edf5ee;
  --portal-action: #aee3b2;
  --portal-action-hover: #c9efcb;
  --portal-action-text: #13251b;
  --portal-focus: #b8e4b2;
  --play-panel: #1c3328;
  --play-panel-line: #415b4b;
  --play-panel-muted: #d1dfd3;
  --play-track: #1a2520;
}

html { scroll-padding-top: 76px; }
body, body#t {
  background: var(--portal-bg);
  color: var(--portal-ink);
  font-family: var(--font-main);
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] body#t,
html.dark body,
html.dark body#t { background: var(--portal-bg); }

a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 2px solid var(--portal-focus);
  outline-offset: 3px;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: clamp(.55rem, 2.2vw, 1.6rem);
  width: 100%;
  min-height: 66px;
  padding: 8px max(20px, calc((100% - var(--site-content-max)) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--portal-ink);
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.top-bar-left { flex: 0 0 auto; min-height: 44px; }
.game-logo { flex: 0 0 auto; width: 32px; height: 32px; object-fit: contain; }
.game-title { font-size: 1rem; letter-spacing: -.035em; white-space: nowrap; }
html.dark .game-logo, html[data-theme="dark"] .game-logo,
html.dark .site-footer-brand img, html[data-theme="dark"] .site-footer-brand img { filter: brightness(1.85); }

.top-nav {
  display: flex;
  align-items: center;
  gap: .2rem;
  margin-left: auto;
}

.top-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: .45rem .65rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.top-nav a:hover, .top-nav a:focus-visible { color: var(--portal-ink); background: var(--surface-soft); }
.top-nav a[aria-current="page"] { color: var(--portal-action); background: var(--surface-soft); box-shadow: inset 0 -2px var(--portal-action); }

.top-bar-tools { display: flex; align-items: center; gap: .4rem; }

.theme-toggle, .mobile-nav-toggle, .language-switcher summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 .55rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--portal-ink);
  font: inherit;
  cursor: pointer;
}

.theme-toggle:hover, .mobile-nav-toggle:hover, .language-switcher summary:hover,
.mobile-nav-toggle[aria-expanded="true"] { background: var(--surface-soft); }

.theme-icon { display: block; font-size: 1.25rem; line-height: 1; }
.theme-icon.sun,
html.dark .theme-icon.moon,
html[data-theme="dark"] .theme-icon.moon { display: none; }
html.dark .theme-icon.sun, html[data-theme="dark"] .theme-icon.sun { display: block; }

.language-switcher { position: relative; z-index: 1; margin: 0; padding: 0; border: 0; background: transparent; }
.language-switcher summary { gap: .3rem; font-size: .78rem; font-weight: 800; list-style: none; }
.language-switcher summary::-webkit-details-marker { display: none; }
.language-switcher img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
.language-caret { width: 5px; height: 5px; margin: -3px 1px 0 2px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.language-switcher[open] .language-caret { margin-top: 2px; transform: rotate(225deg); }
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: max-content;
  min-width: 170px;
  padding: .3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 30px #101b1730;
}

.language-menu a { display: flex; align-items: center; gap: .55rem; min-height: 42px; padding: .3rem .6rem; border-radius: 7px; color: var(--portal-ink); font-size: .86rem; text-decoration: none; }
.language-menu a:hover, .language-menu a[aria-current="true"] { color: var(--portal-action); background: var(--surface-soft); }

.mobile-nav-toggle { display: none; }
.mobile-nav-toggle[hidden] { display: none; }
.mobile-nav-icon { position: relative; display: block; width: 18px; height: 14px; }
.mobile-nav-icon::before, .mobile-nav-icon::after, .mobile-nav-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  content: "";
}
.mobile-nav-icon::before { top: 0; }
.mobile-nav-icon span { top: 6px; }
.mobile-nav-icon::after { top: 12px; }
.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon::before { top: 6px; transform: rotate(45deg); }
.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon::after { top: 6px; transform: rotate(-45deg); }
.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon span { visibility: hidden; }

@media (max-width: 1000px) {
  .top-bar { flex-wrap: wrap; gap: .4rem; min-height: 62px; padding: 8px 14px; }
  .top-bar-left { margin-right: auto; order: 1; }
  .top-bar-tools { order: 2; }
  .mobile-nav-toggle { display: inline-flex; order: 3; }
  .top-nav { flex: 1 0 100%; flex-wrap: wrap; order: 4; margin: 0; padding-top: .35rem; border-top: 1px solid var(--border); }
  .top-bar.mobile-nav-ready .top-nav { display: none; }
  .top-bar.mobile-nav-ready.is-mobile-menu-open .top-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-nav a { min-height: 44px; background: var(--surface-soft); }
}

@media (max-width: 420px) {
  .top-bar { padding-inline: 10px; }
  .game-title { font-size: .9rem; }
  .game-logo { width: 27px; height: 27px; }
  .top-bar-left { gap: .35rem; }
  .language-switcher summary { padding-inline: .4rem; }
}

/* Classic game and home shortcuts */
#site-main > .home-play-panel {
  margin-top: clamp(.9rem, 3.2vw, 2.35rem);
  padding: clamp(12px, 2.7vw, 26px);
  border: 1px solid var(--play-panel-line);
  border-radius: 20px;
  background: var(--play-panel);
}

.home-play-panel .game-launch-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  margin: 0 0 clamp(.9rem, 2vw, 1.35rem);
  text-align: left;
}

.home-play-panel .game-launch-header h1 {
  color: #f4fbef;
  font-size: clamp(1.55rem, 5vw, 3.35rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.052em;
  overflow-wrap: anywhere;
}

.home-play-panel .game-launch-subtitle {
  width: 100%;
  max-width: none;
  margin: .48rem 0 0;
  padding: 0;
  color: var(--play-panel-muted);
  font-size: clamp(.84rem, 2vw, 1.02rem);
  line-height: 1.45;
}
body.home-page .game-launch-subtitle { max-width: none; }

.home-dino-preview {
  display: block;
  width: clamp(43px, 8vw, 88px);
  height: auto;
  border-radius: 12px;
}

body.home-page #main-frame-error.interstitial-wrapper,
:root[data-theme="dark"] body.home-page #main-frame-error.interstitial-wrapper {
  width: 100%;
  min-height: 220px;
  margin: 0;
  padding: 10px max(8px, calc((100% - 900px) / 2));
  border: 1px solid var(--play-panel-line);
  border-radius: 13px;
  background: var(--play-track);
  box-shadow: none;
}

.home-play-panel .controller { background: transparent; }
.home-play-panel #main-frame-error:focus { outline: none; }
.home-play-panel #main-frame-error:focus-visible { outline: 2px solid var(--portal-focus); outline-offset: -3px; }
.home-play-panel .sendmessage { bottom: 12px; }
.home-play-panel .start-game-button {
  min-height: 46px;
  gap: .55rem;
  padding-inline: 1.2rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--play-button);
  color: #132b20;
  font-weight: 800;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 0 #84ad68;
}

.home-play-panel .start-game-button::before {
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left: 8px solid currentColor;
  border-right: 0;
  content: "";
}
.home-play-panel .start-game-button:hover { background: #d7f4c1; }
.home-play-panel .start-hint { border: 0; background: transparent; color: var(--muted); }
.home-play-panel .start-hint kbd { color: var(--portal-ink); background: var(--surface); border: 1px solid var(--border); }
.home-play-panel .game-controls { width: 100%; margin: .65rem 0 -.25rem; justify-content: flex-start; gap: .2rem 1.2rem; color: var(--play-panel-muted); }
.home-play-panel .game-controls a { margin-left: auto; color: #e5f4e6; }
.home-play-panel .game-controls a:focus-visible { outline-color: var(--play-button); }
.home-play-panel .game-controls kbd { background: #233e31; color: #eff8ed; border-color: var(--play-panel-line); }

.daily-mode:not(.daily-embed) .game-launch-header { text-align: left; }
.daily-mode:not(.daily-embed) .game-launch-subtitle { margin-left: 0; padding: 0; }

.home-duel-cta {
  display: grid;
  grid-template-columns: minmax(34px, 1fr) minmax(0, 2fr) minmax(34px, 1fr);
  align-items: center;
  gap: clamp(8px, 2vw, 18px);
  min-height: clamp(102px, 20vw, 128px);
  margin-top: clamp(10px, 2.3vw, 18px);
  padding: clamp(10px, 2.5vw, 20px) clamp(10px, 4.5vw, 40px);
  border: 1px solid #325a46;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 13% 126%, #365e44 0%, transparent 49%),
    radial-gradient(ellipse at 87% 126%, #365e44 0%, transparent 49%),
    #1b382c;
  color: #e2facb;
  text-decoration: none;
  transition: border-color .17s ease, background-color .17s ease;
}
:root[data-theme="dark"] .home-duel-cta { border-color: #557361; }
.home-duel-cta:is(:hover, :focus-visible) {
  border-color: var(--play-button);
  background-color: #244738;
}
.is-offline-practice .home-duel-cta { display: none; }
.home-duel-cta-dino {
  position: relative;
  display: grid;
  min-width: 0;
  padding-block: 5px;
  place-items: end center;
}
.home-duel-cta-dino::after {
  position: absolute;
  inset-inline: 0;
  bottom: 3px;
  height: 2px;
  background: repeating-linear-gradient(to right, currentColor 0 8px, transparent 8px 13px);
  opacity: .36;
  content: "";
}
.home-duel-cta-dino img {
  display: block;
  width: min(100%, clamp(30px, 10vw, 72px));
  height: auto;
  image-rendering: pixelated;
  transition: translate .17s ease;
}
.home-duel-cta-dino-right img { transform: scaleX(-1); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-duel-cta:hover .home-duel-cta-dino img { translate: 3px 0; }
  .home-duel-cta:hover .home-duel-cta-dino-right img { translate: -3px 0; }
}
.home-duel-cta-copy { min-width: 0; text-align: center; overflow-wrap: anywhere; }
.home-duel-cta-copy strong {
  display: block;
  color: #f4fbef;
  font-size: clamp(1rem, 3.9vw, 1.65rem);
  font-weight: 780;
  letter-spacing: -.037em;
  line-height: 1.12;
  text-wrap: balance;
}
.home-duel-cta-action {
  display: inline-block;
  margin-top: .42rem;
  color: var(--play-button);
  font-size: clamp(.73rem, 2.5vw, .92rem);
  font-weight: 680;
}
.home-duel-cta-action span { margin-inline-start: .25em; }
@media (max-width: 520px) {
  .home-duel-cta { grid-template-columns: minmax(27px, .48fr) minmax(0, 2fr) minmax(27px, .48fr); }
}
@media (prefers-reduced-motion: reduce) {
  .home-duel-cta, .home-duel-cta-dino img { transition: none; }
}

/* Sister game promotion — aligned in height with the duel CTA above it. */
.home-3d-cta {
  display: grid;
  grid-template-columns: clamp(108px, 15vw, 148px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(.35rem, 1vw, .75rem);
  min-width: 0;
  min-height: clamp(102px, 20vw, 128px);
  margin-top: clamp(10px, 1.6vw, 15px);
  padding-inline-end: clamp(12px, 2vw, 22px);
  overflow: hidden;
  position: relative;
  border: 1px solid #39789d;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 10% 105%, rgba(255, 164, 50, .21), transparent 42%),
    radial-gradient(ellipse at 87% -18%, rgba(44, 187, 253, .28), transparent 52%),
    linear-gradient(112deg, #123152, #1b4f73 61%, #123a5b);
  color: #f6fbff;
  text-decoration: none;
  box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 8px 24px rgba(6, 35, 59, .12);
  transition: border-color .2s ease, box-shadow .2s ease, translate .2s ease;
}
.home-3d-cta::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, #ffc56d, #53c8ff, #ffc56d);
  opacity: .62;
  pointer-events: none;
}
.home-3d-cta:is(:hover, :focus-visible) {
  border-color: #8cdbff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .2), 0 12px 26px rgba(6, 43, 78, .18);
  translate: 0 -2px;
}
.home-3d-cta:focus-visible { outline: 3px solid #49aafc; outline-offset: 3px; }
.is-offline-practice .home-3d-cta { display: none; }
.home-3d-cta-visual {
  display: grid;
  align-self: stretch;
  place-items: center;
  min-width: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.home-3d-cta-visual::before {
  position: absolute;
  content: "";
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(244, 162, 76, .9);
  filter: blur(24px);
  opacity: .22;
}
.home-3d-cta-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 60% center;
  transform: translateY(1px) scale(1);
  filter: drop-shadow(0 8px 10px rgba(0, 9, 18, .26));
  transition: transform .24s ease;
}
.home-3d-cta:is(:hover, :focus-visible) .home-3d-cta-visual img {
  transform: translateY(0) scale(1.025);
}
.home-3d-cta-copy {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: .22rem;
  min-width: 0;
  padding: clamp(10px, 2vw, 16px) 0;
}
.home-3d-cta-eyebrow {
  color: #94e6ff;
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .16em;
}
.home-3d-cta-eyebrow span { color: #ffd18b; }
.home-3d-cta-copy strong {
  display: block;
  color: #fff;
  font-size: clamp(1.08rem, 2.7vw, 1.6rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.home-3d-cta-description {
  color: #c8e8f5;
  font-size: clamp(.72rem, 1.45vw, .9rem);
  line-height: 1.28;
}
.home-3d-cta-action {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .2rem;
  min-height: 30px;
  padding: .24rem .68rem;
  border-radius: 999px;
  background: #ffcb75;
  color: #18334a;
  font-size: .8rem;
  font-weight: 850;
}
.home-3d-cta-action span { font-size: 1.06em; }
.home-3d-cta-decor {
  position: absolute;
  top: 50%;
  right: clamp(16px, 5vw, 56px);
  transform: translateY(-50%) rotate(-10deg);
  color: rgba(162, 228, 255, .09);
  font: 950 clamp(4rem, 10vw, 7rem)/1 var(--font-main);
  letter-spacing: -.1em;
  pointer-events: none;
  user-select: none;
}
@media (max-width: 560px) {
  .home-3d-cta {
    grid-template-columns: clamp(86px, 28vw, 116px) minmax(0, 1fr);
    min-height: clamp(96px, 28vw, 118px);
    padding-inline-end: .9rem;
  }
  .home-3d-cta-visual img {
    width: 100%;
    height: 100%;
    object-position: 84% center;
    transform: none;
  }
  .home-3d-cta:is(:hover, :focus-visible) .home-3d-cta-visual img { transform: scale(1.02); }
  .home-3d-cta-copy { gap: .18rem; padding: .62rem 0; }
  .home-3d-cta-copy strong { font-size: clamp(.98rem, 4.3vw, 1.22rem); }
  .home-3d-cta-description { font-size: .74rem; }
  .home-3d-cta-action { min-height: 28px; padding: .22rem .56rem; font-size: .74rem; }
  .home-3d-cta-eyebrow { font-size: .58rem; }
  .home-3d-cta-decor { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home-3d-cta, .home-3d-cta-visual img { transition: none; }
}

#site-main > .challenge-pick, #site-main > .home-competition { margin-top: clamp(1.5rem, 4vw, 2.45rem); }
body:not(.is-offline-practice) #site-main > .home-3d-cta + .challenge-pick { margin-top: clamp(1rem, 3vw, 1.65rem); }
.challenge-pick h2, .section-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--portal-ink);
  line-height: 1.18;
  letter-spacing: -.036em;
}

.challenge-pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: .7rem; margin-top: .7rem; }
.mode-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .7rem;
  padding: .95rem .85rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--portal-ink);
  text-decoration: none;
}

.mode-card:hover, .mode-card:focus-visible { border-color: var(--portal-action); }
.mode-card-icon, .best-player-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #e9f3e5;
  color: #1a5b3b;
  font-size: 1.1rem;
  line-height: 1;
}

.mode-card-swords .mode-card-icon { background: #e8eeed; color: #315951; }
.mode-card-duel .mode-card-icon { background: #eee7f5; color: #61497d; font-size: .86rem; font-weight: 800; }
.mode-card-duel { grid-template-columns: auto minmax(0, 1fr); }
.dino-2p-links { display: flex; flex-wrap: wrap; gap: .35rem .6rem; margin-top: .45rem; }
.dino-2p-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .3rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--portal-action);
  font-size: .87rem;
  font-weight: 700;
  text-decoration: none;
}
.dino-2p-links a:is(:hover, [aria-current="page"]) { border-color: var(--portal-action); background: var(--surface-soft); }
.duel-mode-links { margin-bottom: 1rem; }
.mode-card-monthly .mode-card-icon, .best-player-icon { background: #f5edda; color: #765219; }
.mode-card-copy strong { display: block; font-size: .97rem; line-height: 1.28; }
.mode-card-copy > span { display: block; margin-top: .25rem; color: var(--muted); font-size: .84rem; line-height: 1.43; }
.mode-card-arrow { color: var(--portal-action); font-weight: 750; line-height: 1.3; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .25rem .8rem; margin-bottom: .75rem; }
.section-heading a, .competition-link { color: var(--portal-action); font-size: .88rem; font-weight: 750; text-decoration: none; }
.section-heading a:hover, .competition-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.section-heading a { display: inline-flex; gap: .35rem; min-height: 34px; align-items: center; }
#site-main .section-heading #leaderboard-title { width: auto; margin: 0; font-size: clamp(1.25rem, 3vw, 1.75rem); }

/* Monthly rankings and player progress */
.competition-grid { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(225px, 1fr); align-items: start; gap: .85rem; }
.monthly-board, .competition-side { min-width: 0; }
.monthly-board {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.monthly-board .leaderboard-scroll:focus-visible { outline: 2px solid var(--portal-focus); outline-offset: -2px; }

.monthly-best-player-card {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.best-player-info { min-width: 0; }
.best-player-label, .monthly-countdown-label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.best-player-name { display: block; color: var(--portal-ink); font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.best-player-score { color: var(--portal-action); font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.best-player-country { line-height: 1; }
.best-player-country:empty { display: none; }

.monthly-board #leaderboard {
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
  backdrop-filter: none;
}

.monthly-board #leaderboard thead { background: var(--surface-soft); color: var(--muted); }
.monthly-board #leaderboard th { border-bottom: 1px solid var(--border); font-size: .73rem; letter-spacing: 0; text-transform: none; }
.monthly-board #leaderboard :is(th, td) { padding: .66rem .55rem; }
.monthly-board #leaderboard td { border-color: var(--border); color: var(--portal-ink); line-height: 1.3; }
.monthly-board #leaderboard td:nth-child(4), .monthly-board #leaderboard th:nth-child(4) { text-align: right; }
.monthly-board #leaderboard td:nth-child(4) { color: var(--portal-action); font-size: .88rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.monthly-board #leaderboard :is(th, td):nth-child(3) { text-align: center; }
.monthly-board #leaderboard tbody tr:nth-child(n) { background: var(--surface); transform: none; box-shadow: none; border-inline: 0; }
.monthly-board #leaderboard tbody tr:hover { background: var(--surface-soft); }
.monthly-board #leaderboard td[colspan] { padding: 1rem; white-space: normal; text-align: left; }
.monthly-board #leaderboard tbody tr:last-child td { border-bottom: 0; }
.monthly-board #leaderboard td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }

.monthly-board #pagination {
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: .55rem .75rem;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}
.monthly-board #pagination:empty { display: none; }
.monthly-board #pagination button, .monthly-board #pagination select {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--portal-ink);
  font: inherit;
}
.monthly-board #pagination button:not(:disabled):hover { border-color: var(--portal-action); box-shadow: none; transform: none; }
.monthly-board #pagination label { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .86rem; }
.monthly-board #pagination select { padding-inline: .38rem; font-size: 1rem; }

.competition-side { display: grid; gap: .65rem; }
.monthly-countdown, .player-progress-panel, .competition-link {
  padding: .8rem .95rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}
.monthly-countdown { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .15rem .5rem; }
.monthly-countdown strong { color: var(--portal-ink); font-size: .94rem; font-variant-numeric: tabular-nums; }
.player-progress-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem .8rem; }
.player-progress-panel h3, .progress-mission-card { grid-column: 1 / -1; }
.player-progress-panel h3 { margin: 0; font-size: .98rem; letter-spacing: -.016em; }
.player-progress-panel article { min-width: 0; }
.player-progress-panel article > * { display: block; }
.player-progress-panel article span, .player-progress-panel small { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.player-progress-panel strong { color: var(--portal-action); font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
.player-progress-panel .progress-mission-card { border-top: 1px solid var(--border); padding-top: .65rem; }
.player-progress-panel .progress-mission-card strong { font-size: .92rem; margin: .14rem 0; }
.competition-link { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.competition-link:hover { border-color: var(--portal-action); }

.home-page .chart-section, .more-home-guides {
  margin: 1rem 0 0;
  padding: .75rem .95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.home-page .chart-section summary, .more-home-guides summary { color: var(--portal-ink); font-size: .92rem; }
.chart-shell canvas[hidden] { display: none; }
.home-page .chart-section[open] .chart-shell { margin: .8rem 0 0; box-shadow: none; }
.more-home-guides[open] > .seo-articles-grid { margin-top: .75rem; }
.home-page .seo-articles { margin: clamp(1.7rem, 4vw, 2.65rem) 0; }
.seo-articles-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: .65rem; }
.seo-card { min-height: 0; padding: .85rem .95rem; border-color: var(--border); box-shadow: none; }
.seo-card:hover, :root[data-theme="dark"] .seo-card:hover { transform: none; border-color: var(--portal-action); box-shadow: none; }
.seo-card-body h3 { color: var(--portal-ink); }
.seo-card-body p { margin: .15rem 0 0; color: var(--muted); font-size: .84rem; }
.home-seo-copy .home-seo-intro { margin: 0 0 1rem; }

/* v8: all text uses the available content column, without nested 820px/74ch caps. */
.page > :is(.breadcrumb,h1,h2,h3,p,ul,ol,details,.article-callout,.answer-box,.tip-box,.cta-box,.related-guides),
.page > :is(.intro,.article-intro),
.localized-page article > :is(.intro,.article-intro,p,ul,ol),
.localized-page article > section:not(.localized-live-board) p,
.home-seo-copy :is(p,ul),
.home-seo-intro,
.article-intro,
.intro {
  width: 100%; max-width: none;
}
.page :is(img,video,iframe) { max-width: 100%; }
.page :is(p,li,h1,h2,h3), .home-seo-copy :is(p,li) { overflow-wrap: break-word; }
/* Responsive grid and readable long tables: no global horizontal scroll. */
.page, .home-play-panel, .home-seo-copy { min-width: 0; }
.page .leaderboard-scroll { max-width: 100%; overflow-x: auto; }



/* Guides, Daily Challenge, ranking pages and shared footer */
.page {
  margin-block: clamp(.8rem, 3.2vw, 2rem) 1.25rem;
  padding: clamp(1rem, 3.5vw, 2.2rem);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

.page :is(h1, h2, h3) { color: var(--portal-ink); }
.page > h1, .localized-page article > h1 { margin: .2rem 0 .55rem; font-size: clamp(1.75rem, 5vw, 3.1rem); font-weight: 800; line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; }

/* v23: practical, language-specific help; matches the existing page shell. */
.quality-guide-steps {
  width: 100%; max-width: none;
  min-width: 0; margin: 1.3rem 0;
  padding: clamp(.8rem, 2vw, 1.1rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}
.quality-guide-steps h2 {
  margin: 0 0 .7rem; font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--text);
}
.quality-guide-steps ol { padding-inline-start: 1.4rem; margin: 0; width: 100%; max-width: none; }
.quality-guide-steps li { margin: .45rem 0; line-height: 1.55; overflow-wrap: break-word; }
.quality-guide-steps li:last-child { margin-bottom: 0; }


.page .breadcrumb { color: var(--muted); font-size: .84rem; }
.page .breadcrumb a { text-underline-offset: 3px; }
.page .article-contents { margin: 1rem 0 1.45rem; }
.page .guide-group { background: var(--surface-soft); }
.page .guide-link { min-height: 0; }
.page .guide-link:hover { transform: none; box-shadow: none; }
@media (min-width: 900px) {
  .guides-page .guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.cta-button { background: var(--portal-action); color: var(--portal-action-text) !important; }
.cta-button:hover { background: var(--portal-action-hover); transform: none; filter: none; }
.daily-challenge-actions .daily-secondary-cta { border-color: var(--border); background: var(--surface); color: var(--portal-action) !important; }
.daily-challenge-actions .daily-secondary-cta:hover { border-color: var(--portal-action); }
.page.daily-challenge-page { margin-block-start: clamp(.9rem, 3vw, 2rem); padding: clamp(.9rem, 3.1vw, 2.25rem); }
.daily-challenge-page :is(#daily-game, #daily-leaderboard-title), .page h2[id] { scroll-margin-top: .5rem; }
body.daily-embed#t { background: var(--play-track); }
.daily-embed #site-main > #main-frame-error { min-height: 0; height: 100vh; }
.daily-embed .controller { background: transparent; }
.page .daily-localized-actions { margin: .25rem 0 1.25rem; }

.ranking-links { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin: .9rem 0 1rem; }
.ranking-links a { display: inline-flex; align-items: center; min-height: 42px; padding: .35rem .65rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); color: var(--portal-action); font-size: .84rem; font-weight: 700; text-decoration: none; }
.ranking-links a:hover { border-color: var(--portal-action); }

:is(.daily-leaderboard-card, .live-snapshot, .localized-live-board) .article-table {
  min-width: 0;
  table-layout: fixed;
}
:is(.daily-leaderboard-card, .live-snapshot, .localized-live-board) .article-table :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
:is(.daily-leaderboard-card, .live-snapshot, .localized-live-board) .article-table :is(th, td):first-child { width: 12%; }
:is(.daily-leaderboard-card, .live-snapshot, .localized-live-board) .article-table :is(th, td):nth-child(2) { width: 29%; }
.live-snapshot .country-ranking-table :is(th, td):nth-child(2) { width: 23%; }

.site-footer {
  width: min(var(--site-content-max), calc(100% - var(--site-desktop-gutter)));
  margin: .75rem auto 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
}
.site-footer-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem 1.75rem; padding: 1.4rem 0; }
.site-footer-brand .home-link { color: var(--portal-ink); font-size: 1rem; }
.site-footer-brand p { width: 100%; max-width: none; margin: .3rem 0 0; line-height: 1.45; }
.site-footer-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.site-footer-group { display: grid; align-content: start; }
.site-footer-group strong { color: var(--portal-ink); margin-bottom: .2rem; }
.site-footer-group a { display: flex; align-items: center; min-height: 32px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--portal-action); text-decoration: underline; text-underline-offset: 3px; }
.site-footer-legal { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: .45rem 1rem; padding-top: .8rem; border-top: 1px solid var(--border); font-size: .79rem; }
.site-footer-legal ul { display: flex; flex-wrap: wrap; gap: .25rem .8rem; padding: 0; margin: 0; list-style: none; }
.site-footer-legal li { margin: 0; }
.site-footer-legal a { display: flex; align-items: center; min-height: 30px; }

@media (max-width: 760px) {
  :root { --site-desktop-gutter: 24px; }
  .competition-grid { grid-template-columns: 1fr; }
  .mode-card { align-items: center; padding: .75rem; }
  .mode-card-copy > span { margin-top: .14rem; }
  .site-footer-main { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root { --site-desktop-gutter: 20px; }
  #site-main > .home-play-panel { border-radius: 15px; }
  body.home-page #main-frame-error.interstitial-wrapper,
  :root[data-theme="dark"] body.home-page #main-frame-error.interstitial-wrapper { min-height: 211px; }
  .home-play-panel .game-controls { gap: .2rem .65rem; font-size: .76rem; }
  .home-play-panel .game-controls a { min-height: 40px; }
  .monthly-board #leaderboard :is(th, td) { padding: .57rem .3rem; }
  .monthly-board #leaderboard :is(th, td):nth-child(3) { width: 20%; }
  .monthly-board #leaderboard :is(th, td):nth-child(4) { width: 24%; }
  .monthly-board #leaderboard :is(th, td):nth-child(2) { width: 44%; }
  .monthly-board #leaderboard th { white-space: normal; overflow-wrap: anywhere; }
  .monthly-board #leaderboard td:nth-child(4) { font-size: .8rem; }
  .monthly-best-player-card { padding-inline: .6rem; gap: .4rem; }
  .best-player-icon { width: 31px; height: 31px; }
  .best-player-score { font-size: .96rem; }
  .page { padding: .85rem; }
  .live-snapshot { padding: .65rem; }
  .article-table th, .article-table td { padding: .45rem .25rem; font-size: .76rem; }
  .article-table th { font-size: .7rem; letter-spacing: 0; text-transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-play-panel .start-game-button:hover, .home-play-panel .start-game-button:focus-visible { transform: none; }
}

.record-page .record-counter { max-width: 36rem; margin: .85rem 0 1.45rem; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.record-counter .article-table { min-width: 0; margin: 0; }
.record-counter caption { padding: .65rem; background: var(--surface-soft); color: var(--muted); font-size: .88rem; text-align: left; }
.record-counter :is(th, td) { padding: .55rem .65rem; overflow-wrap: anywhere; }
.record-counter tr:last-child td { border-bottom: 0; }
.record-counter code { font-variant-numeric: tabular-nums; }
.record-page .cta-box h2 { margin-top: 0; }
.record-secondary { display: inline-block; margin: .45rem .65rem .1rem 0; font-weight: 700; text-underline-offset: 3px; }

/* Daily iframe renders its own canvas: no 900px max width or side gutters. */
.daily-embed #main-frame-error .runner-container,
.daily-embed #main-frame-error .runner-canvas {
  max-width: none !important;
}
.daily-embed #main-frame-error {
  touch-action: none;
}
/* Minimal end-of-run dialog, shared by Monthly and Daily. */
body:is(.home-page, .daily-mode, .daily-embed) .swal2-container,
body.fullscreen-page .swal2-container { padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); }
body:is(.home-page, .daily-mode, .daily-embed) .swal2-popup,
body.fullscreen-page .swal2-popup {
  box-sizing: border-box;
  width: min(370px, 100%);
  max-height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: hidden;
  padding: 10px 12px 12px;
  border-radius: 15px;
  font-size: 14px;
  display: flex !important;
  flex-direction: column;
}
body:is(.home-page, .daily-mode, .daily-embed) .swal2-icon,
body.fullscreen-page .swal2-icon { width: 30px; height: 30px; margin: 1px auto 3px; transform: scale(.65); }
body:is(.home-page, .daily-mode, .daily-embed) .swal2-title,
body.fullscreen-page .swal2-title { margin: 0; padding: 0 2px; font-size: 1.15rem; line-height: 1.23; }
body:is(.home-page, .daily-mode, .daily-embed) .swal2-html-container,
body.fullscreen-page .swal2-html-container { min-height: 0; flex: 0 1 auto; overflow-y: auto; margin: 6px 1px 0; padding: 0 1px; font-size: .84rem; line-height: 1.3; overscroll-behavior: contain; }
body:is(.home-page, .daily-mode, .daily-embed) .swal2-html-container > p,
body.fullscreen-page .swal2-html-container > p { margin: 0 0 5px; }
body:is(.home-page, .daily-mode, .daily-embed) .swal2-actions,
body.fullscreen-page .swal2-actions { flex: 0 0 auto; display: flex !important; flex-wrap: wrap; gap: 6px; width: 100%; margin: 9px 0 0; padding: 0; }
body:is(.home-page, .daily-mode, .daily-embed) .swal2-actions button,
body.fullscreen-page .swal2-actions button { min-height: 39px; flex: 1 1 100px; margin: 0; padding: 6px 9px; font-size: .81rem; line-height: 1.15; }
body:is(.home-page, .daily-mode, .daily-embed) .swal2-input,
body.fullscreen-page .swal2-input { flex: 0 0 auto; box-sizing: border-box; width: calc(100% - 8px); margin: 10px 4px 0; height: 40px; font-size: 16px; }
body:is(.home-page, .daily-mode, .daily-embed) .swal2-close,
body.fullscreen-page .swal2-close { min-width: 30px; min-height: 30px; font-size: 26px; }
body:is(.home-page, .daily-mode, .daily-embed) .gameover-stats-grid,
body.fullscreen-page .gameover-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 7px; }
body:is(.home-page, .daily-mode, .daily-embed) .gameover-stats-grid div,
body.fullscreen-page .gameover-stats-grid div { padding: 7px 6px; border-radius: 9px; }
body:is(.home-page, .daily-mode, .daily-embed) .gameover-stats-grid span,
body.fullscreen-page .gameover-stats-grid span { font-size: .65rem; }
body:is(.home-page, .daily-mode, .daily-embed) .gameover-stats-grid strong,
body.fullscreen-page .gameover-stats-grid strong { font-size: 1.15rem; }
.gameover-brief { margin: 4px 0; font-size: .8rem; line-height: 1.25; overflow-wrap: anywhere; }
.gameover-details { margin: 6px 0 0; padding: 3px 7px; border: 1px solid #dae7df; border-radius: 8px; text-align: left; font-size: .75rem; }
.gameover-details summary { cursor: pointer; color: #355848; font-weight: 650; }
.gameover-details p { margin: 5px 0; }
/* Share panel also uses a compact single card on phones; keep its actions visible. */
@media (max-width: 680px), (max-height: 480px) {
  .share-score-modal { align-items: center; padding: 7px; overflow: hidden; }
  .share-score-modal-card { width: min(460px, 100%); max-width: 100%; max-height: calc(100dvh - 14px); padding: 15px 12px 12px; gap: 8px; border-radius: 13px; overflow: auto; grid-template-columns: minmax(0, 1fr); }
  .share-score-modal-kicker { margin-bottom: 5px; padding: 4px 8px; font-size: .6rem; }
  .share-score-modal-left h2 { margin: 0 32px 5px 0; font-size: 1.4rem; line-height: 1.12; }
  .share-score-modal-left p { margin: 0 0 6px; font-size: .8rem; }
  .share-score-modal-stats { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; margin-bottom: 6px; }
  .share-score-modal-stats div { padding: 6px 5px; }
  .share-score-modal-stats span { font-size: .59rem; }
  .share-score-modal-stats strong { font-size: .94rem; }
  .share-score-modal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .share-score-modal-actions button { min-height: 38px; padding: 6px 5px; font-size: .76rem; }
  .share-score-modal-close { width: 30px; height: 30px; top: 7px; right: 8px; font-size: 23px; }
  .share-score-modal-preview { display: none; }
}
@media (max-height: 480px) and (orientation: landscape) {
  body:is(.home-page, .daily-mode, .daily-embed) .swal2-popup,
  body.fullscreen-page .swal2-popup { width: min(460px, 100%); padding: 6px 10px 8px; }
  body:is(.home-page, .daily-mode, .daily-embed) .swal2-icon,
  body.fullscreen-page .swal2-icon { display: none; }
  body:is(.home-page, .daily-mode, .daily-embed) .swal2-title,
  body.fullscreen-page .swal2-title { font-size: 1rem; }
  body:is(.home-page, .daily-mode, .daily-embed) .gameover-stats-grid,
  body.fullscreen-page .gameover-stats-grid { margin-bottom: 4px; }
}

/* v13: one compact, data-driven Top 100 benchmark; readable without scrolling. */
.top100-goal {
  display: grid;
  grid-template-columns: 1fr;
  gap: .2rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .65rem .85rem;
  background: var(--surface);
  color: var(--portal-ink);
}
.top100-goal strong { font-size: .88rem; font-weight: 700; }
.top100-goal p { margin: 0; font-size: .78rem; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }

/* v13: 4 live leaderboard facts, not a fixed-width three-column card. */
@media (min-width: 700px) {
  .live-snapshot .snapshot-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 470px) and (max-width: 699px) {
  .live-snapshot .snapshot-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.live-snapshot .snapshot-stat { min-width: 0; overflow-wrap: anywhere; }

/* v13: no date/time column in any visible ranking. */
#leaderboard td:nth-child(4), #leaderboard-daily td:nth-child(4) {
  font-variant-numeric: tabular-nums;
}

/* v15 Country Battle — single responsive scorecard grid across all breakpoints. */
#country-leaderboard-list { gap: 8px; }
#country-leaderboard-list .country-leaderboard-card {
  display: grid;
  grid-template-columns: 40px 44px minmax(0, 1fr) minmax(88px, max-content);
  grid-template-areas: "rank flag main score" "rank flag stats stats";
  gap: 5px 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #dde8df;
  border-radius: 12px;
  background: #f8faf8;
  box-shadow: none;
  transition: background-color .16s ease, border-color .16s ease;
}
#country-leaderboard-list .country-leaderboard-card:hover {
  transform: none;
  border-color: #b6dac1;
  background: #f0f7f1;
}
#country-leaderboard-list .country-leaderboard-card.country-rank-1 {
  background: #f0f8f2;
  border-color: #b8dec3;
}
#country-leaderboard-list .country-card-rank {
  width: 34px;
  height: 34px;
  font-weight: 750;
  font-size: .84rem;
  background: #e9f5ec;
  border: 1px solid #d4e7d8;
  border-radius: 9px;
  color: #165c35;
}
#country-leaderboard-list .country-card-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 4px;
  overflow: visible;
  box-shadow: none;
}
#country-leaderboard-list .country-card-flag img {
  display: block;
  width: 40px;
  height: 30px;
  object-fit: cover;
  border: 1px solid rgba(31,48,36,.14);
  border-radius: 4px;
  box-shadow: none;
}
#country-leaderboard-list .country-card-main { gap: 3px; min-width: 0; }
#country-leaderboard-list .country-card-main strong {
  min-width: 0;
  font-size: .96rem;
  font-weight: 800;
  line-height: 1.25;
  color: #20342a;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
#country-leaderboard-list .country-card-code {
  display: inline;
  margin-left: .3em;
  font-size: .68rem;
  font-weight: 700;
  color: #688275;
}
#country-leaderboard-list .country-card-main span {
  font-size: .77rem;
  font-weight: 500;
  color: #64756a;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
#country-leaderboard-list .country-card-score {
  justify-self: end;
  min-width: 0;
  width: auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: right;
}
#country-leaderboard-list .country-card-score strong {
  font-size: 1.03rem;
  font-weight: 850;
  line-height: 1.2;
  color: #106438;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
#country-leaderboard-list .country-card-score span {
  display: block;
  margin-top: 2px;
  font-size: .66rem;
  font-weight: 600;
  color: #66796c;
}
#country-leaderboard-list .country-card-stats {
  justify-content: flex-start;
  flex-wrap: wrap;
  min-width: 0;
  gap: 5px 12px;
}
#country-leaderboard-list .country-card-stats span {
  padding: 0;
  border: 0;
  background: transparent;
  color: #617368;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}
:root[data-theme="dark"] #country-leaderboard-list .country-leaderboard-card {
  background: #202d24;
  border-color: #354b3b;
}
:root[data-theme="dark"] #country-leaderboard-list .country-leaderboard-card.country-rank-1 {
  background: #203a29;
  border-color: #3b6948;
}
:root[data-theme="dark"] #country-leaderboard-list .country-leaderboard-card:hover { background: #273c2b; }
:root[data-theme="dark"] #country-leaderboard-list .country-card-rank {
  background: #294630;
  border-color: #386444;
  color: #b5ecc3;
}
:root[data-theme="dark"] #country-leaderboard-list .country-card-main strong { color: #f0f7f1; }
:root[data-theme="dark"] #country-leaderboard-list .country-card-code,
:root[data-theme="dark"] #country-leaderboard-list .country-card-main span,
:root[data-theme="dark"] #country-leaderboard-list .country-card-stats span,
:root[data-theme="dark"] #country-leaderboard-list .country-card-score span { color: #b8cabb; }
:root[data-theme="dark"] #country-leaderboard-list .country-card-score strong { color: #a7e8b7; }
:root[data-theme="dark"] #country-leaderboard-list .country-card-score { background: transparent; border: 0; }
:root[data-theme="dark"] #country-leaderboard-list .country-card-flag { background: transparent; border: 0; }
@media (max-width: 680px) {
  #country-leaderboard-list { gap: 7px; }
  #country-leaderboard-list .country-leaderboard-card {
    grid-template-columns: 30px 36px minmax(0, 1fr) minmax(72px,max-content);
    grid-template-areas: "rank flag main score" "rank flag stats stats";
    gap: 4px 8px;
    padding: 10px 9px;
  }
  #country-leaderboard-list .country-card-rank { width: 27px; height: 27px; font-size: .75rem; }
  #country-leaderboard-list .country-card-flag,
  #country-leaderboard-list .country-card-flag img { width: 34px; height: 26px; }
  #country-leaderboard-list .country-card-main strong { font-size: .85rem; }
  #country-leaderboard-list .country-card-code { display: none; }
  #country-leaderboard-list .country-card-score strong { font-size: .91rem; }
  #country-leaderboard-list .country-card-score span { font-size: .59rem; }
  #country-leaderboard-list .country-card-stats { gap: 3px 9px; }
  #country-leaderboard-list .country-card-stats span { font-size: .63rem; }
}
@media (max-width: 360px) {
  #country-leaderboard-list .country-leaderboard-card {
    grid-template-columns: 27px 32px minmax(0, 1fr) 66px;
    column-gap: 6px;
  }
  #country-leaderboard-list .country-card-flag,
  #country-leaderboard-list .country-card-flag img { width: 31px; height: 24px; }
  #country-leaderboard-list .country-card-main strong { font-size: .79rem; }
  #country-leaderboard-list .country-card-score strong { font-size: .83rem; }
}

#country-leaderboard-panel .country-leaderboard-heading p { max-width: none; }

