/* =========================================================
   AIデータ二刀流ブログ — Hanshin Redesign (top page)
   阪神中心の野球分析ブログ＋週末競馬
   v=20260526a (LOCAL PREVIEW ONLY)
   ========================================================= */

:root {
  /* Brand colors */
  --c-ink:        #0f0e0c;
  --c-ink-2:      #1c1a17;
  --c-charcoal:   #2a2520;
  --c-body:       #3a342d;
  --c-mute:       #7a716a;
  --c-line:       #e3dccf;
  --c-line-soft:  #eee8da;
  --c-paper:      #f7f3ea;
  --c-paper-2:    #efe9da;
  --c-beige:      #e6dec8;
  --c-yellow:     #f1b81d;
  --c-yellow-2:   #ffd24a;
  --c-yellow-ink: #1a1408;
  --c-turf:       #2f5d3a;

  /* Type */
  --f-sans:   "Zen Kaku Gothic New", "Noto Sans JP", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --f-body:   "Noto Sans JP", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --f-mono:   "JetBrains Mono", "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sh-card:  0 1px 0 rgba(15,14,12,0.04), 0 8px 24px -16px rgba(15,14,12,0.18);
}

/* Scope to .tb-root so we don't break other pages */
.tb-root, .tb-root *, .tb-root *::before, .tb-root *::after { box-sizing: border-box; }
.tb-root {
  font-family: var(--f-body);
  color: var(--c-body);
  background: var(--c-paper);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  margin: 0;
}
.tb-root img { display: block; max-width: 100%; }
.tb-root a { color: inherit; text-decoration: none; }
.tb-root button { font: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.tb-header { background: var(--c-ink); color: #f4eee0; position: relative; }
.tb-header-inner {
  display: flex; align-items: center; gap: 22px;
  padding: 10px 48px;
  max-width: 1280px; margin: 0 auto;
}
.tb-logo { display: flex; align-items: center; gap: 9px; }
.tb-logo-mark {
  width: 26px; height: 26px;
  background: var(--c-yellow);
  display: grid; place-items: center;
  font-family: var(--f-sans);
  font-weight: 900; font-size: 14px;
  color: var(--c-yellow-ink);
  letter-spacing: -0.02em;
  position: relative;
}
.tb-logo-mark::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, transparent 0 5px, rgba(15,14,12,0.18) 5px 6px, transparent 6px 100%);
  pointer-events: none;
}
.tb-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.tb-logo-main {
  font-family: var(--f-sans);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.tb-logo-sub {
  font-size: 9px;
  color: rgba(244,238,224,0.4);
  letter-spacing: 0.16em;
  font-family: var(--f-mono);
  margin-top: 2px;
}
.tb-nav {
  display: flex; gap: 22px;
  font-family: var(--f-sans);
  font-weight: 500; font-size: 14px;
  letter-spacing: 0.04em;
  margin-left: auto;
}
.tb-nav a {
  color: rgba(244,238,224,0.78);
  padding: 8px 0;
  position: relative;
}
.tb-nav a:hover { color: #fff; }
.tb-nav a.active { color: var(--c-yellow); }
.tb-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px;
  height: 2px; background: var(--c-yellow);
}

/* Mobile burger button (hidden on PC) */
.tb-burger {
  display: none;
  margin-left: auto;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid rgba(244,238,224,0.35);
  color: var(--c-yellow);
  align-items: center; justify-content: center;
}
.tb-burger span {
  display: block; width: 16px; height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
}

/* ---------- Hero ---------- */
.tb-hero {
  position: relative;
  background: var(--c-ink);
  color: #f4eee0;
  overflow: hidden;
  padding: 88px 48px 96px;
}
/* Image background with fallback */
.tb-hero-img {
  position: absolute; inset: 0;
  background-image: url("/assets/img/hero/hanshin-analytics-hero.webp");
  background-size: cover;
  background-position: center 42%;
  opacity: 0.42;
  z-index: 0;
  /* Fallback: if image fails to load, the underlying CSS pattern still shows */
}
/* Readability overlay: left → center gradient that dims image side of text */
.tb-hero-img::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(15,14,12,0.88) 0%, rgba(15,14,12,0.55) 38%, rgba(15,14,12,0.15) 70%, rgba(15,14,12,0.35) 100%),
    linear-gradient(180deg, rgba(15,14,12,0.35) 0%, rgba(15,14,12,0) 30%, rgba(15,14,12,0.55) 100%);
  pointer-events: none;
}
.tb-hero-bg {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(241,184,29,0.18), transparent 60%),
    radial-gradient(ellipse 50% 45% at 90% 80%, rgba(241,184,29,0.12), transparent 65%),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(241,184,29,0.04) 28px 29px);
}
.tb-hero-stripes {
  position: absolute; inset: 0; z-index: 1;
  background-image:
    linear-gradient(90deg, transparent 0 calc(50% - 1px), rgba(241,184,29,0.07) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px) 100%),
    repeating-linear-gradient(90deg, transparent 0 60px, rgba(255,255,255,0.02) 60px 61px);
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
}
.tb-hero-claw {
  position: absolute; right: -40px; top: 30%; bottom: 0; z-index: 1;
  width: 380px;
  background:
    linear-gradient(118deg,
      transparent 18%,
      transparent 30%,
      transparent 38%, rgba(241,184,29,0.18) 38% 41%,
      transparent 41% 53%, rgba(241,184,29,0.22) 53% 56%,
      transparent 56% 70%, rgba(241,184,29,0.16) 70% 73%,
      transparent 73% 100%);
  filter: blur(0.5px);
  opacity: 0.5;
  pointer-events: none;
}
.tb-hero-grid-lines {
  position: absolute; inset: auto 0 0 0; height: 220px; z-index: 1;
  background-image:
    linear-gradient(180deg, transparent 0, rgba(241,184,29,0.08) 100%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(241,184,29,0.08) 39px 40px);
  mask-image: linear-gradient(0deg, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(0deg, #000 0%, transparent 100%);
}
.tb-hero-inner {
  position: relative; z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
}
.tb-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--c-yellow);
  margin-bottom: 28px;
}
.tb-hero-eyebrow::before {
  content: ""; width: 28px; height: 2px; background: var(--c-yellow);
}
.tb-hero-title {
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 72px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #fdfbf3;
  margin: 0 0 24px;
}
.tb-hero-title em {
  color: var(--c-yellow);
  font-style: normal;
  position: relative;
  display: inline-block;
}
.tb-hero-title em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px;
  background: var(--c-yellow);
}
.tb-hero-sub {
  font-size: 17px;
  line-height: 1.85;
  color: rgba(244,238,224,0.82);
  max-width: 620px;
  margin: 0 0 40px;
}
.tb-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.tb-hero-strip {
  margin-top: 36px;
  display: flex; gap: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: rgba(244,238,224,0.5);
  letter-spacing: 0.16em;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.tb-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-sans);
  font-weight: 700; font-size: 14px;
  letter-spacing: 0.04em;
  padding: 14px 22px;
  border: 0;
  background: var(--c-yellow);
  color: var(--c-yellow-ink);
  transition: transform .12s ease, background .12s ease;
}
.tb-btn:hover { background: var(--c-yellow-2); transform: translateY(-1px); }
.tb-btn--ghost {
  background: transparent;
  color: #f4eee0;
  border: 1px solid rgba(244,238,224,0.35);
}
.tb-btn--ghost:hover { background: rgba(255,255,255,0.06); }
.tb-btn .tb-arrow {
  width: 14px; height: 14px;
  display: inline-block;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
}

