/* ============================================================
   Ripmate UI design system — "Forged Lantern".

   Loaded by index.html AFTER its inline <style>, so every rule here wins
   over a legacy rule of equal specificity. It does 3 jobs:
     1. Defines the tokens (everything colour-related derives from ONE hue,
        --h, which render/theme-hue.js sets from the selected Interface
        background) and re-points the legacy variable names
        (--gold, --parchment, --bg-panel, …) at them, so screens that
        have not been redesigned yet still follow the same palette.
     2. Restyles the shared components: panel, button, input/select,
        heading, the custom Select (.dd), the account pill, the top nav.
     3. Restyles the screens already redesigned (Nav bar + Home).
   How to build a new screen with this: docs/subsystems/ui-design-system.md.
   Cursor rule (CLAUDE.md §4): never a bare cursor value, always var(--cur-*).
   ============================================================ */

@property --h{ syntax:'<number>'; inherits:true; initial-value:38; }

:root{
  --h: 38;
  transition: --h .7s ease;

  --f-display: 'Fraunces', serif;
  --f-body: 'Instrument Sans', sans-serif;

  --accent: hsl(var(--h) 42% 56%);
  --accent-2: hsl(var(--h) 36% 40%);
  --accent-hi: hsl(var(--h) 54% 74%);
  --accent-ink: hsl(var(--h) 40% 8%);
  --c-bg: hsl(var(--h) 16% 5%);
  --c-surface: hsl(var(--h) 12% 11%);
  --c-surface-2: hsl(var(--h) 11% 16%);
  --c-line: hsl(var(--h) 24% 86% / .14);
  --c-text: hsl(var(--h) 22% 91%);
  --c-dim: hsl(var(--h) 10% 67%);
  --c-currency: #d9a84e;
  --c-ok: #8fc9a0;
  --c-warn: #d9a84e;
  --c-danger: #e5806f;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;

  --btn-fill: linear-gradient(180deg, hsl(var(--h) 42% 60%), hsl(var(--h) 38% 44%));
  --btn-glow: inset 0 1px 0 hsl(var(--h) 70% 85% / .4), 0 8px 18px rgba(0,0,0,.45);
  --sh-1: 0 14px 34px rgba(0,0,0,.5);
  --sh-2: 0 30px 80px rgba(0,0,0,.6);
  --sh-3: 0 0 0 1px hsl(var(--h) 42% 60% / .55), 0 10px 30px rgba(0,0,0,.5);
  --glass-bg: linear-gradient(160deg, hsl(var(--h) 24% 96% / .08), hsl(var(--h) 24% 96% / .02));
  --glass-fill: hsl(var(--h) 14% 8% / .86);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.16'/></svg>");

  --t-fast: .15s; --t-med: .22s; --t-slow: .38s;
  --ease: cubic-bezier(.2,.7,.2,1);

  /* Legacy names → the new palette (see header comment). */
  --bg-deep: var(--c-bg);
  --bg-panel: hsl(var(--h) 14% 11%);
  --bg-panel-2: hsl(var(--h) 12% 15%);
  --line: var(--c-line);
  --gold: var(--accent);
  --gold-bright: var(--accent-hi);
  --parchment: var(--c-text);
  --parchment-dim: var(--c-dim);

  /* Wider content column on large screens (was clamp(1180px, 92vw, 2000px)). */
  --content-max-width: calc(clamp(1180px, 94vw, 2400px) / var(--ui-zoom));
}

