/* Ysabeau Office (SIL Open Font License, fonts/OFL.txt): variable font, one file per subset covers 500–800. */
@font-face {
  font-family: 'Ysabeau Office'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/ysabeau-office-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Ysabeau Office'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/ysabeau-office-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Palette from the Deadlock key art: deep teal night, mint glow, cream logo. */
  --bg: #08171a;
  --surface: #0e2226;
  --sheet-bg: #0a1c1f; /* every bottom sheet; the recoloured game tooltip is drawn on it */
  --surface-hover: #132d32;
  --border: rgba(143, 214, 190, 0.15);
  --accent: #5cc6a2;          /* mint: lines, icons, active states */
  --accent-rgb: 92, 198, 162;
  --accent-deep: #22705f;     /* filled buttons (cream text stays readable) */
  --accent-2: #4d8ea3;        /* steel teal: secondary controls */
  --accent2-rgb: 77, 142, 163;
  --cream: #efe4c8;           /* logo cream */
  --text: #eee6d2;
  --muted: #86a39c;
  --good: #7fd4a0;
  --bad: #e2765c;
  --slot-weapon: #d08a3a;
  --slot-vitality: #6f9e4f;
  --slot-spirit: #8a6bc4;
  /* Ysabeau Office (SIL OFL): closest free match to the game's Reaver/Radiance, full Cyrillic. */
  --serif: 'Ysabeau Office', Georgia, serif;
  --sans: 'Ysabeau Office', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --tier-S: #e0b04f;
  --tier-A: #e2765c;
  --tier-B: #c9a36b;
  --tier-C: #4d8ea3;
  --tier-D: #56686a;
  --tabbar-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}

img { display: block; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.01em;
}
h1 { font-size: 24px; }
h2 { font-size: 17px; }

.muted { color: var(--muted); font-size: 13px; }

/* --- Top bar --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(8, 23, 26, 0.92); /* --bg */
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
  text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.35);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- Layout --- */

main {
  padding: 16px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
}

.screen-header { margin-bottom: 16px; }
.screen-header p { margin: 4px 0 0; }

.hero-header { display: flex; align-items: center; gap: 12px; }

section { margin-bottom: 24px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.state {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  list-style: none;
}
.state p { margin: 0 0 12px; }

/* --- Cards --- */

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
button.card:focus-visible {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2);
  outline: none;
}

.rank {
  width: 22px;
  flex-shrink: 0;
  text-align: right;
  font-family: var(--serif);
  color: var(--muted);
}

.icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover; /* hero icons are transparent cut-outs: no backing plate */
}
.icon-lg { width: 64px; height: 64px; }

.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.card-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar { height: 3px; background: rgba(138, 133, 128, 0.15); border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

.wr { font-family: var(--serif); font-size: 17px; font-weight: 700; flex-shrink: 0; }
.wr-good { color: var(--good); }
.wr-bad { color: var(--bad); }

.item-card { border-left-width: 3px; }
.item-card .icon { object-fit: contain; padding: 0; background: none; }
/* Shop tiles carry their own dark frame at the edge: crop it (clip ~5 % per side, scale back to full size). */
.item-card .icon, .combo-item img { clip-path: inset(5% round 8px); transform: scale(1.1); }
.slot-weapon { border-left-color: var(--slot-weapon); }
.slot-vitality { border-left-color: var(--slot-vitality); }
.slot-spirit { border-left-color: var(--slot-spirit); }

/* Item catalog (Heroes tab -> Items): tier/slot chips, stat button. */
.builds-view { position: static; grid-template-columns: repeat(2, 1fr); margin-bottom: 12px; }
.item-filters { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.slot-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.slot-dot.slot-weapon { background: var(--slot-weapon); }
.slot-dot.slot-vitality { background: var(--slot-vitality); }
.slot-dot.slot-spirit { background: var(--slot-spirit); }
.items-found { margin: 0 0 8px; font-size: 12px; }

/* --- Hero picker --- */

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.hero-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-tile img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.hero-tile:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2);
  outline: none;
}

/* --- Controls --- */

.btn {
  padding: 8px 16px;
  background: var(--accent-deep);
  color: var(--text);
  border-radius: 8px;
  font-weight: 600;
}

.link { color: var(--accent); font-size: 13px; margin-top: 4px; }

.chips { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.chip {
  padding: 3px 8px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.chip.is-active { color: var(--text); border-color: var(--accent); background: rgba(var(--accent-rgb), 0.18); }

/* --- Player profile --- */

.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.search input:focus { outline: none; border-color: var(--accent-2); }

.rank-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.rank-badge img { width: 26px; height: 26px; object-fit: contain; } /* a bit larger: 22 px was too small */

a.link { text-decoration: none; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 24px; }
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-value { font-family: var(--serif); font-size: 20px; font-weight: 700; }

.match-card { border-left-width: 3px; }
.match-card.is-win { border-left-color: var(--good); }
.match-card.is-loss { border-left-color: var(--bad); }
.match-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13px; flex-shrink: 0; }

/* --- Tab bar --- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.tab {
  flex: 1;
  text-align: center;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--muted);
  border-top: 2px solid transparent;
}
.tab.is-active { color: var(--text); border-top-color: var(--accent); }

/* --- Player comparison --- */

.cmp-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.cmp-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}
.cmp-player .card-title { max-width: 100%; }
.cmp-vs { font-family: var(--serif); font-size: 15px; }

.cmp-table {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
}
.cmp-row {
  display: grid;
  grid-template-columns: 1fr minmax(96px, 1.1fr) 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}
.cmp-row + .cmp-row { border-top: 1px solid var(--border); }
.cmp-label { text-align: center; font-size: 12px; }
.cmp-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.cmp-cell small { font-family: var(--sans); font-size: 11px; font-weight: 400; }
.cmp-cell.is-better { color: var(--good); }
.cmp-cell .rank-badge { flex-direction: column; font-family: var(--sans); font-size: 12px; font-weight: 400; }
.cmp-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); }
.cmp-hero img { width: 32px; height: 32px; border-radius: 6px; }

.cmp-periods { justify-content: center; margin-bottom: 12px; }
.cmp-row-wide { grid-template-columns: 1fr 2fr; }
.low-data {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 999px;
  padding: 1px 8px;
}