/* ---------- Stats bar ---------- */
.tb-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--c-ink);
  color: #f4eee0;
}
.tb-stat {
  padding: 22px 24px;
  border-right: 1px solid rgba(244,238,224,0.08);
}
.tb-stat:last-child { border-right: 0; }
/* When tb-stats is used as a category nav (links) */
.tb-cats a.tb-stat { display: block; text-decoration: none; transition: background-color 0.15s ease; }
.tb-cats a.tb-stat:hover { background: rgba(241,184,29,0.08); }
.tb-cats a.tb-stat:hover .tb-stat-num { color: var(--c-yellow-2); }
.tb-stat-num {
  font-family: var(--f-mono);
  font-weight: 700; font-size: 28px;
  color: var(--c-yellow);
  letter-spacing: -0.02em;
}
.tb-stat-num sub-num {
  font-size: 18px;
}
.tb-stat-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(244,238,224,0.55);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---------- Section ---------- */
.tb-section {
  padding: 80px 48px;
  background: var(--c-paper);
}
.tb-section--alt { background: var(--c-paper-2); }
.tb-section--ink { background: var(--c-ink); color: #f4eee0; }
.tb-section-inner { max-width: 1280px; margin: 0 auto; }
.tb-section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--c-line);
  padding-bottom: 16px;
  gap: 16px; flex-wrap: wrap;
}
.tb-section--ink .tb-section-head { border-bottom-color: rgba(244,238,224,0.15); }
.tb-section-title {
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.01em;
  margin: 0;
  display: flex; align-items: baseline; gap: 14px;
}
.tb-section-title .tb-num {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-yellow);
  letter-spacing: 0.18em;
}
.tb-section-en {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--c-mute);
  text-transform: uppercase;
}
.tb-section-more {
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 13px;
  color: var(--c-charcoal);
  display: inline-flex; align-items: center; gap: 6px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.tb-section--ink .tb-section-more { color: var(--c-yellow); }

/* ---------- Featured (large) ---------- */
.tb-feat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.tb-feat {
  background: var(--c-ink);
  color: #f4eee0;
  position: relative;
  overflow: hidden;
  display: flex;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tb-feat:hover { transform: translateY(-2px); box-shadow: var(--sh-card); }
.tb-feat-thumb {
  flex: 0 0 45%;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse 60% 40% at 30% 60%, rgba(241,184,29,0.25), transparent 60%),
    repeating-linear-gradient(0deg, rgba(241,184,29,0.05) 0 40px, transparent 40px 41px),
    #14110d;
  position: relative;
  overflow: hidden;
}
.tb-feat-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center center;
  opacity: 1;
}
.tb-feat-thumb::after {
  /* Removed dark fade overlay so the image is shown clean and centered */
  content: none;
}
.tb-feat-body {
  flex: 1 1 55%;
  padding: 28px 32px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 1;
}
.tb-feat-tag {
  display: inline-block;
  background: var(--c-yellow);
  color: var(--c-yellow-ink);
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 4px 10px;
  margin-bottom: 16px;
  width: max-content;
}
.tb-feat-title {
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.4;
  margin: 0 0 12px;
  color: #fdfbf3;
}
.tb-feat-excerpt {
  font-size: 13px;
  line-height: 1.85;
  color: rgba(244,238,224,0.75);
  margin: 0 0 18px;
}
.tb-feat-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(244,238,224,0.5);
}

/* Featured triple layout: 3 equal columns */
.tb-feat-grid--triple {
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.tb-feat--col {
  background: var(--c-ink);
  color: #f4eee0;
  flex-direction: column;
  overflow: hidden;
}
.tb-feat--col .tb-feat-thumb {
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
}
.tb-feat--col .tb-feat-thumb::after {
  content: none;
}
.tb-feat--col .tb-feat-body {
  flex: 1 1 auto;
  padding: 20px 22px 22px;
}
.tb-feat--col .tb-feat-title { font-size: 17px; line-height: 1.45; }
.tb-feat--col .tb-feat-excerpt { font-size: 12.5px; margin-bottom: 14px; }

/* Featured mix layout: main card + 3 sub cards (legacy/unused) */
.tb-feat-grid--mix {
  grid-template-columns: 1.55fr 1fr;
  align-items: stretch;
}
.tb-feat--main { grid-row: span 1; flex-direction: column; }
.tb-feat--main .tb-feat-thumb {
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
}
.tb-feat--main .tb-feat-thumb::after {
  content: none;
}
.tb-feat--main .tb-feat-body { flex: 1 1 auto; padding: 22px 28px 24px; }
.tb-feat-sub {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 18px;
}
.tb-feat--card {
  background: #fff;
  color: var(--c-body);
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 0;
  border: 1px solid var(--c-line-soft);
}
.tb-feat--card:hover { box-shadow: 0 8px 28px -16px rgba(15,14,12,0.22); }
.tb-feat--card .tb-feat-thumb {
  flex: none;
  width: 200px;
  min-height: 0;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(241,184,29,0.18), transparent 70%),
    var(--c-ink);
}
.tb-feat--card .tb-feat-thumb::after {
  /* No fade-out for white card background: keep image clean */
  background: none;
}
.tb-feat--card .tb-feat-thumb img {
  opacity: 1;
}
.tb-feat--card .tb-feat-body {
  padding: 14px 18px;
  color: var(--c-body);
  display: flex; flex-direction: column; justify-content: center;
}
.tb-feat--card .tb-feat-title {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--c-ink);
  margin-bottom: 6px;
  font-weight: 800;
}
.tb-feat--card .tb-feat-meta {
  color: var(--c-mute);
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.tb-feat--card .tb-feat-tag {
  font-size: 10px;
  padding: 2px 8px;
  margin-bottom: 8px;
}
/* Category tag variants */
.tb-feat-tag--hanshin { background: var(--c-yellow); color: var(--c-yellow-ink); }
.tb-feat-tag--baseball { background: #2a2520; color: var(--c-yellow); }
.tb-feat-tag--keiba { background: var(--c-turf); color: #f4eee0; }

/* ---------- Card (standard) ---------- */
.tb-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tb-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tb-card {
  background: #fff;
  border: 1px solid var(--c-line);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tb-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-card);
  border-color: #d6cdb8;
}
.tb-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--c-beige);
  overflow: hidden;
}
.tb-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tb-card-thumb--ph {
  background: repeating-linear-gradient(135deg, var(--c-beige) 0 8px, #ddd2b5 8px 9px);
  display: grid; place-items: center;
}
.tb-card-thumb--ph::after {
  content: attr(data-ph);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-mute);
  letter-spacing: 0.12em;
  background: rgba(255,255,255,0.85);
  padding: 4px 10px;
}
.tb-card-body { padding: 18px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.tb-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-mute);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.tb-card-date { color: var(--c-body); font-weight: 600; }
.tb-card-when {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--c-mute);
  margin: 0 0 8px;
  padding-left: 8px;
  border-left: 2px solid var(--c-yellow);
}
.tb-card-title {
  font-family: var(--f-sans);
  font-weight: 700; font-size: 16px;
  line-height: 1.5;
  color: var(--c-charcoal);
  margin: 0 0 8px;
}
.tb-card-excerpt {
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-body);
  margin: 0;
}

