/* Tactix 2026 visual system — intentionally layered over the legacy component CSS. */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --raised: #f7f9fc;
  --line: #dfe5ec;
  --line-strong: #cdd6e1;
  --text: #132238;
  --muted: #718096;
  --cyan: #00a99d;
  --cyan-deep: #087f79;
  --cyan-soft: #e7f8f6;
  --navy: #101d31;
  --navy-soft: #1a2b44;
  --gold: #dba53a;
  --red: #dc5f69;
  --radius: 20px;
  --shadow-sm: 0 1px 2px #1422380a, 0 5px 16px #1422380a;
  --shadow-md: 0 2px 5px #1422380a, 0 18px 45px #14223812;
  --gutter: clamp(16px, 3vw, 36px);
  --gutter-negative: clamp(-36px, -3vw, -16px);
  color-scheme: light;
}

html { background: var(--navy); }

body {
  background:
    radial-gradient(circle at 12% 2%, #214568 0, transparent 27rem),
    radial-gradient(circle at 88% 18%, #0b645f55 0, transparent 25rem),
    var(--navy);
  font-feature-settings: "ss01" 1, "ss02" 1;
  letter-spacing: -.01em;
}

button, input, select { font: inherit; }
button { transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #42d1c566; outline-offset: 2px; }

.app-shell {
  width: min(100%, 1120px);
  min-height: 100dvh;
  background: #f5f7fa;
  box-shadow: 0 30px 100px #02091466;
}

.topbar {
  height: 82px;
  padding: max(15px, env(safe-area-inset-top)) var(--gutter) 13px;
  gap: 12px;
  color: #f8fbff;
  background: #101d31ee;
  border-bottom: 1px solid #ffffff14;
  backdrop-filter: blur(20px) saturate(135%);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff24;
  border-radius: 14px;
  box-shadow: 0 8px 24px #02091455;
}

.brand-copy strong { font-size: 15px; letter-spacing: .18em; }
.brand-copy span { margin-top: 5px; color: #91a3ba; font-size: 9px; letter-spacing: .16em; }

.header-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 14px;
  padding-left: 18px;
  border-left: 1px solid #ffffff1f;
  color: #9db0c5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
}
.header-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #39d7c7;
  box-shadow: 0 0 0 5px #39d7c71a, 0 0 14px #39d7c7aa;
}

.icon-button {
  width: 41px;
  height: 41px;
  color: #d8e3ef;
  background: #ffffff0d;
  border-color: #ffffff1d;
  border-radius: 12px;
  box-shadow: none;
}
.icon-button:hover { color: #fff; background: #ffffff17; border-color: #ffffff32; }

main { padding: 0 var(--gutter) 52px; }

.page-tabs {
  position: sticky;
  top: 82px;
  z-index: 9;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 var(--gutter-negative) 24px;
  padding: 0 var(--gutter);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #ffffffed;
  box-shadow: 0 7px 22px #192a4009;
  backdrop-filter: blur(18px);
}
.page-tabs button {
  position: relative;
  min-height: 57px;
  border-radius: 0;
  color: #7a889b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.page-tabs button::after {
  content: "";
  position: absolute;
  right: 22%;
  bottom: -1px;
  left: 22%;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--cyan);
  opacity: 0;
  transform: scaleX(.45);
  transition: opacity .18s ease, transform .18s ease;
}
.page-tabs button:hover { color: var(--text); background: #f7fafc; }
.page-tabs button[aria-selected=true] { color: var(--navy); background: transparent; box-shadow: none; }
.page-tabs button[aria-selected=true]::after { opacity: 1; transform: scaleX(1); }

.summary-strip {
  padding: 20px 12px;
  border: 1px solid #213753;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(115deg, #13253e 0%, #182f4b 62%, #123f49 100%);
  box-shadow: 0 18px 38px #14223822;
}
.summary-strip div + div::before { background: #ffffff18; }
.summary-strip strong { font-size: 23px; letter-spacing: -.04em; }
.summary-strip span { margin-top: 3px; color: #9fb0c3; font-size: 10px; letter-spacing: .02em; }

.controls { gap: 10px; margin-top: 18px; }
.search-box {
  height: 48px;
  padding: 0 15px;
  border-color: var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.search-box:hover { border-color: var(--line-strong); }
.search-box:focus-within { border-color: #55bfb7; box-shadow: 0 0 0 4px #18a99d14; }
.search-box input { font-size: 13px; }
.filter-button {
  height: 48px;
  padding: 0 16px;
  border-color: var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.filter-button:hover { border-color: #aebcc9; background: #fafcfe; }
.filter-panel { border-color: var(--line); border-radius: 15px; box-shadow: var(--shadow-sm); }
.chip { border-radius: 999px; background: #f3f6f9; }
.chip.selected { border-color: #8ad0ca; color: var(--cyan-deep); background: var(--cyan-soft); }

.style-tabs { gap: 4px; margin-top: 13px; padding-bottom: 3px; }
.style-tab { padding: 8px 12px; border-radius: 999px; }
.style-tab:hover { color: var(--text); background: #e9edf2; }
.style-tab.selected { background: var(--navy-soft); box-shadow: 0 6px 14px #15253b22; }

.section-heading { margin: 26px 2px 13px; }
.eyebrow { color: var(--cyan-deep); font-size: 9px; letter-spacing: .2em; }
.section-heading h2 { margin-top: 5px; font-size: 25px; letter-spacing: -.045em; }
.section-heading > span, .catalog-count { color: #8996a7; font-size: 10px; font-weight: 600; }

.deck-list { gap: 14px; }
.deck-card {
  padding: 18px;
  border-color: var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.deck-card:hover {
  border-color: #bdcbd7;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.deck-card:active { transform: translateY(0) scale(.995); }
.deck-top { gap: 13px; }
.tier-badge {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 19px;
  box-shadow: inset 0 0 0 1px #ffffff2e, 0 8px 17px color-mix(in srgb, var(--tier-color) 25%, transparent);
}
.deck-title h3 { font-size: 16px; letter-spacing: -.025em; }
.deck-title div { margin-top: 5px; }
.style-pill { border-radius: 999px; color: var(--cyan-deep); background: var(--cyan-soft); }
.arrow { color: #a6b1be; font-size: 23px; }

.trait-strip { gap: 6px; margin-top: 15px; }
.trait-badge { padding: 3px 8px 3px 3px; border-radius: 999px; background: color-mix(in srgb, var(--trait) 8%, #fff); }
.trait-gem { width: 22px; height: 22px; }

.roster { gap: 5px 2px; margin-top: 16px; }
.roster .unit-tile { flex-basis: 50px; width: 50px; }
.unit-photo { border-width: 2px; border-radius: 10px; box-shadow: 0 5px 12px #17283d20; }
.unit-tile.small .unit-photo { border-radius: 9px; }
.item-icon { border-color: #bd8b34; border-radius: 4px; box-shadow: 0 2px 5px #17283d22; }
.unit-name { margin-top: 1px; color: #526176; font-weight: 600; }

.card-stats {
  margin-top: 17px;
  padding: 11px 5px;
  border: 1px solid #e8edf2;
  border-radius: 12px;
  background: #f7f9fb;
}
.stat span { color: #8491a2; }
.stat strong { margin-top: 3px; font-size: 14px; }
.stat strong.good { color: var(--cyan-deep); }
.sample-line { margin-top: 10px; padding-top: 10px; color: #8c98a7; }
.sample-line span::before { content: "DATA "; color: #adb6c1; font-size: 7px; font-weight: 800; letter-spacing: .12em; }

.skeleton-card { border: 1px solid var(--line); background: linear-gradient(100deg, #edf1f5 30%, #fff 48%, #edf1f5 65%); background-size: 240% 100%; }

.catalog-heading { margin-top: 31px; }
.catalog-heading h1 { color: var(--navy); font-size: 27px; letter-spacing: -.05em; }
.catalog-patch { padding: 5px 9px; border-radius: 999px; color: var(--cyan-deep); background: var(--cyan-soft); }
.catalog-intro { max-width: 560px; margin: 9px 0 19px; color: #69788c; }
.catalog-cost { justify-content: center; }
.catalog-cost select, .catalog-build-select select { border-color: var(--line); border-radius: 11px; box-shadow: var(--shadow-sm); }

.catalog-list { gap: 14px; }
.catalog-trait-card {
  padding: 19px;
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.catalog-trait-card:hover { border-color: #c4d0db; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.catalog-trait-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--navy-soft); }
.catalog-trait-title h2 { font-size: 18px; letter-spacing: -.025em; }
.catalog-thresholds span { border: 1px solid #c9ebe7; border-radius: 999px; background: #f0fbfa; }
.catalog-description { color: #4d5e73; line-height: 1.8; }
.catalog-member { border-color: #e1e7ed; border-radius: 9px; background: #f7f9fb; }
.catalog-member:hover { border-color: #9fcfc9; background: var(--cyan-soft); transform: translateY(-1px); }

.catalog-unit-grid { gap: 12px; }
.catalog-unit-card {
  padding: 16px 9px;
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.catalog-unit-card:hover { border-color: #9fcfc9; background: #fff; box-shadow: var(--shadow-md); transform: translateY(-3px); }
.catalog-portrait { width: 70px; height: 70px; border-radius: 15px; box-shadow: 0 8px 20px #17283d1d; }
.catalog-portrait img, .catalog-portrait > .image-fallback { border-radius: 12px; }
.catalog-portrait b { border: 2px solid #fff; border-radius: 8px; }
.catalog-unit-card > strong { color: var(--navy); font-size: 13px; }
.catalog-build-status.available { color: var(--cyan-deep); }

.sheet-backdrop { background: #07101c9e; backdrop-filter: blur(8px); }
.deck-sheet {
  width: min(100%, 760px);
  padding: 12px clamp(18px, 4vw, 32px) max(34px, env(safe-area-inset-bottom));
  border-color: #dce3ea;
  border-radius: 26px 26px 0 0;
  background: #f7f9fb;
  box-shadow: 0 -28px 80px #03091266;
}
.sheet-handle { background: #c5ced8; }
.sheet-close { color: #617084; border-color: #dce3ea; border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
.sheet-close:hover { color: var(--navy); border-color: #bec9d4; }
.sheet-kicker { color: var(--cyan-deep); font-size: 9px; letter-spacing: .18em; }
.sheet-title { color: var(--navy); font-size: 30px; }
.sheet-subtitle { color: #718096; }
.sheet-stats { border-color: #dfe5ec; border-radius: 15px; box-shadow: var(--shadow-sm); }
.sheet-stats div { background: #fff; }
.sheet-stats strong { color: var(--navy); font-size: 16px; }
.detail-section { margin-top: 27px; }
.detail-section h4 { margin-bottom: 11px; color: #3f5065; font-size: 11px; letter-spacing: .07em; }
.detail-section h4::before { content: ""; display: inline-block; width: 4px; height: 11px; margin-right: 7px; border-radius: 3px; background: var(--cyan); vertical-align: -1px; }
.unit-detail-panel { border-color: #dde5ec; border-radius: 17px; box-shadow: var(--shadow-sm); }
.board-wrap { border-color: #223952; border-radius: 17px; background: linear-gradient(145deg, #1b3049, #12243a); box-shadow: inset 0 1px 0 #ffffff13; }
.board-labels { color: #8299ae; }
.board-labels strong { color: #dce8f3; }
.hex-cell { background: #34506a; }
.hex-cell::after { background: #1d344c; }
.hex-unit { background: #1d344c; }
.hex-unit span:last-child { color: #fff; background: #0b1726ce; }
.ability-card, .combat-stats, .build-table, .carry-analysis-table { border-color: #dfe6ec; }
.ability-card, .build-table-head, .carry-analysis-head { background: #f3f6f9; }
.carry-analysis-note, .trend-box { color: #386d69; background: #eaf8f6; }
.requirement { border-left-color: var(--gold); background: #fff8e9; }
.augment-card { border-color: #dfe6ec; border-radius: 12px; box-shadow: 0 1px 2px #14223808; }
.augment-card:first-child { border-color: #9ed8d2; background: #f4fcfb; }
.augment-card:first-child .augment-rank { background: var(--navy-soft); }

@media (min-width: 760px) {
  body { padding: 28px; }
  .app-shell { min-height: calc(100dvh - 56px); border: 1px solid #ffffff18; border-radius: 25px; overflow: clip; }
  .topbar { position: sticky; top: 0; }
  .page-tabs { top: 82px; }
  .deck-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .catalog-unit-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .deck-sheet { bottom: 22px; max-height: calc(100dvh - 44px); border-bottom: 1px solid #dce3ea; border-radius: 26px; }
}

@media (max-width: 759px) {
  .header-status { margin-left: 6px; padding-left: 13px; }
  .page-tabs { top: 82px; }
  .catalog-unit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .topbar { height: 74px; }
  .brand-mark { width: 40px; height: 40px; }
  .header-status { display: none; }
  .page-tabs { top: 74px; margin-bottom: 20px; }
  .page-tabs button { min-height: 52px; font-size: 11px; }
  .summary-strip { padding: 17px 4px; }
  .summary-strip strong { font-size: 19px; }
  .deck-card { padding: 16px; }
  .catalog-unit-grid { gap: 8px; }
  .catalog-unit-card { padding: 13px 5px; }
  .catalog-portrait { width: 58px; height: 58px; }
  .sheet-title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .deck-card, .catalog-trait-card, .catalog-unit-card, .catalog-member { transform: none !important; }
}