.account-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid rgba(var(--accent2-rgb), 0.5);
  border-radius: 10px;
}
.account-box p { margin: 0; }
.account-box .section-head { margin: 0; }

.follow { margin-top: 6px; }

/* --- Top bar search button --- */

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.icon-btn.is-active, .icon-btn:focus-visible { border-color: var(--accent-2); background: rgba(var(--accent2-rgb), 0.2); outline: none; }

/* --- My profile --- */

.freshness { margin: 0 0 12px; font-size: 13px; }
.freshness.is-stale { padding: 8px 10px; border: 1px solid rgba(var(--accent-rgb), 0.4); border-radius: 8px; }

.form-strip { display: flex; gap: 4px; }
.form-cell {
  flex: 1;
  max-width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--bg);
}
.form-cell.is-win { background: var(--good); }
.form-cell.is-loss { background: var(--bad); color: var(--text); }

.chart { margin: 0; }
.rank-chart { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.rank-chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.rank-chart .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.rank-chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.rank-chart .hit { fill: transparent; }
.chart-caption { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; }
/* uPlot version of the chart (Render.enhanceCharts): readout line above, the plot in the same framed box. */
.chart-readout { margin: 0 0 6px; font-size: 13px; min-height: 18px; }
.chart-readout b { font-family: var(--serif); font-size: 16px; color: var(--accent); margin-right: 4px; }
.chart-plot { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.chart-plot .u-over { touch-action: pan-y; } /* sideways finger = cursor, up/down = scroll */
.chart-caption b { color: var(--text); }

.activity p { margin: 0 0 6px; }
.hour-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
  margin-top: 8px;
  padding: 0 2px;
  border-bottom: 1px solid var(--border);
}
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.hour-axis { display: flex; justify-content: space-between; font-size: 11px; margin: 4px 0 6px; }

.delta { font-size: 12px; }

.account-box h2 { font-size: 15px; margin-top: 4px; }
.follow-list { display: flex; flex-wrap: wrap; gap: 6px; }
.follow-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 6px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.follow-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.follow-remove { width: 22px; height: 22px; border-radius: 50%; color: var(--muted); text-align: center; }
.follow-remove:active { color: var(--text); background: rgba(var(--accent-rgb), 0.25); }

/* ===================== Visual pass ===================== */

/* Atmosphere: mint glow from the top, teal haze at the bottom + faint film grain. */
body {
  background:
    radial-gradient(120% 50% at 50% -8%, rgba(var(--accent-rgb), 0.14), transparent 62%),
    radial-gradient(90% 40% at 50% 108%, rgba(var(--accent2-rgb), 0.10), transparent 70%),
    var(--bg);
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .topbar { position: relative; z-index: 1; }
.topbar { position: sticky; z-index: 10; }

.card-title { font-weight: 600; }
.wr, .stat-value, .rank { font-family: var(--serif); font-weight: 800; font-variant-numeric: tabular-nums; }

/* Screens and cards rise in softly. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.screen > * { animation: rise 0.28s ease both; }
.screen > *:nth-child(2) { animation-delay: 0.03s; }
.screen > *:nth-child(3) { animation-delay: 0.06s; }
.screen > *:nth-child(n+4) { animation-delay: 0.09s; }

/* Loading skeleton. */
@keyframes shimmer { from { background-position: -200px 0; } to { background-position: 200px 0; } }
.skeleton { display: flex; flex-direction: column; gap: 8px; }
.sk {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface) 0, #1f1a18 50%, var(--surface) 100%) 0 0 / 400px 100%;
  animation: shimmer 1.2s linear infinite;
}
.sk-title { height: 26px; width: 55%; }
.sk-line { height: 14px; width: 80%; margin-bottom: 8px; }
.sk-card { height: 66px; }

@media (prefers-reduced-motion: reduce) {
  .screen > *, .sk { animation: none; }
}

/* Tab bar with icons. */
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  border-top: 0;
  position: relative;
  transition: color 0.15s;
}
.tab-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--text); }
.tab.is-active .tab-icon { stroke: var(--accent); filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.6)); }
.tabbar { background: rgba(8, 23, 26, 0.92); backdrop-filter: blur(8px); }

/* Tier list. */

.tier-group { position: relative; margin-bottom: 18px; }
.tier-group:has(.info[open]) { z-index: 8; } /* open tier popover overlays the next groups */
.tier-head { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tier-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 17px;
  color: #120f0e;
  background: var(--tier-D);
}
.tier-S { background: var(--tier-S); box-shadow: 0 0 14px rgba(224, 176, 79, 0.45); }
.tier-A { background: var(--tier-A); color: var(--text); }
.tier-B { background: var(--tier-B); }
.tier-C { background: var(--tier-C); color: var(--text); }
.tier-D { background: var(--tier-D); color: var(--text); }

.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.art-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: radial-gradient(90% 70% at 50% 30%, var(--hero, #1d3d3f), var(--surface) 75%);
  transition: transform 0.15s, box-shadow 0.15s;
}
.art-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(8, 23, 26, 0.95) 88%);
}
.art-card-body {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.art-card-name { font-family: var(--serif); font-weight: 800; font-size: 15px; line-height: 1.1; }
.art-card .wr { font-size: 17px; }
.art-card .muted { font-size: 11px; }
.art-card-body { left: 8px; right: 8px; bottom: 8px; }

.hero-row { border-left: 3px solid var(--hero, var(--border)); }

/* Hero banner on the build screen. */
.hero-banner {
  position: relative;
  z-index: 7; /* its tier popover must overlay the item list below */
  display: flex;
  align-items: flex-end;
  min-height: 180px;
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    radial-gradient(80% 90% at 85% 40%, var(--hero, #1d3d3f), transparent 70%),
    var(--surface);
}
.hero-banner-art {
  position: absolute;
  right: -10px;
  bottom: 0;
  height: 100%;
  width: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40%);
  mask-image: linear-gradient(90deg, transparent 0, #000 40%);
}
.hero-banner-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 62%; }
.hero-banner h1 { font-size: 30px; line-height: 1.05; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.hero-banner p { margin: 0; }
.hero-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }

.hero-tile { border-bottom: 2px solid var(--hero, var(--border)); }

/* Profile sub-tabs (segmented control). */
.subtabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: sticky;
  top: 58px;
  z-index: 5;
}
.subtab { padding: 8px 4px; border-radius: 7px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.subtab.is-active { color: var(--text); background: rgba(var(--accent-rgb), 0.22); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.5); }

/* "?" explanation next to a title. */
.title-row { position: relative; z-index: 7; display: flex; align-items: center; gap: 10px; } /* above sibling sections (their animation creates stacking contexts) */
.info summary { list-style: none; }
.info summary::-webkit-details-marker { display: none; }
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--serif);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.info[open] .info-btn { color: var(--text); border-color: var(--accent-2); background: rgba(var(--accent2-rgb), 0.25); }
.info-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 6;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent2-rgb), 0.5);
  background: #0c2226;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  font-size: 13px;
  color: var(--muted);
  animation: rise 0.15s ease both;
}
.info-pop p { margin: 0; }
.info-pop p + p { margin-top: 6px; color: var(--text); }