/* Tag */
.tb-tag {
  display: inline-flex; align-items: center;
  font-family: var(--f-sans);
  font-weight: 700; font-size: 11px;
  letter-spacing: 0.14em;
  padding: 3px 9px;
  border-radius: 2px;
}
.tb-tag--hanshin { background: var(--c-yellow); color: var(--c-yellow-ink); }
.tb-tag--baseball { background: var(--c-ink); color: var(--c-yellow); }
.tb-tag--keiba { background: var(--c-turf); color: #f5f1df; }
.tb-tag--column { background: var(--c-beige); color: var(--c-charcoal); }

/* ---------- Player profile cards ---------- */
.tb-player {
  background: #fff;
  border: 1px solid var(--c-line);
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tb-player:hover { transform: translateY(-2px); box-shadow: var(--sh-card); }
.tb-player-thumb {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse 60% 50% at 30% 60%, rgba(241,184,29,0.18), transparent 60%),
    repeating-linear-gradient(135deg, #2a2520 0 10px, #1c1a17 10px 11px);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.tb-player-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}
/* Fallback number badge — sits below image when image is present */
.tb-player-num {
  font-family: var(--f-mono);
  font-weight: 700; font-size: 56px;
  color: var(--c-yellow);
  -webkit-text-stroke: 1px var(--c-ink);
  position: relative; z-index: 1;
  letter-spacing: -0.02em;
}
.tb-player-role {
  display: inline-block;
  font-family: var(--f-sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--c-yellow-ink);
  background: var(--c-yellow);
  padding: 2px 8px;
}
.tb-player-name {
  font-family: var(--f-sans);
  font-weight: 800; font-size: 18px;
  margin: 8px 0 4px;
  color: var(--c-charcoal);
}
.tb-player-meta {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--c-mute);
  margin: 0 0 8px;
}
.tb-player-desc {
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
  color: var(--c-body);
}
.tb-player-link {
  margin-top: auto;
  font-size: 12px; font-weight: 700;
  color: var(--c-charcoal);
  border-bottom: 1px solid var(--c-charcoal);
  padding-bottom: 2px;
  width: max-content;
}

/* ---------- League block (dark) ---------- */
.tb-league-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 22px;
}
.tb-league-main {
  background: var(--c-ink-2);
  padding: 32px;
  border: 1px solid rgba(244,238,224,0.08);
}
.tb-league-main h3 {
  font-family: var(--f-sans);
  font-weight: 800; font-size: 22px;
  line-height: 1.4;
  margin: 14px 0 12px;
  color: #fdfbf3;
}
.tb-league-main p {
  font-size: 13px; line-height: 1.85;
  color: rgba(244,238,224,0.7);
  margin: 0;
}
.tb-league-viz {
  margin-top: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.tb-league-row {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  gap: 12px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  color: rgba(244,238,224,0.7);
}
.tb-league-bar {
  display: block; height: 10px;
  background: rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.tb-league-fill {
  display: block; height: 100%;
  background: #9ca3af;
  position: relative;
}
.tb-league-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 100%);
}
.tb-league-fill.is-leader {
  background: var(--c-yellow);
}
.tb-league-fill.is-leader::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 100%);
}
.tb-league-row > span:first-child {
  color: rgba(244,238,224,0.85);
  font-weight: 600;
}
.tb-league-row.is-leader-row > span:first-child {
  color: var(--c-yellow);
  font-weight: 800;
}
.tb-league-val {
  text-align: right;
  color: #fdfbf3;
  font-weight: 700;
}
.tb-league-asof {
  margin: 14px 0 0;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(244,238,224,0.55);
}
.tb-league-asof a {
  color: var(--c-yellow);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tb-league-note {
  display: block;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(244,238,224,0.06);
  border-left: 3px solid var(--c-yellow);
  font-family: var(--f-mono);
  font-size: 11.5px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: rgba(244,238,224,0.78);
}
.tb-league-note a {
  color: var(--c-yellow);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* For sub cards in league section: use white card but allow dark backgrounds via classes */
.tb-section--ink .tb-card {
  background: var(--c-ink-2);
  border-color: rgba(244,238,224,0.08);
}
.tb-section--ink .tb-card-title { color: #fdfbf3; }
.tb-section--ink .tb-card-excerpt { color: rgba(244,238,224,0.7); }
.tb-section--ink .tb-card-meta { color: rgba(244,238,224,0.5); }
.tb-section--ink .tb-card:hover {
  background: #25211c;
  border-color: rgba(244,238,224,0.15);
}

/* ---------- Keiba (horse race) section ---------- */
.tb-keiba-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.tb-keiba-main {
  background: #fff;
  border: 1px solid var(--c-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tb-keiba-main:hover { transform: translateY(-2px); box-shadow: var(--sh-card); }
.tb-keiba-main > div:last-child {
  padding: 22px 28px 26px;
  display: flex;
  flex-direction: column;
}
.tb-keiba-vis-wrap { /* legacy hook; not used */ }
.tb-keiba-vis {
  background: linear-gradient(135deg, var(--c-turf), #1f4029);
  aspect-ratio: 16 / 9;
  position: relative; overflow: hidden;
}
.tb-keiba-vis img { width: 100%; height: 100%; object-fit: cover; }
.tb-keiba-vis::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 30px, rgba(255,255,255,0.05) 30px 31px);
  pointer-events: none;
}
.tb-keiba-vis-label {
  position: absolute; left: 20px; bottom: 20px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.16em;
  z-index: 1;
}
.tb-keiba-main h3 {
  font-family: var(--f-sans);
  font-weight: 800; font-size: 20px;
  line-height: 1.45;
  margin: 12px 0 10px;
  color: var(--c-charcoal);
}
.tb-keiba-main p {
  font-size: 13px; line-height: 1.85;
  margin: 0 0 14px;
  color: var(--c-body);
}
.tb-keiba-main .tb-tag { margin-bottom: 4px; }
.tb-keiba-main-when {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--c-mute);
  margin: 0 0 12px;
  padding-left: 8px;
  border-left: 2px solid var(--c-turf);
}
.tb-keiba-marks {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-charcoal);
  padding: 12px 14px;
  background: var(--c-paper-2);
  border-left: 3px solid var(--c-turf);
}
.tb-keiba-sub {
  display: flex; flex-direction: column; gap: 16px;
}

/* ---------- YouTube section ---------- */
.tb-yt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tb-yt {
  background: #fff;
  border: 1px solid var(--c-line);
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.tb-yt:hover { transform: translateY(-2px); box-shadow: var(--sh-card); }
.tb-yt-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a1714, #2a2520);
  overflow: hidden;
}
.tb-yt-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.tb-yt-play {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.tb-yt-play::after {
  content: ""; width: 56px; height: 56px;
  background: var(--c-yellow);
  clip-path: polygon(20% 10%, 90% 50%, 20% 90%);
  display: block;
}
.tb-yt-dur {
  position: absolute; right: 10px; bottom: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: #fff;
  background: rgba(0,0,0,0.7);
  padding: 2px 8px;
  z-index: 2;
}
.tb-yt-body { padding: 16px 18px 18px; }
.tb-yt-title {
  font-family: var(--f-sans);
  font-weight: 700; font-size: 15px;
  line-height: 1.5;
  margin: 0 0 8px;
  color: var(--c-charcoal);
}
.tb-yt-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-mute);
  letter-spacing: 0.08em;
}

/* ---------- Footer ---------- */
.tb-footer {
  background: var(--c-ink);
  color: #b8b0a0;
  padding: 64px 48px 28px;
}
.tb-footer-inner { max-width: 1280px; margin: 0 auto; }
.tb-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(244,238,224,0.1);
}
.tb-footer h4 {
  font-family: var(--f-sans);
  font-weight: 700; font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--c-yellow);
  margin: 0 0 14px;
}
.tb-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tb-footer a { font-size: 13px; color: #d6cfbf; }
.tb-footer a:hover { color: var(--c-yellow); }
.tb-footer-brand {
  font-size: 13px; line-height: 1.8; color: #b8b0a0; max-width: 320px;
}
.tb-footer-brand .tb-logo-main { color: #f4eee0; font-size: 16px; }
.tb-footer-brand .tb-logo-sub { color: var(--c-yellow); }
.tb-footer-bottom {
  display: flex; justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #7a716a;
  padding-top: 22px;
  flex-wrap: wrap; gap: 10px;
}

/* Striped divider */
.tb-stripes {
  height: 6px;
  background-image: repeating-linear-gradient(90deg,
    var(--c-ink) 0 14px, var(--c-yellow) 14px 18px, var(--c-ink) 18px 32px, transparent 32px 38px);
  background-color: var(--c-paper);
}

/* =========================================================
   RESPONSIVE — tablet and mobile
   ========================================================= */
@media (max-width: 1100px) {
  .tb-header-inner { padding: 9px 28px; gap: 16px; }
  .tb-nav { gap: 18px; font-size: 13px; }
  .tb-hero { padding: 64px 28px 76px; }
  .tb-hero-title { font-size: 56px; }
  .tb-section { padding: 60px 28px; }
  .tb-feat-grid { grid-template-columns: 1fr; gap: 18px; }
  .tb-grid-3 { grid-template-columns: 1fr 1fr; }
  .tb-grid-4 { grid-template-columns: 1fr 1fr; }
  .tb-league-grid { grid-template-columns: 1fr; }
  .tb-keiba-grid { grid-template-columns: 1fr; }
  .tb-keiba-main { grid-column: 1; grid-template-columns: 1fr; gap: 22px; }
  .tb-yt-grid { grid-template-columns: 1fr 1fr; }
  .tb-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 768px) {
  /* Header / nav: hide desktop nav, show burger */
  .tb-header-inner { padding: 8px 16px; gap: 10px; }
  .tb-logo-main { font-size: 12px; }
  .tb-logo-sub { display: none; }
  .tb-logo-mark { width: 22px; height: 22px; font-size: 12px; }
  .tb-nav { display: none; }
  .tb-burger { display: inline-flex; }
  /* When .is-open is set on body, show stacked nav */
  body.tb-menu-open .tb-nav {
    display: flex;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--c-ink);
    border-top: 1px solid rgba(244,238,224,0.1);
    z-index: 99;
    margin-left: 0;
    padding: 8px 0 18px;
  }
  body.tb-menu-open .tb-nav a {
    padding: 14px 22px;
    border-bottom: 1px solid rgba(244,238,224,0.06);
    font-size: 15px;
  }

  /* Hero */
  .tb-hero { padding: 48px 20px 56px; }
  .tb-hero-eyebrow { font-size: 10px; letter-spacing: 0.16em; margin-bottom: 20px; }
  .tb-hero-title { font-size: 38px; line-height: 1.18; margin-bottom: 18px; }
  .tb-hero-sub { font-size: 14px; margin-bottom: 28px; }
  .tb-cta-row { flex-direction: column; gap: 8px; align-items: stretch; }
  .tb-btn { justify-content: center; padding: 13px 18px; font-size: 13px; }
  .tb-hero-strip { gap: 12px; font-size: 10px; }
  /* simplify hero patterns on small screens */
  .tb-hero-claw { display: none; }
  .tb-hero-grid-lines { height: 140px; }
  /* Hero image: shift to top so the manager/sky portion stays visible
     behind the title while the dense crowd at bottom sits below text. */
  .tb-hero-img {
    background-position: center 22%;
    opacity: 0.48;
  }
  .tb-hero-img::after {
    background:
      linear-gradient(180deg, rgba(15,14,12,0.45) 0%, rgba(15,14,12,0.65) 38%, rgba(15,14,12,0.55) 70%, rgba(15,14,12,0.85) 100%);
  }

  /* Stats */
  .tb-stats { grid-template-columns: 1fr 1fr; }
  .tb-stat { padding: 16px 18px; border-right: 1px solid rgba(244,238,224,0.08); }
  .tb-stat:nth-child(odd) { border-right: 1px solid rgba(244,238,224,0.08); }
  .tb-stat:nth-child(even) { border-right: 0; }
  .tb-stat:nth-child(1), .tb-stat:nth-child(2) { border-bottom: 1px solid rgba(244,238,224,0.08); }
  .tb-stat-num { font-size: 22px; }
  .tb-stat-label { font-size: 10px; letter-spacing: 0.12em; }

  /* Sections */
  .tb-section { padding: 44px 18px; }
  .tb-section-head { margin-bottom: 24px; padding-bottom: 12px; }
  .tb-section-title { font-size: 20px; gap: 10px; flex-wrap: wrap; }
  .tb-section-title .tb-num { font-size: 10px; }
  .tb-section-en { font-size: 10px; letter-spacing: 0.18em; }
  .tb-section-more { font-size: 12px; }

  /* Cards */
  .tb-grid-3, .tb-grid-4 { grid-template-columns: 1fr; gap: 16px; }
  .tb-feat { flex-direction: column; }
  .tb-feat-thumb { flex: 0 0 auto; aspect-ratio: 16 / 9; min-height: 0; }
  .tb-feat-thumb::after { content: none; }
  .tb-feat-body { padding: 22px 22px 24px; }
  .tb-feat-title { font-size: 19px; }
  /* Mix layout collapse to single column */
  .tb-feat-grid--mix { grid-template-columns: 1fr; }
  .tb-feat--main .tb-feat-thumb { aspect-ratio: 16 / 9; min-height: 0; width: 100%; }
  .tb-feat-sub { gap: 14px; }
  .tb-feat--card { grid-template-columns: 130px 1fr; min-height: 0; }
  .tb-feat--card .tb-feat-thumb {
    width: 130px;
    aspect-ratio: 16 / 9;
    min-height: 0;
  }
  .tb-feat--card .tb-feat-body { padding: 12px 14px; }
  .tb-feat--card .tb-feat-title { font-size: 13px; line-height: 1.4; }
  .tb-feat--card .tb-feat-meta { font-size: 9.5px; letter-spacing: 0.06em; }
  .tb-card-title { font-size: 15px; }
  .tb-card-excerpt { font-size: 12px; }

  /* YouTube */
  .tb-yt-grid { grid-template-columns: 1fr; }
  .tb-yt-title { font-size: 14px; }

  /* Footer */
  .tb-footer { padding: 44px 18px 22px; }
  .tb-footer-grid { grid-template-columns: 1fr; gap: 24px; padding-bottom: 28px; }
  .tb-footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}


/* =========================================================================
   TB-LIVE-DASHBOARD — Phase 4 / 阪神ライブダッシュボード
   ========================================================================= */
.tb-live-dashboard {
  background: var(--c-paper);
  padding: 56px 28px 64px;
  border-bottom: 1px solid var(--c-line-soft);
}

/* ---------- DARK MODE for LIVE BOARD ---------- */
@media (prefers-color-scheme: dark) {
  .tb-live-dashboard {
    background: var(--c-ink-2);
    border-bottom-color: rgba(244,238,224,0.08);
  }
  .tb-live-dashboard h2 { color: #fdfbf3; }
  .tb-live-dashboard > p { color: rgba(244,238,224,0.65); }
  .tb-live-dashboard .tb-section-kicker { color: rgba(244,238,224,0.55); }

  /* Cards: ink-2 background, yellow-tinted border */
  .tb-live-dashboard .tb-standings-card,
  .tb-live-dashboard .tb-game-list-card,
  .tb-live-dashboard .tb-war-mini {
    background: var(--c-charcoal);
    border-color: rgba(241,184,29,0.18);
    color: #f4eee0;
  }
  .tb-live-dashboard .tb-card-h3 {
    color: #fdfbf3;
    border-bottom-color: rgba(244,238,224,0.18);
  }
  /* Standings table dark */
  .tb-live-dashboard .tb-standings-table tbody td {
    color: rgba(244,238,224,0.8);
    border-bottom-color: rgba(244,238,224,0.08);
  }
  .tb-live-dashboard .tb-standings-table tbody td.tb-standings-team,
  .tb-live-dashboard .tb-standings-table tbody td.tb-standings-rank {
    color: #fdfbf3;
  }
  .tb-live-dashboard .tb-standings-row--tigers {
    background: rgba(241,184,29,0.16);
  }
  .tb-live-dashboard .tb-standings-row--tigers td {
    color: #fdfbf3 !important;
  }
  .tb-live-dashboard .tb-standings-updated {
    background: rgba(244,238,224,0.06);
    color: rgba(244,238,224,0.75);
  }
  .tb-live-dashboard .tb-standings-meta-top {
    color: rgba(244,238,224,0.55);
  }
  .tb-live-dashboard .tb-standings-meta-top a {
    color: rgba(244,238,224,0.85);
  }

  /* Next-game card stays dark (already) — just bump border */
  .tb-live-dashboard .tb-next-game-card {
    background: var(--c-ink);
    border-color: rgba(241,184,29,0.35);
  }

  /* Game list */
  .tb-live-dashboard .tb-game-list-item {
    border-bottom-color: rgba(244,238,224,0.08);
  }
  .tb-live-dashboard .tb-game-list-date,
  .tb-live-dashboard .tb-game-list-opp {
    color: #fdfbf3;
  }
  .tb-live-dashboard .tb-game-list-time {
    color: rgba(244,238,224,0.85);
  }
  .tb-live-dashboard .tb-game-list-stadium,
  .tb-live-dashboard .tb-game-list-date small {
    color: rgba(244,238,224,0.55);
  }

  /* WAR mini-table dark */
  .tb-live-dashboard .tb-war-mini-sub,
  .tb-live-dashboard .tb-war-mini-intro {
    color: rgba(244,238,224,0.7);
  }
  .tb-live-dashboard .tb-war-mini-asof {
    background: rgba(244,238,224,0.06);
    color: #fdfbf3;
  }
  .tb-live-dashboard .tb-war-mini-row {
    color: rgba(244,238,224,0.85);
  }
  .tb-live-dashboard .tb-war-mini-rank,
  .tb-live-dashboard .tb-war-mini-team,
  .tb-live-dashboard .tb-war-mini-value {
    color: #fdfbf3;
  }
  .tb-live-dashboard .tb-war-mini-row--tigers {
    background: rgba(241,184,29,0.18);
  }
  .tb-live-dashboard .tb-war-mini-track {
    background: rgba(244,238,224,0.08);
  }
  .tb-live-dashboard .tb-war-mini-bar:not(.tb-war-mini-bar--leader) {
    background: #9ca3af;
  }
  .tb-live-dashboard .tb-war-mini-breakdown {
    color: rgba(244,238,224,0.5);
  }
  .tb-live-dashboard .tb-war-mini-meta,
  .tb-live-dashboard .tb-war-mini-note {
    color: rgba(244,238,224,0.55);
    border-top-color: rgba(244,238,224,0.08);
  }
  .tb-live-dashboard .tb-war-mini-meta a {
    color: rgba(244,238,224,0.85);
  }

  /* Footer notes */
  .tb-live-dashboard .tb-dashboard-footer {
    border-top-color: rgba(244,238,224,0.08);
  }
  .tb-live-dashboard .tb-dashboard-meta,
  .tb-live-dashboard .tb-dashboard-notes {
    color: rgba(244,238,224,0.6);
  }
  .tb-live-dashboard .tb-dashboard-meta a {
    color: rgba(244,238,224,0.85);
  }
  .tb-live-dashboard .tb-dashboard-updated {
    color: rgba(244,238,224,0.85);
  }
}
.tb-live-dashboard .tb-section-kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--c-mute);
  margin-bottom: 6px;
  text-align: center;
}
.tb-live-dashboard h2 {
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--c-ink);
  margin: 0 auto 6px;
  text-align: center;
  max-width: 1280px;
}
.tb-live-dashboard > p {
  font-size: 13px;
  color: var(--c-body);
  text-align: center;
  margin: 0 auto 28px;
  max-width: 1280px;
}
.tb-dashboard-root {
  max-width: 1280px;
  margin: 0 auto;
}
.tb-dashboard-fallback {
  text-align: center;
  padding: 36px 18px;
  background: #fff;
  border: 1px solid var(--c-line-soft);
  color: var(--c-body);
}
.tb-dashboard-fallback a { color: #b8821a; text-decoration: underline; }
.tb-dashboard-fallback-sub { font-size: 12px; color: var(--c-mute); margin: 6px 0 16px; }

/* Grid */
.tb-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 26px;
}
.tb-dashboard-col { min-width: 0; display: flex; flex-direction: column; gap: 22px; }

