/* ====== Reset / base ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: #d8e8db;
  min-height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 70px; /* offset for sticky header */
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a1f1c;
  background-color: #d8e8db;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
}

a {
  color: #0a8a3a;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
}

:root {
  --bg: #d8e8db;
  --header-bg: #0f2a1d;
  --header-fg: #ffffff;
  --primary: #d62828;
  --primary-dark: #b51e1e;
  --accent: #ffb627;
  --card: #ffffff;
  --border: #e2e8e3;
  --text: #1a1f1c;
  --muted: #5a6b5f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.pixel-font {
  font-family: "Press Start 2P", "Inter", system-ui, sans-serif;
  letter-spacing: 0.06em;
}

/* ====== Header ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--header-bg);
  color: var(--header-fg);
  border-bottom: 3px solid var(--primary);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--header-fg);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 37px;
  height: 35px;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  background: var(--primary);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 22px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.primary-nav a {
  color: var(--header-fg);
  text-decoration: none;
}
.primary-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

@media (min-width: 768px) {
  .primary-nav {
    display: inline-flex;
  }
}

.header-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  color: var(--header-fg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}
.icon-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

.favorites-count {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
}

.favorites-panel {
  position: fixed;
  top: 72px;
  right: 76px;
  z-index: 100;
  width: min(320px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 96px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.favorites-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: #0f2a1d;
}

.favorites-panel-head strong {
  margin-right: auto;
}

.favorites-clear {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: #ffe8e8;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.favorites-clear:hover {
  background: var(--primary);
  color: #fff;
}

.favorites-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: #eef4ef;
  color: #0f2a1d;
  font-size: 20px;
  line-height: 1;
}

.favorites-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.favorite-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px;
  border-radius: 8px;
  color: #0f2a1d;
  font-weight: 800;
  text-decoration: none;
}

.favorite-item:hover,
.favorite-item:focus-within {
  background: #eef4ef;
  text-decoration: none;
}

.favorite-link {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.favorite-link:hover {
  text-decoration: none;
}

.favorite-link span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.favorite-item img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.favorite-remove {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: #ffe8e8;
  color: var(--primary);
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.favorite-item:hover .favorite-remove,
.favorite-item:focus-within .favorite-remove {
  opacity: 1;
  pointer-events: auto;
}

.favorite-remove:hover {
  background: var(--primary);
  color: #fff;
}

.favorites-empty {
  margin: 0;
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.search {
  display: inline-flex;
  align-items: stretch;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 8px;
  overflow: hidden;
  height: 38px;
  width: 200px;
}
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0 10px;
  font-size: 14px;
  background: transparent;
  color: #1a1f1c;
  min-width: 0;
}
.search button {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search button:hover {
  background: var(--primary-dark);
}

@media (min-width: 640px) {
  .search {
    width: 260px;
  }
}

/* ====== Main / sections ====== */
.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.section-title {
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f2a1d;
  margin: 16px 0 10px;
  scroll-margin-top: 80px;
}

.page-status {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

/* ====== Featured grid ====== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  scroll-margin-top: 80px;
}

@media (min-width: 768px) {
  .featured-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 1024px) {
  .featured-grid {
    grid-template-columns: repeat(9, 1fr);
    gap: 16px;
  }
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #cbd5d0;
  box-shadow: var(--shadow);
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.tile:hover:not(.tile--image) .tile-caption {
  background: var(--primary);
  color: #fff;
}

.tile:hover .tile-hover {
  opacity: 1;
}

.tile-thumb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Decorative race-stripe pattern layer */
.tile-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.07) 0,
    rgba(255, 255, 255, 0.07) 14px,
    rgba(0, 0, 0, 0.07) 14px,
    rgba(0, 0, 0, 0.07) 28px
  );
  pointer-events: none;
}

/* Bottom checkered strip for "racing" feel */
.tile-thumb::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  height: 8px;
  background-image: linear-gradient(45deg, #fff 25%, transparent 25%),
    linear-gradient(-45deg, #fff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%),
    linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  background-color: #111;
  opacity: 0.7;
  pointer-events: none;
}

.tile-thumb.has-image::before,
.tile-thumb.has-image::after {
  display: none;
}

.tile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile--image .tile-caption {
  transform: translateY(0);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.86));
  padding-top: 28px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.tile--image:hover .tile-caption,
.tile--image:focus-visible .tile-caption {
  transform: translateY(0);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.92));
}

.tile--image:hover .tile-image,
.tile--image:focus-visible .tile-image {
  filter: brightness(0.88);
}

.tile-icon {
  position: relative;
  z-index: 1;
  width: 60%;
  height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25));
  margin-bottom: 14px; /* lift above the checkered strip */
}
.tile-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tile-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 42, 29, 0.88);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: 0.04em;
  padding: 7px 6px;
  text-align: center;
  text-transform: uppercase;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

@media (min-width: 1024px) {
  .tile-caption {
    font-size: 9px;
  }
}

