/* Tulpar 1.0 — the shell (side menu, top menus, tab bar), six site designs
   and the styles of the new pages. Loaded after app.css and wins over it. */

@font-face { font-family: 'Plex Serif'; src: url('/assets/fonts/plex-serif-700.woff') format('woff'); font-weight: 600 800; font-display: swap; }

/* ============================================================ tokens
   Every design sets the same tokens. The defaults are "Тұлпар". */
:root {
  --side-w: 236px; --side-mini: 76px; --side-cur: 0px; --vw: 100vw;
  --side-bg: linear-gradient(180deg, #0D2438, #0A1B2B); --side-ink: #E8EEF3; --side-soft: rgba(232, 238, 243, .62);
  --side-hover: rgba(255, 255, 255, .07); --side-active: rgba(255, 255, 255, .12); --side-line: rgba(255, 255, 255, .08);
  --top-bg: rgba(13, 36, 56, .9); --top-ink: #F4EBD8; --top-soft: rgba(244, 235, 216, .72); --top-hover: rgba(255, 255, 255, .08); --top-line: rgba(255, 255, 255, .1);
  --brand-ink: #F4F6F9;
  --deep-bg: radial-gradient(400px 200px at 80% 0%, rgba(242, 118, 58, .25), transparent 60%), linear-gradient(150deg, #0B2034, #123A5C);
  --deep-ink: #F4EBD8;
  --hero-bg: radial-gradient(1000px 520px at 88% 8%, rgba(242, 118, 58, .22), transparent 60%), radial-gradient(900px 600px at -5% 110%, rgba(38, 150, 175, .28), transparent 60%), linear-gradient(160deg, #0A1D2F, #0E2B45 55%, #123A5C);
  --foot-bg: #0B1D2E; --foot-ink: rgba(232, 238, 243, .72); --foot-head: #fff;
  --on-accent: #fff; --accent-solid: #F08A3C;
  --me-bg: #0F2A40; --me-ink: #F4F6F9;
  --card-radius: 18px; --btn-radius: 12px;
  --theme-color: #0D2438;
  --menu-bg: var(--surface); --menu-ink: var(--ink);
}
:root[data-theme="night"] { --me-bg: #2A4A66; --theme-color: #0A1520; }

/* ------------------------------------------------------------ Түн: graphite and turquoise */



/* ------------------------------------------------------------ Киіз: warm felt and ornament */



/* ------------------------------------------------------------ Аспан: sky and glass */





/* ------------------------------------------------------------ Алтын Орда: black and gold */



/* ------------------------------------------------------------ Таза: plain and quick, the house design.
   Clean like lichess, a serif for the titles, the sky blue and gold of the
   steppe, and the ram's-horn ornament as a few quiet accents. */
:root[data-skin="taza"] {
  --page: #F5F5F3; --page-deep: #ECECE9; --surface: #FFFFFF; --surface-2: #F2F2EF; --rule: #E2E1DC;
  --ink: #1C2127; --ink-soft: #565E67; --ink-faint: #7A8188;
  --gold: #1A76BA; --ember: #1A76BA; --gold-ink: #155F96; --gold-wash: rgba(26, 118, 186, .16);
  --accent: #1A76BA; --accent-solid: #1A76BA; --on-accent: #fff;
  --orn-c: #C99A36;
  --top-bg: #FFFFFF; --top-ink: #1C2127; --top-soft: #565E67; --top-hover: #F2F2EF; --top-line: #E2E1DC;
  --side-bg: #FFFFFF; --side-ink: #1C2127; --side-soft: #565E67; --side-hover: #F2F2EF; --side-active: rgba(26, 118, 186, .1); --side-line: #E2E1DC;
  --brand-ink: #1C2127;
  --deep-bg: radial-gradient(360px 200px at 85% 0%, rgba(242, 193, 78, .22), transparent 60%), linear-gradient(150deg, #123A63, #1E6AA8);
  --hero-bg: radial-gradient(800px 420px at 92% 0%, rgba(242, 193, 78, .16), transparent 60%), linear-gradient(160deg, #102F52, #17497A 60%, #1C5A93);
  --foot-bg: #FFFFFF; --foot-ink: #565E67; --foot-head: #1C2127; --hero: #102F52;
  --me-bg: #1A76BA; --me-ink: #fff;
  --card-radius: 8px; --btn-radius: 6px; --radius: 6px;
  --font-display: "Plex Serif", Georgia, serif;
  --shadow: 0 1px 0 rgba(0, 0, 0, .04); --shadow-hi: 0 2px 12px rgba(0, 0, 0, .09);
  --theme-color: #FFFFFF;
}
:root[data-skin="taza"][data-theme="night"] {
  --page: #161512; --page-deep: #11100E; --surface: #232220; --surface-2: #2D2B28; --rule: #393733;
  --ink: #E8E6E1; --ink-soft: #A9A59C; --ink-faint: #7B776F; --gold: #4A9FE0; --gold-ink: #6CB3EA; --gold-wash: rgba(74, 159, 224, .18);
  --accent: #2272B6; --accent-solid: #4A9FE0; --orn-c: #D9AE4E;
  --top-bg: #232220; --top-ink: #E8E6E1; --top-soft: #A9A59C; --top-hover: #2D2B28; --top-line: #393733; --me-bg: #2272B6;
  --side-bg: #232220; --side-ink: #E8E6E1; --side-soft: #A9A59C; --side-hover: #2D2B28; --side-line: #393733;
  --brand-ink: #E8E6E1; --foot-bg: #1C1B19; --foot-ink: #A9A59C; --foot-head: #E8E6E1; --theme-color: #232220; --me-bg: #2F86CC;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3); --shadow-hi: 0 4px 16px rgba(0, 0, 0, .45);
}

/* ============================================================ base, using the tokens */
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow-hi); }
.skip:focus { top: 8px; }
.page-title, .section-title, .hero h1, h1, h2, h3 { font-family: var(--font-display); }
.btn { border-radius: var(--btn-radius); }
.btn-gold { background: var(--accent); color: var(--on-accent); }
.import-form, .resume, .rush-mode, .acc-card, .lobby .level-about, .pset, .fcard, .more-card, .lg-hero, .tz-rules, .bubble-lg, .coach, .feature, .set-group, .card { border-radius: var(--card-radius); }
.hero { background: var(--hero-bg); }
.fvis, .more-vis { background: var(--deep-bg); }
.tz-board { background: var(--deep-bg); }
.page-title::after, .section-title::after { background: var(--accent); }
.f-ico { background: var(--accent); color: var(--on-accent); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* the Ustaz chat: your own messages were invisible at night */
.msg.from-me .bubble-lg { background: var(--me-bg); color: var(--me-ink); border-color: transparent; }
.msg.from-me .bubble-lg a { color: inherit; }

/* custom board colours */
:root[data-board="custom"] { --sq-light: var(--custom-light); --sq-dark: var(--custom-dark); --coord-on-light: var(--custom-dark); --coord-on-dark: var(--custom-light); }
.no-last .sq.last::after { background: none; }
.no-dots .sq.target::before { display: none; }

/* board size: uses the width left by the side menu, and the size setting */
.stage { --board: calc(min(calc(100dvh - var(--nav-h) - 128px), calc(var(--vw) - var(--panel) - 150px), 760px) * var(--board-scale, 1)); }
.stage.has-nav { --board: calc(min(calc(100dvh - var(--nav-h) - 184px), calc(var(--vw) - var(--panel) - 150px), 760px) * var(--board-scale, 1)); }
@media (max-width: 1000px) { .stage, .stage.has-nav { --board: min(calc(100vw - 52px), 640px); } }
@media (max-width: 760px) { .stage, .stage.has-nav { --board: calc(100vw - 46px); } }

/* ============================================================ the side menu */
.sidebar { display: none; }
@media (min-width: 1100px) {
  :root[data-layout="side"] { --side-cur: var(--side-w); --nav-h: 0px; --vw: calc(100vw - var(--side-cur)); }
  :root[data-layout="side"][data-mini] { --side-cur: var(--side-mini); }
  :root[data-layout="side"] body { padding-left: var(--side-cur); }
  :root[data-layout="side"] .topbar { display: none; }
  :root[data-layout="side"] .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    width: var(--side-cur); padding: 16px 12px 14px; background: var(--side-bg); color: var(--side-ink);
    border-right: 1px solid var(--side-line);
  }
  
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--side-ink); text-decoration: none; }
.side-brand .brand-mark { width: 40px; height: 40px; color: var(--brand-ink); flex: none; }
.side-brand .brand-name { font: 700 22px/1 var(--font-display); letter-spacing: -0.03em; color: var(--side-ink); }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sn-group { position: relative; }
.sn-head, .sn-items a {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--side-soft);
  border-radius: 10px; padding: 9px 10px; font-weight: 600; font-size: 15px; white-space: nowrap;
}
.sn-head svg { width: 22px; height: 22px; flex: none; }
.sn-head:hover, .sn-items a:hover { background: var(--side-hover); color: var(--side-ink); }
.sn-group.active > .sn-head { color: var(--side-ink); }
.sn-group.active > .sn-head svg { color: var(--accent-solid); }
.sn-items { display: none; flex-direction: column; gap: 1px; margin: 2px 0 6px 22px; padding-left: 12px; border-left: 1px solid var(--side-line); }
.sn-items a { font-size: 14px; font-weight: 500; padding: 7px 10px; }
.sn-items a svg { display: none; }
.sn-items a[aria-current="page"] { background: var(--side-active); color: var(--side-ink); }
.sn-group.active .sn-items { display: flex; }
/* other sections open as a flyout on hover */
@media (hover: hover) and (min-width: 1100px) {
  .sn-group:not(.active):hover .sn-items, .sn-group:not(.active):focus-within .sn-items {
    display: flex; position: absolute; left: calc(100% + 6px); top: 0; margin: 0; padding: 8px; min-width: 210px; z-index: 60;
    background: var(--menu-bg); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow-hi);
  }
  .sn-group:not(.active):hover .sn-items a, .sn-group:not(.active):focus-within .sn-items a { color: var(--ink-soft); }
  .sn-group:not(.active):hover .sn-items a:hover { background: var(--surface-2); color: var(--ink); }
  .sn-group:not(.active):hover .sn-items a svg { display: block; width: 18px; height: 18px; }
  .sn-group:not(.active):hover::after { content: ""; position: absolute; left: 100%; top: 0; width: 10px; height: 100%; }
}
.side-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid var(--side-line); }
.side-foot .lang-switch { border-color: var(--side-line); align-self: flex-start; }
.side-foot .lang-switch button { color: var(--side-soft); }
.side-tools { display: flex; gap: 8px; }
.sidebar .icon-btn { background: transparent; border-color: var(--side-line); color: var(--side-ink); }
.sidebar .icon-btn:hover { background: var(--side-hover); border-color: var(--side-soft); }
.sidebar .icon-btn[aria-current="page"] { background: var(--side-active); }
/* folded to icons */
:root[data-mini] .side-brand .brand-name, :root[data-mini] .sn-head span, :root[data-mini] .side-foot .lang-switch { display: none; }
:root[data-mini] .side-brand { justify-content: center; padding: 4px 0 16px; }
:root[data-mini] .sn-head { justify-content: center; padding: 11px 0; }
:root[data-mini] .sn-group.active > .sn-head { background: var(--side-active); }
:root[data-mini] .sn-group.active .sn-items { display: none; }
:root[data-mini] .side-tools { flex-direction: column; align-items: center; }
:root[data-mini] #sideCollapse svg { transform: scaleX(-1); }
@media (hover: hover) and (min-width: 1100px) {
  :root[data-mini] .sn-group:hover .sn-items, :root[data-mini] .sn-group:focus-within .sn-items {
    display: flex; position: absolute; left: calc(100% + 6px); top: 0; margin: 0; padding: 8px; min-width: 210px; z-index: 60;
    background: var(--menu-bg); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow-hi);
  }
  :root[data-mini] .sn-group:hover .sn-items a { color: var(--ink-soft); }
  :root[data-mini] .sn-group:hover .sn-items a[aria-current="page"] { background: var(--side-active); color: var(--ink); }
  :root[data-mini] .sn-group:hover .sn-items a:hover { background: var(--surface-2); color: var(--ink); }
  :root[data-mini] .sn-group:hover .sn-items a svg { display: block; width: 18px; height: 18px; }
}
@media (max-height: 640px) { .side-foot .lang-switch { display: none; } }

