:root {
  --bg: #efe6d4;
  --paper: #fffaf1;
  --ink: #1b1712;
  --muted: #5d564c;
  --line: #e2d5bf;
  --green: #0e6a4b;
  --green-dark: #094833;
  --green-soft: #e3f4eb;
  --gold: #c3922a;
  --gold-soft: #f8edd3;
  --danger: #9b2c2c;
  --shadow: 0 18px 40px rgba(40, 28, 10, 0.14);
  --shadow-deep: 0 28px 60px rgba(40, 28, 10, 0.22);
  --radius: 22px;
  --display: "Prompt", "Sarabun", "Noto Sans Thai", sans-serif;
  --font: "Sarabun", "Noto Sans Thai", "TH Sarabun New", "Leelawadee UI", sans-serif;
  --page-1: #ffe9c4;
  --page-2: #f3d7a1;
  --page-3: #d9f0e3;
  --glow-gold: rgba(255, 176, 32, 0.38);
  --glow-green: rgba(14, 160, 90, 0.22);
  --header-bg: rgba(255, 250, 241, 0.82);
  --header-line: rgba(226, 213, 191, 0.8);
  --input-bg: #fff;
  --panel-1: #fffefb;
  --panel-2: #fff7ea;
  --card-shine: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.7);
  --dot: #7a6240;
  --result-1: #edf8f1;
  --result-2: #d7efe3;
  --float-1: #fffdf8;
  --float-2: #f4ead6;
  --weekend: #f4eee3;
  --holiday-bg: #fde8e8;
  --progress-bg: #eee4d2;
}
html { color-scheme: light; }
html, body { transform-style: preserve-3d; }
body::after {
  content: "";
  position: fixed;
  left: -18%;
  right: -18%;
  bottom: -12%;
  height: 32%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  background:
    repeating-linear-gradient(90deg, rgba(195, 146, 42, 0.22) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(14, 106, 75, 0.16) 0 1px, transparent 1px 72px);
  transform: perspective(900px) rotateX(72deg);
  transform-origin: center bottom;
}
html.night {
  color-scheme: dark;
  --bg: #0d1612;
  --paper: #16241d;
  --ink: #f4eee4;
  --muted: #b8b1a6;
  --line: #2d4037;
  --green: #2f9e6f;
  --green-dark: #8ee0b8;
  --green-soft: #163328;
  --gold: #e4bc4a;
  --gold-soft: #3a2e12;
  --danger: #f0a8a8;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  --shadow-deep: 0 28px 60px rgba(0, 0, 0, 0.52);
  --page-1: #0b1612;
  --page-2: #102019;
  --page-3: #0d1c16;
  --glow-gold: rgba(212, 160, 23, 0.16);
  --glow-green: rgba(14, 160, 90, 0.14);
  --header-bg: rgba(12, 24, 18, 0.88);
  --header-line: rgba(45, 64, 55, 0.9);
  --input-bg: #101c17;
  --panel-1: #182820;
  --panel-2: #121c18;
  --card-shine: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --dot: #8a9a88;
  --result-1: #163328;
  --result-2: #10241c;
  --float-1: #1c2c24;
  --float-2: #15221c;
  --weekend: #1a241c;
  --holiday-bg: #3a1c1c;
  --progress-bg: #24332c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
  background:
    radial-gradient(circle at 12% -10%, var(--glow-gold), transparent 32%),
    radial-gradient(circle at 92% 8%, var(--glow-green), transparent 28%),
    linear-gradient(180deg, var(--page-1) 0%, var(--page-2) 42%, var(--page-3) 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(var(--dot) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }
a { color: var(--green-dark); }
.wrap { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--green);
  color: #fff;
  padding: 8px 12px;
}
.skip-link:focus { left: 8px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-line);
  box-shadow: 0 8px 30px rgba(40, 28, 10, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1a8a62, #0b4d37);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(11, 77, 55, 0.28), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand small { display: block; color: var(--muted); font-size: 13px; }
.brand-title {
  font-size: 22px;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #7a5a16, #d4a017 40%, #fff3c4 50%, #d4a017 60%, #7a5a16);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 600; color: inherit; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(40, 28, 10, 0.08);
}
.theme-toggle svg { width: 16px; height: 16px; display: block; }
html.night .ico-moon { display: none; }
html:not(.night) .ico-sun { display: none; }
.theme-toggle:hover { border-color: var(--gold); }
.free-badge {
  background: linear-gradient(180deg, #ffe9b0, #f3d48a);
  color: #6a4b10;
  border: 1px solid #e4c57a;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(195, 146, 42, 0.22);
}

.hero { padding: 28px 0 8px; }
.hero-grid {
  display: block;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  margin: 0 0 12px;
  box-shadow: inset 0 1px 0 #fff;
}
h1, h2, .brand strong { font-family: var(--display); }
.hero-kicker {
  margin: 0 0 4px;
  letter-spacing: 0.42em;
  font-size: 12px;
  font-weight: 700;
  color: #8a6418;
}
.hero-title {
  font-size: clamp(48px, 8vw, 84px);
  line-height: 1.05;
  margin: 0 0 12px;
  background: linear-gradient(180deg, #fff8e1 0%, #f0c14b 38%, #9a6b16 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 8px 18px rgba(154, 107, 22, 0.28));
}
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.2; margin: 0 0 10px; }
.lead { font-size: 18px; color: var(--muted); max-width: 42rem; }
.search-row {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.search-box { margin: 0; flex: 1 1 240px; }
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;
  box-shadow: inset 0 1px 0 #fff, 0 12px 24px rgba(40, 28, 10, 0.08);
}
.live-now {
  flex: none;
  min-width: 220px;
  line-height: 1.15;
  transform: rotateY(-8deg) rotateX(4deg);
  transform-style: preserve-3d;
}
.now-line {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--muted);
}
.now-k { font-weight: 600; }
.now-line b {
  font-family: var(--display);
  font-size: 28px;
  color: var(--ink);
  font-weight: 700;
}
.now-time {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 700;
  line-height: 1;
  color: var(--green-dark);
  letter-spacing: 0.02em;
}

.section { padding: 22px 0 42px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.cat-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.chip {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(40, 28, 10, 0.06);
}
.chip.is-on {
  background: linear-gradient(180deg, #1a8a62, #0b4d37);
  color: #fff;
  border-color: #0b4d37;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  perspective: 1100px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, var(--card-shine), transparent 42%),
    var(--paper);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 176px;
  transform: rotateX(5deg) translateZ(0);
  transform-style: preserve-3d;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tool-card:hover {
  transform: translateY(-10px) rotateX(8deg) translateZ(22px);
  box-shadow: var(--shadow-deep);
}
.tool-card.is-soon { opacity: 0.78; box-shadow: none; }
.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
  box-shadow: 0 12px 20px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.4);
}
.card-icon svg { width: 34px; height: 34px; display: block; }
.icon-tax { background: linear-gradient(160deg, #2f9e6f, #0b4d37); }
.icon-loan { background: linear-gradient(160deg, #4c8dff, #1d4ed8); }
.icon-gold { background: linear-gradient(160deg, #f0c14b, #b7791f); }
.icon-salary { background: linear-gradient(160deg, #34d399, #047857); }
.icon-holiday { background: linear-gradient(160deg, #fb7185, #be123c); }
.icon-vat { background: linear-gradient(160deg, #a78bfa, #6d28d9); }
.icon-bmi { background: linear-gradient(160deg, #38bdf8, #0369a1); }
.icon-unit { background: linear-gradient(160deg, #f97316, #c2410c); }
.icon-electric { background: linear-gradient(160deg, #facc15, #ca8a04); color: #3f2d00; }
.icon-market { background: linear-gradient(160deg, #fb7185, #7c3aed); }
.icon-card { background: linear-gradient(160deg, #0ea5e9, #1d4ed8); }
.icon-wallet { background: linear-gradient(160deg, #059669, #f59e0b); }
.card-body { display: flex; flex-direction: column; gap: 4px; }
.card-body strong { font-size: 19px; }
.card-body span { color: var(--muted); }
.card-cat { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: 0.04em; }

.tool-layout { padding: 28px 0 64px; }
.crumb { color: var(--muted); }
.tool-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 8px;
}
.tool-head h1 { margin: 0 0 8px; }
.free-inline { color: var(--green-dark); font-weight: 700; }
.tool-root {
  background: linear-gradient(180deg, var(--panel-1), var(--panel-2));
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
  transform: rotateX(4deg);
  transform-style: preserve-3d;
}
.disclaimer { color: var(--muted); font-size: 14px; }

.grid-2, .grid-3 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(40, 28, 10, 0.06);
}
.field { margin-bottom: 12px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.btn, button.btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #1a8a62, #0b4d37);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(11, 77, 55, 0.24);
}
.btn.secondary { background: var(--green-soft); color: var(--green-dark); box-shadow: none; }
.result-box {
  margin-top: 16px;
  background: linear-gradient(180deg, var(--result-1), var(--result-2));
  border-radius: 18px;
  padding: 16px;
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgba(11, 77, 55, 0.08);
}
.result-box .big {
  font-size: 32px;
  font-weight: 700;
  color: var(--green-dark);
}
.table-wrap { overflow: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-grid span, .cal-grid button {
  min-height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  border: 0;
  background: transparent;
  font: inherit;
}
.cal-head { font-weight: 700; color: var(--muted); }
.day { background: var(--input-bg); border: 1px solid var(--line) !important; color: var(--ink); }
.day.holiday { background: var(--holiday-bg); color: var(--danger); font-weight: 700; }
.day.weekend { background: var(--weekend); }
.month-title { margin: 18px 0 8px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--muted);
}
.muted { color: var(--muted); }
.prose { padding: 32px 0 64px; max-width: 720px; }
.hidden { display: none !important; }

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c23b3b;
  box-shadow: 0 0 0 0 rgba(194, 59, 59, 0.6);
  animation: pulse 1.6s infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(194, 59, 59, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(194, 59, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(194, 59, 59, 0); }
}
.news-page { padding: 28px 0 64px; }
.news-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  perspective: 1100px;
}
.news-item {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  background: var(--paper);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transform: rotateX(4deg);
  transform-style: preserve-3d;
  transition: transform .18s ease, box-shadow .18s ease;
}
.news-item:hover {
  transform: translateY(-8px) rotateX(7deg) translateZ(16px);
  box-shadow: var(--shadow-deep);
}
.news-item.is-featured {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 420px;
}
.news-thumb {
  height: 150px;
  background: linear-gradient(160deg, #d7efe3, #f3d48a);
  position: relative;
  overflow: hidden;
}
.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(20, 12, 4, 0.55));
  pointer-events: none;
}
.news-item.is-featured .news-thumb { height: 260px; }
.news-thumb.has-img { background-color: #1b1712; }
.news-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-source {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}
.news-meta { color: var(--muted); font-size: 13px; }
.news-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
}
.news-fallback svg { width: 42px; height: 42px; opacity: .9; }

.gold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  perspective: 900px;
}
.gold-card {
  position: relative;
  overflow: hidden;
  transform: rotateX(6deg);
  transform-style: preserve-3d;
  background:
    linear-gradient(145deg, #fff4cc 0%, #e0b34d 42%, #9a6b16 100%);
  border: 1px solid #f2d789;
  border-radius: 22px;
  padding: 18px 16px 16px 18px;
  min-height: 128px;
  color: #3f2d00;
  box-shadow: 0 18px 30px rgba(154, 107, 22, 0.22), inset 0 1px 0 rgba(255,255,255,.55);
}
.gold-ico {
  width: 42px;
  height: 42px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.18));
}
.gold-card strong {
  display: block;
  font-size: 24px;
  color: #3b2a05;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.gold-card small, .gold-card span { color: #5c430d; }
.gold-live-compact { margin: 0 0 18px; }
.tool-banner {
  position: relative;
  height: 120px;
  border-radius: 28px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tool-banner svg {
  position: absolute;
  right: 24px;
  bottom: -8px;
  width: 120px;
  height: 120px;
  color: #fff;
  opacity: .9;
}
.banner-blob {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  left: -40px;
  top: -50px;
  background: rgba(255,255,255,.18);
}
.banner-tax { background: linear-gradient(120deg, #0b4d37, #34d399); }
.banner-loan { background: linear-gradient(120deg, #1d4ed8, #93c5fd); }
.banner-gold { background: linear-gradient(120deg, #b7791f, #fde68a); }
.banner-salary { background: linear-gradient(120deg, #047857, #6ee7b7); }
.banner-holiday { background: linear-gradient(120deg, #be123c, #fda4af); }
.banner-vat { background: linear-gradient(120deg, #6d28d9, #c4b5fd); }
.banner-bmi { background: linear-gradient(120deg, #0369a1, #7dd3fc); }
.banner-unit { background: linear-gradient(120deg, #c2410c, #fdba74); }
.banner-electric { background: linear-gradient(120deg, #ca8a04, #fde047); }
.banner-market { background: linear-gradient(120deg, #7c3aed, #fb7185); }
.banner-card { background: linear-gradient(120deg, #1d4ed8, #38bdf8); }
.banner-wallet { background: linear-gradient(120deg, #047857, #fbbf24); }
.wallet-page { padding: 28px 0 64px; }
.wallet-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.chart-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 140px;
}
.chart-col { text-align: center; }
.chart-bars {
  display: flex;
  gap: 3px;
  align-items: end;
  height: 110px;
  justify-content: center;
}
.bar {
  width: 10px;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
}
.bar.in { background: #059669; }
.bar.out { background: #dc2626; }
.bar.save { background: #d4a017; }
.alert-box {
  background: var(--holiday-bg);
  border: 1px solid var(--danger);
  border-radius: 16px;
  padding: 12px 16px;
  margin: 0 0 16px;
}
.progress {
  height: 10px;
  background: var(--progress-bg);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #059669, #fbbf24);
}
.goal-card { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.bill-cal { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.bill-day {
  min-width: 72px;
  background: var(--paper);
  border-radius: 12px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  font-size: 12px;
}
.st-overdue { color: #b42318; font-weight: 700; display: block; }
.st-due_today { color: #b45309; font-weight: 700; display: block; }
.st-due_soon { color: #a16207; display: block; }
.st-paid { color: #047857; display: block; }
.campaign-box { margin-bottom: 16px; }
.campaign-list { display: grid; gap: 8px; }
.campaign-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 18px rgba(40, 28, 10, 0.06);
}
.campaign-item:hover { transform: translateY(-2px); }
.check-list { display: grid; gap: 12px; }
.check-group {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-weight: 500;
  margin: 0;
}
.check-item em { color: var(--gold); font-style: normal; font-weight: 700; }
.check-item small { display: block; color: var(--muted); font-weight: 400; }
.news-hero-art {
  height: 160px;
  overflow: hidden;
  border-radius: 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.news-hero-art img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.title-scene {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  color: #f8edd3;
  background: #04140e;
  pointer-events: none;
}
html.title-pending .title-scene { display: block; }
html.title-pending { overflow: hidden; }
html.title-done .title-scene { display: none; }
.title-world {
  position: absolute;
  inset: 0;
  perspective: 1400px;
  perspective-origin: 50% 46%;
  transform-style: preserve-3d;
}
.title-bg,
.title-vignette,
.title-rays,
.title-orb,
.title-grain,
.title-particles,
.title-float,
.title-gates {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.title-bg {
  transform: translateZ(-120px) scale(1.12);
}
.title-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.title-scene.is-play .title-bg {
  animation: title-zoom 7s ease-out forwards;
}
.title-floor {
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -8%;
  height: 56%;
  background:
    linear-gradient(180deg, rgba(240,193,75,.1), transparent 42%),
    repeating-linear-gradient(90deg, rgba(240,193,75,.28) 0 1px, transparent 1px 70px),
    repeating-linear-gradient(0deg, rgba(240,193,75,.18) 0 1px, transparent 1px 70px);
  transform: rotateX(76deg) translateZ(-8px);
  transform-origin: center bottom;
  mask-image: linear-gradient(180deg, transparent, #000 28%, #000 78%, transparent);
  opacity: 0;
}
.title-scene.is-play .title-floor {
  animation: title-fade-in 1.1s 0.35s both;
}
.title-vignette {
  background:
    radial-gradient(circle at 50% 42%, transparent 10%, rgba(4, 20, 14, 0.4) 64%, #04140e 100%),
    linear-gradient(180deg, rgba(4,20,14,.45), transparent 22%, transparent 64%, rgba(2,10,8,.92));
}
.title-rays {
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, 0.18) 0 3deg, transparent 3deg 16deg);
  mix-blend-mode: screen;
  opacity: 0.38;
  transform-origin: 50% 42%;
}
.title-scene.is-play .title-rays { animation: title-spin 20s linear infinite; }
.title-orb {
  width: min(58vw, 560px);
  height: min(58vw, 560px);
  margin: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, #fff8d6 0%, #f0c14b 16%, rgba(212,160,23,.3) 46%, transparent 72%);
  filter: blur(8px);
  opacity: 0;
  transform: translateZ(40px);
}
.title-scene.is-play .title-orb { animation: title-pulse 2.6s 0.2s ease-in-out infinite; }
.title-grain {
  opacity: 0.12;
  background-image: radial-gradient(#f6e7b8 0.55px, transparent 0.55px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}
.title-particles span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe08a;
  box-shadow: 0 0 12px #f0c14b;
  opacity: 0;
  left: 12%;
  bottom: 8%;
}
.title-scene.is-play .title-particles span { animation: title-dust 4.2s linear infinite; }
.title-particles span:nth-child(2) { left: 24%; animation-delay: .4s; width: 3px; height: 3px; }
.title-particles span:nth-child(3) { left: 38%; animation-delay: .9s; }
.title-particles span:nth-child(4) { left: 52%; animation-delay: .2s; width: 4px; height: 4px; }
.title-particles span:nth-child(5) { left: 66%; animation-delay: 1.1s; }
.title-particles span:nth-child(6) { left: 78%; animation-delay: .6s; }
.title-particles span:nth-child(7) { left: 88%; animation-delay: 1.4s; width: 3px; height: 3px; }
.title-particles span:nth-child(8) { left: 8%; animation-delay: 1.8s; }
.title-particles span:nth-child(9) { left: 93%; animation-delay: .3s; }
.title-particles span:nth-child(10) { left: 46%; animation-delay: 2s; width: 6px; height: 6px; }
.title-particles span:nth-child(11) { left: 31%; animation-delay: 1.6s; }
.title-particles span:nth-child(12) { left: 17%; animation-delay: 2.2s; }
.title-particles span:nth-child(13) { left: 71%; animation-delay: .8s; }
.title-particles span:nth-child(14) { left: 58%; animation-delay: 2.4s; }
.title-particles span:nth-child(15) { left: 41%; animation-delay: 1.3s; }
.tf {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff4cc, #d4a017 58%, #8a6418);
  box-shadow: 0 18px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.55);
  transform-style: preserve-3d;
  opacity: 0;
}
.tf1 { top: 18%; left: 12%; }
.tf2 { top: 28%; right: 14%; }
.tf3 { bottom: 22%; left: 22%; }
.title-scene.is-play .tf1 { animation: title-card 5.6s 0.5s ease-in-out both infinite; }
.title-scene.is-play .tf2 { animation: title-card 6.2s 0.9s ease-in-out both infinite; }
.title-scene.is-play .tf3 { animation: title-card 5.8s 1.2s ease-in-out both infinite; }
.title-center {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px 90px;
  transform-style: preserve-3d;
  transform: translateZ(-160px) rotateX(12deg);
}
.title-scene.is-play .title-center {
  animation: title-cam 6.6s cubic-bezier(.16,.84,.32,1) forwards;
}
.title-emblem {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 700;
  color: #3b2a05;
  background: radial-gradient(circle at 32% 28%, #fff8d6, #f0c14b 46%, #b7791f);
  border: 2px solid #fff3c4;
  box-shadow: 0 0 0 7px rgba(212,160,23,.16), 0 18px 36px rgba(0,0,0,.35);
  opacity: 0;
  transform: translateZ(70px);
}
.title-ornament {
  width: min(320px, 78vw);
  height: 28px;
  color: #f0c14b;
  fill: #f0c14b;
  opacity: 0;
  margin-top: 8px;
}
.title-eyebrow,
.title-en,
.title-tag { margin: 0; opacity: 0; }
.title-eyebrow {
  letter-spacing: 0.32em;
  font-weight: 600;
  color: #f6e7b8;
  margin-top: 18px;
}
.title-en {
  margin-top: 10px;
  letter-spacing: 0.72em;
  font-size: 13px;
  font-weight: 700;
  color: #e0b34d;
  padding-left: 0.72em;
}
.title-name {
  position: relative;
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: clamp(58px, 13vw, 136px);
  line-height: 1.02;
  font-weight: 700;
  transform-style: preserve-3d;
  transform: rotateX(18deg) translateZ(36px);
  opacity: 0;
}
.title-3d-shadow,
.title-3d-face { display: block; }
.title-3d-shadow {
  position: absolute;
  left: 0;
  right: 0;
  color: #c3922a;
  text-shadow:
    0 1px 0 #be8d1c,
    0 2px 0 #b08118,
    0 3px 0 #a37614,
    0 4px 0 #966c12,
    0 5px 0 #88610f,
    0 6px 0 #7a570d,
    0 8px 0 #6a4b10,
    0 14px 18px rgba(0,0,0,.38),
    0 24px 40px rgba(0,0,0,.32);
  transform: translateZ(-10px);
}
.title-3d-face {
  position: relative;
  background: linear-gradient(180deg, #fff8e1 0%, #ffe08a 28%, #f0c14b 52%, #b7791f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: translateZ(18px);
}
.title-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.65) 50%, transparent 65%);
  background-size: 220% 100%;
  background-position: 120% 0;
  mix-blend-mode: screen;
  pointer-events: none;
}
.title-tag {
  margin-top: 10px;
  font-size: clamp(15px, 2.4vw, 21px);
  color: #efe6d4;
}
.title-scene.is-play .title-emblem { animation: title-crest 0.9s 0.55s both; }
.title-scene.is-play .title-eyebrow { animation: title-rise 0.75s 0.85s both; }
.title-scene.is-play .title-en { animation: title-rise 0.75s 1.1s both; }
.title-scene.is-play .title-name { animation: title-pop 1.05s 1.25s both; }
.title-scene.is-play .title-sheen { animation: title-shimmer 2.1s 1.6s ease-in-out forwards; }
.title-scene.is-play .title-ornament { animation: title-rise 0.75s 1.7s both; }
.title-scene.is-play .title-tag { animation: title-rise 0.75s 1.95s both; }
.title-gates {
  z-index: 6;
  perspective: 1600px;
  transform-style: preserve-3d;
}
.gate {
  position: absolute;
  top: 0;
  width: 51%;
  height: 100%;
  transform-style: preserve-3d;
  background:
    linear-gradient(90deg, rgba(255,232,160,.3), transparent 14%, transparent 86%, rgba(255,232,160,.3)),
    repeating-linear-gradient(90deg, rgba(8,53,38,0) 0 26px, rgba(0,0,0,.22) 26px 28px),
    linear-gradient(180deg, #21845d 0%, #0b3d2c 55%, #041910 100%);
  transition: transform 1.35s cubic-bezier(.16,.78,.22,1);
  backface-visibility: hidden;
}
.gate-l {
  left: 0;
  transform-origin: left center;
  border-right: 5px solid #d4a017;
}
.gate-r {
  right: 0;
  transform-origin: right center;
  border-left: 5px solid #d4a017;
}
.gate-edge {
  position: absolute;
  top: 0;
  width: 16px;
  height: 100%;
  background: linear-gradient(180deg, #f0c14b, #8a6418);
}
.gate-l .gate-edge { right: -8px; transform: rotateY(90deg); transform-origin: left; }
.gate-r .gate-edge { left: -8px; transform: rotateY(-90deg); transform-origin: right; }
.title-seam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 8px;
  margin-left: -4px;
  background: linear-gradient(#fff8d6, #f0c14b, #fff8d6);
  box-shadow: 0 0 30px 12px rgba(240,193,75,.75);
  opacity: 1;
  transition: opacity 0.45s ease;
}
.title-scene.is-play .gate-l { transform: rotateY(-105deg); }
.title-scene.is-play .gate-r { transform: rotateY(105deg); }
.title-scene.is-play .title-seam { opacity: 0; }
html.title-out .title-scene { animation: title-fade 1.2s ease forwards; }
@keyframes title-zoom {
  from { transform: translateZ(-120px) scale(1.18); }
  to { transform: translateZ(-40px) scale(1.04); }
}
@keyframes title-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes title-pulse {
  0%, 100% { opacity: .55; transform: translateZ(40px) scale(1); }
  50% { opacity: 1; transform: translateZ(40px) scale(1.08); }
}
@keyframes title-dust {
  0% { transform: translate3d(0, 20px, 20px); opacity: 0; }
  12% { opacity: .95; }
  100% { transform: translate3d(12px, -82vh, 80px); opacity: 0; }
}
@keyframes title-rise {
  from { opacity: 0; transform: translate3d(0, 24px, -20px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes title-crest {
  from { opacity: 0; transform: translateZ(70px) scale(.55) rotateY(-40deg); }
  to { opacity: 1; transform: translateZ(70px) scale(1) rotateY(0); }
}
@keyframes title-pop {
  from { opacity: 0; transform: rotateX(28deg) translateZ(-40px) scale(.82); }
  to { opacity: 1; transform: rotateX(18deg) translateZ(36px) scale(1); }
}
@keyframes title-shimmer {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}
@keyframes title-cam {
  0% { transform: translateZ(-260px) rotateX(16deg); }
  100% { transform: translateZ(28px) rotateX(6deg); }
}
@keyframes title-card {
  0% { opacity: 0; transform: rotateY(-24deg) rotateX(12deg) translateZ(-40px); }
  18% { opacity: 1; }
  50% { transform: rotateY(16deg) rotateX(-8deg) translateZ(50px); }
  100% { opacity: 1; transform: rotateY(-10deg) rotateX(10deg) translateZ(10px); }
}
@keyframes title-fade { to { opacity: 0; } }
@keyframes title-fade-in { from { opacity: 0; } to { opacity: 1; } }
.listen-page { padding: 28px 0 72px; }
.listen-form { max-width: 720px; }
.listen-status { margin: 12px 0 0; font-weight: 700; }
.listen-status.is-ok { color: var(--green-dark); }
.listen-status.is-bad { color: var(--danger); }
.listen-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1a8a62, #0b4d37);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(11, 77, 55, 0.35);
  transform: rotateX(12deg) translateZ(24px);
}
.listen-fab:hover { transform: rotateX(6deg) translateZ(32px) translateY(-4px); }
@media (prefers-reduced-motion: reduce) {
  .title-scene, .title-scene * { animation: none !important; transition: none !important; }
  .tool-card, .news-item, .gold-card, .tool-root, .live-now, .listen-fab, body::after {
    transform: none !important;
  }
}
html.night .brand-title {
  background: linear-gradient(90deg, #c9a227, #ffe08a 40%, #fff8d6 50%, #ffe08a 60%, #c9a227);
  -webkit-background-clip: text;
  background-clip: text;
}
html.night .hero-title {
  background: linear-gradient(180deg, #fff8e1 0%, #f0c14b 38%, #d4a017 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

@media (max-width: 900px) {
  .news-list { grid-template-columns: 1fr 1fr; }
  .news-item.is-featured { grid-column: span 2; grid-row: auto; min-height: 320px; }
}
@media (max-width: 700px) {
  .header-inner { align-items: flex-start; padding: 10px 0; }
  .tool-root { padding: 14px; }
  .result-box .big { font-size: 26px; }
  .news-list { grid-template-columns: 1fr; }
  .news-item.is-featured { grid-column: auto; }
  .tool-head { grid-template-columns: 1fr; }
  .title-name { font-size: clamp(48px, 16vw, 86px); }
  .title-en { letter-spacing: 0.36em; }
  .title-floor { height: 42%; }
  .tf { width: 42px; height: 42px; }
  .theme-label { display: none; }
  .theme-toggle { padding: 8px; }
  .now-line b { font-size: 24px; }
}
