/* Visual polish v1, icons lane (2026-10-27).
   1. The one UI icon (uiIcon in client/ui-components.ts): a painted PNG from /art/ui-icons/ when the build ships
      it, else existing painted art or an inline SVG with a thick ink outline under a warm fill (the music set's
      drawing). 1em square by default; callers size it with width/height or font-size.
   2. Settings: one opaque card of rows (icon + label, control right) like the Sound sheet; switches, value chips,
      Day/Night segments, a danger Leave face and the legal links inside the panel.
   3. Styled game toggles replacing native checkboxes (Skip animation).
   Loaded last so its few overrides of older per-screen glyph rules win without !important. */
/* Zero specificity: a host's own rule (display:none states, sizes) always wins over this default. */
:where(.ui-icon){display:inline-block;flex:none;width:1em;height:1em;line-height:0;vertical-align:-.14em}
.ui-icon>img,.ui-icon>svg{display:block;width:100%;height:100%;object-fit:contain;overflow:visible}
/* The icon fills its box whatever a host's `.x img` / `.x svg` rule says; size the .ui-icon box instead. */
.ui-icon>:is(img,svg){width:100%!important;height:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:0!important;border:0!important;opacity:1!important;filter:none;transform:none}
.ui-icon .uio>*{fill:var(--vs-ink);stroke:var(--vs-ink);stroke-width:3.2px;stroke-linejoin:round;stroke-linecap:round}
.ui-icon .uio>.ln{fill:none;stroke-width:6.6px}
.ui-icon .uif>*{fill:var(--ui-icon-fill);stroke:none}
.ui-icon .uil>.ln{fill:none;stroke:var(--ui-icon-fill);stroke-width:3.3px;stroke-linecap:round;stroke-linejoin:round}
.ui-icon .uih>.ln{fill:none;stroke:#ffffffb8;stroke-width:1.5px;stroke-linecap:round}
.ui-icon .uih>.dk{fill:var(--vs-ink)}
.ui-icon .uih>.fold{fill:none;stroke:var(--vs-ink);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}
.ui-icon>.mi{--mi-ink:var(--vs-ink)}
/* A glyph slot that used to be text keeps its box; the icon is centred in it. */
.ui-icon-slot{display:inline-grid;place-items:center;line-height:0}

/* ---- Settings ---- */
#modal .settings-panel .settings-rows{display:block;margin:12px 0 0;padding:0 12px;border-radius:12px;background:#f7e8c9;box-shadow:inset 0 2px 3px #b4895333,inset 0 0 0 1.5px #d5b783;color:var(--vs-ink-text)}
/* Every 44px target has the scenery row's clearance, including the 3px face drop. */
#modal .settings-rows>.settings-row{display:flex;align-items:center;gap:6px;min-width:0;min-height:58px;margin:0;padding:0;border:0;border-radius:0}
#modal .settings-rows>.settings-row+.settings-row{border-top:1.5px dashed #d5b78399}
#modal .settings-row>.settings-row-icon{width:24px;height:24px;flex:none}
#modal .settings-row>.settings-row-label{flex:1 1 auto;min-width:0;font:16px/1.15 Lucky;text-align:left;overflow-wrap:normal}
#modal .settings-row>.ui-switch{margin-left:auto}
#modal .settings-row>.settings-value{flex:none;width:auto;min-width:104px;height:44px;min-height:44px;margin:0 0 0 auto;padding:0 16px;font-size:18px}
#modal .settings-value>.button-label{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0}
#modal .settings-value-text{white-space:nowrap}
#modal .settings-value .settings-value-go{width:14px;height:14px}
#modal .settings-row .home-scenery-options{display:flex;flex:none;gap:6px;margin:0 0 0 auto;padding:0;border:0}
#modal .settings-row .home-scenery-options .secondary{width:auto;min-width:0;height:44px;min-height:44px;margin:0;padding:0 14px;font-size:17px}
#modal .settings-row .home-scenery-options .button-label{display:flex;align-items:center;gap:5px}
#modal .settings-row .scenery-icon{width:20px;height:20px}
/* AC784: with the Season alerts row, short screens use the dense row pitch
   (44px target + 3px lip + at least 4px painted clearance) so Close stays on screen. */
@media(max-height:700px){#modal:has(.settings-row-season-notify) .settings-rows>.settings-row{min-height:51px}}
/* b213 AC885: the Graphics row is one more row; on a short screen the rows give way (targets stay 44px) so Settings never
   scrolls, also with the iOS Season alerts and Analytics rows. */
@media(max-height:700px){#modal:has(.settings-row-graphics) .settings-rows>.settings-row{min-height:51px}
 /* A three-row menu (Rewards for an invite code, the owner's Feature flags) with the Graphics row needs 616px at this
    pitch. Like the Bait tasks and Merge all sheets, Settings then uses the safe viewport minus 12px margins where that
    exceeds the default 90dvh (Compact: 623px instead of 600px), so the rows keep their clearance and nothing scrolls. */
 #modal:has(.settings-row-graphics){max-height:max(90dvh,calc(100dvh - var(--safe-top,env(safe-area-inset-top,0px)) - var(--safe-bottom,env(safe-area-inset-bottom,0px)) - 24px))}
 #modal:has(.settings-row-graphics):has(.settings-row-season-notify) .settings-rows>.settings-row{min-height:46px}
 #modal:has(.settings-row-graphics):has(.settings-row-season-notify):has(.settings-row-analytics) .settings-rows>.settings-row{min-height:44px}}
#modal .settings-panel .settings-leave{width:100%;margin:12px 0 0}
#modal .settings-panel .settings-legal{margin:8px 4px 0}
#modal .settings-panel .settings-legal .legal-link{color:#6b4a2d;font-size:13px}
#modal .settings-panel .settings-legal .legal-link:active>span{color:#a0703f}
:root[data-input-modality=keyboard] #modal .settings-panel .settings-legal .legal-link:focus-visible{outline-color:#b67939}
@media(max-height:700px){
 /* Keep controls clear of dividers even on Compact; tighten the surrounding margins instead. */
 #modal .settings-panel .settings-rows{margin-top:6px}
 #modal .settings-panel .settings-leave{margin-top:8px}
 #modal .settings-panel .settings-legal{margin-top:0}
}

/* ---- Game toggle: a native checkbox drawn as the Sound sheet's switch (Skip animation, Remember, flags) ---- */
:is(#online,#modal) input.ui-toggle{appearance:none;-webkit-appearance:none;position:relative;flex:none;width:46px;height:28px;margin:0;padding:0;border:2px solid var(--vs-ink);border-radius:14px;background:linear-gradient(#8d8784,#a7a19c);box-shadow:inset 0 3px 2px #0003;cursor:pointer;transition:background-color .2s}
:is(#online,#modal) input.ui-toggle::before{content:'';position:absolute;left:1px;top:1px;width:22px;height:22px;box-sizing:border-box;border-radius:50%;border:2px solid var(--vs-ink);background:radial-gradient(circle at 40% 32%,#fff,#efe3cc);box-shadow:0 2px 0 #0004;transition:transform .36s cubic-bezier(.34,1.7,.5,1)}
:is(#online,#modal) input.ui-toggle:checked{background:linear-gradient(#2f8d36,#4cb453)}
:is(#online,#modal) input.ui-toggle:checked::before{transform:translateX(18px)}
:is(#online,#modal) input.ui-toggle:disabled{opacity:.55;cursor:default}
@media (prefers-reduced-motion:reduce){:is(#online,#modal) input.ui-toggle,:is(#online,#modal) input.ui-toggle::before{transition:none}}

/* ---- Glyph sites now drawn with uiIcon (sizes match the old glyphs' visible ink) ---- */
#modal .event-card-edge>.ui-icon{width:24px;height:24px}
#modal .events-panel .event-card-edge>.ui-icon{width:22px;height:22px}
#modal .calendar-event-row .calendar-event-edge>.ui-icon{width:20px;height:20px}
.collection-entry>.collection-entry-go{width:16px;height:16px}
#modal .bestiary-act-arrow>.ui-icon{width:20px;height:20px}
#modal .whats-new-page>.ui-icon{position:relative;width:18px;height:18px}
.sr-row-go.ui-icon{width:18px;height:18px;font-size:inherit;translate:none}
.drone-star-more.ui-icon{width:14px;height:14px}
.hub-travel-box strong>.ui-icon{width:18px;height:18px}
.hub-shortcut .menu-lines{display:grid;place-items:center}
.hub-shortcut .menu-lines>.ui-icon{width:24px;height:24px}
.home-scene .hub-menu .menu-lines>.ui-icon{width:30px;height:30px}
/* Close: the Home Menu bar (was a ✕ drawn from two bars under five drop-shadow filters) and the receipt corner ×. */
#modal :is(.home-menu-close,.receipt-dismiss){display:grid;place-items:center}
#modal .home-menu-close>.ui-icon{width:34px;height:34px;font-size:inherit;filter:none}
#modal .home-menu-close>.ui-icon::before,#modal .home-menu-close>.ui-icon::after{content:none}
#modal .receipt-dismiss>.ui-icon{width:22px;height:22px}
/* Arrows: power change strip, merge paths and rows, Gear "worn"/"better" corner marks. */
#combat-power-change .power-change-values>.power-change-arrow{width:16px;height:16px}
#combat-power-change .power-change-values em>.ui-icon{width:17px;height:17px}
.gear-merge-path>.gear-merge-arrow{width:16px;height:16px}
.gemstone-merge-row-text>.merge-row-arrow{width:14px;height:14px}
.gemstone-merge-art>.gemstone-merge-arrow{width:28px;height:28px}
.gemstone-merge-bonus>.ui-icon{width:.8em;height:.8em;vertical-align:-.05em}
.gear-worn-mark.ui-icon,.gear-better-mark.ui-icon{width:13px;height:13px;-webkit-text-stroke:0}
.gear-grid .gear-card :is(.gear-worn-mark,.gear-better-mark).ui-icon{width:15px;height:15px}
/* Check marks: the painted tick is the badge (no green disc behind a green tick). */
/* Badge ticks: one stamp badge (ink ring, cream face, green tick) wherever a selection or completion is marked. */
#modal .avatar-check.ui-icon,.skill-offer-check.ui-icon,.tasks-node-check.ui-icon,.mail-reward-check.ui-icon,.drone-req-state.ui-icon{box-sizing:border-box;padding:3px;border:2px solid var(--vs-ink);border-radius:50%;background:radial-gradient(circle at 40% 32%,#fffdf4,#efe1c4);box-shadow:0 2px 0 var(--vs-ink)}
#modal .avatar-check.ui-icon{width:26px;height:26px}
.skill-offer-check.ui-icon{width:28px;height:28px}
.tasks-node-check.ui-icon,.mail-reward-check.ui-icon{width:20px;height:20px;padding:2px;box-shadow:0 1px 0 var(--vs-ink)}
.fund-tile-check.ui-icon{inset:auto;left:50%;top:50%;width:30px;height:30px;translate:-50% -50%;-webkit-text-stroke:0}
.drone-req-state.ui-icon{width:24px;height:24px}
.drone-perk-fact-ok.ui-icon{width:18px;height:18px}
.key-offer-claimed.ui-icon{width:18px;height:18px}
.collection-track-node>.collection-track-check{position:absolute;right:-7px;top:-7px;width:18px;height:18px}
.collection-track-node .collection-track-check>img{width:100%;height:100%}
.route-slot.cleared .route-slot-index{background:#1d1b24}
.route-slot-index>.ui-icon{width:18px;height:18px}
.route-slot.chapter-slot .route-slot-index>.ui-icon{width:20px;height:20px}
.treasure-attempts span.ui-icon{position:static;display:inline-block;width:18px;height:18px;border:0;border-radius:0;background:none;box-shadow:none}
/* Weapon card: "Equipped" state and the Preview Lv5 sparkle. */
#modal .weapon-equipped-status>.button-label{display:flex;align-items:center;justify-content:center;gap:6px}
#modal .weapon-equipped-status>.button-label>.ui-icon{width:22px;height:22px}
#modal .weapon-preview-toggle .weapon-preview-spark{width:20px;height:20px}
.owned-skins small>.ui-icon,.training-step small>.ui-icon{width:13px;height:13px}
/* Stars in copy ("2 / 10 ★", "Next: 3★", tier badges, Blip's ★N): the painted chapter star, not a text glyph. */
.ui-star-inline{width:1.05em;height:1.05em;margin-left:.08em;vertical-align:-.17em}
.drone-star-gold.ui-icon{width:1.05em;height:1.05em;vertical-align:-.17em;-webkit-text-stroke:0}
.drone-star-badge>.ui-icon{width:16px;height:16px;margin-right:2px}
.collection-chip>.collection-chip-star{width:20px;height:20px}
.collection-guide-glyph.is-star>.ui-icon{width:30px;height:30px}
/* Server picker: painted check in the Current tag, chevron on the other rows (were CSS \2713 / \203A glyphs). */
#modal .server-switcher .server-option-tag.is-current:before{content:none}
#modal .server-switcher .server-options button:not([aria-pressed=true]):after{content:none}
#modal .server-switcher .server-option-tag.is-current>.ui-icon{width:13px;height:13px}
#modal .server-switcher .server-options .server-option-go{width:16px;height:16px}
/* Empty Backpack mark. */
.backpack-empty:before{content:none}
.backpack-empty>.ui-icon{width:24px;height:24px}
/* Skill draft category tags and Tower guardian stats: one tag-icon family (tag-recovery / tag-attack / tag-defense).
   Until the painted family lands, the stat art is boxed alike; the full-bleed heart sits one step smaller so it
   carries the same optical weight as the diagonal sword and the shield. */
.skill-offer-group>.ui-icon,.tower-enemy-stats>.ui-icon{width:15px;height:15px}
.skill-offer-group>.ui-icon[data-icon=tag-recovery]:not([data-painted]),.tower-enemy-stats>.ui-icon[data-icon=tag-recovery]:not([data-painted]){width:13px;height:13px;margin-inline:1px}
.tower-enemy-stats>.ui-icon{width:18px;height:18px}
.tower-enemy-stats>.ui-icon[data-icon=tag-recovery]:not([data-painted]){width:16px;height:16px}

/* Game Center is a Settings navigation action beside Close. Use the menu's
   dense type tier, preserving its 44px faces and the shared face centring. */
#modal:has(.settings-row-game-center)>.equipment-actions>.secondary{height:44px;min-height:44px;margin:0;padding:8px 6px;font-size:var(--tier-dense-fs)}
@media(max-height:700px){
 /* 44px target + 3px lip + at least 4px painted clearance between rows. */
 #modal:has(.settings-row-game-center) .settings-rows>.settings-row{min-height:51px}
 #modal:has(.settings-row-game-center) .menu-grid .settings-pair{gap:8px}
}

/* AC821: the shared scroll hint (uiScrollHint): a small chevron on a dark translucent disc, centred on the bottom edge
   of a contained list, rising gently; it fades in and never takes a tap. Reduced motion keeps it still. */
.ui-scroll-hint{position:absolute;z-index:3;width:34px;height:34px;margin:-42px 0 0 -17px;display:grid;place-items:center;border-radius:50%;background:#1b1826b3;box-shadow:0 2px 6px #0006;pointer-events:none;animation:ui-scroll-hint-in .35s ease-out both,ui-scroll-hint-bob 1.4s ease-in-out .35s infinite}
.ui-scroll-hint>svg{width:22px;height:22px;fill:none;stroke:var(--cream-50,#fffaf0);stroke-width:3px;stroke-linecap:round;stroke-linejoin:round}
@keyframes ui-scroll-hint-in{from{opacity:0;translate:0 6px}to{opacity:1;translate:0 0}}
@keyframes ui-scroll-hint-bob{0%,100%{translate:0 0}50%{translate:0 4px}}
.ui-scroll-hint.is-steady{animation:ui-scroll-hint-bob 1.4s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){.ui-scroll-hint,.ui-scroll-hint.is-steady{animation:none}}