/* Tappable tier badges. */
.hero-banner-bg { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.tier-info summary.tier-badge { cursor: pointer; user-select: none; transition: transform 0.12s; }
.tier-info summary.tier-badge:active { transform: scale(0.94); }
.tier-info[open] summary.tier-badge { outline: 2px solid var(--text); outline-offset: 2px; }
.tier-info .info-pop { min-width: 240px; }
.hero-banner .tier-info .info-pop { right: auto; width: min(300px, calc(100vw - 64px)); }
.info-pop-title { color: var(--text); font-family: var(--serif); font-weight: 800; font-size: 15px; }
.info-pop .info-pop-title + p { margin-top: 4px; color: var(--muted); }

/* ===================== Responsiveness & "breathing" ===================== */

/* Press feedback: quick press-in, soft spring back. */
button, summary, a { -webkit-tap-highlight-color: transparent; }
button.card, .chip, .tab, .icon-btn, .art-card, .hero-tile, .btn, .subtab,
.follow-remove, .info summary, .cmp-player, .cmp-hero, .link {
  transition:
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
button.card:active, .chip:active, .icon-btn:active, .art-card:active, .hero-tile:active,
.btn:active, .subtab:active, .follow-remove:active, .cmp-player:active, .cmp-hero:active {
  transform: scale(0.97);
  transition-duration: 0.07s;
}
.link:active { opacity: 0.6; }
button.card:active, .hero-tile:active {
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.45), 0 0 16px rgba(var(--accent-rgb), 0.18);
}
.btn:active { box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.55); }
.chip.is-active, .subtab.is-active { transition-duration: 0.25s; }

/* Tab bar: one indicator glides between tabs; the new icon pops. */
.tab-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.tab-indicator::after {
  content: '';
  position: absolute;
  left: 30%;
  right: 30%;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7);
}
.tab:active { transform: scale(0.94); transition-duration: 0.07s; }
@keyframes tab-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18) translateY(-1px); } 100% { transform: scale(1); } }
.tab.is-active .tab-icon { animation: tab-pop 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); } /* static glow: an animated filter repainted every frame */