html{
  background: radial-gradient(ellipse at 50% -10%, hsl(var(--h) 20% 10%) 0%, var(--bg-deep) 60%);
}
html, body{ font-family: var(--f-body); color: var(--c-text); }
:focus-visible{ outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* ---------- Headings ---------- */
h1{ font: 700 2.5rem/1 var(--f-display); letter-spacing: -.01em; color: var(--c-text); text-shadow: none; }
h1 .gameNameLabel{ display: inline; font-size: inherit; font-family: inherit; font-weight: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
h1 .gameNameLabel::after{ content: "."; color: var(--accent); }
h1 span:not(.gameNameLabel){ font-family: var(--f-body); }
header{ align-items: center; border-bottom: 0; padding-bottom: 0; margin-bottom: 20px; gap: 16px; }
/* The "Ripmate." title sits at the same spot on every screen: the header has one
   fixed height, the title is pinned to its top (a header with a gold/account pill
   or a sub-title no longer shifts it) and the pills centre on that height. The
   screen name under the title is hidden on phones (portrait). */
@media (min-width: 601px){
  .wrap:not(#battleScreen) > header{ align-items: flex-start; min-height: 66px; }
  .wrap:not(#battleScreen) > header .status{ align-self: center; }
}
@media (max-width: 600px){
  .wrap:not(#battleScreen) > header{ align-items: flex-start; }
  .wrap:not(#devScreen) > header h1 span:not(.gameNameLabel){ display: none; }
}
.panel h2{
  font: 700 1.6rem/1.15 var(--f-display); letter-spacing: -.005em; text-transform: none;
  color: var(--c-text); border-bottom: 0; padding-bottom: 0; margin: 0 0 14px;
}
.hint{ color: var(--c-dim); font-size: .85rem; }
.hint b{ color: var(--accent-hi); }

/* ---------- Panel ----------
   No backdrop-filter anywhere on scrolling content: blurring a fixed full-screen photo
   under every panel/nav/badge re-runs the blur each scroll frame (measured: p95 frame 67ms
   with it, 17ms without at 1920x1080). The glass look comes from the grain + a denser fill. */
.panel{
  background-image: var(--grain), var(--glass-bg);
  background-color: var(--glass-fill);
  border: 1px solid var(--c-line);
  border-radius: 30px;
  padding: clamp(16px, 2.4vw, 28px);
  box-shadow: var(--sh-1), inset 0 1px 0 hsl(var(--h) 40% 100% / .09);
}
#battleScreen .panel{ backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: var(--r-md); padding: 12px; }
.homeTeamStripPanel{ background: none; border-color: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }

/* ---------- Buttons ---------- */
button{
  font-family: var(--f-body); font-weight: 600; font-size: .9rem; letter-spacing: 0; text-transform: none;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid hsl(var(--h) 30% 80% / .3);
  background: hsl(var(--h) 24% 96% / .07); color: var(--accent-hi);
  transition: border-color var(--t-med) var(--ease), background var(--t-med) var(--ease), color var(--t-med) var(--ease), transform .1s;
}
button:hover{ background: hsl(var(--h) 30% 92% / .12); border-color: var(--accent); color: var(--c-text); }
button:active{ transform: translateY(1px); }
button.ghost{ border-color: var(--c-line); color: var(--c-text); background: hsl(var(--h) 24% 96% / .06); }
button.ghost:hover{ border-color: var(--accent); background: hsl(var(--h) 30% 92% / .1); }
button.primary, button.primaryBig{
  background: var(--btn-fill); border-color: hsl(var(--h) 45% 68% / .5); color: var(--accent-ink);
  box-shadow: var(--btn-glow); min-height: 52px; font-size: .95rem;
}
button.primary:hover, button.primaryBig:hover{ background: var(--btn-fill); filter: brightness(1.08); color: var(--accent-ink); }
button.primary:active{ filter: brightness(.94); }
button.danger, button.ghost.danger{ border-color: var(--c-danger); color: var(--c-danger); background: transparent; }
button.danger:hover{ background: var(--c-danger); color: #1a0705; }

/* ---------- Inputs ---------- */
input:not([type]), input[type="text"], input[type="number"], input[type="email"], input[type="search"], input[type="password"], textarea, select{
  background-color: hsl(var(--h) 14% 8% / .9); color: var(--c-text);
  border: 1px solid var(--c-line); border-radius: 14px; font-family: var(--f-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:not([type]):hover, input[type="text"]:hover, input[type="number"]:hover, input[type="email"]:hover, input[type="search"]:hover, textarea:hover, select:hover{ border-color: var(--accent); }
input:not([type]):focus, input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="search"]:focus, textarea:focus, select:focus{
  outline: none; border-color: var(--accent-hi); box-shadow: 0 0 0 3px hsl(var(--h) 40% 60% / .25);
}
.collFilterRow input, .collFilterRow select{
  min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: .95rem;
  background-color: hsl(var(--h) 14% 8% / .9); color: var(--c-text); border: 1px solid var(--c-line);
}

/* ---------- Select (src/ui/select.js enhances a native <select>) ---------- */
.dd{ position: relative; flex: 1 1 140px; min-width: 0; }
.dd > select{ display: none; }
.ddBtn{
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 16px;
  text-align: left; white-space: nowrap; font-weight: 500; font-size: .95rem;
  background-color: hsl(var(--h) 14% 8% / .9); color: var(--c-text); border: 1px solid var(--c-line);
}
.ddBtn span{ overflow: hidden; text-overflow: ellipsis; }
.ddBtn svg{ width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--c-dim); transition: transform var(--t-fast) var(--ease); }
.dd.open .ddBtn{ border-color: var(--accent-hi); }
.dd.open .ddBtn svg{ transform: rotate(180deg); color: var(--accent-hi); }
.ddMenu{
  display: none; position: absolute; left: 0; min-width: 100%; top: calc(100% + 6px); z-index: 40; max-height: 264px; overflow: auto;
  margin: 0; padding: 6px; list-style: none; border-radius: var(--r-md);
  background: hsl(var(--h) 14% 7% / .985); border: 1px solid var(--c-line); box-shadow: var(--sh-2);
}
.dd.open .ddMenu{ display: block; animation: ddIn var(--t-med) var(--ease); }
@keyframes ddIn{ from{ opacity: 0; transform: translateY(-4px); } to{ opacity: 1; transform: none; } }
.ddMenu li{
  min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  border-radius: 12px; cursor: var(--cur-click, pointer); color: var(--c-dim); font: 500 .95rem var(--f-body); white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.ddMenu li:hover, .ddMenu li.kb{ background: hsl(var(--h) 30% 92% / .08); color: var(--c-text); }
.ddMenu li[aria-selected="true"]{ color: var(--accent-hi); }
.ddMenu li[aria-selected="true"]::after{ content: "\2713"; font-size: .8rem; }
.collFilterRow .dd{ flex: 1 1 140px; }
@media (min-width: 701px){ .collFilterRow .dd{ flex: 0 1 170px; } }

/* ---------- Account pill (ui/auth.js renderAccountBar) ---------- */
.status{ font-family: var(--f-body); text-transform: none; letter-spacing: 0; color: var(--c-dim); font-size: .95rem; font-weight: 600; }
.status b{ color: var(--accent-hi); }
header .status:has(> #goldDisplay){
  display: inline-flex; align-items: center; gap: .45em; padding: 8px 16px 8px 12px; border-radius: 999px;
  background-image: var(--grain), var(--glass-bg); background-color: var(--glass-fill); border: 1px solid var(--c-line);
  box-shadow: var(--sh-1), inset 0 1px 0 hsl(var(--h) 40% 100% / .09);
}
header .status:has(> #goldDisplay)::before{
  content: ""; width: 18px; height: 18px; background: var(--c-currency);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7v10M9.5 9.5h4a1.5 1.5 0 010 3h-3a1.5 1.5 0 000 3h4'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7v10M9.5 9.5h4a1.5 1.5 0 010 3h-3a1.5 1.5 0 000 3h4'/></svg>") center/contain no-repeat;
}
#goldDisplay{ color: var(--c-currency); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
#accountBar:has(.accountSignOutBtn){
  display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 5px; border-radius: 999px;
  background-image: var(--grain), var(--glass-bg); background-color: var(--glass-fill); border: 1px solid var(--c-line);
  box-shadow: var(--sh-1), inset 0 1px 0 hsl(var(--h) 40% 100% / .09);
}
#accountBar b{ color: var(--c-text); font-weight: 600; white-space: nowrap; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.accountBarPortrait{ width: 40px; height: 40px; margin: 0; flex: none; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--accent); }
.accountBarPortrait .heroPortrait{ width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
.accountBarAvatar{ font-size: 1.4rem; line-height: 40px; width: 40px; text-align: center; }
.accountSignOutBtn{ padding: 0 18px; font-size: .85rem; }
.accountSignInBtn{ padding: 0 22px; font-size: .9rem; }
@media (max-width: 600px){
  header{ flex-wrap: wrap; }
  #accountBar:has(.accountSignOutBtn){ order: 3; flex: 1 1 100%; }
  #accountBar:has(.accountSignOutBtn) b{ flex: 1; max-width: none; }
}

/* ---------- Top navigation (src/ui/nav.js) ---------- */
.mainNav{ border-bottom: 0; background: none; padding: 12px 18px 0; position: sticky; top: 0; z-index: 20; }
.mainNavInner{
  position: relative; max-width: calc(var(--content-max-width) - 36px); margin: 0 auto; padding: 8px; gap: 2px; flex-wrap: nowrap; align-items: center;
  height: 62px; border-radius: 22px;
  background-image: var(--grain), var(--glass-bg); background-color: var(--glass-fill);
  border: 1px solid var(--c-line); box-shadow: var(--sh-1), inset 0 1px 0 hsl(var(--h) 40% 100% / .09);
}
.navPill{
  position: absolute; z-index: 0; pointer-events: none; border-radius: 999px; opacity: 0;
  background: hsl(var(--h) 30% 92% / .09); box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 70% / .3);
  transition: left .32s var(--ease), top .32s var(--ease), width .32s var(--ease), height .32s var(--ease), opacity .2s;
}
.mainNavBtn{
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .55em; white-space: nowrap;
  height: 46px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent;
  font: 500 .95rem var(--f-body); letter-spacing: 0; text-transform: none; color: var(--c-dim);
}
.mainNavBtn:hover{ background: hsl(var(--h) 60% 96% / .08); color: var(--c-text); border: 0; }
.mainNavBtn.active{ background: transparent; color: var(--accent-hi); }
.mainNavBtn .navIcon{ width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.mainNavMoreToggle{ position: relative; width: 46px; height: 46px; min-height: 46px; padding: 0; border: 0; background: hsl(var(--h) 60% 96% / .08); font-size: 1.2rem; }
.mainNavMoreToggle.hasActive::after{ content: ""; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-hi); }
@media (min-width: 701px) and (max-width: 1000px){
  .mainNavBtn{ padding: 0 12px; }
  .mainNavBtn .navIcon{ display: none; }
}
@media (max-width: 720px){
  .mainNavBtn{ padding: 0 12px; }
  .mainNavMore{ margin-left: auto; }
  .mainNavMoreDropdown{
    top: calc(100% + 8px); padding: 8px; gap: 2px; border-radius: 20px; border: 1px solid var(--c-line);
    background: hsl(var(--h) 14% 7% / .985); box-shadow: var(--sh-2);
  }
  .mainNavMoreDropdown .mainNavBtn{ width: 100%; height: 46px; border-radius: 12px; }
  .mainNavMoreDropdown .mainNavBtn.active{ background: hsl(var(--h) 30% 92% / .09); box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 70% / .3); }
  .mainNavMoreDropdown .mainNavBtn .navIcon{ display: block; }
}
/* The flat bar does not fit (big Interface size, narrow window, wide fonts): src/ui/nav.js sets .navCollapsed
   on #mainNav and the overflowing tabs live in the same ☰ dropdown the phones use, so Settings (and the
   Interface size slider inside it) can never be pushed out of reach. Same look as the phone rules above. */
.mainNav.navCollapsed .mainNavBtn{ padding: 0 12px; }
.mainNav.navCollapsed .mainNavMore{ display: block; position: relative; margin-left: auto; }
.mainNav.navCollapsed .mainNavMoreToggle{ display: flex; align-items: center; justify-content: center; flex: none; }
.mainNav.navCollapsed .mainNavMoreDropdown{
  display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 10; flex-direction: column; gap: 2px; padding: 8px;
  width: max-content; border-radius: 20px; border: 1px solid var(--c-line); background: hsl(var(--h) 14% 7% / .985); box-shadow: var(--sh-2);
}
.mainNav.navCollapsed .mainNavMoreDropdown:not(.navMoreClosed){ display: flex; }
.mainNav.navCollapsed .mainNavMoreDropdown .mainNavBtn{ width: 100%; height: 46px; border-radius: 12px; flex: none; }
.mainNav.navCollapsed .mainNavMoreDropdown .mainNavBtn.active{ background: hsl(var(--h) 30% 92% / .09); box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 70% / .3); }
.mainNav.navCollapsed .mainNavMoreDropdown .mainNavBtn .navIcon{ display: block; }
@media (max-width: 480px){
  .mainNavBtn .navIcon{ display: none; }
  .mainNavInner{ padding: 6px; gap: 0; }
  .mainNavMoreDropdown .mainNavBtn .navIcon{ display: block; }
}

/* ---------- Home ---------- */
.showcaseHeader{ align-items: flex-start; gap: 16px; flex-wrap: nowrap; margin-bottom: 18px; }
.showcaseName{ font: 700 1.6rem/1.15 var(--f-display); letter-spacing: -.005em; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 0; border: 0; margin: 0; }
.showcaseName:hover{ color: var(--accent-hi); }
.showcaseNumPrefix{ font: 700 1.6rem/1.15 var(--f-display); color: var(--accent-hi); margin-right: .25em; }
.showcaseRenameInput{ min-height: 44px; font: 600 1.05rem var(--f-body); border: 1px solid var(--accent-hi); border-radius: 14px; background: hsl(var(--h) 14% 8% / .9); color: var(--c-text); padding: 0 14px; }
.showcaseNavBtn, .showcaseAddBtn{ width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.showcaseDeleteConfirmText{ color: var(--c-danger); }
.showcaseSlotGrid{ gap: clamp(10px, 1.4vw, 22px); margin: 0 0 18px; }
.showcaseSlotGrid .slot{ overflow: visible; aspect-ratio: 2/3; }
@media (min-width: 901px){ .showcaseSlotGrid .slot{ height: calc(42vh / var(--ui-zoom)); width: auto; } }
@media (max-width: 680px){
  .showcaseSlotGrid{ gap: 10px; }
  .showcaseSlotGrid .slot{ flex: 0 0 calc((100% - 20px) / 3); max-width: calc((100% - 20px) / 3); min-width: 0; }
}
.slot{ border-radius: 24px; border: 1px solid transparent; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.slot.filled{ border-color: var(--c-line); border-style: solid; box-shadow: 0 14px 34px rgba(0,0,0,.5); cursor: var(--cur-click, pointer); }
.slot.filled:hover{ transform: translateY(-7px); border-color: hsl(var(--h) 45% 64% / .6); box-shadow: 0 24px 50px rgba(0,0,0,.6), 0 0 0 1px hsl(var(--h) 45% 64% / .35); }
.slot:not(.filled){ border: 1px dashed var(--c-line); color: var(--c-dim); background: rgba(255,255,255,.03); justify-content: center; }
.slot.unavailable{ border-color: var(--c-danger); }
.slot .slot-icon{ border-radius: inherit; overflow: hidden; }
.slot .slot-icon .heroCardArt{ transition: transform .5s var(--ease); }
.slot.filled:hover .slot-icon .heroCardArt{ transform: scale(1.05); }
.slot .slot-name{
  position: absolute; inset: auto 8px 8px; z-index: 2; margin: 0; padding: 10px 8px; border-radius: 14px; text-align: center;
  font: 700 clamp(.75rem, 1.2vw, .95rem) var(--f-display); letter-spacing: 0; color: var(--c-text);
  background: hsl(var(--h) 30% 8% / .76); border: 1px solid var(--c-line);
}
/* A unit's level: the number alone (title "Level N") in a small round chip
   tucked into the corner, so it covers as little of the art as possible; it
   grows only as wide as a 2-digit level needs. Same look as Collection's .lv. */
.lvlBadge{
  top: 6px; left: 6px; min-width: 24px; height: 24px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  border-radius: 999px; background: hsl(var(--h) 30% 8% / .82);
  border: 1px solid var(--c-line); color: var(--c-text); font: 700 .75rem/1 var(--f-body); font-variant-numeric: tabular-nums;
}
/* The name: 2 lines at most, "…" where it is cut (the inner span clamps, so
   the chip's padding never shows a third line's top). */
.slot .slot-name > span{ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
/* Edit mode: drag a hero onto another slot to swap them (wirePointerDrag). */
.showcaseSlotGrid .slot.slotDraggable{ touch-action: none; cursor: var(--cur-grab, grab); }
.showcaseSlotGrid .slot.slotDragging{ opacity: .35; }
.showcaseSlotGrid .slot.slotDropOver{ border-color: hsl(var(--h) 45% 64%); box-shadow: 0 0 0 2px hsl(var(--h) 45% 64% / .7), 0 14px 34px rgba(0,0,0,.5); }
.slot .slot-remove{ top: 10px; right: 10px; width: 30px; height: 30px; background: rgba(10,8,8,.82); border: 1px solid var(--c-line); color: var(--c-danger); font-size: .8rem; }
.slot .slot-remove:hover{ background: var(--c-danger); color: #1a0705; }
.slotTip{
  position: absolute; left: 50%; bottom: calc(100% - 8px); z-index: 6; transform: translate(-50%, 6px); opacity: 0; pointer-events: none;
  transition: opacity .16s, transform .16s; white-space: nowrap; padding: 10px 14px; border-radius: 16px; text-align: left;
  background: hsl(var(--h) 30% 7% / .97); border: 1px solid hsl(var(--h) 45% 64% / .45); box-shadow: var(--sh-1);
  font: 500 .85rem var(--f-body); color: var(--c-dim);
}
.slotTip b{ display: block; font: 700 .95rem var(--f-display); color: var(--c-text); }
@media (hover: hover){ .slot:hover .slotTip{ opacity: 1; transform: translate(-50%, 0); } }
.showcaseActionsRow{ flex-wrap: nowrap; gap: 12px; margin-top: 0; }
.showcaseActionsRow button{ flex: 1 1 0; min-width: 0; }
.showcaseActionsRow.confirm{ flex-wrap: wrap; }
.showcaseDeleteBtn{ border-color: var(--c-danger); color: var(--c-danger); background: transparent; }
.showcaseDeleteBtn:hover{ background: var(--c-danger); color: #1a0705; }

.teamStripCard{
  background-image: var(--grain), var(--glass-bg); background-color: var(--glass-fill); border: 1px solid var(--c-line);
  border-radius: 999px; padding: 4px 6px; gap: 4px; box-shadow: var(--sh-1), inset 0 1px 0 hsl(var(--h) 40% 100% / .09);
  transition: border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.teamStripCard.selected{ border-color: var(--accent); box-shadow: 0 0 0 3px hsl(var(--h) 40% 60% / .14), var(--sh-1); }
.tsc-arrows{ gap: 4px; }
.tsc-arrows button{ width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.tsc-num{ font: 700 1.25rem var(--f-display); color: var(--c-text); min-width: 32px; }
.teamStripAddBtn{
  width: 56px; min-height: 52px; padding: 0; border-radius: 999px; font-size: 1.4rem; font-weight: 500; color: var(--c-dim);
  background: hsl(var(--h) 24% 96% / .06); border: 1px dashed var(--c-line);
}
.teamStripAddBtn:hover{ border-style: solid; border-color: var(--accent); color: var(--accent-hi); }

.rosterGrid{ grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.rosterCard{ border-radius: 20px; border: 1px solid var(--c-line); transition: transform var(--t-med) var(--ease), border-color var(--t-med), box-shadow var(--t-med); }
.rosterCard:hover{ transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--sh-3); }
.rosterCard .rc-icon .heroPortrait{ transition: transform .45s var(--ease); }
.rosterCard:hover .rc-icon .heroPortrait{ transform: scale(1.06); }
.rosterCard .rc-name{
  inset: auto 0 0 0; bottom: 0; padding: 28px 8px 10px; clip-path: none; text-shadow: none;
  background: linear-gradient(0deg, hsl(var(--h) 30% 4% / .94), transparent);
  font: 700 clamp(.75rem, 1.2vw, .95rem)/1.15 var(--f-display); color: var(--c-text); overflow-wrap: anywhere;
}
/* the name keeps to 2 lines ("…" when cut; the full name is the tile's title) */
.rosterCard .rc-name > span{ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
@media (max-width: 700px){
  .rosterGrid{ grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .rosterCard .rc-name{ font-size: .68rem; padding: 22px 6px 8px; }
}

.homeManifesto{ border-top: 0; margin-top: 12px; }
.homeManifestoText p{ color: var(--c-dim); font-size: 1rem; line-height: 1.65; }
.homeManifestoText p:first-child{ font: 500 clamp(1.2rem, 2vw, 1.5rem)/1.4 var(--f-display); color: var(--c-text); }
.homeManifestoMotto{ font-family: var(--f-display); font-weight: 500; font-style: italic; color: var(--accent-hi) !important; font-size: 1.15rem !important; letter-spacing: 0; }

@media (prefers-reduced-motion: reduce){
  :root{ transition: none; }
  .navPill, .slot, .rosterCard, .teamStripCard, .slotTip, .ddBtn svg{ transition: none; }
  .dd.open .ddMenu{ animation: none; }
}

/* Buttons that carry an icon next to their label (nav tabs, Edit, …). */
button{ display: inline-flex; align-items: center; justify-content: center; gap: .45em; }
.accountBarAvatar{ border-radius: 50%; background: hsl(var(--h) 14% 16%); box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 600px){
  h1{ font-size: 2.1rem; }
  header{ gap: 10px; }
  header .status:has(> #goldDisplay){ padding: 6px 12px 6px 9px; }
  .accountSignInBtn{ padding: 0 16px; }
}

/* Optional item art (util/item-art.js): replaces an emoji icon inline; the emoji stays when there is no art. */
.itemArt{ width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -.25em; -webkit-user-drag: none; user-select: none; }
.itemArt.big{ width: 100%; height: 100%; }

/* Custom Select: optgroup headings (not selectable) and item art inside options. */
.ddMenu li.ddGroup{ min-height: 0; padding: 10px 14px 4px; font: 600 .68rem var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--c-dim); pointer-events: none; cursor: var(--cur-normal, default); }
.ddMenu li.ddGroup:hover{ background: transparent; }
.ddMenu li .itemArt, .ddBtn .itemArt{ width: 1.4em; height: 1.4em; margin-right: .2em; }

/* Information popup on the generic confirm overlay (ui/modal.js showInfoModal): scrollable reference list. */
#genericConfirmMsg .infoModalList{ text-align: left; max-height: 50vh; overflow: auto; margin: 10px 0 0; padding-left: 20px; }
#genericConfirmMsg .infoModalList li{ margin: 3px 0; }

/* A board layout drawing (render/board-layout-diagram.js): the Dev Game
   Modes editor and the Encyclopedia's Game Modes cards. */
.bldBoard{ position: relative; flex: none; }
.bldTile{
  position: absolute; display: flex; align-items: center; justify-content: center;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: hsl(var(--h) 12% 22%); color: #fff; font-size: .85rem; line-height: 1;
}
.bldTile.deploy.player{ background: hsl(165 45% 32%); }
.bldTile.deploy.enemy{ background: hsl(6 50% 34%); }
.bldTile.tower.player{ background: hsl(165 55% 44%); }
.bldTile.tower.enemy{ background: hsl(6 60% 46%); }