/* Common card */
.tb-standings-card,
.tb-next-game-card,
.tb-game-list-card {
  background: #fff;
  border: 1px solid var(--c-line-soft);
  padding: 22px 24px 24px;
  position: relative;
}
.tb-card-h3 {
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--c-ink);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--c-ink);
  position: relative;
}
.tb-card-h3::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 36px; height: 2px;
  background: var(--c-yellow);
}

/* Standings */
.tb-standings-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tb-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--f-mono);
  min-width: 380px;
}
.tb-standings-table thead th {
  background: var(--c-ink);
  color: var(--c-yellow);
  font-family: var(--f-sans);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 8px 8px;
  text-align: center;
}
.tb-standings-table tbody td {
  padding: 9px 8px;
  text-align: center;
  border-bottom: 1px solid var(--c-line-soft);
  color: var(--c-body);
}
.tb-standings-table tbody td.tb-standings-team {
  font-family: var(--f-sans);
  font-weight: 700;
  color: var(--c-ink);
  text-align: left;
}
.tb-standings-table tbody td.tb-standings-rank {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--c-ink);
}
.tb-standings-row--tigers {
  background: rgba(241,184,29,0.18);
}
.tb-standings-row--tigers td {
  font-weight: 800 !important;
  color: var(--c-ink) !important;
}
.tb-standings-row--tigers td.tb-standings-team {
  position: relative;
  padding-left: 14px;
}
.tb-standings-row--tigers td.tb-standings-team::before {
  content: "";
  position: absolute;
  left: 4px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 16px;
  background: var(--c-yellow);
}
.tb-standings-updated {
  margin-top: 12px;
  font-size: 11px;
  color: var(--c-body);
  text-align: left;
  font-family: var(--f-mono);
  padding: 6px 10px;
  background: var(--c-paper-2);
  border-left: 3px solid var(--c-yellow);
  line-height: 1.55;
  letter-spacing: 0.02em;
}
.tb-standings-stale {
  display: block;
  color: #8a5a00;
  font-weight: 700;
  margin-top: 4px;
}
.tb-standings-meta-top {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--c-mute);
  margin: -4px 0 10px;
}
.tb-standings-meta-top a {
  color: var(--c-body);
  text-decoration: underline;
}
.tb-standings-meta-top a:hover { color: var(--c-ink); }
.tb-standings-card--interleague .tb-card-h3 {
  border-bottom-color: var(--c-turf);
}
.tb-standings-card--interleague .tb-card-h3::after { background: var(--c-turf); }