/* ============================================================ the top bar and its menus */
.topbar { background: var(--top-bg); color: var(--top-ink); border-bottom: 1px solid var(--top-line); }
.topbar .brand { color: var(--top-ink); }
.topbar .brand-mark { color: var(--brand-ink); }
.top-menu-btn { display: none; }
.top-nav { display: flex; gap: 2px; align-items: center; }
.tn-group { position: relative; }
.tn-head {
  display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--top-soft);
  font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: var(--btn-radius); cursor: pointer;
}
.tn-head svg { opacity: .7; transition: transform .15s; }
.tn-head:hover, .tn-group.open .tn-head { color: var(--top-ink); background: var(--top-hover); }
.tn-group.active .tn-head { color: var(--top-ink); box-shadow: inset 0 -2px 0 var(--accent-solid); border-radius: var(--btn-radius) var(--btn-radius) 0 0; }
.tn-menu {
  display: none; position: absolute; left: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px; z-index: 60;
  background: var(--menu-bg); color: var(--menu-ink); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow-hi);
}
.tn-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.tn-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.tn-menu a svg { width: 18px; height: 18px; color: var(--ink-faint); }
.tn-menu a:hover { background: var(--surface-2); color: var(--ink); }
.tn-menu a:hover svg { color: var(--accent-solid); }
.tn-menu a[aria-current="page"] { background: var(--gold-wash); color: var(--ink); }
.tn-group.open .tn-menu { display: block; }
.tn-group.open .tn-head svg { transform: rotate(180deg); }
@media (hover: hover) { .tn-group:hover .tn-menu { display: block; } }
.topbar .lang-switch { border-color: var(--top-line); }
.topbar .lang-switch button { color: var(--top-soft); }
.topbar .icon-btn { background: transparent; border-color: var(--top-line); color: var(--top-ink); }
.topbar .icon-btn:hover { background: var(--top-hover); }