/* Winrate bars grow in. */
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar span { transform-origin: left center; animation: grow-x 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both; }
.bar-fill { transform-origin: bottom center; animation: grow-y 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===================== Item card (bottom sheet, game tooltip look) ===================== */

body.sheet-open { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet.is-sprung .sheet-panel { animation: none; } /* Motion springs the panel in (app.js) */
.sheet.is-waiting .sheet-panel { visibility: hidden; } /* springy open: up to 250 ms for the final content */
.sheet.is-closing { pointer-events: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Backdrop: drawn by #sheet itself, so it fades in once per opening (display none -> block) and never restarts when the
   panel content is replaced. --backdrop dims it while the panel is dragged down; .is-closing fades it out. */
.sheet::before {
  content: ''; position: absolute; inset: 0; background: rgba(3, 12, 14, 0.7);
  opacity: var(--backdrop, 1); transition: opacity 0.2s ease;
  animation: fade-in 0.2s ease backwards;
}
.sheet.is-closing::before { opacity: 0; }
.sheet-panel {
  --slot: var(--accent); /* top edge: mint; items — slot colour, matches — win/loss, tournaments — tier tone */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 640px;
  margin: 0 auto;
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); /* top: room for the grip */
  border-radius: 16px 16px 0 0;
  border-top: 2px solid var(--slot);
  background: var(--sheet-bg);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  /* backwards, not both: a held final keyframe would override the inline transform used while dragging */
  animation: sheet-up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.sheet-panel.slot-weapon { --slot: var(--slot-weapon); }
.sheet-panel.slot-vitality { --slot: var(--slot-vitality); }
.sheet-panel.slot-spirit { --slot: var(--slot-spirit); }
/* Grip: the same thin bar on every sheet, over the content at the top edge. The element is a 64x18 touch area
   (swipe-to-close starts on it, app.js onSheetTouchStart); the visible 36x4 bar is its ::before. */
.sheet-grip { position: absolute; top: 0; left: 0; right: 0; z-index: 2; width: 64px; height: 18px; margin: 0 auto; cursor: grab; }
.sheet-grip::before {
  content: ''; position: absolute; top: 7px; left: 14px; width: 36px; height: 4px; border-radius: 2px;
  background: color-mix(in srgb, var(--text) 40%, transparent);
}

.item-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.item-head-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  padding: 6px;
  object-fit: contain;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--slot) 35%, transparent), #061214 75%);
  border: 1px solid color-mix(in srgb, var(--slot) 60%, transparent);
}
.item-head-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-head-body h2 { font-size: 21px; }
.item-cost { display: inline-flex; align-items: center; gap: 5px; font-family: var(--serif); font-weight: 800; color: #9fe0c4; }
.item-cost img { width: auto; height: 17px; } /* tall glyph (35x67) */

.tt-section { margin-bottom: 12px; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--border); }
.tt-innate { background: rgba(0, 0, 0, 0.25); }
.tt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--slot) 22%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--slot) 40%, transparent);
}
.tt-cd { display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; }
.tt-cd img { width: 14px; height: 14px; }
.tt-text { margin: 0; padding: 10px 12px 4px; line-height: 1.45; font-size: 14px; color: #d6d9cc; }
.tt-text .highlight { color: var(--text); font-weight: 700; }
.tt-text .diminish { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.tt-text svg, .tt-text img { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.16em; margin: 0 0.12em; }
.tt-text [class*="SpiritDamage"], .tt-text [class*="Spirit "], .tt-text [class$="Spirit"] { color: #cf9cff; }
.tt-text [class*="WeaponDamage"], .tt-text [class*="FireRate"], .tt-text [class*="MeleeDamage"] { color: #f0a54a; }
.tt-text [class*="Heal"], .tt-text [class*="Regen"] { color: #6fe0a0; }
.tt-text [class*="MoveSpeed"] { color: #9fd0ff; }

.tt-stats { list-style: none; margin: 0; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 5px; }
.tt-stats li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.tt-stats li img, .tt-dot { width: 16px; height: 16px; flex-shrink: 0; }
.tt-dot { border-radius: 50%; background: color-mix(in srgb, var(--slot) 50%, transparent); transform: scale(0.45); }
.tt-stats b { font-family: var(--serif); font-weight: 800; color: var(--text); min-width: 44px; }
.tt-stats span { color: var(--muted); }
.tt-note { margin: 4px 2px 0; font-size: 12px; }

/* People lists under the player search. */
.people-panel { margin-top: 4px; }
.people-tabs { position: static; margin-bottom: 12px; }

/* Hover effects only for a real pointer (mouse). On touch screens a finger passing over a card
   while scrolling triggers :hover, which then sticks until the next tap elsewhere. */
@media (hover: hover) and (pointer: fine) {
  button.card:hover {
    background: var(--surface-hover);
    border-color: rgba(var(--accent-rgb), 0.6);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2);
  }
  .hero-tile:hover { border-color: rgba(var(--accent-rgb), 0.6); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2); }
  .art-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--tier-S); }
  .rank-chart .point:hover .dot { r: 5; }
  .bar-col:hover .bar-fill { background: #e05a55; }
  .follow-remove:hover { color: var(--text); background: rgba(var(--accent-rgb), 0.25); }
}

/* ===================== Match breakdown sheet ===================== */

li > button.match-card { width: 100%; }
.sheet-panel.is-win { border-top-color: var(--good); }
.sheet-panel.is-loss { border-top-color: var(--bad); }
.match-head h2 { font-size: 22px; }
.sheet-ok { display: block; margin: 0 auto 8px; }

/* Vertical timeline. */
.timeline { list-style: none; margin: 0 0 18px; padding: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 58px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--border), rgba(138, 133, 128, 0.35), var(--border));
}
.tl-item { position: relative; display: grid; grid-template-columns: 48px 20px 1fr; align-items: start; column-gap: 0; padding: 7px 0; }
.tl-time { font-family: var(--serif); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; padding-right: 2px; line-height: 20px; }
.tl-dot {
  justify-self: center;
  margin-top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px var(--bg);
  position: relative;
  z-index: 1;
}
.tl-item.is-enemy .tl-dot { background: var(--bad); }
.tl-item.is-big .tl-dot { width: 14px; height: 14px; margin-top: 3px; box-shadow: 0 0 0 3px var(--bg), 0 0 12px rgba(224, 176, 79, 0.7); background: var(--tier-S); }
.tl-body { display: flex; flex-direction: column; gap: 5px; padding-left: 6px; }
.tl-title { font-weight: 600; line-height: 20px; }
.tl-item.is-enemy .tl-title { color: var(--muted); }
.tl-item.is-big .tl-title { font-family: var(--serif); font-weight: 800; color: var(--tier-S); }
.tl-victims { display: flex; gap: 4px; flex-wrap: wrap; }
.tl-victims img { width: 26px; height: 26px; border-radius: 6px; background: #000; object-fit: cover; }

/* Teams in the breakdown. */
.match-teams { display: flex; flex-direction: column; gap: 4px; }
.match-team { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.match-player {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto 52px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  font-size: 14px;
}
.match-player img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; background: #000; }
.match-player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-player-souls { font-family: var(--serif); font-weight: 800; text-align: right; }
.match-player.is-me { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--accent-rgb), 0.12); }
.match-player:active { transform: scale(0.98); }

/* No double-tap zoom (also removes the tap delay); pinch zoom is off via the viewport meta + gesturestart. */
html, body { touch-action: manipulation; }

/* ===================== Tournaments ===================== */

.t-status { position: static; grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.t-tiers { margin-bottom: 12px; }
.lp-tier { width: 34px; height: 34px; flex-shrink: 0; animation: none; }
.t-row { align-items: center; }
.t-row.is-followed { border-color: rgba(var(--accent2-rgb), 0.7); }
/* "Live" pill: dot + label, vertically centred. */
.t-live {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #b9e0a8;
  background: rgba(143, 176, 127, 0.14);
  border: 1px solid rgba(143, 176, 127, 0.45);
}
.t-live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #8fe07a; }
.t-champ { display: inline-block; margin-left: 6px; color: var(--tier-S); font-weight: 700; }
.attribution { margin: 16px 0 0; text-align: center; font-size: 12px; }
.attribution a { color: var(--muted); }

/* Sheet follows the finger while swiped down (see sheet drag in app.js). */
.sheet-panel.is-dragging { transition: none !important; }

/* ===================== Tournament sheet ===================== */

.ico { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-lg { width: 30px; height: 30px; }

/* Tier tone: one colour drives the hero glow, accents and the sheet border. */
.tier-tone-S { --tone: var(--tier-S); --tone-rgb: 224, 176, 79; }
.tier-tone-A { --tone: var(--tier-A); --tone-rgb: 226, 118, 92; }
.tier-tone-B { --tone: var(--tier-B); --tone-rgb: 201, 163, 107; }
.tier-tone-C { --tone: var(--tier-C); --tone-rgb: 77, 142, 163; }
.tier-tone-D { --tone: var(--tier-D); --tone-rgb: 86, 104, 106; }
.sheet-panel.t-sheet { border-top-color: var(--tone); }

.t-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 -16px 14px;
  padding: 8px 16px 16px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(var(--tone-rgb), 0.28), transparent 60%);
  border-bottom: 1px solid var(--border);
}
.t-hero .lp-tier { width: 46px; height: 46px; font-size: 24px; border-radius: 12px; box-shadow: 0 0 18px rgba(var(--tone-rgb), 0.45); }
.t-hero-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.t-hero-body h2 { font-size: 21px; line-height: 1.15; }
.t-hero-org { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.t-hero-org .ico { width: 15px; height: 15px; }
.t-hero-meta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }

.t-progress { margin-bottom: 14px; }
.t-progress-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.t-progress-bar { height: 6px; border-radius: 3px; background: rgba(138, 133, 128, 0.18); overflow: hidden; }
.t-progress-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgba(var(--tone-rgb), 0.6), var(--tone)); transform-origin: left; animation: grow-x 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.t-note { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); font-weight: 600; }
.t-note .ico { color: var(--tone); }

