/* 01. Design tokens and document base
   Keep sections ordered from global primitives to page-specific surfaces. */

:root {
  --brand: #9147ff;
  --brand-soft: rgba(145, 71, 255, 0.14);
  --brand-strong: #bf94ff;
  --bg: #0d0f14;
  --panel: #161925;
  --panel-soft: rgba(255, 255, 255, 0.05);
  --panel-strong: #202436;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --border-brand: rgba(145, 71, 255, 0.42);
  --text: #f2f3fb;
  --muted: #a7abc1;
  --dim: #747991;
  --danger: #ff5f6d;
  --success: #20d49b;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(145, 71, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: Inter, Avenir Next, Hiragino Sans, Yu Gothic, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: var(--brand-strong);
  text-decoration: none;
  text-decoration-skip-ink: none;
  text-underline-offset: 0.14em;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* 02. Initial language guards */

html[data-initial-language="ja"] .seo-locale:not([data-seo-language="ja"]),
html[data-initial-language="en"] .seo-locale:not([data-seo-language="en"]),
html[data-initial-language="es"] .seo-locale:not([data-seo-language="es"]) {
  display: none !important;
}

html[data-initial-language="ja"] .seo-locale[data-seo-language="ja"][hidden],
html[data-initial-language="en"] .seo-locale[data-seo-language="en"][hidden],
html[data-initial-language="es"] .seo-locale[data-seo-language="es"][hidden] {
  display: block !important;
}

/* 03. App shell and header */

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  padding: calc(8px + var(--safe-top)) clamp(12px, 2vw, 24px) 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 15, 20, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  width: clamp(164px, 18vw, 222px);
  height: auto;
  aspect-ratio: 520 / 120;
  display: block;
  opacity: 0.96;
  filter: drop-shadow(0 6px 18px rgba(145, 71, 255, 0.16));
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

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

/* 04. Shared controls */

.nav-btn,
.type-tab,
.secondary-btn,
.primary-btn,
.filter-select,
.compact-select,
.date-input,
.search-input {
  min-height: 40px;
  border-radius: var(--radius);
}

.nav-btn {
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.nav-btn.active {
  color: var(--text);
  background: var(--panel-soft);
  border-color: var(--border);
}

.badge {
  display: inline-flex;
  justify-content: center;
  min-width: 22px;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 0.76rem;
}

.compact-select,
.filter-select,
.date-input {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
}

/* 05. Main layout and tool panel */

.main-layout {
  width: min(100%, 1280px);
  margin: 0 auto;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: clamp(12px, 2vw, 20px);
  padding: clamp(12px, 2vw, 20px);
}

.main-layout.main-layout-full {
  grid-template-columns: minmax(0, 1fr);
}

.content-area {
  min-width: 0;
}

.tool-panel,
.setup-warning,
.top-ad-wrap,
.ad-card,
.affiliate-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(22, 25, 37, 0.82);
  box-shadow: var(--shadow);
}

.tool-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(14px, 2vw, 18px);
}

.setup-warning {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-color: rgba(255, 95, 109, 0.4);
  color: #ffd6dc;
}

.setup-warning strong {
  color: white;
}

.type-tabs {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.type-tab {
  padding: 9px 14px;
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.type-tab:hover,
.nav-btn:hover,
.secondary-btn:hover,
.clip-actions button:hover,
.clip-actions a:hover,
.amazon-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-brand);
  text-decoration: none;
}

.type-tab.active {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
}

/* 06. Search and filter controls */

.mode-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.search-controls {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-input {
  width: 100%;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 14px;
}

.search-input:focus,
.filter-select:focus,
.compact-select:focus,
.date-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(145, 71, 255, 0.16);
}

.clip-thumb:focus-visible,
.clip-actions button:focus-visible,
.clip-actions a:focus-visible,
.clip-title-btn:focus-visible,
.clip-streamer-btn:focus-visible,
.player-modal button:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.nav-btn:focus-visible,
.type-tab:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 3px;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-weight: 700;
}