:root[data-skin="taza"] .topbar { backdrop-filter: none; box-shadow: none; }
:root[data-skin="taza"] .topbar::before { content: none; }

@media (max-width: 1100px) { .tn-head { padding: 8px 9px; font-size: 14px; } .topbar { gap: 14px; } }
@media (max-width: 960px) { .topbar .lang-switch { display: none; } }

/* ============================================================ phone: tab bar and the "More" sheet */
@media (max-width: 760px) {
  .top-nav { display: none; }
  
  .tabbar { grid-template-columns: repeat(5, 1fr); }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border: 0; background: none;
    text-decoration: none; color: var(--ink-faint); font: 600 11px/1.2 var(--font-ui); cursor: pointer;
  }
  .tabbar a svg, .tabbar button svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--ink); }
  .tabbar [aria-current="page"] svg { color: var(--accent-solid); }
}
.more-sheet { padding: 0; }
.more-sheet[open] { display: block; }
@media (max-width: 760px) {
  .more-sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 86dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
.more-sheet { background: var(--surface); color: var(--ink); border: 1px solid var(--rule); overflow-y: auto; }

.more-sheet::backdrop { background: rgba(5, 10, 20, .45); backdrop-filter: blur(2px); }
.ms-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; background: inherit; z-index: 1; }
.ms-head b { font: 700 18px/1.2 var(--font-display); }
.more-sheet section { padding: 4px 16px 10px; }
.more-sheet h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 6px 0 6px; font-family: var(--font-ui); }
.ms-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ms-items a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.ms-items a svg { width: 20px; height: 20px; color: var(--accent-solid); flex: none; }
.ms-items a[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--gold); }

/* ============================================================ footer */
.site-footer { background: var(--foot-bg); color: var(--foot-ink); padding: 40px 0 calc(34px + env(safe-area-inset-bottom)); margin-top: 40px; border-top: 1px solid var(--rule); }
.site-footer::before { content: none; }
.foot-grid { display: grid !important; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 28px; }
.foot-brand .brand { display: inline-flex; color: var(--foot-head); margin-bottom: 12px; }
.foot-brand .brand-mark { color: var(--foot-head); width: 30px; height: 30px; }
.foot-brand p { max-width: 360px; font-size: 14px; line-height: 1.55; }
.foot-ver { margin-top: 10px; font-size: 12.5px; opacity: .75; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer h4 { margin: 0 0 4px; color: var(--foot-head); font: 700 13px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: .08em; }
.site-footer a { color: var(--foot-ink); text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: var(--foot-head); text-decoration: underline; }
.foot-support { display: inline-flex !important; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 14px; border-radius: var(--btn-radius); background: var(--accent); color: var(--on-accent) !important; font-weight: 700; align-self: flex-start; }
.foot-support:hover { text-decoration: none !important; filter: brightness(1.05); }
.foot-support svg { width: 18px; height: 18px; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 760px) { .site-footer { margin-bottom: 0; padding-bottom: 24px; } }

/* ============================================================ update bar, crash screen */
.update-bar { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--ink); color: var(--page); box-shadow: var(--shadow-hi); max-width: calc(100vw - 24px); }
@media (max-width: 760px) { .update-bar { bottom: calc(78px + env(safe-area-inset-bottom)); } }
.crash { display: grid; place-items: center; min-height: 60vh; padding-block: 40px; }
.crash-card { max-width: 520px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--ink); }
.crash-card .logo { color: var(--ink); }
.crash-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.crash details { font-size: 13px; color: var(--ink-faint); }
.crash code { display: block; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }

/* ============================================================ design-specific touches */
/* Тұлпар keeps the hairline of warm light under the header */












/* Таза: the ornament, used sparingly */
:root[data-skin="taza"] .btn-gold { box-shadow: none; text-shadow: none; }
:root[data-skin="taza"] .hero { padding-block: 40px; }
:root[data-skin="taza"] .card, :root[data-skin="taza"] .fcard, :root[data-skin="taza"] .more-card, :root[data-skin="taza"] .x-card { box-shadow: none; }
:root[data-skin="taza"] .page-title, :root[data-skin="taza"] .section-title, :root[data-skin="taza"] .dash-hero h1 { letter-spacing: -0.015em; font-weight: 700; }
:root[data-skin="taza"] .page-title::after, :root[data-skin="taza"] .section-title::after {
  width: 58px; height: 20px; border-radius: 0; margin-top: 8px; background: var(--orn-c);
  -webkit-mask: var(--orn) left center / 40px 20px repeat-x; mask: var(--orn) left center / 40px 20px repeat-x; opacity: .85; }
:root[data-skin="taza"] .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--orn-c) 20%, var(--orn-c) 80%, transparent); opacity: .55; }
:root[data-skin="taza"] .dash-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 11px; pointer-events: none;
  background: #F2C14E; opacity: .32; -webkit-mask: var(--orn) 0 50% / 22px 11px repeat-x; mask: var(--orn) 0 50% / 22px 11px repeat-x; }
:root[data-skin="taza"] .dash-hero::before { content: ""; position: absolute; right: -90px; top: -90px; width: 340px; height: 340px; pointer-events: none;
  background: #F2C14E; opacity: .07; -webkit-mask: var(--rosette) center / contain no-repeat; mask: var(--rosette) center / contain no-repeat; }
:root[data-skin="taza"] .dash-hero > * { position: relative; z-index: 1; }
:root[data-skin="taza"] .dash-hero { padding-bottom: calc(clamp(24px, 4vw, 44px) + 18px); }
:root[data-skin="taza"] .site-footer { position: relative; }
:root[data-skin="taza"] .site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; height: 11px; background: var(--orn-c); opacity: .28;
  -webkit-mask: var(--orn) 0 50% / 22px 11px repeat-x; mask: var(--orn) 0 50% / 22px 11px repeat-x; }
:root[data-skin="taza"] .site-footer { padding-top: 52px; }
:root[data-skin="taza"] .x-ico { color: #F2C14E; }
:root[data-skin="taza"] .tn-group.active .tn-head { box-shadow: inset 0 -2px 0 var(--orn-c); }
:root[data-skin="taza"] .dh-rank svg { color: #F2C14E; }
:root[data-skin="taza"] .pill { background: rgba(201, 154, 54, .16); color: #8A6414; }
:root[data-skin="taza"][data-theme="night"] .pill { color: #E8C266; }

/* ============================================================ home dashboard */
.dash { padding-top: 22px; padding-bottom: 20px; display: flex; flex-direction: column; gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--card-radius); box-shadow: var(--shadow); padding: 20px; color: var(--ink); }
a.card { text-decoration: none; display: block; transition: transform .16s, box-shadow .16s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 19px; letter-spacing: -0.02em; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--gold-wash); color: var(--gold-ink); white-space: nowrap; }
.muted { color: var(--ink-faint); }

.dash-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 34px; align-items: center;
  padding: clamp(24px, 4vw, 44px); border-radius: calc(var(--card-radius) + 6px); background: var(--hero-bg); color: #F4F1EA; box-shadow: var(--shadow-hi); }
:root[data-skin="taza"] .dash-hero { color: #fff; }
.dh-hi { font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; margin-bottom: 8px; }
.dash-hero h1 { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.04; letter-spacing: -0.035em; margin-bottom: 14px; color: #fff; }
.dh-lead { font-size: 16.5px; line-height: 1.55; opacity: .85; max-width: 560px; }
.dh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.dh-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.dh-ghost:hover { background: rgba(255, 255, 255, .16); }
.dh-rank { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; margin-top: 22px; max-width: 420px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: inherit; text-decoration: none; }
.dh-rank:hover { background: rgba(255, 255, 255, .13); }
.dh-rank svg { width: 24px; height: 24px; grid-row: span 3; color: #FFD36A; }
.dh-rank i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .15); position: relative; overflow: hidden; }
.dh-rank i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--accent); border-radius: 3px; }
.dh-rank small { font-size: 12.5px; opacity: .75; }
.dh-board { justify-self: end; width: min(100%, 400px); }
.dh-board .board { --board: min(400px, 100%); width: 100%; height: auto; aspect-ratio: 1; }
.dh-board .hero-caption { color: rgba(255, 255, 255, .75); }

.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 18px; align-items: stretch; }
.quick-opp { color: var(--ink-soft); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.opp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.opp-chip i { font-style: normal; color: var(--ink-faint); font-size: 13px; }
.opp-chip u { text-decoration: none; color: var(--gold-ink); font-size: 12.5px; font-weight: 600; }
.opp-chip .avatar, .opp-chip svg { width: 26px; height: 26px; }
.tc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tc-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; border-radius: calc(var(--card-radius) - 6px);
  background: var(--surface-2); border: 1px solid var(--rule); text-decoration: none; color: var(--ink); transition: background .12s, border-color .12s, transform .12s; }