/* Next game card */
.tb-next-game-card {
  background: var(--c-ink);
  color: #f4eee0;
  border: 1px solid rgba(241,184,29,0.25);
  position: relative;
  overflow: hidden;
}
.tb-next-game-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background: var(--c-yellow);
}
.tb-next-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--c-yellow);
  margin-bottom: 12px;
}
.tb-next-date-row {
  display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tb-next-date {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 22px;
  color: #fdfbf3;
  letter-spacing: -0.01em;
}
.tb-next-weekday {
  font-family: var(--f-mono);
  font-size: 14px;
  color: rgba(244,238,224,0.65);
}
.tb-next-time {
  font-family: var(--f-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--c-yellow);
  margin-left: 4px;
}
.tb-next-status {
  font-family: var(--f-sans);
  font-size: 11px;
  font-weight: 700;
  background: rgba(241,184,29,0.18);
  color: var(--c-yellow);
  padding: 2px 8px;
  letter-spacing: 0.08em;
  margin-left: 4px;
}
.tb-next-matchup {
  font-family: var(--f-sans);
  font-weight: 900;
  font-size: 26px;
  margin: 0 0 14px;
  color: #fdfbf3;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.tb-next-opp { color: var(--c-yellow); }
.tb-next-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.tb-next-stadium {
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 700;
  color: rgba(244,238,224,0.85);
}
.tb-next-gametype {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(244,238,224,0.55);
  border: 1px solid rgba(244,238,224,0.18);
  padding: 1px 7px;
}
.tb-next-pitchers {
  font-size: 12px;
  color: rgba(244,238,224,0.85);
  padding: 10px 12px 11px;
  background: rgba(244,238,224,0.04);
  border-left: 2px solid var(--c-yellow);
  margin-bottom: 18px;
}
.tb-next-pitchers strong { color: var(--c-yellow); margin-right: 4px; }
.tb-next-pitchers-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: rgba(244,238,224,0.55);
  margin-bottom: 4px;
}
.tb-next-pitchers-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 2px 0;
  flex-wrap: wrap;
}
.tb-next-pitchers-team {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 11.5px;
  color: var(--c-yellow);
  min-width: 56px;
}
.tb-next-pitchers-name {
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 13.5px;
  color: #fdfbf3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tb-next-pitchers--pending .tb-next-pitchers-pending {
  font-size: 12.5px;
  color: rgba(244,238,224,0.6);
  font-style: italic;
}
.tb-game-list-pitchers {
  grid-column: 1 / -1;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--c-body);
  padding-top: 4px;
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}
.tb-game-list-pitchers-vs {
  color: var(--c-mute);
  margin: 0 2px;
}
.tb-game-list-pitchers--pending {
  color: var(--c-mute);
  font-style: italic;
}
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-pitchers {
  color: rgba(244,238,224,0.75);
}
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-pitchers-vs,
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-pitchers--pending {
  color: rgba(244,238,224,0.5);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tb-live-dashboard .tb-game-list-pitchers { color: rgba(244,238,224,0.75); }
  html:not([data-theme="light"]) .tb-live-dashboard .tb-game-list-pitchers-vs,
  html:not([data-theme="light"]) .tb-live-dashboard .tb-game-list-pitchers--pending {
    color: rgba(244,238,224,0.5);
  }
}
.tb-next-broadcasts-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(244,238,224,0.55);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(244,238,224,0.1);
}

/* Home/away badge */
.tb-ha-badge {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 7px;
}
.tb-ha-badge--home {
  background: var(--c-yellow);
  color: var(--c-yellow-ink);
}
.tb-ha-badge--away {
  background: transparent;
  color: rgba(244,238,224,0.75);
  border: 1px solid rgba(244,238,224,0.35);
}

/* Broadcast list */
.tb-broadcast-tags {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.tb-broadcast-tag {
  display: inline-block;
  font-family: var(--f-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  background: var(--c-yellow);
  color: var(--c-yellow-ink);
}
.tb-broadcast-tag--mini { font-size: 9px; padding: 1px 5px; }
.tb-broadcast-list--empty .tb-broadcast-note {
  font-size: 12px;
  color: rgba(244,238,224,0.65);
  margin: 0;
}
.tb-broadcast-list--empty .tb-broadcast-note a {
  color: var(--c-yellow);
  text-decoration: underline;
}
.tb-broadcast-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(244,238,224,0.06);
  font-size: 12px;
}
.tb-broadcast-row:last-child { border-bottom: 0; }
.tb-broadcast-type {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-yellow);
  text-align: center;
  border: 1px solid rgba(241,184,29,0.45);
  padding: 1px 4px;
}
.tb-broadcast-name { color: #fdfbf3; font-weight: 600; }
.tb-broadcast-time {
  font-family: var(--f-mono);
  color: rgba(244,238,224,0.65);
  font-size: 11px;
}
.tb-broadcast-note-inline {
  grid-column: 2 / -1;
  font-size: 11px;
  color: rgba(244,238,224,0.55);
}

/* Game list (upcoming) */
.tb-game-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tb-game-list-item {
  display: grid;
  grid-template-columns: 100px 56px 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-line-soft);
  font-size: 13px;
}
.tb-game-list-item:last-child { border-bottom: 0; }
.tb-game-list-date {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--c-ink);
  font-size: 12px;
}
.tb-game-list-date small { color: var(--c-mute); margin-left: 3px; font-weight: 500; }
.tb-game-list-time {
  font-family: var(--f-mono);
  color: var(--c-body);
  font-size: 12px;
  font-weight: 700;
}
.tb-game-list-opp {
  font-family: var(--f-sans);
  font-weight: 800;
  color: var(--c-ink);
}
.tb-game-list-stadium {
  font-size: 11px;
  color: var(--c-mute);
}
.tb-game-list-tags {
  display: flex; gap: 3px; flex-wrap: wrap;
}