.primary-btn {
  color: white;
  background: var(--brand);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.secondary-btn {
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.primary-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(42vh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border-brand);
  border-radius: var(--radius);
  background: #10131c;
  box-shadow: var(--shadow);
}

.suggestion {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
  background: transparent;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover,
.suggestion.active {
  background: var(--brand-soft);
}

.suggestion span:last-child {
  color: var(--muted);
  font-size: 0.8rem;
}

.filter-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.custom-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.custom-range label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* 07. Ads and affiliate surfaces */

.top-ad-wrap {
  margin: 14px 0;
  padding: 10px;
}

.ad-rail {
  position: sticky;
  top: 90px;
  height: fit-content;
}

.ad-card,
.affiliate-card {
  padding: 10px;
}

.ad-label {
  display: block;
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--dim);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.5;
}

.ad-slot-horizontal {
  min-height: 92px;
}

.ad-slot-vertical {
  min-height: 420px;
}

.adsbygoogle {
  display: block;
}

.affiliate-card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.amazon-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.amazon-link {
  display: block;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.4;
}

.amazon-link span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 4px;
}

.affiliate-disclosure {
  color: var(--dim);
  font-size: 0.74rem;
  line-height: 1.5;
  margin: 12px 0 0;
}

/* 08. Clip lists, cards, and tab surfaces */

.status-bar {
  min-height: 34px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.status-bar:empty {
  visibility: hidden;
}

.status-bar:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.status-bar.error {
  color: var(--danger);
}

.reset-search-btn {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.reset-search-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-brand);
}

.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.clip-card,
.skeleton-card,
.game-clip-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.clip-card {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.clip-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-brand);
}

.clip-thumb,
.game-clip-thumb {
  aspect-ratio: 16 / 9;
  background: #050507;
}

.clip-thumb {
  position: relative;
  cursor: pointer;
}

.clip-thumb img,
.game-clip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.clip-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 5px;
  background: rgba(0,0,0,0.72);
  color: white;
  padding: 2px 7px;
  font-size: 0.74rem;
}

.clip-body {
  padding: 11px;
}

.clip-title {
  margin: 0 0 8px;
  min-height: 2.8em;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.4;
}

.clip-title-btn {
  width: 100%;
  display: -webkit-box;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: inherit;
  transition: color 0.18s ease;
}

.clip-title-btn:hover {
  color: var(--brand-strong);
}

.clip-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.clip-streamer-btn {
  min-width: 0;
  max-width: 100%;
  padding: 0;
  background: transparent;
  color: var(--brand-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  transition: color 0.18s ease;
}

.clip-streamer-btn:hover {
  color: #fff;
}

.clip-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 11px 11px;
}

.clip-actions button,
.clip-actions a {
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.clip-actions button.active {
  color: #fff;
  background: rgba(32, 212, 155, 0.18);
  border-color: rgba(32, 212, 155, 0.55);
}

.empty-state {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--dim);
  text-align: center;
}

.empty-icon {
  font-size: 2.6rem;
  color: var(--brand-strong);
  opacity: 0.45;
}

.tab-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 56px;
  padding: 0 0 16px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  min-height: 66px;
  padding: 20px 0 6px;
}

.load-more-wrap .secondary-btn {
  min-width: min(100%, 220px);
}

.load-more-wrap .secondary-btn.hidden {
  display: inline-flex !important;
  visibility: hidden;
  pointer-events: none;
}

/* 09. SEO content sections */

.seo-section {
  border-top: 1px solid var(--border);
  background: rgba(13, 15, 20, 0.72);
}

.seo-inner {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px) clamp(14px, 2vw, 24px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: clamp(16px, 3vw, 26px);
}

.seo-copy,
.seo-faq,
.seo-preview {
  min-width: 0;
}