.tc-tile b { font: 700 19px/1.1 var(--font-display); letter-spacing: -0.02em; }
.tc-tile span { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.tc-tile:hover { border-color: var(--gold); background: var(--gold-wash); transform: translateY(-1px); }
.tc-tile.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.daily-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 14px; align-items: center; }
.daily-board.board, .daily-board .board { --board: 100%; width: 100%; height: auto; aspect-ratio: 1; box-shadow: none; }
.daily-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); }
.daily-side b { color: var(--ink); font-size: 15px; }
.cont-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cont-list a { display: grid; grid-template-columns: 30px 1fr 18px; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; background: var(--surface-2); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500; }
.cont-list a:hover { background: var(--gold-wash); }
.cont-list a > svg:last-child { width: 16px; height: 16px; color: var(--ink-faint); }
.cont-list .avatar, .cont-list a > svg.avatar { width: 30px; height: 30px; }
.li-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: var(--on-accent); }
.li-ico svg { width: 17px; height: 17px; }
.tip-box { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); border-top: 1px dashed var(--rule); padding-top: 12px; }
.tip-box b { color: var(--ink); }
.dash-sec { display: flex; flex-direction: column; gap: 6px; }
.dash-sec .char-strip { margin-top: 10px; }
.dash-import { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.dash-import h2 { font-size: 22px; margin-bottom: 6px; letter-spacing: -0.02em; }
.dash-import .import-form { box-shadow: none; border: 0; padding: 0; background: none; }
.x-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.x-card { display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; gap: 2px 14px; align-items: center; padding: 16px; border-radius: var(--card-radius);
  background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .16s, box-shadow .16s; }
.x-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi); }
.x-ico { grid-row: span 2; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--deep-bg); color: #FFD36A; }
.x-ico svg { width: 22px; height: 22px; }
.x-card b { font: 700 16px/1.2 var(--font-display); }
.x-card span:last-child { font-size: 13.5px; color: var(--ink-soft); }
.all-features { margin-top: 16px; }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: 1fr 1fr; } .dash-grid .quick { grid-column: 1 / -1; } .tc-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 860px) {
  .dash-hero { grid-template-columns: 1fr; }
  .dh-board { justify-self: center; width: min(100%, 360px); }
  .dash-import { grid-template-columns: 1fr; }
  .x-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .dash { padding-top: 12px; gap: 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  .tc-grid { grid-template-columns: repeat(3, 1fr); }
  .x-grid { grid-template-columns: 1fr; }
  .dh-board { display: none; }
  .dash-hero { padding: 22px 18px; }
}
.brand-name::after { content: none; }
:root[data-board="onyx"] { --sq-light: #E6DCC3; --sq-dark: #4A463F; --coord-on-light: #4A463F; --coord-on-dark: #E6DCC3; }

/* ============================================================ new pages */
.seg-links a.on, .seg-links a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
/* puzzle of the day */
.puzzle-page { padding-top: 18px; }
.puzzle-page .page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; }
.pz-stage { padding-inline: 0; }
.pz-status .status { font-size: 17px; }
.status.good { color: var(--win); } .status.bad { color: var(--loss); }
.status svg { width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; }
.pz-actions, .fr-actions, .ls-actions, .ed-row, .sp-actions, .crash-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pz-count { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pz-count svg { width: 20px; height: 20px; color: var(--orn-c, var(--gold)); }
.pz-count span { color: var(--ink-faint); font-size: 13px; }
.pz-streak { border-top: 1px solid var(--rule); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sq.pz-hint::after { content: ""; position: absolute; inset: 0; background: rgba(46, 139, 105, .45); animation: pz-pulse 1s ease-in-out infinite alternate; }
@keyframes pz-pulse { from { opacity: .35; } to { opacity: .9; } }

/* friend */
.fr-title { font-size: 26px; }
.fr-setup { display: flex; flex-direction: column; gap: 12px; }
.fr-names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.fr-line { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.fr-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-faint); flex: none; }
.fr-dot.w { background: #fff; } .fr-dot.b { background: #1C2127; }
.fr-line .clock { margin-left: auto; font: 700 18px/1 var(--font-ui); font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 8px; background: var(--surface-2); color: var(--ink-soft); }
.fr-line .clock.on { background: var(--ink); color: var(--page); }
.fr-line .clock.low { background: var(--loss); color: #fff; }
.moves .mvn { color: var(--ink-faint); font-variant-numeric: tabular-nums; margin-left: 4px; }
.moves .mv.cur { background: var(--gold-wash); border-radius: 4px; padding: 0 3px; }
#moves { line-height: 1.9; font-size: 14px; }

/* coordinates */
.co-wrap { position: relative; }
.co-target { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 14px; pointer-events: none; z-index: 5; }
.co-target b { font: 800 clamp(64px, 14vw, 140px)/1 var(--font-display); color: #fff; text-shadow: 0 4px 30px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .6); }
.co-target span { font: 700 clamp(24px, 4vw, 40px)/1 var(--font-display); color: rgba(255, 255, 255, .7); text-shadow: 0 2px 12px rgba(0, 0, 0, .5); align-self: flex-end; margin-bottom: 30%; }
.board.co-live { cursor: pointer; }
.sq.co-ok::after { content: ""; position: absolute; inset: 0; background: rgba(46, 139, 105, .7); }
.sq.co-no::after { content: ""; position: absolute; inset: 0; background: rgba(194, 65, 59, .7); }
.co-score { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 14px; }
.co-score span { display: block; font-size: 12px; color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.co-score b { font: 700 30px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }

/* lessons */
.learn { padding-top: 18px; padding-bottom: 30px; }
.ls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 8px; }
.ls-card { position: relative; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto auto; gap: 2px 14px; align-items: start; padding: 16px; }
.ls-card .ls-pc { grid-row: span 3; width: 52px; height: 52px; border-radius: 14px; background: var(--deep-bg); display: grid; place-items: center; }
.ls-card .ls-pc svg, .ls-head .ls-pc svg { width: 42px; height: 42px; }
.ls-card b { font: 700 17px/1.2 var(--font-display); }
.ls-card > span:not(.ls-pc):not(.ls-num) { font-size: 13.5px; color: var(--ink-soft); }
.ls-num { position: absolute; right: 14px; top: 12px; font: 700 12px/1 var(--font-ui); color: var(--ink-faint); }
.ls-stars { display: flex; gap: 2px; margin-top: 6px; }
.ls-stars i { width: 18px; height: 18px; color: var(--rule); }
.ls-stars i.on { color: #E9B23A; }
.ls-card.done { border-color: color-mix(in srgb, var(--win) 40%, var(--rule)); }
.ls-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 600; }
.ls-back svg { width: 16px; height: 16px; }
.ls-head { display: flex; gap: 14px; align-items: center; }
.ls-head .ls-pc { flex: none; width: 60px; height: 60px; border-radius: 16px; background: var(--deep-bg); display: grid; place-items: center; }
.ls-head .page-title { font-size: 26px; }
.ls-progress { display: flex; gap: 6px; }
.ls-progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--rule); }
.ls-progress i.ok { background: var(--win); } .ls-progress i.cur { background: var(--gold); }
.ls-star { position: absolute; inset: 18%; color: #E9B23A; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); animation: ls-in .3s ease-out; z-index: 1; }
@keyframes ls-in { from { transform: scale(.4); opacity: 0; } }

/* editor */
.ed-tray { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--rule); }
#trayB { grid-template-columns: repeat(6, 1fr); }
.ed-pc { aspect-ratio: 1; border: 0; border-radius: 8px; background: transparent; cursor: pointer; padding: 2px; display: grid; place-items: center; color: var(--ink-soft); }
.ed-pc svg { width: 100%; height: 100%; max-width: 54px; }
.ed-erase svg { width: 60%; height: 60%; }
.ed-pc:hover { background: var(--surface); }
.ed-pc[aria-pressed="true"] { background: var(--gold-wash); box-shadow: inset 0 0 0 2px var(--gold); }
.editor .board { cursor: crosshair; }
.ed-castle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.ed-fen { display: flex; gap: 6px; }
.ed-fen .input { flex: 1; min-width: 0; font-size: 12.5px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* profile */
.profile { padding-top: 18px; padding-bottom: 30px; display: flex; flex-direction: column; gap: 18px; }
#pf { display: flex; flex-direction: column; gap: 20px; }
.pf-rank { display: flex; gap: 24px; align-items: center; background: var(--hero-bg); color: #fff; border: 0; padding: 26px; position: relative; overflow: hidden; }
.pf-mark { width: 104px; height: 104px; border-radius: 26px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; color: #fff; flex: none; }
.pf-label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.pf-rank h2 { font-size: 40px; letter-spacing: -0.02em; margin: 2px 0 10px; color: #fff; }
.pf-rank-text { flex: 1; }
.pf-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .16); overflow: hidden; max-width: 460px; }
.pf-bar i { display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, #F2C14E, #F6A63F); border-radius: 4px; }
.pf-rank p { margin-top: 8px; opacity: .85; font-size: 14px; }
.pf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pf-stat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--card-radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.pf-stat b { font: 700 24px/1.2 var(--font-display); }
.pf-stat b small { font: 600 13px var(--font-ui); color: var(--ink-faint); }
.pf-stat span { font-size: 13px; color: var(--ink-soft); }
.pf-heat h2 { font-size: 18px; margin-bottom: 12px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i, .heat-legend i { width: 11px; height: 11px; border-radius: 2px; background: var(--surface-2); display: inline-block; }
.heat .h1, .heat-legend .h1 { background: color-mix(in srgb, var(--gold) 30%, var(--surface-2)); }
.heat .h2, .heat-legend .h2 { background: color-mix(in srgb, var(--gold) 55%, var(--surface-2)); }
.heat .h3, .heat-legend .h3 { background: color-mix(in srgb, var(--gold) 78%, var(--surface-2)); }
.heat .h4, .heat-legend .h4 { background: var(--gold); }
.heat-legend { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink-faint); margin-top: 8px; justify-content: flex-end; }
.aw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.aw { display: flex; flex-direction: column; gap: 4px; padding: 14px; opacity: .6; }
.aw.got { opacity: 1; border-color: color-mix(in srgb, var(--orn-c, var(--gold)) 50%, var(--rule)); }
.aw-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-faint); font: 700 18px/1 var(--font-display); margin-bottom: 4px; }
.aw-ico svg { width: 18px; height: 18px; }
.aw.got .aw-ico { background: var(--deep-bg); color: #F2C14E; }
.aw b { font: 700 15px/1.25 var(--font-display); }
.aw span { font-size: 13px; color: var(--ink-soft); }
.aw small { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.rk-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.rk-list li { padding: 12px 14px; border-radius: var(--card-radius); border: 1px solid var(--rule); background: var(--surface); display: flex; flex-direction: column; gap: 2px; opacity: .65; }
.rk-list li.past { opacity: .9; } .rk-list li.cur { opacity: 1; border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.rk-list b { font: 700 16px/1.2 var(--font-display); } .rk-list span { font-size: 13px; color: var(--ink-soft); } .rk-list i { font-style: normal; font-size: 12px; color: var(--ink-faint); }
@media (max-width: 760px) { .pf-stats { grid-template-columns: 1fr 1fr; } .pf-rank { flex-direction: column; text-align: center; } .pf-bar { margin: 0 auto; } }

/* support */
.support { padding-top: 18px; padding-bottom: 30px; display: flex; flex-direction: column; gap: 20px; }
.sp-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: clamp(24px, 4vw, 44px); border-radius: calc(var(--card-radius) + 6px); background: var(--hero-bg); color: #fff; }
.sp-hero h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.02em; margin-bottom: 12px; color: #fff; }
.sp-hero p { max-width: 620px; opacity: .88; line-height: 1.6; font-size: 16px; }
.sp-actions { margin-top: 22px; align-items: center; }
.sp-soon { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .1); font-size: 14.5px; }
.sp-share { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.sp-cup { width: 150px; height: 150px; border-radius: 40px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; color: #F2C14E; }
.sp-cup svg { width: 84px; height: 84px; stroke-width: 1.4; }
.sp-help h2 { font-size: 19px; margin-bottom: 8px; }
.sp-help ul { margin: 0; padding-left: 20px; color: var(--ink-soft); line-height: 1.8; }
.ct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 12px; }
.ct-card { display: flex; gap: 14px; align-items: flex-start; }
.ct-card b { font: 700 17px/1.25 var(--font-display); }
.ct-card p { font-size: 14px; color: var(--ink-soft); margin: 4px 0 12px; }
.ct-card .x-ico { flex: none; }
.ct-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; font-size: 15px; }
.ct-mail > svg { width: 20px; height: 20px; color: var(--ink-faint); }
@media (max-width: 860px) { .ct-grid { grid-template-columns: 1fr; } .sp-hero { grid-template-columns: 1fr; } .sp-cup { display: none; } }
a.card.ls-card { display: grid; }
@media (min-width: 1001px) {
  .pz-stage { --board: calc(min(calc(100dvh - var(--nav-h) - 240px), calc(var(--vw) - var(--panel) - 150px), 700px) * var(--board-scale, 1)); padding-top: 8px; }
  .stage.editor { --board: calc(min(calc(100dvh - var(--nav-h) - 230px), calc(var(--vw) - var(--panel) - 150px), 700px) * var(--board-scale, 1)); }
  .stage.friend { --board: calc(min(calc(100dvh - var(--nav-h) - 150px), calc(var(--vw) - var(--panel) - 150px), 720px) * var(--board-scale, 1)); }
}
/* Ұстаз: the chips and your own question, docked at the bottom */
.ask-dock { position: sticky; bottom: 12px; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-hi); z-index: 5; }
.ask-dock .chips.ask { position: static; padding: 0; border: 0; background: none; backdrop-filter: none; border-radius: 0; }
.ask-form { display: flex; gap: 8px; }
.ask-form .input { flex: 1; min-width: 0; }
.ask-form .btn { padding-inline: 14px; }
.ask-form .btn svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .ask-dock { bottom: calc(70px + env(safe-area-inset-bottom)); } .ask-dock .chips.ask { bottom: auto; } }
.ed-tray { background: color-mix(in srgb, var(--sq-light) 55%, var(--surface-2)); }
.ustaz .msg { scroll-margin-bottom: 190px; }
.draw-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--gold-wash); font-weight: 600; }
.draw-box span { flex: 1 1 100%; }
/* settings: designs, logos, colours */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.skin { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; }
.skin:hover { border-color: var(--ink-faint); }
.skin[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.skin-sw { display: flex; width: 100%; height: 34px; border-radius: 8px; overflow: hidden; margin-bottom: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.skin-sw i { flex: 1; } .skin-sw i:first-child { flex: 1.4; }
.skin b { font: 700 15px/1.2 var(--font-display); } .skin small { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.logos { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 600; }
.logo-pick[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.custom-colors { display: flex; gap: 14px; flex-wrap: wrap; }
.color-field { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.color-field input { width: 44px; height: 32px; border: 1px solid var(--rule); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
.sound-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input[type="range"] { accent-color: var(--accent-solid); width: min(320px, 100%); }
.fv-ico svg { width: 72px; height: 72px; color: #F2C14E; stroke-width: 1.4; }
@media (max-width: 640px) { :root[data-skin="taza"] .dash-hero::before { display: none; } }
.seg-links { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-links::-webkit-scrollbar { display: none; }
.seg-links a { white-space: nowrap; }
/* eval bar: always readable, also at night */
.evalbar { box-shadow: 0 0 0 1px var(--bar-edge, rgba(0, 0, 0, .2)); }
:root[data-theme="night"] { --bar-black: #2C3137; --bar-white: #ECE6D8; --bar-edge: rgba(255, 255, 255, .24); }

/* ============================================================ analysis: the Tulpar views */
.an-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.an-tabs::-webkit-scrollbar { display: none; }
.an-tabs button { flex: 1 0 auto; border: 0; background: none; color: var(--ink-soft); font: 600 13.5px/1.2 var(--font-ui); padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.an-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.an-tab { display: flex; flex-direction: column; gap: 12px; }
.an-empty { padding: 18px; border: 1px dashed var(--rule); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; color: var(--ink-soft); }
.an-sub { font: 700 15px/1.3 var(--font-display); margin: 6px 0 2px; }
/* relief under the board */
.relief { display: block; width: 100%; height: 76px; margin-top: 10px; border-radius: 8px; cursor: pointer; border: 1px solid var(--rule); }
.relief .rf-sky0 { stop-color: #EAF2F8; } .relief .rf-sky1 { stop-color: #F7F3EA; }
.relief .rf-land0 { stop-color: #D9B46A; } .relief .rf-land1 { stop-color: #9C7A3C; }
:root[data-theme="night"] .relief .rf-sky0 { stop-color: #13202C; } :root[data-theme="night"] .relief .rf-sky1 { stop-color: #1B2733; }
:root[data-theme="night"] .relief .rf-land0 { stop-color: #C9A24C; } :root[data-theme="night"] .relief .rf-land1 { stop-color: #6E5428; }
.relief .rf-ridge { fill: none; stroke: #6B4F1E; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
:root[data-theme="night"] .relief .rf-ridge { stroke: #EAD08C; }
.relief .rf-mid { stroke: var(--ink-faint); stroke-dasharray: 3 4; stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .6; }
.relief .rf-flag line { stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.relief .rf-flag path { fill: var(--c-blunder, #C2413B); }
.relief .rf-flag.mistake path { fill: var(--c-mistake, #E08A2C); } .relief .rf-flag.brilliant path { fill: var(--c-brilliant, #1CA3A3); }
.relief .rf-cur { stroke: var(--gold); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.relief .rf-rider circle { fill: var(--gold); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
/* story */
.story-head .acc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acc-pair > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--rule); }
.acc-pair span { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-pair b { font: 700 26px/1.1 var(--font-display); } .acc-pair small { font-size: 14px; color: var(--ink-faint); margin-left: 2px; }
.chapter { position: relative; padding: 4px 0 4px 18px; border-left: 2px solid var(--rule); }
.chapter h3 { font: 700 16px/1.3 var(--font-display); margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.chapter .ch-num { position: absolute; left: -12px; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--orn-c, var(--gold)); color: var(--ink);
  font: 700 10px/18px var(--font-ui); text-align: center; }
.chapter p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.chapter p b { color: var(--ink); }
.chapter .st-acc { font-size: 12.5px; color: var(--ink-faint); }
.chapter .tag { font-size: 11px; padding: 1px 4px; border-radius: 4px; vertical-align: 1px; }
.chapter.epilogue { border-left-color: var(--orn-c, var(--gold)); }
.link { border: 0; background: none; padding: 0; color: var(--gold-ink); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.moments-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.moment-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); text-align: left; cursor: pointer; color: var(--ink); }
.moment-card:hover { border-color: var(--gold); }
.mc-text { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mc-text small { flex-basis: 100%; color: var(--ink-faint); font-size: 12px; }
.mini-board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; width: 100%; border-radius: 4px; overflow: hidden; }
.mini-board i { position: relative; display: block; background: var(--sq-light); }
.mini-board i.d { background: var(--sq-dark); }
.mini-board i.hl::before { content: ""; position: absolute; inset: 0; background: rgba(233, 178, 58, .45); }
.mini-board i svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* why */
.why-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.why-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.why-chip { font-size: 12.5px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule); color: var(--ink-soft); }
.why-chip b { color: var(--ink); margin-left: 3px; }
.why-list { display: flex; flex-direction: column; gap: 8px; }
.why-card { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface); border-left: 4px solid var(--c-inaccuracy, #E9B23A); }
.why-card.mistake { border-left-color: var(--c-mistake, #E08A2C); } .why-card.blunder { border-left-color: var(--c-blunder, #C2413B); }
.why-card.active { box-shadow: 0 0 0 2px var(--gold); }
.why-card header { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.why-card .tag { font-size: 11px; padding: 1px 5px; border-radius: 4px; }
.why-who { color: var(--ink-faint); font-size: 12.5px; }
.why-loss { margin-left: auto; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.why-card h4 { margin: 8px 0 2px; font: 700 15px/1.3 var(--font-display); }
.why-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.why-acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.why-drill { margin-top: 8px !important; padding: 8px 10px; border-radius: 8px; background: var(--gold-wash); color: var(--ink) !important; }
.why-drill svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; color: var(--win); }
/* power map */
.pm-layer { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); pointer-events: none; z-index: 1; }
.pm-layer i { display: block; transition: background .25s; }
.pm-layer i.contested { background: repeating-linear-gradient(45deg, rgba(242, 193, 78, .25) 0 6px, rgba(36, 104, 170, .25) 6px 12px); }
.pm-layer i.hang { box-shadow: inset 0 0 0 4px rgba(194, 65, 59, .9); background: rgba(194, 65, 59, .22); }
.pm-layer i.risk { box-shadow: inset 0 0 0 3px rgba(224, 138, 44, .9); }
.pm-layer i.att { background: radial-gradient(circle, rgba(194, 65, 59, .55) 0 14%, transparent 16%); }
.pm-modes { display: flex; gap: 4px; }
.pm-modes button { flex: 1; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-soft); padding: 7px 8px; border-radius: 8px; font: 600 13px var(--font-ui); cursor: pointer; }
.pm-modes button[aria-selected="true"] { border-color: var(--gold); color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold); }
.pm-stats { display: flex; flex-direction: column; gap: 8px; }
.pm-bar { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.pm-l { color: var(--ink-soft); }
.pm-track { height: 10px; border-radius: 5px; background: #1F3346; overflow: hidden; box-shadow: 0 0 0 1px var(--rule); }
.pm-track i { display: block; height: 100%; background: #F2E6C9; }
.pm-n { font-variant-numeric: tabular-nums; color: var(--ink-faint); }
.pm-kings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm-king { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; }
.pm-king b { font: 700 26px/1.1 var(--font-display); }
.pm-king.ok b { color: var(--win); } .pm-king.mid b { color: #C98A1E; } .pm-king.bad b { color: var(--loss); }
.pm-king span { font-size: 12.5px; color: var(--ink-soft); } .pm-king small { font-size: 12px; color: var(--ink-faint); }
.pm-threats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.pm-threats em { color: var(--loss); font-style: normal; font-weight: 600; }
.pm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid var(--ink-faint); vertical-align: -1px; }
.pm-dot.w { background: #fff; } .pm-dot.b { background: #1C2127; }
/* portrait */
.portrait { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.pt-top { display: flex; gap: 12px; align-items: center; }
.pt-top p { margin: 0; font-size: 14px; line-height: 1.45; }
.pt-ava svg { width: 56px; height: 56px; display: block; }
.radar { width: 100%; max-width: 280px; align-self: center; overflow: visible; }
.radar .r-ring { fill: none; stroke: var(--rule); stroke-width: 1; }
.radar .r-shape { fill: rgba(26, 118, 186, .2); stroke: var(--accent-solid, var(--gold)); stroke-width: 2; stroke-linejoin: round; }
.radar text { font: 600 9px var(--font-ui); fill: var(--ink-soft); }
.pt-traits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pt-traits li { display: grid; grid-template-columns: 104px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-soft); }
.pt-traits i { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--rule); }
.pt-traits i b { display: block; height: 100%; background: var(--accent-solid, var(--gold)); }
.pt-traits em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.portrait > p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