/* Footer */
.tb-dashboard-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--c-line);
}
.tb-dashboard-warning {
  background: rgba(241,184,29,0.18);
  border-left: 3px solid var(--c-yellow);
  padding: 10px 14px;
  font-size: 12px;
  color: #5a4408;
  margin-bottom: 12px;
}
.tb-dashboard-meta {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  font-size: 11px;
  color: var(--c-mute);
  font-family: var(--f-mono);
}
.tb-dashboard-meta a { color: var(--c-body); text-decoration: underline; }
.tb-dashboard-meta a:hover { color: var(--c-ink); }
.tb-dashboard-notes {
  margin: 10px 0 0; padding-left: 18px;
  font-size: 11px;
  color: var(--c-mute);
}
.tb-dashboard-notes li { margin: 2px 0; }

/* Mobile: stack, reorder
   Spec: 1) next-game card (broadcast含む) → 2) standings → 3) interleague → 4) upcoming list → footer
   Achieve via display:contents on columns and explicit order on each card. */
@media (max-width: 900px) {
  .tb-dashboard-grid { display: flex; flex-direction: column; gap: 18px; }
  .tb-dashboard-col { display: contents; }
  .tb-next-game-card  { order: 1; }
  .tb-standings-card  { order: 2; }
  .tb-war-mini        { order: 3; }
  .tb-standings-card--interleague { order: 4; }
  .tb-game-list-card  { order: 5; }
}
@media (max-width: 768px) {
  .tb-live-dashboard { padding: 40px 18px 48px; }
  .tb-live-dashboard h2 { font-size: 22px; }
  .tb-next-game-card,
  .tb-standings-card,
  .tb-game-list-card { padding: 18px 18px 20px; }
  .tb-next-date { font-size: 18px; }
  .tb-next-matchup { font-size: 21px; }
  .tb-standings-table { font-size: 12px; min-width: 360px; }
  .tb-standings-table thead th { padding: 7px 5px; font-size: 10px; }
  .tb-standings-table tbody td { padding: 7px 5px; }
  .tb-game-list-item {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date time"
      "opp ha"
      "stadium tags";
    gap: 4px 8px;
    padding: 10px 0;
  }
  .tb-game-list-date  { grid-area: date; }
  .tb-game-list-time  { grid-area: time; text-align: right; }
  .tb-game-list-opp   { grid-area: opp; }
  .tb-game-list-item .tb-ha-badge { grid-area: ha; justify-self: end; }
  .tb-game-list-stadium { grid-area: stadium; }
  .tb-game-list-tags  { grid-area: tags; justify-self: end; }
  .tb-broadcast-row { grid-template-columns: 56px 1fr; }
  .tb-broadcast-time { grid-column: 2 / -1; }
}
/* === END TB-LIVE-DASHBOARD === */

/* =========================================================================
   TB-THUMB-POSITION — サムネイル画像を中央寄せに統一
   YouTubeサムネ等は人物・文字が中央付近にあるケースが多いため、
   全カード共通で object-position: center center を当てる。
   ========================================================================= */
.tb-feat-thumb img,
.tb-card-thumb img,
.tb-player-thumb img,
.tb-keiba-vis img,
.tb-yt-thumb img,
.tb-next-game-card img,
.tb-feat-grid--triple .tb-feat-thumb img,
.tb-feat-grid--mix .tb-feat-thumb img,
.tb-keiba-sub .tb-card-thumb img {
  object-fit: cover !important;
  object-position: center center !important;
}

/* Add 3-col → 2-col → 1-col responsive collapse for triple FEATURED */
@media (max-width: 1100px) {
  .tb-feat-grid--triple { grid-template-columns: 1fr 1fr; }
  .tb-feat-grid--triple .tb-feat--col:last-child { grid-column: 1 / -1; }
  .tb-feat-grid--triple .tb-feat--col:last-child .tb-feat-thumb { aspect-ratio: 24 / 9; }
}
@media (max-width: 768px) {
  .tb-feat-grid--triple { grid-template-columns: 1fr; gap: 16px; }
  .tb-feat-grid--triple .tb-feat--col:last-child { grid-column: auto; }
  .tb-feat-grid--triple .tb-feat--col:last-child .tb-feat-thumb { aspect-ratio: 16 / 9; }
}
/* === END TB-THUMB-POSITION === */

/* =========================================================================
   TB-WAR-MINI — 順位表下のセ・リーグ Team WAR ミニ表
   ========================================================================= */
.tb-war-mini {
  background: #fff;
  border: 1px solid var(--c-line-soft);
  padding: 20px 22px 22px;
  margin-top: 18px;
}
.tb-war-mini-head { margin-bottom: 12px; }
.tb-war-mini-head .tb-card-h3 { margin-bottom: 4px; }
.tb-war-mini-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--c-mute);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tb-war-mini-intro {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--c-body);
  margin: 0 0 8px;
}
.tb-war-mini-asof {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-ink);
  background: var(--c-paper-2);
  border-left: 3px solid var(--c-yellow);
  padding: 6px 10px;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
  line-height: 1.55;
}
.tb-war-mini-warn {
  background: rgba(241,184,29,0.14);
  border-left: 3px solid var(--c-yellow);
  padding: 8px 12px;
  font-size: 11.5px;
  color: #5a4408;
  margin-bottom: 10px;
}
.tb-war-mini-list {
  display: flex; flex-direction: column;
  gap: 7px;
}
.tb-war-mini-row {
  display: grid;
  grid-template-columns: 18px 60px 1fr 44px;
  gap: 8px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-body);
  position: relative;
  padding: 3px 0;
}
.tb-war-mini-row--tigers {
  background: rgba(241,184,29,0.12);
  padding-left: 6px;
  padding-right: 6px;
  margin: 0 -6px;
  font-weight: 700;
}
.tb-war-mini-rank {
  font-weight: 700;
  color: var(--c-ink);
  text-align: center;
}
.tb-war-mini-team {
  font-family: var(--f-sans);
  font-weight: 700;
  color: var(--c-ink);
}
.tb-war-mini-row--tigers .tb-war-mini-team {
  color: var(--c-ink);
  font-weight: 800;
}
.tb-war-mini-track {
  display: block;
  height: 8px;
  background: var(--c-line-soft);
  position: relative;
  overflow: hidden;
}
.tb-war-mini-bar {
  display: block;
  height: 100%;
  background: #9ca3af;
  position: relative;
}
.tb-war-mini-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 100%);
}
.tb-war-mini-bar--leader {
  background: var(--c-yellow);
}
.tb-war-mini-value {
  font-weight: 800;
  color: var(--c-ink);
  text-align: right;
}
.tb-war-mini-row--tigers .tb-war-mini-value {
  color: var(--c-yellow-ink);
}
.tb-war-mini-breakdown {
  grid-column: 2 / -1;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: var(--c-mute);
  padding-top: 2px;
}
.tb-war-mini-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--c-line);
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--c-mute);
}
.tb-war-mini-meta a {
  color: var(--c-body);
  text-decoration: underline;
}
.tb-war-mini-meta a:hover { color: var(--c-ink); }
.tb-war-mini-note {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: var(--c-mute);
  line-height: 1.6;
}
.tb-war-mini--empty .tb-war-mini-list { display: none; }

/* Dark mode (top page uses light paper, but support if user inverts) */
@media (prefers-color-scheme: dark) {
  /* top page stays paper bg by design, no override here */
}

/* Mobile */
@media (max-width: 768px) {
  .tb-war-mini { padding: 16px 16px 18px; }
  .tb-war-mini-row {
    grid-template-columns: 16px 52px 1fr 40px;
    gap: 6px;
    font-size: 11.5px;
  }
  .tb-war-mini-breakdown { display: none; } /* save space on mobile */
}
/* === END TB-WAR-MINI === */


/* =========================================================================
   TB-LEAGUE-INFO — LIVE BOARD 内 リーグ情報エリア
   - PC: セ・リーグ順位表 ｜ 交流戦順位表（2カラム）
   - その下に Team WAR ミニ表（横幅いっぱい）
   - スマホ: 縦積み（CL → Interleague → WAR）
   ========================================================================= */
.tb-league-info {
  margin: 0 0 28px;
}
.tb-league-info-intro {
  margin: 0 0 14px;
}
.tb-league-info-lead {
  font-family: var(--f-sans);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--c-ink);
  margin: 0;
  padding: 8px 12px;
  background: var(--c-paper-2);
  border-left: 4px solid var(--c-yellow);
}
.tb-standings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  margin: 0 0 18px;
  align-items: start;
}
.tb-standings-grid > .tb-standings-card { margin: 0; }
.tb-league-info .tb-war-mini { margin-top: 0; }

/* Schedule grid (next game + upcoming) — same proportions as legacy dashboard-grid */
.tb-dashboard-grid--schedule {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

/* Tablet: still 2-col standings but slightly tighter */
@media (max-width: 1024px) {
  .tb-standings-grid { gap: 16px; }
}

/* Mobile: stack standings cards */
@media (max-width: 768px) {
  .tb-league-info { margin-bottom: 20px; }
  .tb-standings-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
  }
  .tb-league-info-lead {
    font-size: 12px;
    padding: 7px 10px;
  }
}

