/*
Theme Name: Sabong Legends X-Dark
Theme URI: https://sabonglegends.net/
Author: Sabong Legends Engineering
Description: Ultra-fast X.com Lights Out Dark Mode SEO Theme for Sabong & Online Sabong Philippines. Zero image bloat, 1px hairline grid architecture.
Version: 1.1.3
Text Domain: sabonglegends
*/

:root {
  --bg-primary: #000000;
  --bg-elevated: #16181c;
  --bg-hover: #1d1f23;
  --bg-glass: rgba(0, 0, 0, 0.72);
  --border-hairline: #2f3336;
  --text-primary: #e7e9ea;
  --text-secondary: #71767b;
  --accent-blue: #1d9bf0;
  --accent-blue-hover: #1a8cd8;
  --meron-red: #f4212e;
  --meron-bg: rgba(244, 33, 46, 0.14);
  --wala-blue: #1d9bf0;
  --wala-bg: rgba(29, 155, 240, 0.14);
  --draw-green: #00ba7c;
  --draw-bg: rgba(0, 186, 124, 0.14);
  --gold-legend: #ffd400;
  --gold-bg: rgba(255, 212, 0, 0.14);
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* =====================================================================
   RECONSTRUCTED BELOW (Module 1 PDF was truncated after a:hover).
   Mobile-first X.com "Lights Out" 3-column shell. Square corners on all
   buttons, pills, tabs and inputs (owner rule: no rounded pills).
   ===================================================================== */

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--text-primary); line-height: 1.25; font-weight: 800; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ---------- Shell (mobile first: single column) ---------- */
.x-shell { display: flex; flex-direction: column; width: 100%; max-width: 1265px; margin: 0 auto; }
.x-feed-center { width: 100%; min-width: 0; border-left: 0; border-right: 0; }

/* Left rail = compact sticky top bar on phones */
.x-rail-left { position: relative; z-index: 50; background: var(--bg-primary); border-bottom: 1px solid var(--border-hairline); }
.x-rail-top { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 6px; }
.x-brand-logo-wrap { display: inline-block; align-self: flex-start; }
.x-brand-logo { width: auto; height: 34px; }
.x-nav-list { list-style: none; display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.x-nav-list::-webkit-scrollbar { display: none; }
.x-nav-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--text-primary); font-weight: 600; font-size: 0.88rem; white-space: nowrap; border-radius: 0; }
.x-nav-link:hover { background: var(--bg-hover); text-decoration: none; }
.x-nav-link.active { font-weight: 800; box-shadow: inset 0 -2px 0 var(--accent-blue); }
.x-nav-icon { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; }
.x-rail-cta { display: none; }
.x-rail-disclaimer { display: none; }

/* Right rail stacks under the feed on phones */
.x-rail-right { width: 100%; padding: 12px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--border-hairline); }

/* ---------- Center feed pieces ---------- */
.x-sticky-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--bg-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-hairline); }
.x-header-title { font-size: 1.12rem; font-weight: 800; color: var(--text-primary); }
.x-header-sub { font-size: 0.78rem; color: var(--text-secondary); }
.x-feed-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--border-hairline); scrollbar-width: none; }
.x-feed-tabs::-webkit-scrollbar { display: none; }
.x-tab-btn { flex: 1 0 auto; background: transparent; border: 0; color: var(--text-secondary); font-weight: 700; font-size: 0.9rem; padding: 14px 14px; cursor: pointer; border-radius: 0; white-space: nowrap; min-height: 48px; }
.x-tab-btn:hover { background: var(--bg-hover); }
.x-tab-btn.active { color: var(--text-primary); box-shadow: inset 0 -4px 0 var(--accent-blue); }

