/*
 * IRON TIDE | fable-hud-polish-pack.css  (readability + brass filigree + tactile hover pack)
 * Owner      : studio content and visual team
 * Contract   : ASSIGNMENT_FOR_CLAUDE.md, Deliverable C38 (HUD polish for the Shipyard, Armory, Constellation, Forge and
 *              Chronicle modals)
 * Target path: public/tools/battleships/fable-hud-polish-pack.css  (load it AFTER styles.css)
 *
 * WHAT IT DOES
 *   1. Readable text with the page font: body copy is never dimmer than #d8e3f2 and never smaller than 0.73rem, Korean
 *      lines break between words (keep-all) with a looser line height, numbers line up (tabular figures).
 *   2. Brass corner filigree on the two modal frames (two sticky pseudo-elements, so it stays put while the content
 *      scrolls and takes no room) and small brass corner ticks on every card, drawn with CSS gradients and borders only:
 *      no images, no fonts, no extra elements.
 *   3. Tactile micro-animations: cards lift, buttons press, the close button turns, ledger rows slide, the modal rises
 *      in. With prefers-reduced-motion nothing moves; hover and focus still show through color and outline.
 *   4. A clear keyboard focus ring and a slim brass scrollbar.
 *
 * HOW TO USE
 *   <link rel="stylesheet" href="/tools/battleships/styles.css" />
 *   <link rel="stylesheet" href="/tools/battleships/fable-hud-polish-pack.css" />
 *   document.body.classList.add('fable-polish');      // on
 *   document.body.classList.remove('fable-polish');   // off: every rule below is scoped under body.fable-polish
 *
 * SAFE BY CONSTRUCTION
 *   Selectors only read the existing ids #modal-harbor and #modal-chronicle and existing classes; no id is added, renamed
 *   or needed beyond those two, no element is hidden or reordered, and pointer events are never disabled on live controls.
 *   Pure ASCII. No @import, no url(), no web fonts.
 */

