/* IVWORK v3 shared visual and accessibility layer. */
:root{
  --fs-12:12px;
  --fs-13:13px;
  --fs-14:14px;
  --fs-16:16px;
  --fs-18:18px;
  --fs-24:24px;
  --fs-32:32px;
  --fs-hero:clamp(34px,5.2vw,64px);
  --bg:#090c12;
  --surface:#111722;
  --surface-raised:#171f2c;
  --accent:#ffb800;
  --up:#34d399;
  --down:#f87171;
  --up-color:var(--up);
  --down-color:var(--down);
  --line:rgba(186,203,230,.14);
  --text:#f4f6fb;
  --muted:#96a3b7;
  --font-display:"Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --font-body:"Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html{background:var(--bg)}
body{font-family:var(--font-body)}
body.ivart-body{--ivart-bg:var(--bg);--ivart-card:var(--surface);--ivart-accent:var(--accent);font-family:var(--font-body)}
h1,h2,h3,.big-num,.cap-pill,.eq{font-family:var(--font-display)}
/* 2026-10-28 brand-font guard: re-assert the display font on the shell's own
   headings so component-level declarations can never fall back to inherit. */
.ivwork-fc .ivwork-fc-hero h1,
.ivwork-fc .ivwork-fc-explore h2,
.ivwork-fc .ivwork-fc-section h1,
.ivwork-fc .ivwork-fc-section h2,
.ivwork-fc .ivwork-fc-card h3{font-family:var(--font-display)}
/* CJK fallback: Chakra Petch has no Chinese glyphs. Keep Noto Sans SC for
   Chinese locales and restore normal letter-spacing (narrow Latin tracking
   looks cramped on Han glyphs). */
:lang(zh) h1,:lang(zh) h2,:lang(zh) h3{font-family:"Noto Sans SC","Chakra Petch",sans-serif!important;letter-spacing:0!important;font-weight:900}
.big-num,.data-table,.data-table td,.data-table th{font-variant-numeric:tabular-nums lining-nums}
.big-num{color:var(--accent);font-weight:700;letter-spacing:-.025em}
.cap-pill{display:inline-flex;align-items:center;gap:.3em;padding:.22em .65em;border-radius:999px;font-size:.78em;font-weight:700;line-height:1.3;font-variant-numeric:tabular-nums}
.cap-pill.is-up,.cap-pill[data-direction="up"],.cap-pill[aria-label*="increase"]{color:var(--up-color);background:color-mix(in srgb,var(--up-color) 13%,transparent)}
.cap-pill.is-down,.cap-pill[data-direction="down"],.cap-pill[aria-label*="decrease"]{color:var(--down-color);background:color-mix(in srgb,var(--down-color) 13%,transparent)}
[data-trend-polarity="inverse"]{--up-color:var(--down);--down-color:var(--up)}
.data-table{width:100%;border-collapse:separate;border-spacing:0;color:var(--text);font-family:var(--font-body);font-size:.92rem}
.data-table caption{padding:.7rem 0;text-align:left;color:var(--muted);font-size:.82rem}
.data-table th{position:sticky;top:0;z-index:1;background:var(--surface);color:var(--muted);text-align:left;font-size:.76rem;letter-spacing:.06em;text-transform:uppercase}
.data-table th,.data-table td{padding:.7rem .8rem;border-bottom:1px solid var(--line)}
.sparkline-wrap svg,.ivwork-sparkline-wrap svg{display:block;width:100%;height:auto;overflow:visible}
.sparkline-wrap [data-sparkline-line]{transform-origin:center;animation:ivw-v3-line-in .65s ease-out both}
@keyframes ivw-v3-line-in{from{opacity:0}to{opacity:1}}
.hub-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.hub-f{grid-column:span 2;grid-row:span 2}
.hub-grid>a,.hub-grid>.hub-card,.hub-grid>.hub-f{min-width:0}
.live-board{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,.7fr);gap:16px}
.live-f{grid-row:span 2;min-width:0}
.live-list{display:grid;gap:8px;min-width:0}
.eq{display:inline-flex;height:1em;align-items:end;gap:2px;vertical-align:middle}
.eq i{display:block;width:3px;height:var(--h,.5em);border-radius:3px;background:currentColor;transform-origin:bottom;animation:ivw-v3-eq .8s ease-in-out var(--d,0s) infinite alternate}
@keyframes ivw-v3-eq{from{transform:scaleY(.35);opacity:.58}to{transform:scaleY(1);opacity:1}}
.ticker{overflow:hidden;white-space:nowrap;mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent)}
.ticker-track{display:flex;width:max-content;animation:ivw-v3-ticker 32s linear infinite}
@keyframes ivw-v3-ticker{to{transform:translateX(-50%)}}
.period-tabs{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.period-tabs [role="tab"]{min-height:38px;padding:.45rem .8rem;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--muted);font:600 .84rem var(--font-body);cursor:pointer}
.period-tabs [role="tab"][aria-selected="true"]{border-color:var(--accent);color:var(--accent)}
.filter-chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.filter-chips a,.filter-chips button,.filter-chips [role="option"]{font-family:var(--font-body)}
img{max-width:100%;height:auto}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:3px solid var(--accent)!important;outline-offset:3px!important}
/* 2026-10-28: removed the global transition-property:transform,opacity!important
   override — it wiped color/background transitions set elsewhere
   (e.g. .ivwork-fc-viewers computed transitionProperty was forced to none).
   Per-rule transitions already use compositor-friendly properties where needed.
   The prefers-reduced-motion rule below is intentional accessibility behavior and stays. */
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.ticker{overflow-x:auto;mask-image:none}.ticker-track{width:auto;animation:none}}