.t-champion {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(224, 176, 79, 0.5);
  background: linear-gradient(135deg, rgba(224, 176, 79, 0.16), rgba(224, 176, 79, 0.03));
  color: var(--tier-S);
}
.t-champion div { display: flex; flex-direction: column; gap: 1px; }
.t-champion b { font-family: var(--serif); font-size: 20px; color: var(--tier-S); }
.t-champion small { font-size: 11.5px; }

.t-follow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  font-weight: 700;
  color: var(--text);
  background: rgba(var(--tone-rgb), 0.18);
  border: 1px solid rgba(var(--tone-rgb), 0.55);
}
.t-follow-btn.is-active { background: rgba(255, 255, 255, 0.04); border-color: var(--border); color: var(--muted); }
.t-follow-btn:active { transform: scale(0.98); }
.t-follow-hint { margin: 6px 0 14px; font-size: 12px; text-align: center; }

.t-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.t-fact {
  display: grid;
  grid-template-columns: 18px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  min-width: 0;
}
.t-fact .ico { grid-row: 1 / 3; color: var(--muted); }
.t-fact-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.t-fact-value {
  font-weight: 700;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* long regions wrap to a second line instead of being cut */
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.t-fact.is-accent { grid-column: 1 / -1; } /* the prize pool is the headline fact */
.t-fact.is-accent .ico { color: var(--tier-S); }
.t-fact.is-accent .t-fact-value { font-family: var(--serif); font-size: 18px; color: var(--tier-S); }

.t-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.t-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.t-link .ico { width: 16px; height: 16px; color: var(--muted); }
.t-link:active { transform: scale(0.96); }

.t-section { margin-bottom: 16px; }
.t-count { font-family: var(--serif); font-weight: 800; color: var(--muted); }
.t-day { margin: 10px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.t-day:first-of-type { margin-top: 0; }
.t-match {
  display: grid;
  grid-template-columns: 58px 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 13.5px;
}
.t-match-time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-side { display: flex; align-items: center; gap: 6px; min-width: 0; }
.t-side-1 { justify-content: flex-end; text-align: right; }
.t-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-side.is-win { font-weight: 700; color: var(--text); }
.t-side.is-loss { color: var(--muted); }
.t-mid { display: inline-flex; align-items: center; gap: 4px; font-family: var(--serif); font-weight: 800; }
.t-mid i { color: var(--muted); font-style: normal; }
.t-mid em { font-style: normal; font-size: 11px; padding: 2px 6px; border-radius: 6px; color: var(--muted); border: 1px solid var(--border); font-family: var(--sans); font-weight: 700; }
.t-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  color: hsl(var(--h), 70%, 88%);
  background: hsl(var(--h), 35%, 26%);
  border: 1px solid hsl(var(--h), 45%, 40%);
}
.t-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.t-team {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.t-team.is-champion { border-color: rgba(224, 176, 79, 0.6); color: var(--tier-S); }

/* Effect stats, in-game layout: important stats as blocks, the rest in one line below. */
.tt-blocks { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 4px; }
.tt-block {
  flex: 1 1 120px;
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--slot) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--slot) 35%, transparent);
}
.tt-block img { grid-row: 1 / 3; width: 22px; height: 22px; }
.tt-block b { font-family: var(--serif); font-weight: 800; font-size: 18px; color: var(--slot); line-height: 1.1; }
.tt-block span { font-size: 12px; color: var(--muted); line-height: 1.25; }
.tt-block:not(:has(img)) { grid-template-columns: 1fr; }
.tt-minor { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 8px 12px 10px; font-size: 13px; color: var(--muted); }
.tt-minor b { font-family: var(--serif); font-weight: 800; color: var(--text); }

/* ===================== Hero analytics tabs ===================== */