body.fable-polish {
  --fp-ink: #f8fafc;
  --fp-body: #e4ecf8;
  --fp-soft: #d8e3f2;
  --fp-brass: rgba(245, 196, 104, 0.95);
  --fp-brass-dim: rgba(196, 144, 62, 0.9);
  --fp-brass-0: rgba(245, 196, 104, 0);
  --fp-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  /* one group of gradient layers for each corner of a modal frame: jewel, two curls, outer bracket, inner bracket */
  --fp-tl:
    radial-gradient(circle, #fff3c4 0 1.4px, #e9b851 1.6px 3.2px, transparent 3.7px) left 2.5px top 2.5px / 9px 9px no-repeat,
    radial-gradient(circle, transparent 0 2.1px, var(--fp-brass) 2.4px 3.3px, transparent 3.8px) left 48px top 2.5px / 9px 9px no-repeat,
    radial-gradient(circle, transparent 0 2.1px, var(--fp-brass) 2.4px 3.3px, transparent 3.8px) left 2.5px top 48px / 9px 9px no-repeat,
    linear-gradient(90deg, var(--fp-brass), var(--fp-brass-0)) left 6px top 6px / 44px 2px no-repeat,
    linear-gradient(180deg, var(--fp-brass), var(--fp-brass-0)) left 6px top 6px / 2px 44px no-repeat,
    linear-gradient(90deg, var(--fp-brass-dim), transparent) left 11px top 11px / 26px 1px no-repeat,
    linear-gradient(180deg, var(--fp-brass-dim), transparent) left 11px top 11px / 1px 26px no-repeat;
  --fp-tr:
    radial-gradient(circle, #fff3c4 0 1.4px, #e9b851 1.6px 3.2px, transparent 3.7px) right 2.5px top 2.5px / 9px 9px no-repeat,
    radial-gradient(circle, transparent 0 2.1px, var(--fp-brass) 2.4px 3.3px, transparent 3.8px) right 48px top 2.5px / 9px 9px no-repeat,
    radial-gradient(circle, transparent 0 2.1px, var(--fp-brass) 2.4px 3.3px, transparent 3.8px) right 2.5px top 48px / 9px 9px no-repeat,
    linear-gradient(270deg, var(--fp-brass), var(--fp-brass-0)) right 6px top 6px / 44px 2px no-repeat,
    linear-gradient(180deg, var(--fp-brass), var(--fp-brass-0)) right 6px top 6px / 2px 44px no-repeat,
    linear-gradient(270deg, var(--fp-brass-dim), transparent) right 11px top 11px / 26px 1px no-repeat,
    linear-gradient(180deg, var(--fp-brass-dim), transparent) right 11px top 11px / 1px 26px no-repeat;
  --fp-bl:
    radial-gradient(circle, #fff3c4 0 1.4px, #e9b851 1.6px 3.2px, transparent 3.7px) left 2.5px bottom 2.5px / 9px 9px no-repeat,
    radial-gradient(circle, transparent 0 2.1px, var(--fp-brass) 2.4px 3.3px, transparent 3.8px) left 48px bottom 2.5px / 9px 9px no-repeat,
    radial-gradient(circle, transparent 0 2.1px, var(--fp-brass) 2.4px 3.3px, transparent 3.8px) left 2.5px bottom 48px / 9px 9px no-repeat,
    linear-gradient(90deg, var(--fp-brass), var(--fp-brass-0)) left 6px bottom 6px / 44px 2px no-repeat,
    linear-gradient(0deg, var(--fp-brass), var(--fp-brass-0)) left 6px bottom 6px / 2px 44px no-repeat,
    linear-gradient(90deg, var(--fp-brass-dim), transparent) left 11px bottom 11px / 26px 1px no-repeat,
    linear-gradient(0deg, var(--fp-brass-dim), transparent) left 11px bottom 11px / 1px 26px no-repeat;
  --fp-br:
    radial-gradient(circle, #fff3c4 0 1.4px, #e9b851 1.6px 3.2px, transparent 3.7px) right 2.5px bottom 2.5px / 9px 9px no-repeat,
    radial-gradient(circle, transparent 0 2.1px, var(--fp-brass) 2.4px 3.3px, transparent 3.8px) right 48px bottom 2.5px / 9px 9px no-repeat,
    radial-gradient(circle, transparent 0 2.1px, var(--fp-brass) 2.4px 3.3px, transparent 3.8px) right 2.5px bottom 48px / 9px 9px no-repeat,
    linear-gradient(270deg, var(--fp-brass), var(--fp-brass-0)) right 6px bottom 6px / 44px 2px no-repeat,
    linear-gradient(0deg, var(--fp-brass), var(--fp-brass-0)) right 6px bottom 6px / 2px 44px no-repeat,
    linear-gradient(270deg, var(--fp-brass-dim), transparent) right 11px bottom 11px / 26px 1px no-repeat,
    linear-gradient(0deg, var(--fp-brass-dim), transparent) right 11px bottom 11px / 1px 26px no-repeat;
}

/* ------------------------------------------------------------------------------------------------------------------
   1. Modal frame: deeper glass for contrast, double brass line, corner filigree that does not scroll with the content
   ------------------------------------------------------------------------------------------------------------------ */
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-card {
  --fp-pad-y: 1.15rem;
  --fp-pad-x: 1.25rem;
  padding: var(--fp-pad-y) var(--fp-pad-x);
  background: linear-gradient(180deg, rgba(11, 20, 37, 0.98), rgba(6, 11, 22, 0.98));
  border-color: rgba(245, 196, 104, 0.6);
  box-shadow:
    0 0 0 1px rgba(5, 9, 18, 0.95),
    0 0 0 2px rgba(245, 196, 104, 0.2),
    0 26px 64px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 240, 200, 0.08);
  color: var(--fp-ink);
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 196, 104, 0.6) rgba(8, 14, 26, 0.7);
  font-variant-numeric: tabular-nums;
}
/* Two sticky caps carry the corner filigree. They take no room in the flow (the margins cancel their height), stay glued to
   the top and bottom edges while the content scrolls, let every click through, and fade the text that slides under them.
   Sticky insets are measured from the padded content edge of the scroller, hence the negative top and bottom. */
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-card::before,
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-card::after {
  content: "";
  display: block;
  position: sticky;
  z-index: 3;
  height: 58px;
  pointer-events: none;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-card::before {
  top: calc(-1 * var(--fp-pad-y));
  margin: calc(-1 * var(--fp-pad-y)) calc(-1 * var(--fp-pad-x)) calc(var(--fp-pad-y) - 58px);
  background:
    var(--fp-tl), var(--fp-tr),
    linear-gradient(180deg, rgb(11, 20, 37) 0, rgb(11, 20, 37) 14px, rgba(11, 20, 37, 0) 22px) left top / 100% 22px no-repeat;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-card::after {
  bottom: calc(-1 * var(--fp-pad-y));
  margin: calc(var(--fp-pad-y) - 58px) calc(-1 * var(--fp-pad-x)) calc(-1 * var(--fp-pad-y));
  background:
    var(--fp-bl), var(--fp-br),
    linear-gradient(0deg, rgb(6, 11, 22) 0, rgb(6, 11, 22) 14px, rgba(6, 11, 22, 0) 22px) left bottom / 100% 22px no-repeat;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle).open .modal-card {
  animation: fable-polish-rise 0.24s var(--fp-ease) both;
}
@keyframes fable-polish-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-title {
  color: #fff7e0;
  letter-spacing: -0.01em;
  word-break: keep-all;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-head {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(245, 196, 104, 0.22);
}
html.mbp0-on.mbp0-sheets body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-card {
  --fp-pad-y: 0px;
}
html.mbp0-on.mbp0-sheets body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-card::before {
  top: 0;
  height: 22px;
  margin: 0 -14px;
  background: linear-gradient(#cbd5e1, #cbd5e1) center 9px / 44px 4px no-repeat, #080e1a;
}
html.mbp0-on.mbp0-sheets body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-head {
  padding-bottom: 10px;
  margin-bottom: 12px;
}
html.mbp0-on.mbp0-sheets body.fable-polish :is(#modal-harbor, #modal-chronicle) .harbor-toolbar {
  padding-top: 6px;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .brand-eyebrow {
  font-size: 0.76rem !important;
  letter-spacing: 0.03em !important;
  color: #fcd34d;
  word-break: keep-all;
  white-space: normal;
  flex-wrap: wrap;
  line-height: 1.45;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-close {
  color: var(--fp-ink);
  border-color: rgba(245, 196, 104, 0.45);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  transition: transform 0.2s var(--fp-ease), border-color 0.16s ease, background 0.16s ease;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-close:hover {
  transform: rotate(90deg);
  border-color: #fde68a;
  background: rgba(245, 196, 104, 0.2);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-close:active {
  transform: rotate(90deg) scale(0.9);
}

/* ------------------------------------------------------------------------------------------------------------------
   2. Section titles and cards
   ------------------------------------------------------------------------------------------------------------------ */
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
  color: #7dd3fc;
  word-break: keep-all;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-section-title::after {
  content: "";
  flex: 1 1 24px;
  min-width: 24px;
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 196, 104, 0.55), rgba(245, 196, 104, 0));
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card {
  position: relative;
  background-color: rgba(13, 22, 40, 0.96);
  border-color: rgba(148, 197, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.16s var(--fp-ease), box-shadow 0.16s ease, border-color 0.16s ease;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card.active-card {
  border-color: #34d399;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.25), 0 1px 0 rgba(0, 0, 0, 0.35);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card::before,
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border: 0 solid rgba(245, 196, 104, 0.6);
  pointer-events: none;
  transition: width 0.18s var(--fp-ease), height 0.18s var(--fp-ease), border-color 0.18s ease;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card::before {
  top: 3px;
  left: 3px;
  border-top-width: 2px;
  border-left-width: 2px;
  border-top-left-radius: 5px;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card::after {
  right: 3px;
  bottom: 3px;
  border-right-width: 2px;
  border-bottom-width: 2px;
  border-bottom-right-radius: 5px;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card:hover,
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(245, 196, 104, 0.9) !important;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.1), 0 8px 18px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 196, 104, 0.18);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card:hover::before,
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card:hover::after,
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card:focus-within::before,
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card:focus-within::after {
  width: 19px;
  height: 19px;
  border-color: #fde68a;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .slot-card:active {
  transform: translateY(0) scale(0.99);
}

/* card text: high contrast, Korean-friendly wrapping */
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-head {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  gap: 0.5rem;
  color: var(--fp-ink);
  word-break: keep-all;
}
/* family and class tags keep their own hue (set inline by the game) but are brightened for contrast */
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-fam {
  filter: brightness(1.32);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-head > span:last-child {
  flex: 0 0 auto;
  text-align: right;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card[style*="grid-column"] .sc-head > span:last-child,
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-head > span:first-child {
  flex: 0 1 auto;
  min-width: 0;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-name {
  font-size: 0.96rem !important;
  line-height: 1.38;
  color: #ffffff !important;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-meta {
  font-family: var(--font-sans);
  font-size: 0.75rem !important;
  line-height: 1.5 !important;
  color: var(--fp-soft) !important;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-desc {
  font-size: 0.8rem !important;
  line-height: 1.6 !important;
  color: var(--fp-body) !important;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-desc strong {
  color: #ffffff;
}
/* tinted helper lines keep their hue but are lifted to body-text brightness */
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-meta[style*="#93c5fd"] { color: #dbeafe !important; }
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-meta[style*="#6ee7b7"],
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-meta[style*="110, 231, 183"] { color: #c6f7e2 !important; }
body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-meta[style*="#fde68a"] { color: #fef0b5 !important; }

body.fable-polish :is(#modal-harbor, #modal-chronicle) .delta-row {
  gap: 0.3rem;
  margin: 0.2rem 0;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .delta-chip {
  font-family: var(--font-sans);
  font-size: 0.73rem;
  line-height: 1.35;
  padding: 1px 6px;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .delta-chip.pos { color: #a7f3d0; background: rgba(52, 211, 153, 0.18); }
body.fable-polish :is(#modal-harbor, #modal-chronicle) .delta-chip.neg { color: #ffe4e6; background: rgba(251, 113, 133, 0.18); }
body.fable-polish :is(#modal-harbor, #modal-chronicle) .upgrade-badge {
  font-family: var(--font-sans);
  font-size: 0.73rem;
  color: #a7f3d0;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .badge-owned {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: #6ee7b7;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .relic-tag-pill,
body.fable-polish :is(#modal-harbor, #modal-chronicle) .syn-pill {
  font-size: 0.73rem;
  color: var(--fp-soft);
}

/* ------------------------------------------------------------------------------------------------------------------
   3. Buttons, tabs and filter pills: readable labels and a pressed feel
   ------------------------------------------------------------------------------------------------------------------ */
body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn {
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 0.42rem 0.66rem;
  min-height: 32px;
  border-color: rgba(148, 197, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 0 rgba(0, 0, 0, 0.45);
  transition: transform 0.12s var(--fp-ease), box-shadow 0.12s ease, border-color 0.14s ease, background-position 0.3s ease, filter 0.14s ease;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #fde68a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 0 rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 196, 104, 0.2);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.5), 0 0 0 rgba(0, 0, 0, 0);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn.primary {
  background-image: linear-gradient(115deg, #e88a0a 0%, #fbb424 45%, #ffd978 55%, #f59e0b 100%);
  background-size: 220% 100%;
  background-position: 0% 0;
  border-color: #fef0b5;
  font-weight: 700 !important;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn.primary:hover:not(:disabled) {
  background-position: 100% 0;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn.cyan-btn {
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.7);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn:disabled {
  opacity: 0.62;
  filter: saturate(0.55);
  box-shadow: none;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) :is(.harbor-tab, .chronicle-tab).active {
  color: #fde68a;
  border-color: #fbbf24;
  background: rgba(245, 188, 94, 0.2);
  box-shadow: inset 0 -2px 0 #fbbf24, 0 2px 0 rgba(0, 0, 0, 0.45);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .filter-pill {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  padding: 0.3rem 0.64rem;
  color: var(--fp-body);
  border-color: rgba(148, 197, 255, 0.38);
  transition: transform 0.12s var(--fp-ease), border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .filter-pill:hover {
  transform: translateY(-1px);
  color: #ffffff;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .filter-pill:active {
  transform: translateY(1px);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .filter-pill.active {
  color: #fef0b5;
  box-shadow: inset 0 -2px 0 #fbbf24;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) :is(.hud-btn, .filter-pill, .modal-close, .slot-card, input, select, a):focus-visible {
  outline: 2px solid #fde68a;
  outline-offset: 2px;
  border-radius: 7px;
}

/* ------------------------------------------------------------------------------------------------------------------
   4. Constellation and Forge header bars
   ------------------------------------------------------------------------------------------------------------------ */
body.fable-polish :is(#modal-harbor, #modal-chronicle) .rank-submit-bar {
  background: linear-gradient(180deg, rgba(16, 27, 48, 0.96), rgba(10, 18, 34, 0.96));
  border-color: rgba(245, 196, 104, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.06);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) .rank-field span {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  color: #fcd34d;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) :is(.rank-field input, .rank-field select, .season-pass-row input) {
  font-size: 0.84rem;
  color: #ffffff;
  border-color: rgba(148, 197, 255, 0.4);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) :is(.rank-field input, .rank-field select, .season-pass-row input):focus {
  border-color: #fde68a;
  box-shadow: 0 0 0 2px rgba(245, 196, 104, 0.25);
}
body.fable-polish :is(#modal-harbor, #modal-chronicle) input::placeholder {
  color: var(--fp-soft);
  opacity: 0.8;
}

/* ------------------------------------------------------------------------------------------------------------------
   5. Chronicle: season banner, ledger, AI panels
   ------------------------------------------------------------------------------------------------------------------ */
body.fable-polish #modal-chronicle .season-title {
  font-size: 0.98rem;
  line-height: 1.4;
  word-break: keep-all;
}
body.fable-polish #modal-chronicle .season-pool-label {
  font-family: var(--font-sans);
  font-size: 0.73rem;
  color: #a7f3d0;
}
body.fable-polish #modal-chronicle .season-vs-row {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--fp-ink);
}
body.fable-polish #modal-chronicle .ledger-row {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--fp-ink);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  transition: transform 0.14s var(--fp-ease), background 0.14s ease;
}
body.fable-polish #modal-chronicle .ledger-row:nth-child(even) {
  background: rgba(148, 197, 255, 0.045);
}
body.fable-polish #modal-chronicle .ledger-row:hover {
  transform: translateX(3px);
  background: rgba(245, 196, 104, 0.1);
}
body.fable-polish #modal-chronicle .ledger-left {
  min-width: 0;
  word-break: keep-all;
}
body.fable-polish #modal-chronicle .rank-num {
  font-size: 0.84rem;
  color: #fcd34d;
}
body.fable-polish #modal-chronicle .rank-badge {
  font-family: var(--font-sans);
  font-size: 0.73rem;
  padding: 1px 6px;
}
body.fable-polish #modal-chronicle .rank-badge.human { color: #a7f3d0; }
body.fable-polish #modal-chronicle .rank-badge.ai { color: #f3e8ff; }
body.fable-polish #modal-chronicle .ledger-sub {
  font-size: 0.76rem;
  color: var(--fp-soft);
}
body.fable-polish #modal-chronicle .ledger-score {
  font-size: 0.84rem;
  color: #fcd34d;
}
body.fable-polish #modal-chronicle .ledger-note {
  font-family: var(--font-sans);
  font-size: 0.73rem;
  color: var(--fp-soft);
}
body.fable-polish #modal-chronicle .byok-title {
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: keep-all;
}
body.fable-polish #modal-chronicle .byok-status-pill {
  font-family: var(--font-sans);
  font-size: 0.73rem;
  color: #e2e8f0;
}
body.fable-polish #modal-chronicle .byok-status-pill.live { color: #a7f3d0; }
body.fable-polish #modal-chronicle .byok-status-pill.err { color: #ffe4e6; }
body.fable-polish #modal-chronicle .byok-security-note {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--fp-body);
  word-break: keep-all;
}
body.fable-polish #modal-chronicle .byok-log {
  font-size: 0.74rem;
  color: #e2e8f0;
}
body.fable-polish #modal-chronicle .byok-log-line.ok { color: #a7f3d0; }
body.fable-polish #modal-chronicle .byok-log-line.err { color: #ffe4e6; }
body.fable-polish #modal-chronicle .ai-api-box {
  font-size: 0.84rem;
  line-height: 1.62;
  color: var(--fp-body);
  word-break: keep-all;
}
body.fable-polish #modal-chronicle .ai-api-box code {
  font-size: 0.8rem;
  color: #a5f3fc;
}
body.fable-polish #modal-chronicle .ai-code-snippet {
  font-size: 0.75rem;
  color: #f1f5f9;
}
body.fable-polish #modal-chronicle label {
  color: var(--fp-body);
  font-size: 0.8rem;
}

/* ------------------------------------------------------------------------------------------------------------------
   6. Phones: comfortable tap targets, long labels may wrap, smaller corner ornaments
   ------------------------------------------------------------------------------------------------------------------ */
@media (max-width: 560px) {
  body.fable-polish :is(#modal-harbor, #modal-chronicle) {
    padding: 0.5rem;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-card {
    --fp-pad-y: 1rem;
    --fp-pad-x: 0.9rem;
    max-height: 92vh;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .modal-title {
    font-size: 1.22rem;
    line-height: 1.3;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn {
    min-height: 38px;
    white-space: normal;
    text-align: left;
    word-break: keep-all;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .filter-pill {
    min-height: 34px;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .sc-head {
    flex-wrap: wrap;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-section-title::after {
    content: none;
  }
  body.fable-polish #modal-chronicle .ledger-row {
    align-items: flex-start;
  }
}

/* ------------------------------------------------------------------------------------------------------------------
   7. Reduced motion: nothing moves or fades in; hover and focus stay visible through color, border and outline
   ------------------------------------------------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  body.fable-polish :is(#modal-harbor, #modal-chronicle).open .modal-card {
    animation: none;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) :is(.shop-card, .hud-btn, .filter-pill, .modal-close, .ledger-row, input, select) {
    transition: none !important;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card::before,
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .shop-card::after {
    transition: none !important;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) :is(.shop-card, .hud-btn, .filter-pill, .modal-close, .ledger-row, .slot-card):is(:hover, :active, :focus-within) {
    transform: none !important;
  }
  body.fable-polish :is(#modal-harbor, #modal-chronicle) .hud-btn.primary:hover:not(:disabled) {
    background-position: 0% 0;
    filter: brightness(1.08);
  }
}