.x-post-card, .x-hero-card { padding: 16px 14px; border-bottom: 1px solid var(--border-hairline); }
.x-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.x-avatar-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.x-title-group { min-width: 0; }
.x-handle { color: var(--text-secondary); font-size: 0.84rem; overflow-wrap: anywhere; }
.x-monogram { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem; color: var(--text-primary); background: var(--bg-elevated); border: 2px solid var(--border-hairline); letter-spacing: 0.5px; }
.x-monogram.gold-ring { border-color: var(--gold-legend); color: var(--gold-legend); }
.x-monogram.blue-ring { border-color: var(--wala-blue); color: var(--wala-blue); }
.x-monogram.red-ring { border-color: var(--meron-red); color: var(--meron-red); }
.x-monogram.green-ring { border-color: var(--draw-green); color: var(--draw-green); }

.x-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border: 1px solid var(--border-hairline); border-radius: 0; font-size: 0.78rem; font-weight: 700; color: var(--text-primary); background: var(--bg-elevated); white-space: nowrap; }
a.x-pill:hover { background: var(--bg-hover); text-decoration: none; }
.x-pill.gold { color: var(--gold-legend); background: var(--gold-bg); border-color: rgba(255,212,0,0.35); }
.x-pill.meron { color: var(--meron-red); background: var(--meron-bg); border-color: rgba(244,33,46,0.35); }
.x-pill.wala { color: var(--wala-blue); background: var(--wala-bg); border-color: rgba(29,155,240,0.35); }
.x-pill.draw { color: var(--draw-green); background: var(--draw-bg); border-color: rgba(0,186,124,0.35); }
.x-badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.x-btn-primary, .x-btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; font-weight: 800; font-size: 0.95rem; border-radius: 0; cursor: pointer; text-align: center; }
.x-btn-primary { background: var(--text-primary); color: #0f1419; border: 1px solid var(--text-primary); }
.x-btn-primary:hover { background: #d7dbdc; text-decoration: none; }
.x-btn-primary.blue { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
.x-btn-primary.blue:hover { background: var(--accent-blue-hover); }
.x-btn-outline { background: transparent; color: var(--text-primary); border: 1px solid #536471; }
.x-btn-outline:hover { background: var(--bg-hover); text-decoration: none; }
.x-btn-block { display: flex; width: 100%; }

/* Long-form copy */
.x-prose h1 { font-size: 1.45rem; margin: 6px 0 10px; }
.x-prose h2 { font-size: 1.22rem; margin: 22px 0 10px; }
.x-prose h3 { font-size: 1.04rem; margin: 16px 0 6px; }
.x-prose p { margin: 0 0 12px; color: var(--text-primary); font-size: 0.98rem; }
.x-prose ul, .x-prose ol { margin: 0 0 12px 20px; }
.x-prose li { margin-bottom: 6px; }
.x-prose strong { color: #fff; }
.x-muted { color: var(--text-secondary); font-size: 0.86rem; }
.x-section-anchor { scroll-margin-top: 110px; }

.x-hero-figure { margin: 12px 0 14px; border: 1px solid var(--border-hairline); overflow: hidden; background: var(--bg-elevated); }
.x-hero-figure img { width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: 420px; object-fit: cover; }

/* Platform feed cards */
.x-platform-card { display: block; padding: 14px; border-bottom: 1px solid var(--border-hairline); color: var(--text-primary); }
.x-platform-card:hover { background: #080808; text-decoration: none; }
.x-platform-card[hidden] { display: none; }
.x-platform-card .x-name { font-weight: 800; font-size: 1rem; }
.x-platform-card .x-tagline { color: var(--text-primary); font-size: 0.92rem; margin: 6px 0 8px; }
.x-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Tables (scroll on phones) */
.x-table-wrap { overflow-x: auto; border: 1px solid var(--border-hairline); margin: 10px 0 14px; }
.x-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.x-table-wide { min-width: 520px; }
.x-table th, .x-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-hairline); text-align: left; vertical-align: top; }
.x-table th { background: var(--bg-elevated); color: var(--text-secondary); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.3px; }
.x-table tr:last-child td { border-bottom: 0; }

.x-grid-2 { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 10px 0 14px; }
.x-box { border: 1px solid var(--border-hairline); padding: 12px 14px; background: var(--bg-elevated); }
.x-box.pros { border-left: 3px solid var(--draw-green); }
.x-box.cons { border-left: 3px solid var(--meron-red); }
.x-box h3 { margin-top: 0; }
.x-steps { counter-reset: step; list-style: none; margin-left: 0 !important; }
.x-steps li { counter-increment: step; position: relative; padding-left: 40px; min-height: 30px; }
.x-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--accent-blue); color: #fff; font-weight: 800; font-size: 0.85rem; }

.x-faq details { border: 1px solid var(--border-hairline); margin-bottom: 8px; background: var(--bg-elevated); }
.x-faq summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; }
.x-faq summary::-webkit-details-marker { display: none; }
.x-faq summary::after { content: "+"; float: right; color: var(--text-secondary); }
.x-faq details[open] summary::after { content: "\2212"; }
.x-faq .x-faq-a { padding: 0 14px 12px; color: var(--text-primary); }

/* ---------- Right rail widgets ---------- */
.x-search-box { position: relative; display: flex; align-items: center; gap: 10px; background: var(--bg-elevated); border: 1px solid var(--border-hairline); padding: 0 14px; border-radius: 0; }
.x-search-box:focus-within { border-color: var(--accent-blue); background: #000; }
.x-search-input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text-primary); padding: 12px 0; font-size: 16px; min-width: 0; }
.x-search-results { list-style: none; border: 1px solid var(--border-hairline); border-top: 0; background: #000; max-height: 320px; overflow-y: auto; }
.x-search-results[hidden] { display: none; }
.x-search-results a { display: block; padding: 10px 14px; color: var(--text-primary); border-bottom: 1px solid var(--border-hairline); font-size: 0.9rem; }
.x-search-results a:hover { background: var(--bg-hover); text-decoration: none; }
.x-search-empty { padding: 10px 14px; color: var(--text-secondary); font-size: 0.86rem; }
.x-widget-card { background: var(--bg-elevated); border: 1px solid var(--border-hairline); border-radius: 0; overflow: hidden; }
.x-widget-title { font-size: 1.1rem; font-weight: 800; padding: 12px 16px 0; }
.x-widget-card input, .x-widget-card select { border-radius: 0 !important; }
.x-calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.x-calc-out div { border: 1px solid var(--border-hairline); background: #000; padding: 10px; }
.x-calc-out span { display: block; font-size: 0.72rem; color: var(--text-secondary); font-weight: 700; }
.x-calc-out strong { font-size: 1.05rem; color: var(--draw-green); }
.x-calc-out .total strong { color: var(--gold-legend); }
.x-trend-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--text-primary); border-top: 1px solid var(--border-hairline); }
.x-trend-item:hover { background: var(--bg-hover); text-decoration: none; }
.x-trend-item .x-monogram { width: 36px; height: 36px; font-size: 0.78rem; }
.x-trend-meta { font-size: 0.76rem; color: var(--text-secondary); }
.x-trend-name { font-weight: 700; font-size: 0.92rem; }
.x-rail-footnote { font-size: 0.75rem; color: var(--text-secondary); padding: 0 4px; }

/* ---------- Tablet / desktop: X.com 3-column shell ---------- */
@media (min-width: 700px) {
  .x-grid-2 { grid-template-columns: 1fr 1fr; }
  .x-prose h1 { font-size: 1.7rem; }
}
@media (min-width: 1000px) {
  .x-shell { flex-direction: row; align-items: flex-start; }
  .x-rail-left { position: sticky; top: 0; height: 100vh; width: 260px; flex: 0 0 260px; border-bottom: 0; background: var(--bg-primary); -webkit-backdrop-filter: none; backdrop-filter: none; overflow-y: auto; }
  .x-rail-top { padding: 14px 12px; gap: 14px; }
  .x-brand-logo { height: auto; width: 180px; }
  .x-nav-list { flex-direction: column; overflow: visible; gap: 4px; }
  .x-nav-link { font-size: 1.12rem; padding: 12px 14px; gap: 18px; }
  .x-nav-link.active { box-shadow: inset 3px 0 0 var(--accent-blue); }
  .x-nav-icon { width: 26px; height: 26px; }
  .x-rail-cta { display: flex; margin-top: 6px; }
  .x-rail-disclaimer { display: block; font-size: 0.75rem; color: var(--text-secondary); padding: 0 6px; }
  .x-feed-center { flex: 0 1 600px; max-width: 600px; border-left: 1px solid var(--border-hairline); border-right: 1px solid var(--border-hairline); min-height: 100vh; }
  .x-rail-right { position: sticky; top: 0; flex: 0 0 350px; width: 350px; padding: 12px 0 24px 28px; border-top: 0; max-height: 100vh; overflow-y: auto; scrollbar-width: none; }
  .x-post-card, .x-hero-card { padding: 16px; }
}
@media (min-width: 1280px) {
  .x-rail-left { width: 275px; flex-basis: 275px; }
}

/* ---------- Play CTAs: Browser + Telegram (square, side by side; stacked on narrow phones) ---------- */
.x-play-ctas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.x-play-ctas .x-btn-primary, .x-play-ctas .x-btn-outline { width: 100%; padding: 10px 8px; font-size: 0.9rem; }
.x-play-telegram { border-color: #2aabee; color: #2aabee; }
.x-play-telegram:hover { background: rgba(42,171,238,0.12); }
.x-cta-icon { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
@media (max-width: 359px) { .x-play-ctas { grid-template-columns: 1fr; } }
.x-mobile-playbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(0,0,0,0.92); border-top: 1px solid var(--border-hairline); }
body.x-lights-out { padding-bottom: 72px; }
.x-rail-cta.x-play-ctas { display: none; }
@media (min-width: 1000px) {
  .x-mobile-playbar { display: none; }
  body.x-lights-out { padding-bottom: 0; }
  .x-rail-cta.x-play-ctas { display: grid; grid-template-columns: 1fr; margin-top: 6px; }
}

/* Layout fixes */
.x-rail-right > * { flex-shrink: 0; }
.x-sticky-header .x-btn-outline { white-space: nowrap; min-height: 36px; }
.x-table th[scope="row"] { width: 42%; }

/* ---------- v1.1.1: Mobile-only header CTAs beside the logo (Mark 2026-11-14) ---------- */
.x-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.x-brand-row .x-brand-logo-wrap { flex: 0 0 auto; }
.x-play-ctas.x-top-ctas { display: flex; width: auto; gap: 6px; flex: 0 1 auto; min-width: 0; }
.x-play-ctas.x-top-ctas .x-btn-primary, .x-play-ctas.x-top-ctas .x-btn-outline { width: auto; padding: 7px 10px; font-size: 0.82rem; gap: 5px; white-space: nowrap; min-height: 34px; border-radius: 0; }
.x-top-ctas .x-cta-icon { width: 16px; height: 16px; }
@media (max-width: 359px) { .x-play-ctas.x-top-ctas { display: flex; } .x-play-ctas.x-top-ctas .x-btn-primary, .x-play-ctas.x-top-ctas .x-btn-outline { padding: 7px 7px; font-size: 0.78rem; } }
@media (min-width: 1000px) {
  .x-brand-row { display: contents; }
  .x-play-ctas.x-top-ctas { display: none; }
}

/* v1.1.2: hero image first in the main column (Mark 2026-11-14) */
.x-hero-figure.x-hero-top { margin: 0; border: 0; border-bottom: 1px solid var(--border-hairline); }
.x-hero-link { display: block; cursor: pointer; line-height: 0; }