.hero-tabs { position: static; margin: -6px 0 16px; }
.combo-row { align-items: center; }
.combo-icons { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.combo-plus { color: var(--muted); font-weight: 700; padding: 0 1px; }
.combo-item {
  width: 38px;
  height: 38px;
  padding: 3px;
  border-radius: 8px;
  background: #0a0908;
  border: 1px solid var(--border);
}
.combo-item.slot-weapon { border-color: color-mix(in srgb, var(--slot-weapon) 60%, transparent); }
.combo-item.slot-vitality { border-color: color-mix(in srgb, var(--slot-vitality) 60%, transparent); }
.combo-item.slot-spirit { border-color: color-mix(in srgb, var(--slot-spirit) 60%, transparent); }
.combo-item img { width: 100%; height: 100%; object-fit: contain; }
.combo-names { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.counter-baseline { margin: -6px 0 12px; font-size: 12.5px; }

.wr-chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.wr-chart .value-label { fill: var(--text); font-size: 12px; font-weight: 800; font-family: var(--serif); }
.wr-chart .dot.is-open { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart-note { font-size: 12px; margin: 8px 0 10px; }
.history-table { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.history-row {
  display: grid;
  grid-template-columns: 1fr auto 64px 52px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 13.5px;
}
.history-row b { font-family: var(--serif); text-align: right; }
.history-row span:last-child { text-align: right; font-size: 12.5px; }
.history-row em { font-style: normal; }

/* Hero screen: 5 tabs. */
.hero-tabs { grid-template-columns: repeat(5, 1fr); }
.hero-tabs .subtab { font-size: 12px; padding: 8px 2px; }

/* "Vs team": enemy picker. */
.vs-count { margin: 0; }
.vs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-bottom: 18px; }
.vs-hero {
  aspect-ratio: 1; border-radius: 9px; overflow: hidden; padding: 0;
  background: var(--surface); border: 1px solid var(--border);
  opacity: .55; filter: grayscale(.6);
  transition: opacity .2s, filter .2s, box-shadow .2s, transform 70ms;
}
.vs-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vs-hero.is-active { opacity: 1; filter: none; border-color: var(--hero, var(--accent)); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .75), 0 0 12px rgba(var(--accent-rgb), .35); }
.vs-hero:active { transform: scale(.94); }
.vs-hint { line-height: 1.45; }

/* Bottom bar: 5 tabs. */
.tab { font-size: 11px; }

/* Teammate finder. */
.lfg-card { display: block; padding: 12px; }
.lfg-card.is-looking { border-color: rgba(92, 184, 92, 0.45); box-shadow: 0 0 14px rgba(92, 184, 92, 0.12); }
.lfg-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.lfg-head .avatar { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface); }
.lfg-head .card-body { min-width: 0; flex: 1; }
.lfg-head .card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lfg-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 3px; font-size: 12px; }
.lfg-hero { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.lfg-live { margin-top: 8px; }
.lfg-stats { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.lfg-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.lfg-actions .btn { padding: 7px 14px; font-size: 13px; }
.lfg-actions .btn:disabled { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.lfg-steam { padding: 6px 12px; font-size: 13px; font-weight: 600; border-radius: 8px; border: 1px solid var(--border); color: var(--text); }
.lfg-report { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; }
.lfg-me .list { margin-bottom: 10px; }
.lfg-switch {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 11px 12px; margin-bottom: 8px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 14px;
}
.switch-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); transition: background 0.2s; flex: none; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform 0.2s; }
.lfg-switch.is-on .switch-track { background: var(--accent); }
.lfg-switch.is-on .switch-knob { transform: translateX(18px); }
.lfg-filters { margin-bottom: 10px; }
.lfg-list .lfg-card { margin-bottom: 0; }

/* Seamless screens (app.js): after the first entrance a screen is "settled" — tab switches and in-place
   updates don't replay entrance animations (display:none -> block would restart them). */
.screen.is-settled > *,
.screen.is-settled .bar span,
.screen.is-settled .bar-fill,
.screen.is-settled .t-progress-bar span { animation: none; }

/* Steam sign-in. */
.steam-login { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: #1b2838; box-shadow: inset 0 0 0 1px #66c0f4; color: #fff; }
.steam-login-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.verify-box h2 { margin: 0 0 4px; font-size: 16px; }
.steam-fallback { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.steam-fallback p { margin: 0 0 8px; font-size: 12px; line-height: 1.4; }
.steam-url { width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg, #141110); color: var(--muted); font-size: 12px; }

/* Hero banner: iridescent frame (the ring itself is .hero-frame, see "GPU-only animations" below). */
.hero-banner { border-color: transparent; box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.14), 0 10px 30px rgba(0, 0, 0, 0.35); }
.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 26px rgba(var(--accent-rgb), 0.16);
  animation: frame-glow 3.5s ease-in-out infinite;
}
@keyframes frame-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.hero-banner-body { z-index: 3; }

/* Hero scene: the in-game hero select background behind S-tier cards and the hero banner. */
.hero-scene { position: absolute; inset: 0; background-repeat: no-repeat; background-size: cover; pointer-events: none; }
.art-card .hero-scene { background-size: auto 100%; background-position: 80% center; }
/* Banner: the source is a wide picture whose left half is transparent (collage on the right). Scaled to 200 %
   and pinned right, the collage fills the whole banner; a dark wash on the left keeps the name readable. */
.hero-banner .hero-scene { background-size: 200% auto; background-position: 100% 35%; }
.hero-banner .hero-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 23, 26, 0.88) 0%, rgba(8, 23, 26, 0.55) 45%, rgba(8, 23, 26, 0.05) 80%);
}
/* No hero-colour radial glow behind the collage (it was the look before game backgrounds). */
.hero-banner:has(.hero-scene) { background: var(--surface); }
/* With a scene behind it the long fade let the collage show through the hero (looked like it was on top). */
.hero-banner-bg:has(.hero-scene) .hero-banner-art {
  /* Only the cut edge of the portrait fades (short ramp), the hero itself stays opaque. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14%);
}

/* ===================== Modern touches (2026-09-25) ===================== */

/* 1. Floating glass tab bar (Liquid Glass style): a capsule above the content, blurred, with a lit rim.
      The active tab sits in a soft mint pill that glides between tabs. */
.tabbar {
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--tabbar-h);
  padding-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 52, 57, 0.62), rgba(10, 28, 31, 0.74));
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(var(--accent-rgb), 0.08);
}
main { padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
.tab-indicator { top: 5px; bottom: 5px; height: auto; }
.tab-indicator::after {
  left: 6%;
  right: 6%;
  top: 0;
  bottom: 0;
  height: auto;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.1));
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 14px rgba(var(--accent-rgb), 0.18);
}
.tab { z-index: 1; }

/* 2. Holographic S-tier cards: a foil sheen + glare that follow the phone's tilt (app.js sets --tilt-x/-y
      on <html> from Telegram DeviceOrientation). Without tilt data the sheen drifts slowly by itself. */
/* 3. The S-tier card expands into the hero banner ("container transform", View Transitions API; app.js
      openHero). Both snapshots fill the morphing box (cover), the card fades out as the banner fades in. */
.hero-banner { view-transition-name: hero-card; }
::view-transition-group(hero-card) { animation-duration: 0.42s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
::view-transition-old(hero-card), ::view-transition-new(hero-card) { width: 100%; height: 100%; object-fit: cover; }
::view-transition-old(hero-card) { animation: vt-out 0.24s ease both; }
::view-transition-new(hero-card) { animation: vt-in 0.3s ease 0.06s both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }

/* Settings sheet (gear in the top bar). */
.settings .sheet-title, .stat-picker .sheet-title { margin: 0 0 12px; font-size: 20px; }
.set-block { margin-bottom: 16px; }
.set-block h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.set-block .follow-list + h3 { margin-top: 12px; }
.set-status { margin: 0 0 8px; }
.set-status.is-ok { color: var(--good); }
.set-switch { margin-bottom: 0; text-align: left; }
.set-switch small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; }
.settings-panel { max-height: 88vh; overflow-y: auto; }