/* iPhone-sized viewports: the standings tables sit just over the available width.
   Shrink card padding, table font, and per-cell padding so all 8 columns fit at 375px
   (and degrade gracefully at 320px). Layout, content, and tigers row highlight all stay intact. */
@media (max-width: 480px) {
  .tb-live-dashboard,
  .tb-dashboard-root,
  .tb-league-info,
  .tb-standings-grid,
  .tb-standings-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .tb-live-dashboard .tb-standings-card {
    padding: 16px 12px 18px;
  }
  .tb-live-dashboard .tb-standings-tablewrap {
    /* Internal scroll is disallowed at iPhone widths — the table must fit. */
    overflow-x: visible;
  }
  .tb-live-dashboard .tb-standings-table {
    width: 100%;
    table-layout: fixed;
    min-width: 0;
    font-size: 11px;
  }
  .tb-live-dashboard .tb-standings-table thead th {
    padding: 6px 2px;
    font-size: 10px;
    letter-spacing: 0.02em;
  }
  .tb-live-dashboard .tb-standings-table tbody td {
    padding: 6px 2px;
  }
  /* Give the team column more room, numeric columns less */
  .tb-live-dashboard .tb-standings-table thead th:nth-child(1),
  .tb-live-dashboard .tb-standings-table tbody td:nth-child(1) { width: 8%; }
  .tb-live-dashboard .tb-standings-table thead th:nth-child(2),
  .tb-live-dashboard .tb-standings-table tbody td:nth-child(2) { width: 22%; }
  .tb-live-dashboard .tb-standings-table thead th:nth-child(n+3),
  .tb-live-dashboard .tb-standings-table tbody td:nth-child(n+3) { width: auto; }
  .tb-live-dashboard .tb-standings-table tbody td.tb-standings-team {
    /* allow long team names like ソフトバンク to wrap to two lines instead of overflowing */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.3;
  }
  .tb-live-dashboard .tb-standings-row--tigers td.tb-standings-team {
    padding-left: 10px;
  }
  .tb-live-dashboard .tb-standings-row--tigers td.tb-standings-team::before {
    width: 3px; left: 2px;
  }
  .tb-live-dashboard .tb-standings-meta-top,
  .tb-live-dashboard .tb-standings-updated {
    font-size: 10px;
    padding: 5px 7px;
  }
}
/* Extra-narrow (e.g. iPhone SE 320px) — one more notch tighter */
@media (max-width: 360px) {
  .tb-live-dashboard .tb-standings-card { padding: 14px 10px 16px; }
  .tb-live-dashboard .tb-standings-table { font-size: 10.5px; }
  .tb-live-dashboard .tb-standings-table thead th { font-size: 9px; padding: 5px 1px; }
  .tb-live-dashboard .tb-standings-table tbody td { padding: 5px 1px; }
}
/* Dark mode coverage for league-info intro */
html[data-theme="dark"] .tb-live-dashboard .tb-league-info-lead {
  background: rgba(244,238,224,0.06);
  color: #fdfbf3;
  border-left-color: var(--c-yellow);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tb-live-dashboard .tb-league-info-lead {
    background: rgba(244,238,224,0.06);
    color: #fdfbf3;
    border-left-color: var(--c-yellow);
  }
}
/* === END TB-LEAGUE-INFO === */


/* =========================================================================
   TB-DARK-FIX (final layer)
   - Covers BOTH `html[data-theme="dark"]` (manual toggle / theme.js)
   - AND `@media (prefers-color-scheme: dark)` (OS preference)
   - Placed at END so it wins source-order against earlier light-mode rules
   - High-specificity selectors override .tb-war-mini-row--tigers tigers value
   ========================================================================= */