/* Hover "PLAY" overlay */
.tile-hover {
  position: absolute;
  inset: 0;
  background: rgba(214, 40, 40, 0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 3;
  pointer-events: none;
}

.tile--image .tile-hover {
  background: rgba(0, 0, 0, 0.18);
}

/* Featured playable slot */
.tile-featured {
  grid-column: 1 / -1;
  grid-row: span 2;
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.tile-featured .tile-caption {
  font-size: 12px;
  background: var(--primary);
  padding: 10px 8px;
  letter-spacing: 0.08em;
}

/* Player */
.player {
  position: relative;
  inset: auto;
  flex: 1 1 auto;
  aspect-ratio: 16 / 9;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.player-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
}

.play-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 6px 0 var(--primary-dark), 0 10px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.play-btn:hover {
  transform: translateY(1px);
  box-shadow: 0 5px 0 var(--primary-dark), 0 8px 14px rgba(0, 0, 0, 0.3);
}
.play-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--primary-dark), 0 4px 8px rgba(0, 0, 0, 0.25);
}

.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fff;
  color: var(--primary);
  border-radius: 50%;
}

@media (max-width: 480px) {
  .tile-featured .play-btn {
    padding: 8px 14px;
    font-size: 13px;
    gap: 8px;
  }
  .tile-featured .play-icon {
    width: 28px;
    height: 28px;
  }
  .tile-featured .play-icon svg {
    width: 16px;
    height: 16px;
  }
}

@media (min-width: 768px) {
  .tile-featured {
    grid-column: span 4;
  }
}

@media (min-width: 1024px) {
  .tile-featured {
    grid-column: span 6;
    grid-row: span 4;
  }
}


.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease;
}
.fullscreen-btn:hover {
  background: var(--primary);
}
.fullscreen-btn[hidden] {
  display: none;
}

.featured-actions {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 9px 18px;
  background: #fff;
  border-top: 1px solid #e7ece8;
}

body.is-featured-theater {
  overflow: hidden;
}

body.is-featured-theater .tile-featured {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
}

body.is-featured-theater .tile-featured:hover {
  transform: none;
}

body.is-featured-theater .tile-featured .player {
  min-height: 0;
}

body.is-featured-theater .featured-actions {
  min-height: 72px;
  padding: 10px 22px;
  border-top-color: #dfe6e1;
}

.featured-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: #0f2a1d;
  text-decoration: none;
}

.featured-title:hover {
  text-decoration: none;
}

.featured-title-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 5px;
  object-fit: cover;
  background: #0f2a1d;
}

.featured-title span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #0f2a1d;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-shadow: none;
  text-transform: uppercase;
}

.featured-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.featured-action-btn {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 7px;
  background: #ff7617;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.featured-action-btn:hover,
.featured-action-btn.is-active {
  background: #e95f00;
}

.featured-action-btn span {
  display: block;
  font-size: 12px;
}

.featured-action-btn svg {
  flex: 0 0 auto;
}

#featured-favorite-button.is-active svg,
#game-favorite-button.is-active svg {
  fill: currentColor;
}

.featured-icon-btn {
  width: 38px;
  padding: 0;
}

.featured-share-panel {
  position: absolute;
  right: 18px;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: 190px;
  padding: 8px;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.featured-share-panel[hidden] {
  display: none;
}

.featured-share-link {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #0f2a1d;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.featured-share-link:hover {
  background: #f1f6f2;
  color: var(--primary);
  text-decoration: none;
}

@media (max-width: 640px) {
  .featured-actions {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 8px 10px;
    min-height: 56px;
  }

  .featured-title {
    font-size: 14px;
    gap: 8px;
  }

  .featured-title-thumb {
    width: 40px;
    height: 40px;
  }

  .featured-action-buttons {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
  }

  .featured-action-btn {
    min-width: 38px;
    height: 38px;
  }

  .featured-icon-btn {
    width: 38px;
  }

  .featured-share-panel {
    right: 10px;
    bottom: 58px;
  }
}

.game-page {
  max-width: 1180px;
}

.game-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-title-row .section-title {
  margin: 16px 0 10px;
}

.game-title-row .featured-title:hover {
  text-decoration: none;
}

.back-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #0f2a1d;
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}
.back-home-link:hover {
  background: var(--primary);
  text-decoration: none;
}

.game-title-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.game-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #0f2a1d;
  color: #fff;
}

.game-action-btn:hover,
.game-action-btn.is-active {
  background: var(--primary);
}

.game-action-btn.is-active svg {
  fill: currentColor;
}

body.is-theater-mode .site-header,
body.is-theater-mode .game-info,
body.is-theater-mode .site-footer,
body.is-theater-mode .back-to-top {
  display: none;
}

body.is-theater-mode {
  background: #07140d;
}

body.is-theater-mode .main.game-page {
  max-width: none;
  width: 100%;
  padding: 14px;
}

body.is-theater-mode .game-title-row {
  width: 100%;
  max-width: none;
  margin: 0;
  justify-content: flex-start;
  color: #fff;
}