/* Shared polish for pages rendered outside the Frontend Core shell. */
body{background:var(--bg);color:var(--text);overflow-x:clip}
::selection{background:rgba(255,184,0,.28);color:var(--text)}
button,input,select,textarea{font:inherit}
button,select{cursor:pointer}
input,select,textarea{max-width:100%;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text)}
input::placeholder,textarea::placeholder{color:var(--muted)}
button{border-radius:9px}
.ivw-site-header-inner{isolation:isolate}
.ivw-site-logo{margin-right:6px}
.ivw-menu>li>a[aria-current="page"]{color:var(--accent);background:rgba(255,184,0,.1);box-shadow:inset 0 -2px var(--accent)}
.ivw-menu a:focus-visible,.ivw-site-tools :focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.ivwork-mtab-item[aria-current="page"]{color:var(--accent)!important}
.ivt{--ivt-bg:var(--bg);max-width:1200px!important;color:var(--text);font-family:var(--font-body)!important}
.ivt h1,.ivt h2,.ivt h3{font-family:var(--font-display)!important;color:var(--text)}
.ivt section{background:var(--surface)!important;border-color:var(--line)!important;border-radius:16px!important;box-shadow:0 12px 32px rgba(0,0,0,.18)}
.ivt .ivt-table-wrap{border:1px solid var(--line);border-radius:12px;background:var(--surface);scrollbar-color:#46536a var(--surface)}
.ivt table{border-collapse:separate;border-spacing:0}
.ivt th{position:sticky;top:0;background:#151d2a;color:#c9d4e3}
.ivt tbody tr:hover{background:rgba(255,184,0,.06)}
.ivt .ivt-links a{border-color:var(--line);background:var(--surface-raised);color:var(--text);transition:transform .15s,opacity .15s}
.ivt .ivt-links a:hover{transform:translateY(-2px);color:var(--accent)}
.chan-profile-main{max-width:1200px!important;color:var(--text);font-family:var(--font-body)}
.chan-head,.chan-kpis article,.chan-games,.chan-history,.chan-like,.sparkline-wrap,.player,.offline{border-color:var(--line)!important;background:var(--surface)!important}
.chan-head h1,.chan-profile-main h2,.chan-profile-main h3{font-family:var(--font-display);color:var(--text)}
.chan-kpis strong{color:var(--accent);font-family:var(--font-display);font-variant-numeric:tabular-nums}
.chan-history table{border-collapse:separate;border-spacing:0;color:var(--text)}
.chan-history th{position:sticky;top:0;background:var(--surface-raised);color:var(--muted)}
.chan-history th,.chan-history td{border-color:var(--line)}
.chan-like-card{border-color:var(--line)!important;background:var(--surface-raised)!important;color:var(--text)}
.chan-like-card:hover{transform:translateY(-2px);border-color:rgba(255,184,0,.5)!important}
.chan-profile-main .breadcrumbs{color:var(--muted);font-size:.84rem}
.chan-profile-main .breadcrumbs a{color:var(--muted);text-decoration:none}
.chan-profile-main .breadcrumbs a:hover{color:var(--accent)}
@media(max-width:600px){.ivt{padding-right:16px!important;padding-left:16px!important}.ivt section{padding:17px!important}.ivw-site-header-inner{padding-left:8px!important}}
@media(max-width:900px){.hub-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.live-board{grid-template-columns:minmax(0,1fr)}.live-f{grid-row:auto}}
@media(max-width:560px){.hub-grid{grid-template-columns:minmax(0,1fr)}.hub-f{grid-column:auto;grid-row:auto}.data-table{font-size:.82rem}.data-table th,.data-table td{padding:.55rem .5rem}}
/* ===== IVW-UI-BEAUT 20261026: zero-cost polish (no new fonts/images) ===== */
@keyframes ivw-beaut-card-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
.ivwork-fc-card{animation:ivw-beaut-card-in .5s ease-out both}
.ivwork-fc-card:nth-child(2){animation-delay:.05s}
.ivwork-fc-card:nth-child(3){animation-delay:.1s}
.ivwork-fc-card:nth-child(4){animation-delay:.15s}
.ivwork-fc-card:nth-child(5){animation-delay:.2s}
.ivwork-fc-card:nth-child(6){animation-delay:.25s}
.ivwork-fc-card:nth-child(7){animation-delay:.3s}
.ivwork-fc-card:nth-child(8){animation-delay:.35s}
@keyframes ivw-beaut-pulse{0%,100%{box-shadow:0 0 0 0 rgba(248,113,113,.55)}70%{box-shadow:0 0 0 7px rgba(248,113,113,0)}}
.ivwork-fc-live-signal{animation:ivw-beaut-pulse 1.8s ease-out infinite}
.ivwork-fc-viewers{transition:color .18s ease,background-color .18s ease}
.ivwork-fc-card:hover .ivwork-fc-viewers{color:var(--accent)}
::selection{background:rgba(255,184,0,.32);color:#fff}
*{scrollbar-width:thin;scrollbar-color:#3a465c transparent}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#3a465c;border-radius:999px;border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:#4d5c77;background-clip:content-box}
@media(prefers-reduced-motion:reduce){.ivwork-fc-card,.ivwork-fc-live-signal{animation:none}}

/* === merged from ivwork-v3-polish.css (2026-10-28) === */
/* IVWORK v3 polish layer — incremental refinements only.
 * Loaded after ivwork-v3-design-system.css (wp_head priority 1001).
 * Additive rules: typography rendering, spacing, radii, motion, hover states.
 * Existing color scheme and layout are intentionally untouched.
 */

/* 1) Typography rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 {
  letter-spacing: -.015em;
  text-wrap: balance;
}
p {
  line-height: 1.65;
}

/* 2) Keyboard focus visibility */
a:focus-visible,
button:focus-visible,
[role='tab']:focus-visible,
input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 3) Card hover micro-interaction (hub + live cards) */
.hub-grid > a,
.hub-card,
.live-list > * {
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.hub-grid > a:hover,
.hub-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 10px 28px -14px rgba(0, 0, 0, .55);
}

/* 4) Data table row hover */
.data-table tbody tr {
  transition: background-color .18s ease;
}
.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-raised) 55%, transparent);
}

/* 5) Pills, tabs, chips micro-interactions */
.cap-pill {
  transition: background-color .2s ease, color .2s ease;
}
.period-tabs [role='tab'] {
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.period-tabs [role='tab']:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.filter-chips a,
.filter-chips button {
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

/* 6) Buttons: consistent radius and feedback */
.wp-block-button__link,
button[type='submit'],
input[type='submit'] {
  border-radius: 8px;
  transition: filter .2s ease, transform .2s ease;
}
.wp-block-button__link:hover,
button[type='submit']:hover,
input[type='submit']:hover {
  filter: brightness(1.06);
}
.wp-block-button__link:active,
button[type='submit']:active {
  transform: translateY(1px);
}

/* 7) Content imagery polish */
.entry-content img,
.wp-block-image img {
  border-radius: 10px;
}

/* 8) Scrollbar aligned with surface tokens */
* {
  scrollbar-color: var(--surface-raised) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-raised);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 30%, var(--surface-raised));
}

/* 9) Selection color on-brand */
::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text);
}

/* 10) Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