/* Animations off (settings): no shimmer, no flowing frame, no idle holo drift. */
html.no-motion .hero-banner::after, html.no-motion .hero-frame > span, html.no-motion .holo,
html.no-motion .tier-badge.tier-S::after, html.no-motion .t-live-dot::after { animation: none !important; }
html.no-motion .holo, html.no-motion .card-glare { display: none; } /* no foil and no glare when animations are off */

/* Compact tier rows: popularity as an icon + whole percent. */
.pick { display: inline-flex; align-items: center; gap: 4px; }
.ico-inline { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Hero screen: bell follow, icon tabs, min-matches behind a filter icon. */
.bell-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(8, 23, 26, 0.55); color: var(--text);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bell-btn .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bell-btn.is-on { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.55); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.3); }
.hero-tabs .subtab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; font-size: 11px; }
.subtab-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mm-filter { position: relative; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 5px; list-style: none; cursor: pointer;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--muted);
}
.filter-btn::-webkit-details-marker { display: none; }
.mm-filter[open] .filter-btn { color: var(--text); border-color: var(--accent); }
.mm-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 6;
  display: flex; flex-direction: column; gap: 6px; padding: 10px;
  border-radius: 12px; border: 1px solid var(--border); background: #0c2226; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap; font-size: 12px;
}
.mm-pop .chips { flex-wrap: nowrap; }

/* Teammates: one status line instead of the big own-card block. */
.lfg-status {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
}
.lfg-status .link { margin: 0; }
.lfg-state { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--muted); }
.lfg-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.lfg-state.is-on { color: var(--text); }
.lfg-state.is-on::before { background: var(--good); box-shadow: 0 0 8px rgba(127, 212, 160, 0.6); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.lfg-mycard { margin-bottom: 14px; }
.lfg-mycard summary { cursor: pointer; font-size: 13px; color: var(--accent); list-style: none; padding: 2px 2px 8px; }
.lfg-mycard summary::-webkit-details-marker { display: none; }

/* My profile: period chips + match-type filter in one row. */
.dash-filters { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.filter-btn.is-set { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.55); }

/* Toast: small confirmation above the floating tab bar, fades out by itself. */
.toast {
  position: fixed; left: 16px; right: 16px; z-index: 40;
  bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom));
  max-width: 460px; margin: 0 auto; padding: 10px 14px;
  border-radius: 14px; border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(12, 34, 38, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); color: var(--text); font-size: 14px; line-height: 1.4; text-align: center;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.is-shown { opacity: 1; transform: none; }
.pick-ico { color: var(--accent); opacity: 0.85; } /* line icon, mint like the nav icons */

/* App hidden/minimised (app.js setPaused): freeze every animation until it is back. */
html.app-paused *, html.app-paused *::before, html.app-paused *::after { animation-play-state: paused !important; }

/* One-time "add to home screen" offer, above the tab bar. */
.home-prompt {
  position: fixed; left: 16px; right: 16px; z-index: 35;
  bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom));
  max-width: 460px; margin: 0 auto; padding: 12px 14px;
  border-radius: 14px; border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(12, 34, 38, 0.95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); animation: rise 0.25s ease both;
}
.home-prompt[hidden] { display: none; }
.home-prompt p { margin: 0 0 10px; font-size: 14px; }
.home-prompt-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.home-prompt-actions .link { margin: 0; color: var(--muted); }

/* Share button in the match sheet header (same round style as the hero bell). */
.match-head { align-items: flex-start; }
.share-btn {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); color: var(--text);
}
.share-btn .ico, .hero-banner-actions .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Search: clear button inside the field, instant hero matches above player results. */
.search-field { position: relative; flex: 1; min-width: 0; display: flex; }
.search-field input { flex: 1; padding-right: 36px; }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center; /* vector cross: exactly centred */
  color: var(--muted); background: rgba(255, 255, 255, 0.06);
}
.search-clear svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search-field input:placeholder-shown + .search-clear { display: none; }
.hero-hits:empty { display: none; }
.hero-hits { margin: -4px 0 16px; }
.hero-hits-title { margin: 0 0 6px; font-size: 12px; }
.hero-hits-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.hero-hits-row::-webkit-scrollbar { display: none; }
.hero-hit {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  border-left: 3px solid var(--hero, var(--border)); font-weight: 600; font-size: 14px;
}
.hero-hit img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.item-hit img { border-radius: 6px; clip-path: inset(5% round 6px); } /* shop tile: no dark frame, square */
.hero-hits-row + .hero-hits-title { margin-top: 10px; }

/* Fullscreen (phones): Telegram draws its close / menu buttons over the top edge — keep the top bar below them. */
html.is-fullscreen .topbar {
  padding-top: calc(10px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
}

/* In-place update (app.js load): current content dims while new data loads, instead of a skeleton. */
.screen > * { transition: opacity 0.18s ease; }
.screen.is-updating > * { opacity: 0.55; }

/* Profile header: nickname with a Steam icon link to its right. */
.name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name-row .card-title { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steam-link { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: #c7d5e0; opacity: 0.9; }
.steam-link .ico { width: 18px; height: 18px; fill: currentColor; stroke: none; } /* filled official logo, Steam's light grey-blue */

/* Hero scene fades in if its image is still loading (app.js revealScenes); instant when already cached. */
.hero-scene { opacity: 0; transition: opacity 0.3s ease; }
.hero-scene.is-loaded { opacity: 1; }
.hero-scene.no-fade { transition: none; }
.hero-banner .hero-scene.is-loaded { opacity: 1; }

/* Tier legend in the tier list "?": same badges as on the screen, smaller. */
.tier-legend { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tier-legend li { display: flex; align-items: center; gap: 10px; color: var(--text); }
.tier-legend .tier-badge { width: 22px; height: 22px; font-size: 13px; border-radius: 6px; box-shadow: none; animation: none; flex: none; }
.legend-pick { display: flex; gap: 6px; align-items: flex-start; }
.legend-pick .ico { margin-top: 2px; }

/* "?" with its popover open: mint rim with a soft, slowly breathing glow. */
.info[open] > .info-btn {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.85);
  background: rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35), 0 0 10px rgba(var(--accent-rgb), 0.45);
  animation: info-glow 1.8s ease-in-out infinite;
}
@keyframes info-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.3), 0 0 6px rgba(var(--accent-rgb), 0.35); }
  50% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.55), 0 0 14px rgba(var(--accent-rgb), 0.6); }
}
html.no-motion .info[open] > .info-btn { animation: none; }