body.is-theater-mode .game-title-row .featured-title {
  flex: 1 1 auto;
  max-width: none !important;
}

body.is-theater-mode .game-title-row .section-title {
  flex: 1 1 auto;
  min-width: 0;
  color: #0f2a1d;
}

body.is-theater-mode .game-shell {
  max-width: min(1600px, 100%);
  margin: 0 auto;
}

body.is-theater-mode .game-frame-host {
  min-height: min(78vh, 900px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.game-shell {
  position: relative;
}

.game-frame-host {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 420px;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  box-shadow: var(--shadow);
}

.game-frame-host iframe,
.game-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.game-frame-host iframe {
  display: block;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.game-frame-host.is-crazygames-embed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  z-index: 3;
  background: #11121c;
  pointer-events: auto;
}

.game-poster {
  object-fit: cover;
  filter: brightness(0.75);
}

.game-start-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.game-start-button:hover {
  transform: translate(-50%, -50%);
}
.game-start-button:active {
  transform: translate(-50%, calc(-50% + 3px));
}

.game-notice {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.game-info {
  margin-top: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.game-info h2 {
  margin: 22px 0 8px;
  color: #0f2a1d;
  font-size: 22px;
  line-height: 1.25;
}

.game-info h2:first-child {
  margin-top: 0;
}

.game-info p {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 16px;
}

.game-info ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.game-info li {
  margin: 6px 0;
  color: var(--text);
}

.pager {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 36px;
}

.pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  padding: 0 4px;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #cfd5d2;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}
.pager-link:hover,
.pager-link.is-active {
  background: #191a2d;
  color: #fff;
  text-decoration: none;
}

/* ====== New games grid ====== */
.new-games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (min-width: 640px) {
  .new-games-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
@media (min-width: 1024px) {
  .new-games-grid {
    grid-template-columns: repeat(9, 1fr);
    gap: 16px;
  }
}

/* ====== Article ====== */
.article {
  background: var(--card);
  border-radius: 10px;
  padding: 20px;
  margin-top: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 15px;
}

@media (min-width: 768px) {
  .article {
    padding: 32px 36px;
  }
}

.article h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 28px 0 10px;
  color: #0f2a1d;
}
.article h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 6px;
  color: #1a1f1c;
}
.article p {
  margin: 8px 0;
}
.article ul {
  margin: 8px 0 12px;
  padding-left: 22px;
}
.article ul.toc {
  list-style: disc;
  color: var(--primary);
}
.article ul.toc a {
  color: var(--primary);
}
.article .bold {
  font-weight: 700;
}
.article .solution {
  font-style: italic;
  color: #4a5b50;
  margin-top: 4px;
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 10px;
}

.review-card {
  border: 1px solid rgba(15, 42, 29, 0.12);
  border-radius: 8px;
  background: #f7faf7;
  padding: 14px;
}

.review-card h3 {
  margin-top: 0;
}

.review-card p {
  margin-bottom: 0;
  color: #34453a;
}

.review-source {
  color: #52665a;
  font-size: 14px;
}

@media (min-width: 768px) {
  .review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.legal-main {
  max-width: 980px;
  padding-top: 28px;
}

.legal-article {
  margin-top: 0;
}

.legal-article h1 {
  margin: 0 0 12px;
  color: #0f2a1d;
  font-family: "Press Start 2P", "Inter", system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
}

.legal-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.legal-article > p:first-of-type + h1 + p,
.legal-article h1 + p {
  color: #34453a;
  font-size: 16px;
}

.contact-note {
  margin-top: 24px;
  padding-top: 4px;
}

.contact-note h2 {
  margin: 0 0 10px;
  color: #0f2a1d;
  font-size: 20px;
}

.contact-note p {
  color: #34453a;
}

.contact-email-link {
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .legal-main {
    padding-top: 42px;
  }

  .legal-article h1 {
    font-size: 30px;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.banner {
  display: block;
  margin: 28px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.banner img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.table-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table-wrap thead {
  background: var(--primary);
  color: #fff;
}
.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.table-wrap tbody tr {
  border-top: 1px solid var(--border);
}
.table-wrap tbody tr:nth-child(even) {
  background: #fafafa;
}
.cell-title {
  font-weight: 700;
  color: var(--primary);
}

/* ====== Footer ====== */
.site-footer {
  background: var(--header-bg);
  color: #cdd9d2;
  margin-top: 36px;
  padding: 24px 16px;
  text-align: center;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
}
.footer-nav a {
  color: #cdd9d2;
  font-size: 13px;
}
.footer-nav a:hover {
  color: var(--accent);
}
.copyright {
  font-size: 12px;
  color: #7d8c83;
  margin: 4px 0 0;
}

/* ====== Empty state (search no results) ====== */
.empty-state {
  grid-column: 1 / -1;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 24px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  background: #fff;
}
.empty-state.is-visible {
  display: flex;
}

/* ====== Back to top ====== */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 0 var(--primary-dark), 0 8px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--primary-dark);
}

/* ====== Visually hidden helper ====== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
