/* ================================
   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: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Tema stranice */
  --bg-color: 
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.9), rgba(245, 250, 255, 0.75)),
    linear-gradient(180deg, #eef6ff, #f5faff);
  --text-color: #1f2937;

  /* Top bar – ostaje bijeli u oba moda */
  --topbar-bg: #ffffffcc;
  --topbar-border: rgba(148, 163, 184, 0.5);
  --topbar-text: #111827;
  --accent-color: #22c55e;
}

/* Dark mode – Mijenjamo samo pozadinu i tekst stranice, ne top bar */
:root[data-theme="dark"] {
  --bg-color: #050816;
  --text-color: #f1f5f9;
  --accent-color: #00cec9;
}

/* 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: 70px;
}

/* 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;
}

.hidden {
  display: none !important;
}

/* ================================
   TOP BAR / NAVIGACIJA
   ================================ */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--topbar-border);
  z-index: 1000;
  color: var(--topbar-text);
}

/* Lijevi dio – logo + naslov (link) */
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.game-title {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
}

/* Link oko loga/naslova */
.home-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit; /* koristi boju teksta top bara */
}

.home-link:hover {
  opacity: 0.85;
}

/* Desna strana – theme toggle */

.theme-toggle {
  position: relative;
  width: 60px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--topbar-border);
  background: #f3f4f6;
  cursor: pointer;
  padding: 0;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

:root[data-theme="dark"] .theme-toggle {
  background: #111827;
}

.theme-icon {
  flex: 1;
  text-align: center;
  font-size: 16px;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.theme-icon.sun {
  opacity: 0.9;
}

:root[data-theme="dark"] .theme-icon.sun {
  opacity: 0.4;
}

:root[data-theme="dark"] .theme-icon.moon {
  opacity: 0.9;
}

/* Kuglica koja klizi */

.theme-toggle::before {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-color);
  top: 3px;
  left: 3px;
  transition: transform 0.22s ease;
}

:root[data-theme="dark"] .theme-toggle::before {
  transform: translateX(26px);
}

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

.offline .interstitial-wrapper {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 900px;
  padding: 18px 20px 40px;
  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,
#leaderboard-graph-title {
  text-align: center;
  margin: 42px auto 12px;
  width: 100%;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #111827; /* dobro se vidi na light bg */
  font-size: 1.05rem;
  opacity: 1;
}

/* Opcionalni podnaslov */
.leaderboard-subtitle {
  text-align: center;
  margin: 4px auto 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

#leaderboard,
#leaderboard-daily {
  border-collapse: collapse;
  table-layout: fixed;
  width: 95%;
  max-width: 900px;
  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: 10%;
}

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

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

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

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

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

#pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px auto 48px;
  max-width: 900px;
}

#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;
  color: var(--text-main);
  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);
  color: #0f172a;
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.7);
  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,
  #leaderboard-graph-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) {
  .suggested-left > #control-buttons,
  .suggested-right > #control-buttons {
    float: none;
  }
  .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%;
  }
  .nav-wrapper {
    margin-top: 30px;
  }
}

@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
   ================================ */

.dino-game-info {
  max-width: 900px;
  margin: 2.4rem auto 2.8rem;
  line-height: 1.7;
  color: var(--text-main);
  padding: 0 16px;
}

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

.dino-game-info h2 {
  font-size: 2.1rem;
  margin-bottom: 0.4rem;
  text-align: center;
  letter-spacing: 0.06em;
  color: #111827;
  text-transform: uppercase;
}

.dino-game-info h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin: 0.4rem auto 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
}

.dino-tagline {
  text-align: center;
  margin-bottom: 1.4rem;
  font-size: 0.98rem;
  opacity: 0.78;
  color: var(--text-muted);
}

/* Akordeon – malo posvijetljen dark */

.dino-accordion {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: linear-gradient(145deg, #020617, #020c1f);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.dino-accordion details {
  border-bottom: 1px solid rgba(31, 41, 55, 0.75);
  background: transparent;
  transition: background var(--transition-med), border-color var(--transition-med);
}

.dino-accordion details:last-of-type {
  border-bottom: none;
}

.dino-accordion summary {
  cursor: pointer;
  padding: 0.95rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  font-weight: 600;
  font-size: 0.98rem;
  color: #f9fafb;
}

.dino-accordion summary::-webkit-details-marker {
  display: none;
}

.dino-accordion summary span.title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.dino-accordion summary span.icon {
  font-size: 1.25rem;
  opacity: 0.95;
}

.dino-accordion summary span.chevron {
  transition: transform var(--transition-med), opacity var(--transition-med);
  opacity: 0.75;
  font-size: 0.85rem;
}

.dino-accordion details[open] summary {
  background: radial-gradient(circle at left, rgba(34, 197, 94, 0.16), #020617);
  border-bottom-color: rgba(34, 197, 94, 0.65);
}

.dino-accordion details[open] summary span.chevron {
  transform: rotate(90deg);
  opacity: 1;
}

/* Sadržaj panela */

.dino-accordion .panel-content {
  padding: 0 1.3rem 1.15rem;
  font-size: 0.94rem;
  color: var(--text-main);
}

.dino-accordion p {
  margin: 0.4rem 0;
}

.dino-accordion strong {
  font-weight: 600;
  color: #e5e7eb;
}

.dino-accordion ul {
  margin: 0.4rem 0 0.6rem 1.25rem;
  padding: 0;
}

.dino-accordion li {
  margin: 0.22rem 0;
  color: var(--text-muted);
}

/* Responsive za info sekciju */

@media (max-width: 600px) {
  .dino-game-info {
    margin: 1.2rem auto 2rem;
    padding: 0 12px;
  }
  .dino-game-info h2 {
    font-size: 1.6rem;
  }
  .dino-accordion summary {
    padding-inline: 1rem;
  }
  .dino-accordion .panel-content {
    padding-inline: 1rem;
  }
}

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

.content-section {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 16px;
  text-align: justify;
}

.content-section h2 {
  text-align: center;
  margin-bottom: 16px;
}

.content-section ul {
  margin-left: 20px;
  line-height: 1.6;
}

.content-section h3 {
  margin-top: 22px;
  margin-bottom: 6px;
}










.seo-articles {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.seo-articles-inner {
  width: 100%;
  max-width: 900px; /* <-- tvoja željena širina */
  margin: 0 auto;
}

.seo-articles-header h2 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
  color: #0f172a;
}

.seo-articles-header p {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

/* GRID – automatski broj stupaca, unutar max 900px wrappera */
.seo-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.3rem;
}

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

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

.seo-card-body p {
  font-size: 0.9rem;
  color: #6b7280;
}

.seo-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .9rem;
}

.seo-pill {
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seo-arrow {
  color: #9ca3af;
  transition: 0.15s ease;
}

.seo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15,23,42,.08);
  border-color: #c7d2fe;
  background: #f9fafb;
}

.seo-card:hover .seo-arrow {
  transform: translateX(3px);
  color: #4f46e5;
}

@media (max-width: 640px) {
  .seo-articles-header h2 {
    font-size: 1.5rem;
  }
}