.seo-kicker {
  color: var(--brand-strong);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.seo-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.seo-copy p,
.seo-faq p,
.seo-faq li,
.seo-preview-list span {
  color: var(--muted);
  line-height: 1.7;
}

.seo-faq h2,
.seo-preview h2 {
  margin: 0 0 10px;
  font-size: 1.02rem;
}

.seo-faq h3 {
  margin: 14px 0 5px;
  font-size: 0.94rem;
}

.seo-faq ul,
.seo-preview-list {
  margin: 0;
  padding-left: 1.15rem;
}

.seo-preview-list li + li {
  margin-top: 8px;
}

.seo-preview-list a {
  display: block;
  color: var(--text);
  line-height: 1.45;
}

.seo-preview-list span {
  display: block;
  font-size: 0.8rem;
}

/* 10. Game landing pages */

.game-page {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(14px, 2vw, 24px) clamp(34px, 5vw, 56px);
}

.game-breadcrumb {
  color: var(--dim);
  font-size: 0.82rem;
}

.game-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.game-breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--border-strong);
}

.game-breadcrumb a {
  max-width: min(60vw, 460px);
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-breadcrumb a:hover {
  color: var(--brand-strong);
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: clamp(18px, 4vw, 36px);
  align-items: end;
  padding: clamp(22px, 5vw, 52px) 0;
}

.game-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.game-hero p,
.game-card p,
.game-card li {
  color: var(--muted);
  line-height: 1.7;
}

.game-actions,
.game-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-card {
  border-top: 1px solid var(--border);
  padding: clamp(18px, 3vw, 28px) 0;
}

.game-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.game-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.game-section-heading h2,
.game-section-heading p {
  margin: 0;
}

.game-clip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.game-clip-thumb {
  display: block;
}

.game-clip-body {
  display: flex;
  min-height: 164px;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.game-clip-body h3 {
  margin: 0;
  min-height: 2.8em;
  font-size: 0.92rem;
  line-height: 1.4;
}

.game-clip-body h3 a {
  display: -webkit-box;
  color: var(--text);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-clip-body p {
  margin: 0;
  font-size: 0.8rem;
}

.game-clip-actions {
  gap: 8px;
  margin-top: auto;
  padding: 0;
}

.game-clip-actions button,
.game-clip-actions a {
  min-height: 36px;
  padding: 7px 9px;
}

.game-link-grid a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
}

/* 11. Loading skeletons */

.skeleton-thumb,
.skeleton-line,
.skeleton-actions span {
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.12), rgba(255,255,255,0.05));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.skeleton-thumb {
  aspect-ratio: 16 / 9;
}

.skeleton-body {
  padding: 11px;
}

.skeleton-line {
  height: 14px;
  margin: 0 0 10px;
  border-radius: 4px;
}

.skeleton-line.short {
  width: 56%;
}

.skeleton-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 11px 11px;
}

.skeleton-actions span {
  min-height: 34px;
  border-radius: 6px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* 12. Player overlay */

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(8px, 2vh, 18px);
  background: rgba(0, 0, 0, 0.78);
}

.overlay.active {
  display: flex;
}

.player-modal {
  display: flex;
  height: min(760px, calc(100dvh - 24px));
  width: min(1120px, 100%);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-brand);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.player-header {
  flex: 0 0 auto;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #111520;
}

.player-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.player-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.embed-container {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.5vw, 16px);
  background: #050507;
}

.embed-container iframe {
  width: auto;
  max-width: min(100%, 980px);
  height: min(100%, 56dvh, 551px);
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
}

.player-info {
  flex: 0 0 auto;
  padding: 14px 18px calc(14px + var(--safe-bottom));
}

.player-info h2 {
  display: -webkit-box;
  margin: 0 0 8px;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
  color: var(--muted);
}