/* ---------- Helper: apply same rules to both dark contexts ---------- */
/* TOP page LIVE BOARD container & section */
html[data-theme="dark"] .tb-live-dashboard {
  background: #1c1a17;
  border-bottom-color: rgba(244,238,224,0.08);
}
html[data-theme="dark"] .tb-live-dashboard h2 { color: #fdfbf3; }
html[data-theme="dark"] .tb-live-dashboard > p { color: rgba(244,238,224,0.65); }
html[data-theme="dark"] .tb-live-dashboard .tb-section-kicker { color: rgba(244,238,224,0.55); }

/* Cards: charcoal background + yellow-tinted border */
html[data-theme="dark"] .tb-live-dashboard .tb-standings-card,
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-card,
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini {
  background: #2a2520;
  border-color: rgba(241,184,29,0.18);
  color: #f4eee0;
}
html[data-theme="dark"] .tb-live-dashboard .tb-card-h3 {
  color: #fdfbf3;
  border-bottom-color: rgba(244,238,224,0.18);
}
/* Standings table */
html[data-theme="dark"] .tb-live-dashboard .tb-standings-table tbody td {
  color: rgba(244,238,224,0.8);
  border-bottom-color: rgba(244,238,224,0.08);
}
html[data-theme="dark"] .tb-live-dashboard .tb-standings-table tbody td.tb-standings-team,
html[data-theme="dark"] .tb-live-dashboard .tb-standings-table tbody td.tb-standings-rank {
  color: #fdfbf3;
}
html[data-theme="dark"] .tb-live-dashboard .tb-standings-row--tigers {
  background: rgba(241,184,29,0.16);
}
html[data-theme="dark"] .tb-live-dashboard .tb-standings-row--tigers td {
  color: #fdfbf3;
}
html[data-theme="dark"] .tb-live-dashboard .tb-standings-updated {
  background: rgba(244,238,224,0.06);
  color: rgba(244,238,224,0.75);
}
html[data-theme="dark"] .tb-live-dashboard .tb-standings-meta-top {
  color: rgba(244,238,224,0.55);
}
html[data-theme="dark"] .tb-live-dashboard .tb-standings-meta-top a {
  color: rgba(244,238,224,0.85);
}

/* Next game card */
html[data-theme="dark"] .tb-live-dashboard .tb-next-game-card {
  background: #0f0e0c;
  border-color: rgba(241,184,29,0.35);
}

/* Game list */
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-item {
  border-bottom-color: rgba(244,238,224,0.08);
}
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-date,
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-opp {
  color: #fdfbf3;
}
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-time {
  color: rgba(244,238,224,0.85);
}
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-stadium,
html[data-theme="dark"] .tb-live-dashboard .tb-game-list-date small {
  color: rgba(244,238,224,0.55);
}

/* WAR mini table — ALL text cream, tigers row keeps yellow bg but cream text */
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-sub,
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-intro {
  color: rgba(244,238,224,0.7);
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-asof {
  background: rgba(244,238,224,0.06);
  color: #fdfbf3;
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-row {
  color: rgba(244,238,224,0.85);
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-row .tb-war-mini-rank,
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-row .tb-war-mini-team,
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-row .tb-war-mini-value {
  color: #fdfbf3;
}
/* CRITICAL: high-specificity tigers row override (beats line 1781 light-mode rule) */
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-row.tb-war-mini-row--tigers .tb-war-mini-rank,
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-row.tb-war-mini-row--tigers .tb-war-mini-team,
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-row.tb-war-mini-row--tigers .tb-war-mini-value {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-row--tigers {
  background: rgba(241,184,29,0.22);
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-track {
  background: rgba(244,238,224,0.08);
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-bar:not(.tb-war-mini-bar--leader) {
  background: #9ca3af;
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-breakdown {
  color: rgba(244,238,224,0.5);
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-meta,
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-note {
  color: rgba(244,238,224,0.55);
  border-top-color: rgba(244,238,224,0.08);
}
html[data-theme="dark"] .tb-live-dashboard .tb-war-mini-meta a {
  color: rgba(244,238,224,0.85);
}

/* Footer notes */
html[data-theme="dark"] .tb-live-dashboard .tb-dashboard-footer {
  border-top-color: rgba(244,238,224,0.08);
}
html[data-theme="dark"] .tb-live-dashboard .tb-dashboard-meta,
html[data-theme="dark"] .tb-live-dashboard .tb-dashboard-notes {
  color: rgba(244,238,224,0.6);
}
html[data-theme="dark"] .tb-live-dashboard .tb-dashboard-meta a {
  color: rgba(244,238,224,0.85);
}
html[data-theme="dark"] .tb-live-dashboard .tb-dashboard-updated {
  color: rgba(244,238,224,0.85);
}

/* ---------- Bottom LEAGUE section bar chart (existing dark) ---------- */
html[data-theme="dark"] .tb-league-row.is-leader-row > span:first-child,
html[data-theme="dark"] .tb-league-row.is-leader-row .tb-league-val {
  color: #fdfbf3;
}

/* ---------- @media duplicate for OS dark-only browsers ---------- */
@media (prefers-color-scheme: dark) {
  /* CRITICAL: high-specificity tigers row override */
  .tb-live-dashboard .tb-war-mini-row.tb-war-mini-row--tigers .tb-war-mini-rank,
  .tb-live-dashboard .tb-war-mini-row.tb-war-mini-row--tigers .tb-war-mini-team,
  .tb-live-dashboard .tb-war-mini-row.tb-war-mini-row--tigers .tb-war-mini-value {
    color: #fdfbf3 !important;
  }
  .tb-live-dashboard .tb-war-mini-row--tigers {
    background: rgba(241,184,29,0.22);
  }
}

/* === END TB-DARK-FIX === */


/* =========================================================================
   TB-DARK-FIX-2 (final FINAL layer — TOP page mobile dark mode)
   Investigation findings:
   - TOP page lacked theme.js → html[data-theme="dark"] never set (now fixed in HTML)
   - @media (prefers-color-scheme: dark) rules for h2/p existed but were
     OVERRIDDEN by later light-mode .tb-live-dashboard h2 { color: var(--c-ink) }
     at line ~1199 due to source order
   - .tb-section (FEATURED, REVIEW, PLAYER, LEAGUE, KEIBA, YT) had NO dark
     override at all → still paper #f7f3ea in dark mode

   Strategy: append all dark-mode rules at end so source order wins.
   Cover both manual toggle (html[data-theme="dark"]) AND OS pref (@media).
   ========================================================================= */

/* ===== Variant A: html[data-theme="dark"] (manual toggle via theme.js) ===== */
html[data-theme="dark"] body.tb-root {
  background: #14110d;
  color: #f4eee0;
}
/* Live board headings */
html[data-theme="dark"] body.tb-root .tb-live-dashboard {
  background: #1c1a17 !important;
  border-bottom-color: rgba(244,238,224,0.08) !important;
}
html[data-theme="dark"] body.tb-root .tb-live-dashboard h2,
html[data-theme="dark"] body.tb-root .tb-live-dashboard h2[id] {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body.tb-root .tb-live-dashboard > p {
  color: rgba(244,238,224,0.78) !important;
}
html[data-theme="dark"] body.tb-root .tb-live-dashboard .tb-section-kicker {
  color: rgba(244,238,224,0.55) !important;
}
/* Section backgrounds (FEATURED / REVIEW / PLAYER / LEAGUE / KEIBA / YT) */
html[data-theme="dark"] body.tb-root .tb-section {
  background: #14110d !important;
}
html[data-theme="dark"] body.tb-root .tb-section--alt {
  background: #1c1a17 !important;
}
html[data-theme="dark"] body.tb-root .tb-section--ink {
  background: #0a0908 !important;
}
html[data-theme="dark"] body.tb-root .tb-section-title,
html[data-theme="dark"] body.tb-root .tb-section-head .tb-section-title {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body.tb-root .tb-section-en {
  color: rgba(241,184,29,0.6) !important;
}
html[data-theme="dark"] body.tb-root .tb-section-more {
  color: var(--c-yellow) !important;
}
/* FEATURED cards */
html[data-theme="dark"] body.tb-root .tb-feat--col {
  background: #1c1a17 !important;
  border: 1px solid rgba(241,184,29,0.18) !important;
}
html[data-theme="dark"] body.tb-root .tb-feat-body {
  background: #1c1a17 !important;
}
html[data-theme="dark"] body.tb-root .tb-feat-title {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body.tb-root .tb-feat-excerpt {
  color: rgba(244,238,224,0.75) !important;
}
html[data-theme="dark"] body.tb-root .tb-feat-meta {
  color: rgba(244,238,224,0.5) !important;
}
/* Game review / player / yt cards */
html[data-theme="dark"] body.tb-root .tb-card {
  background: #1c1a17 !important;
  border-color: rgba(241,184,29,0.18) !important;
}
html[data-theme="dark"] body.tb-root .tb-card-body {
  background: #1c1a17 !important;
}
html[data-theme="dark"] body.tb-root .tb-card-title {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body.tb-root .tb-card-excerpt {
  color: rgba(244,238,224,0.78) !important;
}
html[data-theme="dark"] body.tb-root .tb-card-meta,
html[data-theme="dark"] body.tb-root .tb-card-date,
html[data-theme="dark"] body.tb-root .tb-card-when {
  color: rgba(244,238,224,0.65) !important;
}
html[data-theme="dark"] body.tb-root .tb-player {
  background: #1c1a17 !important;
  border-color: rgba(241,184,29,0.18) !important;
}
html[data-theme="dark"] body.tb-root .tb-player-name {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body.tb-root .tb-player-meta {
  color: rgba(244,238,224,0.5) !important;
}
html[data-theme="dark"] body.tb-root .tb-player-desc {
  color: rgba(244,238,224,0.78) !important;
}
html[data-theme="dark"] body.tb-root .tb-player-link {
  color: var(--c-yellow) !important;
}
/* Keiba section */
html[data-theme="dark"] body.tb-root .tb-keiba-main {
  background: #1c1a17 !important;
  border-color: rgba(241,184,29,0.18) !important;
}
html[data-theme="dark"] body.tb-root .tb-keiba-main h3 {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body.tb-root .tb-keiba-main p {
  color: rgba(244,238,224,0.78) !important;
}
html[data-theme="dark"] body.tb-root .tb-keiba-marks {
  background: rgba(244,238,224,0.05) !important;
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body.tb-root .tb-keiba-main-when {
  color: rgba(244,238,224,0.5) !important;
}
/* YouTube cards */
html[data-theme="dark"] body.tb-root .tb-yt {
  background: #1c1a17 !important;
  border-color: rgba(241,184,29,0.18) !important;
}
html[data-theme="dark"] body.tb-root .tb-yt-title {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body.tb-root .tb-yt-meta {
  color: rgba(244,238,224,0.5) !important;
}
/* League section dark adjustments */
html[data-theme="dark"] body.tb-root .tb-league-asof {
  color: rgba(244,238,224,0.65) !important;
}
/* Striped divider */
html[data-theme="dark"] body.tb-root .tb-stripes {
  filter: brightness(0.8);
}

/* ===== Variant B: @media (prefers-color-scheme: dark) — OS pref only ===== */
@media (prefers-color-scheme: dark) {
  body.tb-root .tb-live-dashboard h2,
  body.tb-root .tb-live-dashboard h2[id] {
    color: #fdfbf3 !important;
  }
  body.tb-root .tb-live-dashboard > p {
    color: rgba(244,238,224,0.78) !important;
  }
  body.tb-root .tb-live-dashboard .tb-section-kicker {
    color: rgba(244,238,224,0.55) !important;
  }
  body.tb-root .tb-section {
    background: #14110d !important;
  }
  body.tb-root .tb-section--alt {
    background: #1c1a17 !important;
  }
  body.tb-root .tb-section--ink {
    background: #0a0908 !important;
  }
  body.tb-root .tb-section-title {
    color: #fdfbf3 !important;
  }
  body.tb-root .tb-section-en {
    color: rgba(241,184,29,0.6) !important;
  }
  body.tb-root .tb-section-more {
    color: var(--c-yellow) !important;
  }
  body.tb-root .tb-feat--col,
  body.tb-root .tb-card,
  body.tb-root .tb-player,
  body.tb-root .tb-keiba-main,
  body.tb-root .tb-yt {
    background: #1c1a17 !important;
    border-color: rgba(241,184,29,0.18) !important;
  }
  body.tb-root .tb-feat-body,
  body.tb-root .tb-card-body {
    background: #1c1a17 !important;
  }
  body.tb-root .tb-feat-title,
  body.tb-root .tb-card-title,
  body.tb-root .tb-player-name,
  body.tb-root .tb-keiba-main h3,
  body.tb-root .tb-yt-title {
    color: #fdfbf3 !important;
  }
  body.tb-root .tb-feat-excerpt,
  body.tb-root .tb-card-excerpt,
  body.tb-root .tb-player-desc,
  body.tb-root .tb-keiba-main p {
    color: rgba(244,238,224,0.78) !important;
  }
  body.tb-root .tb-feat-meta,
  body.tb-root .tb-card-meta,
  body.tb-root .tb-card-date,
  body.tb-root .tb-card-when,
  body.tb-root .tb-player-meta,
  body.tb-root .tb-keiba-main-when,
  body.tb-root .tb-yt-meta {
    color: rgba(244,238,224,0.5) !important;
  }
  body.tb-root .tb-player-link {
    color: var(--c-yellow) !important;
  }
  body.tb-root .tb-keiba-marks {
    background: rgba(244,238,224,0.05) !important;
    color: #fdfbf3 !important;
  }
  body.tb-root .tb-league-asof {
    color: rgba(244,238,224,0.65) !important;
  }
}

/* === END TB-DARK-FIX-2 === */