/* Team logo in place of the initials avatar (same box, transparent logos on a soft plate). */
.t-logo { object-fit: contain; padding: 3px; background: rgba(255, 255, 255, 0.05); box-sizing: border-box; }

/* Ranked season under the rank in My profile. */
.season { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 2px; max-width: 220px; }
.season-text { font-size: 12px; color: var(--muted); }
.season-bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.season-bar span { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* Item sheet with the game tooltip (app.js showGameTooltip). The sheet opens in this look at once:
   teal surface, slot-coloured top line, a placeholder with the real name/cost in the tooltip's header style.
   .is-game-ready: the themed, translated, sized tooltip replaces the placeholder with a short fade. */
.item-own[hidden] { display: none; }
.sheet-panel.has-game-tip { padding: 0 0 env(safe-area-inset-bottom); overflow-x: hidden; } /* tooltip edge to edge, grip over it */
.dl-game-tooltip { position: relative; }
.dl-game-tooltip dl-item-tooltip { display: block; width: 450px; } /* width/zoom set by fitTooltip */
.item-sheet:not(.is-game-ready) .dl-game-tooltip dl-item-tooltip { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
.item-sheet.is-game-ready .tip-skeleton { display: none; }
.item-sheet.is-game-ready .dl-game-tooltip dl-item-tooltip { animation: fade-in 0.18s ease both; }
.tip-sk-head {
  display: flex; flex-direction: column; gap: 4px; padding: 22px 16px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--slot) 30%, #11292d), #11292d 92%);
  border-bottom: 2px solid color-mix(in srgb, var(--slot) 65%, transparent);
}
.tip-sk-head b { font-family: var(--serif); font-size: 24px; font-weight: 800; color: #eee6d2; }
.tip-sk-head span { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #7fe3d0; }
.tip-sk-head img { width: 16px; height: 16px; }
.tip-sk-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 180px; }
.tip-sk-body .sk { height: 18px; border-radius: 6px; }
.tip-sk-body .sk:nth-child(2) { width: 80%; }
.tip-sk-body .sk:nth-child(3) { width: 60%; height: 64px; }

/* ===================== GPU-only animations =====================
   Every infinite animation changes only transform or opacity of a ready layer, so the phone's GPU composites
   it without repainting (animated gradients, filters and shadows were redrawn by the CPU every frame). */

/* S tier badge "breathes": a glow layer fades in and out. */
.tier-badge.tier-S { position: relative; }
.tier-badge.tier-S::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 20px rgba(224, 176, 79, 0.65); opacity: 0.35; animation: glow-pulse 3.6s ease-in-out infinite;
}
.tier-legend .tier-badge::after { display: none; }
@keyframes glow-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* "Live" dot: an expanding ring. */
.t-live-dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: rgba(143, 224, 122, 0.55);
  animation: ring-pulse 1.6s ease-out infinite;
}
@keyframes ring-pulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2.6); opacity: 0; } }

/* Ring mask shared by the hero frame and the S-card glare: only a 2 px border of the layer shows. */
.hero-frame, .card-glare {
  position: absolute; inset: 0; z-index: 2; padding: 2px; border-radius: inherit; pointer-events: none; overflow: hidden;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.hero-frame > span, .card-glare > span {
  position: absolute; left: 50%; top: 50%; aspect-ratio: 1; will-change: transform;
  transform: translate(-50%, -50%) rotate(var(--spin, 0deg));
}
@keyframes spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Hero banner frame: a conic ring (mint, steel teal, cream, the hero's colour) rotating as one layer. */
.hero-frame { inset: -1px; }
.hero-frame > span {
  width: 150%;
  background: conic-gradient(rgba(var(--accent-rgb), 0.95), var(--accent-2), var(--cream), var(--hero, var(--accent)),
    rgba(var(--accent-rgb), 0.35), var(--accent-2), rgba(var(--accent-rgb), 0.95));
  animation: spin 7s linear infinite;
}

/* S-card frame glare: a light arc on the card edge; it points where the phone tilts (--tilt-angle from app.js)
   or circles slowly without a tilt sensor. Faint mint ring underneath. */
.card-glare { background: rgba(var(--accent-rgb), 0.18); }
.card-glare > span {
  width: 170%;
  background: conic-gradient(transparent 0 62%, rgba(var(--accent-rgb), 0.7) 72%, #fff6de 80%, rgba(var(--accent-rgb), 0.7) 88%, transparent 96%);
  --spin: var(--tilt-angle, 0deg);
}
:root:not(.has-tilt) .card-glare > span { animation: spin 9s linear infinite; }

/* S-card foil: a fixed sheen image larger than the card, moved as a whole toward the tilt (or drifting). */
.art-card { --hx: var(--tilt-x, 0.5); --hy: var(--tilt-y, 0.5); }
.holo {
  position: absolute; inset: -40%; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0.26; will-change: transform;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.28), transparent 16%),
    linear-gradient(115deg, transparent 30%, rgba(92, 198, 162, 0.45) 40%, rgba(239, 228, 200, 0.4) 46%,
      rgba(77, 142, 163, 0.45) 52%, rgba(190, 150, 230, 0.3) 58%, transparent 68%);
  transform: translate(calc((var(--hx) - 0.5) * 45%), calc((var(--hy) - 0.5) * 45%));
}
:root:not(.has-tilt) .holo { animation: holo-drift 9s ease-in-out infinite alternate; }
.art-card:nth-child(2n) .holo, .art-card:nth-child(2n) .card-glare > span { animation-delay: -3s; }
.art-card:nth-child(3n) .holo, .art-card:nth-child(3n) .card-glare > span { animation-delay: -6s; }
@keyframes holo-drift {
  0% { transform: translate(-16%, -9%); }
  50% { transform: translate(16%, 2%); }
  100% { transform: translate(-7%, 16%); }
}