.player-game-btn {
  min-width: 0;
  max-width: min(280px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-audio-note {
  display: -webkit-box;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.player-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: 8px;
}

.player-actions button {
  min-width: 0;
  white-space: normal;
}

/* 13. Footer and document pages */

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px clamp(12px, 2vw, 24px) calc(18px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.doc-page {
  background: var(--bg);
}

.doc-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 30px 16px;
}

.doc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.doc-header,
.doc-body {
  padding: clamp(18px, 3vw, 30px);
}

.doc-header {
  border-bottom: 1px solid var(--border);
}

.doc-header h1 {
  margin: 6px 0;
}

.doc-kicker {
  color: var(--brand-strong);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.doc-section + .doc-section {
  margin-top: 24px;
}

.doc-section h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.doc-section p,
.doc-section li {
  color: var(--muted);
  line-height: 1.7;
}

.doc-list {
  padding-left: 1.2rem;
}

.doc-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 10px 0 0;
  padding-left: 1.2rem;
}

/* 14. Responsive layouts */

@media (max-width: 1120px) {
  .main-layout {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  }
}

@media (max-width: 820px) {
  .app-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-nav {
    order: 3;
    flex-basis: 100%;
  }

  .main-layout {
    display: block;
  }

  .doc-link-grid {
    grid-template-columns: 1fr;
  }

  .game-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .game-section-heading,
  .game-clip-grid {
    grid-template-columns: 1fr;
  }

  .right-rail {
    position: static;
    margin-top: 14px;
  }

  .ad-slot-vertical {
    min-height: 180px;
  }

  .search-controls {
    flex-direction: column;
  }

  .suggestions {
    max-height: min(32vh, 260px);
  }

  .filter-controls,
  .custom-range {
    grid-template-columns: 1fr;
  }

  .clips-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
  }

  .seo-inner {
    grid-template-columns: 1fr;
  }

  .clip-body {
    padding: 9px;
  }

  .clip-title {
    font-size: 0.84rem;
  }

  .clip-actions {
    padding: 0 9px 9px;
  }

  .skeleton-body {
    padding: 9px;
  }

  .skeleton-actions {
    padding: 0 9px 9px;
  }

  .clip-actions button,
  .clip-actions a {
    font-size: 0.72rem;
  }

  .game-clip-actions {
    padding: 0;
  }

  .overlay {
    padding: 0;
    align-items: stretch;
  }

  .player-modal {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .player-header {
    padding-top: calc(10px + var(--safe-top));
    flex-wrap: wrap;
  }

  .embed-container {
    flex-basis: 42dvh;
    padding: 8px;
  }

  .embed-container iframe {
    height: min(100%, 46dvh);
  }

  .player-info {
    padding: 10px 12px calc(10px + var(--safe-bottom));
  }

  .player-info h2 {
    margin-bottom: 6px;
    font-size: 1rem;
  }

  .player-meta,
  .player-audio-note {
    margin-bottom: 8px;
  }

  .player-audio-note {
    -webkit-line-clamp: 1;
  }

  .player-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .player-nav {
    width: 100%;
    margin-left: 0;
  }

  .player-nav button {
    flex: 1;
  }
}

@media (max-width: 420px) {
  .player-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-actions .primary-btn {
    grid-column: 1 / -1;
  }
}

@media (max-height: 720px) {
  .player-modal {
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .player-header {
    min-height: 48px;
    padding: 8px 10px;
  }

  .embed-container {
    padding: 8px;
  }

  .player-info {
    padding: 10px 14px calc(10px + var(--safe-bottom));
  }

  .player-info h2 {
    margin-bottom: 6px;
    font-size: 1rem;
  }

  .player-meta,
  .player-audio-note {
    margin-bottom: 8px;
  }

  .player-audio-note {
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 520px) {
  .app-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .brand {
    max-width: calc(100% - 112px);
  }

  .brand img {
    width: min(50vw, 154px);
  }

  .header-actions {
    margin-left: auto;
  }

  .header-nav {
    order: 3;
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .type-tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .clip-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .nav-btn,
  .type-tab,
  .clip-actions button,
  .clip-actions a {
    width: 100%;
  }

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