/* Lightkeepers v0.11 shell: four tabs (Battle, Cards, Journey, Shop), menu
   and social sheets, daily chests and streak, card sheet with a recorded
   demo, rival profiles, Shop, emotes. Loaded after styles.css and town.css;
   same Nocturne tokens (ink glass, ivory, aged gold), no new fonts. */

/* ---------- header: avatar + trophies, wallet, social, menu ---------- */
.shell-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 6px;
  min-height: 60px; padding: calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 4px calc(10px + var(--safe-left));
}
.hdr-me {
  display: flex; align-items: center; gap: 9px; min-height: 44px; min-width: 0; max-width: max-content;
  padding: 3px 14px 3px 3px; border-radius: 999px; cursor: pointer; color: var(--ivory);
  background: rgba(6, 10, 30, .58); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 240, 210, .06); transition: border-color .2s, background-color .2s;
}
.hdr-me:hover { border-color: var(--line-strong); background-color: rgba(12, 17, 44, .7); }
.hdr-count { display: flex; align-items: center; gap: 4px; }
.hdr-count .hdr-trophy-icon { width: 15px; height: 15px; color: var(--gold-hot); }
.hdr-me .hdr-trophy-text b { font-size: 19px; }
.wallet {
  display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 44px; padding: 3px 12px 3px 9px;
  border-radius: 14px; cursor: pointer; color: var(--ivory); font: inherit;
  background: rgba(6, 10, 30, .58); border: 1px solid var(--line-soft);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.wallet:hover { border-color: var(--line); }
.coin { display: flex; align-items: center; gap: 5px; line-height: 1.1; }
.coin svg { width: 15px; height: 15px; }
.coin b { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.coin.gold svg { color: var(--gold-hot); }
.coin.moon svg { color: #b9c8ff; }
.shell-head .icon-btn svg { width: 21px; height: 21px; }

/* ---------- generated avatar (monogram on a seed colour) + frames ---------- */
.avatar {
  --av-hue: 40; --av-hue2: 220;
  position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 28%, hsl(var(--av-hue) 52% 64% / .95), hsl(var(--av-hue2) 42% 20%) 74%);
  box-shadow: inset 0 0 0 1px rgba(var(--tk-line-strong-rgb), .55), inset 0 0 0 3px rgba(4, 7, 22, .4), 0 2px 8px rgba(0, 0, 0, .35);
  color: var(--ivory); font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1;
}
.avatar .av-mono { text-shadow: 0 1px 4px rgba(2, 4, 16, .8); transform: translateY(1px); }
.avatar[data-glyph="diamond"] { border-radius: 30%; }
.avatar[data-kind="character"] { box-shadow: inset 0 0 0 1px rgba(var(--tk-jade-text-rgb), .6), inset 0 0 0 3px rgba(4, 7, 22, .4); }
.avatar.big { width: 52px; height: 52px; font-size: 26px; }
.avatar[data-frame]::before {
  content: ""; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none;
  border: 2px solid var(--gold-hot); box-shadow: 0 0 10px rgba(var(--tk-gold-hot-rgb), .45);
}
/* frame_silverfiligree: a cold silver double ring with a fine dotted filigree */
.avatar[data-frame="frame_silverfiligree"]::before {
  border: 2px solid #e4e9f6; outline: 1px dotted rgba(228, 233, 246, .85); outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(10, 14, 36, .9), 0 0 12px rgba(200, 214, 255, .5);
}

/* ---------- Battle: wordmark over the art, one action, today's chests ---------- */
.battle { justify-content: space-between; gap: 12px; }
.battle > :first-child { margin-top: clamp(2px, 2.5vh, 26px); }
.battle .brand { gap: 0; }
.battle h1 { font-size: clamp(24px, 7.4vw, 36px); }
.battle-dock { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
/* Hero spacer (v0.14: empty, the key art shows through): takes only the space
   left between wordmark and dock (flex basis 0, min-height 0, capped), so it
   can never push the dock or tabs off screen. */
.battle-hero { position: relative; flex: 1 1 0; min-height: 0; max-height: 420px; width: 100%; pointer-events: none; }
.battle-dock .error:empty { display: none; }
.battle-dock .error { text-align: center; }
.deck-summary .ds-icons { margin-left: auto; }
.btn.battle-btn {
  min-height: 64px; border-radius: 18px; font-size: 28px; letter-spacing: .16em; text-transform: uppercase; padding-left: .16em;
}
.daily {
  padding: 10px 12px 12px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 19, 46, .74), rgba(7, 10, 28, .88)); border: 1px solid var(--line-soft);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 240, 210, .05);
}
.daily-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.daily-title { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.daily-count { margin-left: 6px; color: var(--muted); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--gold-hot); white-space: nowrap; }
.streak svg { width: 15px; height: 15px; }
.streak.celebrate { animation: streak-glow 1.6s var(--ease) 1; }
.chest-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.chest-slots:has(.older) { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.chest-slot { display: flex; }
.chest {
  flex: 1; min-height: 52px; min-width: 44px; border-radius: 14px; display: grid; place-items: center; position: relative;
  border: 1px solid var(--line-soft); background: rgba(3, 6, 20, .45); color: var(--muted); font: inherit;
}
.chest svg { width: 28px; height: 28px; }
.chest .chest-art { width: 38px; height: 38px; overflow: visible; }
.chest.empty { border-style: dashed; opacity: .6; }
.chest.empty .chest-art { opacity: .35; filter: grayscale(1); }
.chest.opened { color: rgba(var(--tk-gold-rgb), .55); }
.chest.opened .chest-art { opacity: .5; filter: saturate(.45); }
.chest.opened .ch-lid { transform: rotate(-58deg) scaleY(.9); }
.chest.opened .ch-petal-in { opacity: .85; }
.chest.opened::after {
  content: ""; position: absolute; right: 7px; bottom: 7px; width: 5px; height: 9px;
  border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: rotate(45deg);
}
button.chest { cursor: pointer; }
.chest.ready {
  color: var(--tk-gilt-ink); border-color: rgba(250, 236, 196, .85);
  background: radial-gradient(90% 80% at 50% 62%, rgba(255, 222, 150, .38), rgba(34, 44, 102, .92) 62%, rgba(14, 19, 52, .96));
  box-shadow: inset 0 1px 0 rgba(var(--tk-cv-gold-hot-rgb), .45), 0 0 18px rgba(245, 210, 140, .32);
  animation: chest-breathe 2.8s ease-in-out infinite;
}
.chest.ready .ch-glow { opacity: .5; }
.chest.ready .ch-lit { opacity: .35; }
.chest.ready:disabled { animation: none; filter: saturate(.5); cursor: default; }
/* Waiting for the server: the closed gift rocks on its plinth; it never opens here. */
.chest.ready[aria-busy="true"] { animation: none; }
.chest[aria-busy="true"] .ch-box { animation: chest-shake .5s ease-in-out infinite; }
body.reduced .chest[aria-busy="true"] { opacity: .75; } /* still: body.reduced turns the shake off */
.chest.older { padding: 0 10px; font-weight: 700; font-size: 14px; color: var(--gold-hot); border-color: var(--line); }
.daily-note { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.daily-note:empty { display: none; }
.daily-note[data-kind="bad"] { color: var(--danger); }
@keyframes chest-breathe { 50% { box-shadow: inset 0 1px 0 rgba(var(--tk-cv-gold-hot-rgb), .55), 0 0 26px rgba(245, 210, 140, .55); } }
@keyframes chest-shake { 0%, 100% { transform: none; } 20% { transform: rotate(-5deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
@keyframes streak-glow { 0% { transform: scale(.9); text-shadow: none; } 40% { transform: scale(1.08); text-shadow: 0 0 12px rgba(255, 214, 140, .9); } 100% { transform: none; } }

/* ---------- panels: shared head, disclosures ---------- */
.panel-head { display: flex; align-items: center; gap: 10px; }
.panel-head .panel-title { margin: 2px 0 0; flex: 1; }
.panel-head .icon-btn { flex: none; }
.btn.slim { min-height: 40px; padding: 6px 14px; font-size: 13.5px; }
details.more > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 14px;
  border-radius: 14px; cursor: pointer; list-style: none; color: var(--ivory); font-weight: 600; font-size: 14px;
  border: 1px solid var(--line-soft); background: rgba(3, 6, 20, .5);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
details.more[open] > summary { margin-bottom: 8px; }
details.more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.journey-block.more { padding: 6px; }
details.journey-block.more > summary { border: 0; background: transparent; }
details.journey-block.more > :not(summary) { margin: 0 10px 8px; }

/* ---------- Cards: four slots, collection grid ---------- */
.deck-slots .slot { padding: 0; }
.slot-open {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; min-height: 84px; padding: 8px 4px;
  border: 0; border-radius: 14px; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.slot-open:hover { background: rgba(255, 255, 255, .03); }
.deck-slots .slot.empty { align-items: center; justify-content: center; min-height: 84px; }
.deck-slots .slot-cost {
  position: absolute; top: 6px; left: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--tk-gilt-ink); background: linear-gradient(180deg, var(--tk-gilt-top), var(--tk-gilt-base));
}
.deck-slots .slot .slot-key { top: auto; bottom: 5px; left: 8px; }
.slot-remove { min-width: 36px; min-height: 36px; border-radius: 0 14px 0 12px; }
.deck-presets .preset { align-items: center; justify-content: center; min-height: 40px; padding: 6px 8px; text-align: center; }
.deck-presets .preset b { font-size: 15.5px; }
.collection-title { margin-top: 4px; }
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.card-tile {
  position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 9px;
  border-radius: 16px; border: 1px solid var(--line-soft); cursor: pointer; color: var(--ivory); font: inherit;
  background: linear-gradient(180deg, rgba(var(--tk-glass-hi-rgb), .88), rgba(8, 11, 30, .92));
  box-shadow: inset 0 1px 0 rgba(255, 240, 210, .05); transition: border-color .2s, transform .12s var(--ease);
}
.card-tile:hover { border-color: var(--line); }
.card-tile:active { transform: translateY(1px); }
.card-grid li.in-deck .card-tile { border-color: rgba(var(--tk-line-strong-rgb), .55); box-shadow: inset 0 1px 0 rgba(255, 240, 210, .06), 0 0 0 1px rgba(var(--tk-line-rgb), .22); }
.ct-art {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: var(--gold-hot);
  background: radial-gradient(circle at 50% 32%, rgba(64, 76, 140, .55), rgba(6, 9, 26, .95) 72%);
  box-shadow: inset 0 0 0 1px rgba(var(--tk-line-strong-rgb), .5), inset 0 0 0 4px rgba(4, 7, 22, .6);
}
.ct-art svg { width: 36px; height: 36px; }
.ct-art .portrait { display: none; width: 52px; height: 52px; }
.card-grid li.has-art .ct-art .portrait { display: block; }
.card-grid li.has-art .ct-art svg { display: none; }
.ct-art .portrait-img { width: 52px; height: 52px; object-fit: contain; border-radius: 50%; }
.card-grid li.has-img .ct-art svg { display: none; }
.card-grid li.has-art .ct-art .portrait-img { display: none; } /* the collector bust replaces the Gleaner image */
.ct-cost {
  position: absolute; top: 7px; left: 7px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--tk-gilt-ink); background: linear-gradient(180deg, var(--tk-gilt-top), var(--tk-gilt-base));
}
.ct-name { font-family: var(--display); font-weight: 500; font-size: 17px; line-height: 1.1; }
.ct-in { font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-hot); visibility: hidden; }
.card-grid li.in-deck .ct-in { visibility: visible; }
.rules-more .rule-list { border-radius: 14px; }

/* card prestige (cosmetic): a pearl finish on the card's frame wherever it shows */
[data-prestige] > .card-tile, .deck-slots .slot[data-prestige], .card[data-prestige], .cs-art[data-prestige], .si-card[data-prestige] {
  border-color: rgba(236, 240, 255, .85);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 0 0 1px rgba(190, 205, 255, .25), 0 0 16px rgba(214, 224, 255, .28);
}
[data-prestige] > .card-tile, .deck-slots .slot[data-prestige], .cs-art[data-prestige], .si-card[data-prestige] {
  background:
    linear-gradient(125deg, rgba(255, 236, 246, .14), rgba(214, 236, 255, .06) 40%, rgba(255, 250, 225, .12) 70%, rgba(210, 225, 255, .08)),
    linear-gradient(180deg, rgba(26, 32, 70, .92), rgba(10, 13, 34, .94));
}
.card[data-prestige] { outline: 1px solid rgba(236, 240, 255, .6); outline-offset: -3px; }

/* ---------- card sheet ---------- */
.card-sheet { width: min(460px, calc(100% - 20px)); }
.cs-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cs-art {
  flex: none; width: 60px; height: 60px; overflow: hidden; border-radius: 14px; display: grid; place-items: center; color: var(--gold-hot);
  border: 1px solid var(--line); background: radial-gradient(circle at 50% 30%, rgba(64, 76, 140, .6), rgba(6, 9, 26, .95) 75%);
}
.cs-art svg { width: 34px; height: 34px; }
.cs-art .cs-portrait { display: block; width: 100%; height: 100%; }
.cs-art.has-portrait svg { display: none; }
.cs-meta { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cs-prestige {
  font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  color: #eef2ff; border: 1px solid rgba(236, 240, 255, .6); background: rgba(214, 224, 255, .1);
}
.cs-body { display: flex; flex-direction: column; gap: 10px; }
.cs-role { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ivory); }
.cs-demo {
  position: relative; margin: 0; border-radius: 14px; overflow: hidden; min-height: 64px; display: flex; flex-direction: column; flex: none; /* never shrink: it clipped Play/Pause */
  background: radial-gradient(90% 70% at 50% 30%, var(--tk-panel-glow), #070b1f); border: 1px solid var(--line-soft);
}
.cs-canvas { display: block; width: 100%; height: 240px; }
.cs-demo-status { margin: 0; padding: 22px 12px; text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.cs-retry { align-self: center; margin: -10px 0 14px; }
.cs-demo-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-top: 1px solid var(--line-soft); }
.cs-demo-bar:has(.cs-play[hidden]) { display: none; }
.cs-caption { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--text); }
.cs-scenes { display: flex; gap: 4px; }
.cs-scene {
  min-width: 36px; min-height: 36px; border-radius: 10px; border: 1px solid var(--line-soft); cursor: pointer;
  background: rgba(3, 6, 20, .55); color: var(--muted); font: inherit; font-size: 13px; font-weight: 700;
}
.cs-scene[aria-pressed="true"] { color: var(--gold-hot); border-color: var(--line); background: rgba(var(--tk-line-rgb), .12); }
.cs-play { flex: none; min-height: 36px; padding: 4px 12px; }
.cs-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cs-stats div { padding: 7px 10px; border-radius: 12px; background: rgba(3, 6, 20, .5); border: 1px solid var(--line-soft); min-width: 0; }
.cs-stats dt { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.cs-stats dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; color: var(--ivory); }
.cs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cs-actions .btn { min-height: 46px; font-size: 15px; }
.cs-deck-note { font-size: 12.5px; }
.cs-deck-note:empty { display: none; }
.cs-rules p { margin: 0 2px 8px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.cs-rules b { color: var(--ivory); font-weight: 600; }

/* ---------- menu and social sheets ---------- */
.menu-body { display: flex; flex-direction: column; gap: 14px; }
.menu-group { display: flex; flex-direction: column; gap: 6px; }
.menu-label { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.menu-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .03); color: var(--ivory);
  font: inherit; font-weight: 600; font-size: 15px; text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s;
}
.menu-row:hover { border-color: var(--line); background: rgba(255, 255, 255, .05); }
.menu-row:disabled { opacity: .45; cursor: default; }
.menu-row svg { width: 22px; height: 22px; color: var(--gold-hot); }
.mr-note { font-size: 11px; font-weight: 600; color: var(--muted); }
.mr-note:empty { display: none; }
.training-entry[data-state="none"] .mr-note {
  padding: 1px 7px; border-radius: 999px; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tk-gilt-ink); background: linear-gradient(180deg, var(--tk-gilt-hi), var(--tk-gilt-lo));
}
.training-entry[data-state="done"] .mr-note { color: var(--tk-jade-text); }
.menu-fine { margin: 0 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.menu-body .practice-row { padding: 6px; gap: 6px; }
.menu-body .practice-row .menu-row { border-color: transparent; background: transparent; }
/* Three equal columns, each label under its 44 px button (the column flow fills
   button then label): one row of button + label for all three needs more than
   a 360 px sheet has, and overran it sideways. */
.menu-toggles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; grid-auto-flow: column;
  justify-items: center; align-items: center; gap: 4px 8px;
}
.mt-label { max-width: 100%; font-size: 13px; font-weight: 600; color: var(--text); text-align: center; overflow-wrap: anywhere; }
#btn-emote-mute-home[aria-pressed="true"] { color: var(--gold-hot); border-color: var(--line-strong); background-color: rgba(var(--tk-line-rgb), .14); }
/* display: the older `@media (max-height: 820px) { .brand-note { display: none } }`
   in styles.css was meant for the old Battle tab; in the menu it always shows. */
.menu-body .brand-note { display: block; align-self: center; margin: 2px 0 0; }
.menu-body details.more .keep-body, .menu-body details.more.research > :not(summary) { padding: 0 2px 4px; }
.menu-body .keep summary, .menu-body .research summary { margin: 0; letter-spacing: normal; text-transform: none; font-size: 14px; color: var(--ivory); padding: 0 14px; }
.research-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; font-size: 14px; }
.research-choice input { width: 20px; height: 20px; accent-color: var(--gold); }
.join-form { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Journey ---------- */
.journey .journey-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.journey-id { display: flex; flex-direction: column; min-width: 0; }
.journey-name { margin: 0; font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journey-tag { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.journey .journey-total { align-items: flex-end; text-align: right; }
.journey .record { margin: 0; text-align: left; }
.journey .record div { justify-content: flex-start; }
.season-line { font-size: 12px; }
.recent-summary { margin: 2px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.recent-summary div { display: flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(3, 6, 20, .5); border: 1px solid var(--line-soft); font-size: 12px; }
.recent-summary dt { color: var(--muted); font-weight: 600; }
.recent-summary dd { margin: 0; color: var(--ivory); font-weight: 600; font-variant-numeric: tabular-nums; }
.recent-list .rc-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.rc-cat { font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.recent-list li[data-cat="practice"] .rc-cat, .recent-list li[data-cat="computer"] .rc-cat { color: var(--tk-jade-text); }
.rc-detail { font-size: 11px; color: var(--muted); }
.rc-who.link {
  padding: 6px 0; margin: -6px 0; border: 0; background: transparent; font: inherit; color: var(--ivory); cursor: pointer; text-align: left;
  text-decoration: underline dotted rgba(var(--tk-line-rgb), .7); text-underline-offset: 3px; max-width: 100%;
}
.rc-who.link:hover { color: var(--gold-hot); }

/* ---------- rival profile ---------- */
.rival-body { display: flex; flex-direction: column; gap: 10px; }
.rv-head { display: flex; align-items: center; gap: 12px; }
.rv-head .avatar { width: 56px; height: 56px; font-size: 28px; }
.rv-id { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.rv-name { font-family: var(--display); font-weight: 500; font-size: 24px; color: var(--ivory); }
.rv-tag { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.rv-desc { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); }
.rv-stats { margin: 0; display: grid; gap: 0; padding: 2px 12px; border-radius: 14px; background: rgba(3, 6, 20, .5); border: 1px solid var(--line-soft); }
.rv-stats div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(var(--tk-line-rgb), .1); }
.rv-stats div:first-child { border-top: 0; }
.rv-stats dt { color: var(--gold); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.rv-stats dd { margin: 0; font-weight: 600; color: var(--ivory); font-variant-numeric: tabular-nums; }
.rv-sub { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.rv-deck { display: flex; gap: 10px; }
.rv-deck .deck-ic { width: 30px; height: 30px; }

/* ---------- chest reveal ---------- */
.chest-sheet { width: min(340px, calc(100% - 40px)); }
.chest-card { align-items: center; text-align: center; padding: 22px 18px 18px; }
/* v0.14 reveal (chest-art.js ChestReveal): each layer is its own <use>.
   v0.24 Moon Gift: one 0 0 120 120 box for every layer; closed and open are
   the same nodes, open is transforms only. Petals hinge about (57px, 86px),
   the right one mirrored in chest-art.js; the plinth never moves in the reveal.
   celebrate: latch, petals swing open, the pearl lifts and lights, sparkles,
   then the contents (about 1.55 s; a tap, Enter or Space finishes it).
   quiet: already open, no burst.
   Reduced motion: every animation is off (body.reduced); the reveal shows
   the still final picture (done). */
.moon-gift .ch-box { transform-origin: 60px 104px; } /* the busy rock pivots on the plinth */
.moon-gift .ch-lid { transform-origin: 57px 86px; }
.moon-gift .ch-orb { transform-origin: 60px 63px; }
.moon-gift .ch-petal-in, .moon-gift .ch-lit { opacity: 0; }
.moon-gift .ch-glow, .moon-gift .ch-beam, .moon-gift .ch-spark { opacity: 0; }
.moon-gift .ch-glow, .moon-gift .ch-beam { transform-origin: 60px 63px; }
.moon-gift .ch-spark { transform-box: fill-box; transform-origin: center; }

.chest-stage { width: 168px; height: 168px; display: grid; place-items: center; }
.chest-stage .chest-art { width: 168px; height: 168px; overflow: visible; }
.chest-stage[data-reveal="quiet"] .ch-lid,
.chest-stage[data-reveal="done"] .ch-lid { transform: rotate(-58deg) scaleY(.9); }
.chest-stage[data-reveal="quiet"] .ch-petal-in,
.chest-stage[data-reveal="done"] .ch-petal-in { opacity: .85; }
.chest-stage[data-reveal="done"] .ch-orb { transform: translateY(-5px); }
.chest-stage[data-reveal="done"] .ch-lit { opacity: 1; }
.chest-stage[data-reveal="done"] .ch-glow { opacity: .9; }
.chest-stage[data-reveal="done"] .ch-beam { opacity: .8; }
.chest-stage[data-reveal="quiet"] .ch-lit { opacity: .4; }
.chest-stage[data-reveal="quiet"] .ch-beam { opacity: .3; }
.chest-stage[data-reveal="celebrate"] { animation: chest-run 1.55s linear both; }
.chest-stage[data-reveal="celebrate"] .ch-lid { animation: mg-hinge 1.06s linear both; }
.chest-stage[data-reveal="celebrate"] .ch-petal-in { animation: mg-face .5s ease-in .32s both; }
.chest-stage[data-reveal="celebrate"] .ch-clasp { animation: mg-latch .3s ease-out .14s both; }
.chest-stage[data-reveal="celebrate"] .ch-orb { animation: mg-lift .72s cubic-bezier(.3, .8, .3, 1) .38s both; }
.chest-stage[data-reveal="celebrate"] .ch-lit { animation: mg-lit .7s ease-out .4s both; }
.chest-stage[data-reveal="celebrate"] .ch-glow { animation: chest-bloom .8s var(--ease, ease-out) .45s both; }
.chest-stage[data-reveal="celebrate"] .ch-beam { animation: mg-ring .8s ease-out .55s both; }
.chest-stage[data-reveal="celebrate"] .ch-spark { animation: mg-mote .9s ease-out both; }
.chest-stage[data-reveal="celebrate"] .s1 { animation-delay: .52s; }
.chest-stage[data-reveal="celebrate"] .s2 { animation-delay: .6s; }
.chest-stage[data-reveal="celebrate"] .s3 { animation-delay: .7s; }
.chest-stage[data-reveal="celebrate"] .s4 { animation-delay: .56s; }
.chest-stage[data-reveal="celebrate"] .s5 { animation-delay: .64s; }
.chest-stage[data-reveal="celebrate"] .s6 { animation-delay: .76s; }
.chest-stage[data-reveal="celebrate"] .s7 { animation-delay: .68s; }
.chest-stage[data-reveal="celebrate"] ~ .chest-contents { animation: chest-contents .45s var(--ease, ease-out) 1s both; }
/* Pinch in 2° (latch tension), release at 0.2 s, swing with weight, ~4% overshoot, settle. */
@keyframes mg-hinge {
  0% { transform: none; animation-timing-function: ease-in-out; }
  19% { transform: rotate(2deg); animation-timing-function: cubic-bezier(.3, .05, .3, 1); }
  79% { transform: rotate(-61deg) scaleY(.89); animation-timing-function: ease-in-out; }
  100% { transform: rotate(-58deg) scaleY(.9); }
}
@keyframes mg-face { from { opacity: 0; } to { opacity: .85; } }
@keyframes mg-latch { 0% { filter: none; } 40% { filter: brightness(1.6); } 100% { filter: none; } }
@keyframes mg-lift { from { transform: none; } to { transform: translateY(-5px); } }
@keyframes mg-lit { from { opacity: 0; } 60% { opacity: 1; } to { opacity: 1; } }
@keyframes mg-ring { from { opacity: 0; transform: scale(.7); } to { opacity: .8; transform: none; } }
@keyframes mg-mote { 0% { opacity: 0; transform: translateY(4px) scale(.3); } 30% { opacity: 1; transform: translateY(-3px) scale(1); } 100% { opacity: 0; transform: translateY(-16px) scale(.5); } }
/* The stage's own run: its animationend is what ends a celebration (ChestReveal). */
@keyframes chest-run { to { opacity: 1; } }
@keyframes chest-bloom { from { opacity: 0; transform: scale(.4); } 60% { opacity: 1; } to { opacity: .9; transform: none; } }
@keyframes chest-contents { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
.chest-card { cursor: default; }
.chest-card h2 { margin: 2px 0 0; font-family: var(--display); font-weight: 500; font-size: 26px; color: var(--ivory); }
.chest-contents { margin: 0; font-family: var(--display); font-size: 24px; color: var(--gold-hot); }
.chest-note { font-size: 12.5px; }
.chest-card .btn { align-self: stretch; }
@keyframes chest-open { 0% { transform: scale(.6) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: none; } }

/* ---------- emote art (original atlas: 3 columns × 2 rows of square cells) ---------- */
.emote-art {
  display: inline-block; flex: none; width: 56px; height: 56px; border-radius: 22%;
  background-color: var(--tk-panel-top); background-image: url('/assets/emotes-v1/collector-expressions.png');
  background-size: 300% 200%; background-repeat: no-repeat; background-position: 0% 0%;
  box-shadow: inset 0 0 0 1px rgba(var(--tk-line-strong-rgb), .45);
}
.emote-art[data-emote="emote_wave"] { background-position: 0% 0%; }
.emote-art[data-emote="emote_wellplayed"] { background-position: 50% 0%; }
.emote-art[data-emote="emote_goodluck"] { background-position: 100% 0%; }
.emote-art[data-emote="emote_thanks"] { background-position: 0% 100%; }
.emote-art[data-emote="emote_moonwave"] { background-position: 50% 100%; }
.emote-art[data-emote="emote_lanterncheer"] { background-position: 100% 100%; }
/* v0.14 ensemble sheet: 2 × 2 cells, its own class (emotes.js); v1 above unchanged. */
.emote-art.ensemble { background-image: url('/assets/emotes-v2/ensemble.png'); background-size: 200% 200%; }
.emote-art.ensemble[data-emote="emote_respect"] { background-position: 0% 0%; }
.emote-art.ensemble[data-emote="emote_wow"] { background-position: 100% 0%; }
.emote-art.ensemble[data-emote="emote_onward"] { background-position: 0% 100%; }
.emote-art.ensemble[data-emote="emote_bravo"] { background-position: 100% 100%; }
.emote-art.star {
  display: inline-grid; place-items: center; background-image: radial-gradient(circle at 50% 42%, rgba(255, 226, 150, .35), var(--tk-panel-top) 68%);
  color: var(--gold-hot);
}
.emote-art.star svg { width: 58%; height: 58%; }

/* ---------- Shop: compact shelves, two columns on phones ---------- */
.shop-panel .panel-head { align-items: flex-start; }
.shop-info { position: relative; flex: none; margin-top: 6px; }
.shop-info > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 600; color: var(--gold-hot); background: rgba(3, 6, 20, .6); border: 1px solid var(--line-soft);
}
.shop-info > summary::-webkit-details-marker { display: none; }
.shop-info > summary svg { width: 15px; height: 15px; }
.shop-info[open] > summary { border-color: var(--line); }
.shop-info-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 3; width: min(280px, calc(100vw - 40px)); margin: 0;
  padding: 12px 14px; border-radius: 14px; font-size: 12.5px; line-height: 1.5; color: var(--text);
  background: #0b1030; border: 1px solid var(--line); box-shadow: 0 16px 36px rgba(0, 0, 0, .55);
}
.shop-status { margin: 0; font-size: 13px; font-weight: 600; }
.shop-status:empty { display: none; }
.shop-status[data-kind="ok"] { color: var(--gold-hot); }
.shop-status[data-kind="bad"] { color: var(--danger); }
.shop-root { display: flex; flex-direction: column; gap: 14px; }
.shop-empty { margin: 12px 0; padding: 16px; border-radius: 16px; text-align: center; color: var(--muted); background: rgba(3, 6, 20, .6); border: 1px solid var(--line-soft); }
.shop-shelf { display: flex; flex-direction: column; gap: 8px; }
.shop-shelf-title { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.shop-shelf-empty { margin: 0; font-size: 12.5px; color: var(--muted); }
.shop-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shop-mine .shop-grid { margin-top: 2px; }
.shop-tile {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px;
  border-radius: 16px; border: 1px solid var(--line-soft); cursor: pointer; color: var(--ivory); font: inherit; text-align: center;
  background: linear-gradient(180deg, #161d45, var(--tk-panel-deep)); box-shadow: inset 0 1px 0 rgba(255, 240, 210, .05);
  transition: border-color .2s, transform .12s var(--ease);
}
.shop-tile:hover { border-color: var(--line); }
.shop-tile:active { transform: translateY(1px); }
.shop-tile.equipped { border-color: rgba(var(--tk-line-strong-rgb), .6); }
.si-visual { width: 64px; height: 64px; display: grid; place-items: center; }
.si-visual .emote-art { width: 64px; height: 64px; }
.si-visual .avatar { width: 46px; height: 46px; font-size: 23px; }
.si-visual.big { width: 112px; height: 112px; align-self: center; }
.si-visual.big .emote-art { width: 112px; height: 112px; }
.si-visual.big .avatar { width: 76px; height: 76px; font-size: 38px; }
.si-visual.big .si-card { width: 70px; height: 88px; }
.si-visual.big .si-card svg { width: 46px; height: 46px; }
.si-bubble {
  max-width: 64px; padding: 5px 8px; border-radius: 12px 12px 12px 4px; font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center;
  color: var(--tk-gilt-ink); background: var(--ivory);
}
.si-card { width: 46px; height: 58px; border-radius: 10px; display: grid; place-items: center; color: var(--gold-hot); border: 1px solid var(--line); background: #10163a; }
.si-card svg { width: 30px; height: 30px; }
.st-name { font-family: var(--display); font-weight: 500; font-size: 16px; line-height: 1.15; color: var(--ivory); }
.st-foot { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; }
.st-price { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shop-tile.short .st-price { color: var(--muted); }
.st-status { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-hot); }
.shop-tile.owned:not(.equipped) .st-status { color: var(--muted); }
.si-cur { width: 16px; height: 16px; color: var(--gold-hot); }
.si-cur.moon { color: #b9c8ff; }
/* item sheet: the details and the one action */
.item-sheet { width: min(400px, calc(100% - 24px)); }
.item-body { display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: center; }
.is-kind { margin: 2px 0 0; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.is-says { margin: 0; font-family: var(--display); font-size: 19px; color: var(--ivory); }
.is-desc { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text); }
.is-note { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.is-act { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.is-buy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-variant-numeric: tabular-nums; }
.is-buy .si-cur { color: var(--tk-gilt-ink); }
.is-short { margin: 0; font-size: 12.5px; color: var(--muted); }
.is-state { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-hot); }
.is-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; text-align: left; }
.is-slots-label { grid-column: 1 / -1; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.is-slot {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 8px; border-radius: 12px; border: 1px solid var(--line-soft); cursor: pointer;
  background: rgba(3, 6, 20, .6); color: var(--ivory); font: inherit; font-size: 13px; font-weight: 600; text-align: left;
}
.is-slot .emote-art { width: 36px; height: 36px; }
.is-slot:hover { border-color: var(--line); }
.is-slot:disabled { opacity: .5; cursor: default; }
.item-sheet #item-status { text-align: center; }
@media (min-width: 560px) {
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- daily chest info ---------- */
/* A 44 px target; the negative margins keep the Daily chests row as tall as
   before, so the Battle tab still fits 360x640 without page scroll. */
.info-btn {
  flex: none; width: 44px; height: 44px; margin: -10px -10px -10px 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: transparent; color: var(--muted); cursor: pointer;
}
.info-btn svg { width: 18px; height: 18px; }
.info-btn:hover { color: var(--gold-hot); }
.daily-head .streak { margin-left: auto; }
.info-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--text); }
.info-list b { color: var(--ivory); }

/* ---------- in-match emotes ---------- */
.emote-tray {
  position: absolute; right: 58px; top: 10px; z-index: 7; width: min(240px, calc(100% - 76px));
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 16px;
  background: #080c26; border: 1px solid var(--line); box-shadow: 0 16px 36px rgba(0, 0, 0, .5);
}
.emote-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.emote-btn, .emote-mute {
  min-height: 44px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line-soft); cursor: pointer;
  background: #121840; color: var(--ivory); font: inherit; font-size: 12.5px; font-weight: 600;
}
.emote-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; line-height: 1.2; }
.emote-btn .emote-art { width: 52px; height: 52px; }
.emote-btn:disabled { opacity: .45; cursor: default; }
.emote-mute { font-size: 12px; color: var(--muted); }
.emote-mute[aria-pressed="true"] { color: var(--gold-hot); border-color: var(--line); }
.emote-note { margin: 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.emote-note:empty { display: none; }
.emote-bubble {
  position: absolute; left: 50%; z-index: 5; margin: 0; max-width: 72%; padding: 6px 14px 6px 6px; border-radius: 16px; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  transform: translateX(-50%); font-weight: 600; font-size: 14px; line-height: 1.25; text-align: left;
  color: var(--tk-gilt-ink); background: rgba(var(--tk-ivory-rgb), .97); box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}
.emote-bubble .emote-art { width: 48px; height: 48px; box-shadow: none; }
.emote-bubble.theirs { top: 14%; border-bottom-left-radius: 4px; }
.emote-bubble.mine { bottom: 12%; border-top-right-radius: 4px; }
.emote-bubble.pop { animation: emote-in .28s var(--ease) both; }
@keyframes emote-in { from { transform: translate(-50%, 6px) scale(.9); opacity: 0; } }
@media (min-width: 700px) {
  .emote-tray { right: 8px; }
}

/* ---------- result: daily reward line and rival link ---------- */
.rp-reward { margin: 0; text-align: center; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--gold-hot); }
.rp-reward[data-qualified="false"] { font-weight: 500; color: var(--muted); }
.result-rival { align-self: center; min-height: 36px; padding: 4px 14px; font-size: 13px; }

/* ---------- reading tabs: an opaque backing so the key art never competes with text ---------- */
#app[data-tab="cards"] .keyart-veil,
#app[data-tab="journey"] .keyart-veil,
#app[data-tab="shop"] .keyart-veil,
#app[data-tab="trials"] .keyart-veil { background: #070b20; }
#app[data-tab="cards"] .keyart-img,
#app[data-tab="journey"] .keyart-img,
#app[data-tab="shop"] .keyart-img,
#app[data-tab="trials"] .keyart-img { opacity: .1; }

/* ---------- fit: short phones, tiny heights, desktop ---------- */
@media (max-height: 680px) {
  .shell-head { min-height: 56px; padding-top: calc(6px + var(--safe-top)); }
  .btn.battle-btn { min-height: 56px; font-size: 24px; }
  .daily { padding: 8px 10px 10px; }
  .chest { min-height: 46px; }
  .chest svg { width: 24px; height: 24px; }
  .chest .chest-art { width: 32px; height: 32px; }
  .card-tile { padding: 12px 4px 7px; }
  .ct-art { width: 50px; height: 50px; }
  .ct-art svg { width: 30px; height: 30px; }
  .cs-canvas { height: 220px; }
}
@media (max-height: 480px) {
  .battle .brand { display: none; }
  .battle-hero { display: none; }
  .shell-head { min-height: 52px; padding-top: calc(4px + var(--safe-top)); padding-bottom: 2px; }
  .cs-canvas { height: 200px; }
}
@media (max-width: 350px) {
  .wallet { padding: 3px 8px 3px 6px; }
  .hdr-me { padding-right: 10px; }
  .hdr-me #hdr-title { display: none; }
}
@media (min-width: 900px) and (min-height: 560px) {
  .shell-head { padding-left: 16px; padding-right: 16px; min-height: 76px; }
  .battle { justify-content: center; }
  .battle > :first-child { margin-top: auto; }
  .battle .brand { align-items: flex-start; margin-bottom: 18px; }
  .battle-dock { margin-top: 0; margin-bottom: auto; }
}

/* ---------- v0.12: new cards, unlocks, Try, Season 1, leaderboard ---------- */
/* Cards: the unlock path line and the catalogue retry. */
.collection-bar { display: flex; align-items: center; gap: 8px; margin: -2px 0 2px; }
.collection-status { flex: 1; font-size: 12px; line-height: 1.4; }
.collection-status:empty { display: none; }
.collection-status[data-kind="bad"] { color: var(--danger); }
.collection-bar .btn { flex: none; }
/* A locked tile: dimmed art, a small lock with the battles it needs. Still a
   button (it opens the sheet, where Try is offered). */
.ct-lock { display: none; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-lock svg { width: 12px; height: 12px; }
.card-grid li.locked .ct-lock { display: inline-flex; }
.card-grid li.locked .ct-in { display: none; }
.card-grid li.locked .ct-art { opacity: .55; filter: grayscale(.6); }
.card-grid li.locked .card-tile { border-style: dashed; }
.deck-slots .slot[data-locked="true"] { border-style: dashed; }
.deck-status[data-kind="locked"], .deck-status[data-kind="unconfirmed"] { color: var(--gold-hot); }

/* Card sheet: lock status, counterplay, what Try is, Training as a separate choice. */
.cs-lock { margin: 0; padding: 7px 10px; border-radius: 12px; font-size: 13px; line-height: 1.4; color: var(--gold-hot); border: 1px dashed var(--line); background: rgba(var(--tk-line-rgb), .06); }
.cs-counter { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.cs-counter:empty { display: none; }
.cs-try-note { font-size: 12px; }
.cs-learn { align-self: flex-start; }
.cs-rules-new p { margin: 0 2px 8px; font-size: 13.5px; line-height: 1.5; color: var(--text); }

/* Journey: Season 1, kept apart from trophies and the preseason archive. */
.season1 { margin: 10px 0 2px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(3, 6, 20, .5); display: flex; flex-direction: column; gap: 4px; }
.s1-head { display: flex; align-items: center; gap: 10px; }
.s1-title { margin: 0; flex: 1; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.s1-rating { font-size: 22px; font-weight: 700; color: var(--ivory); font-variant-numeric: tabular-nums; }
.s1-head .btn { min-height: 44px; }
.s1-progress { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.s1-fine { font-size: 11.5px; line-height: 1.4; }

/* Leaderboard sheet: rank, avatar, name (a profile link when the row has a ref), rating, record. */
.board-sheet { width: min(460px, calc(100% - 20px)); }
.board-body { display: flex; flex-direction: column; gap: 8px; }
.board-bar { display: flex; align-items: center; gap: 8px; }
.board-status { flex: 1; font-size: 12.5px; }
.board-status[data-kind="unavailable"], .board-status[data-kind="error"], .board-status[data-kind="offline"], .board-status[data-kind="limited"] { color: var(--gold-hot); }
.board-bar .btn { flex: none; min-height: 44px; }
.board-you { margin: 0; padding: 7px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--ivory); background: rgba(var(--tk-line-rgb), .1); border: 1px solid var(--line-soft); }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  display: grid; grid-template-columns: 34px 30px minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; min-height: 44px; padding: 4px 8px;
  border-radius: 12px; background: rgba(3, 6, 20, .45); border: 1px solid var(--line-soft);
}
.lb-row.mine { border-color: var(--line-strong); background: rgba(var(--tk-line-rgb), .1); }
.lb-rank { font-size: 12px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.lb-row .avatar { width: 30px; height: 30px; }
.lb-who { display: flex; flex-direction: column; min-width: 0; }
.lb-name { font-weight: 600; font-size: 14px; color: var(--ivory); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.lb-name.link {
  min-height: 32px; padding: 0; border: 0; background: transparent; font: inherit; font-weight: 600; cursor: pointer; color: var(--ivory);
  text-decoration: underline dotted rgba(var(--tk-line-rgb), .7); text-underline-offset: 3px; max-width: 100%;
}
.lb-name.link:hover { color: var(--gold-hot); }
.lb-tag { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
.lb-rating { grid-row: 1; grid-column: 4; font-size: 16px; color: var(--ivory); font-variant-numeric: tabular-nums; text-align: right; }
.lb-rec { grid-column: 3 / span 2; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Result: Season 1 and the unlock path, each its own quiet line. */
.rp-ranked, .rp-unlock { margin: 0; text-align: center; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.rp-ranked[data-dir="up"] { color: var(--tk-jade-text); }
.rp-ranked[data-dir="down"] { color: var(--muted); }
.rp-unlock[data-fresh="true"] { color: var(--gold-hot); }

/* ---------- v0.13 Cycle Beta: mode switch, loaned deck, Next / Discard row ---------- */
/* Home: two 44 px options near Battle; the hero gives up the height they need. */
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 14px;
  background: rgba(3, 6, 20, .55); border: 1px solid var(--line-soft);
}
.mode-opt {
  min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-weight: 600; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
}
.mode-opt[aria-pressed="true"] {
  color: var(--ivory); background: linear-gradient(180deg, rgba(46, 56, 112, .95), rgba(24, 31, 70, .95));
  box-shadow: inset 0 0 0 1px rgba(var(--tk-line-strong-rgb), .55);
}
.mode-opt:disabled { opacity: .45; cursor: not-allowed; }
.mode-note { margin: -4px 0 0; font-size: 11.5px; line-height: 1.35; text-align: center; color: var(--muted); }
.mode-note[hidden], .mode-fix[hidden] { display: none; }
.btn.mode-fix { align-self: center; min-height: 44px; }
.deck-summary[data-size="8"] .ds-icons { gap: 2px; }
.deck-summary[data-size="8"] .deck-ic { width: 14px; height: 14px; }
/* Cards tab: eight read-only loaned slots, two rows of four. */
.deck-slots.cycle .slot { min-height: 64px; }
.deck-slots.cycle .slot .deck-ic { width: 24px; height: 24px; margin-top: 6px; }
.deck-status[data-kind="loaned"] { color: var(--muted); }
/* Countdown telegraph: two eight-card decks stay on one row each. */
.ri-decks[data-size="8"] .ri-deck { gap: 3px; }
.ri-decks[data-size="8"] .deck-ic { width: 14px; height: 14px; }
/* Match footer (Cycle only): fixed height, so selecting never moves the cards. */
.cycle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; margin: -2px 0 8px; }
.cycle-row[hidden] { display: none; }
.cy-next {
  display: flex; align-items: center; gap: 6px; min-width: 0; height: 34px; margin: 0; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px dashed var(--line-soft); background: rgba(3, 6, 20, .4); color: var(--muted); font-size: 12.5px;
}
.cy-next-label { font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.cy-next-art { display: flex; }
.cy-next-art .deck-ic { width: 20px; height: 20px; }
.cy-next-name { color: var(--ivory); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.cy-discard { flex: none; min-height: 44px; height: 44px; padding: 0 14px; font-size: 13.5px; white-space: nowrap; }
.btn.cy-discard:disabled { opacity: .45; cursor: not-allowed; }
.card.card-wait { cursor: default; opacity: .45; justify-content: center; }
@media (max-height: 680px) {
  body.cycle-battle .card { min-height: 64px; }
  body.cycle-battle .card .portrait { width: 40px; height: 40px; }
  .cycle-row { margin: -2px 0 6px; }
}
.cycle-presets .preset { min-height: 44px; }

/* ---------- v0.14: result, Battle log ---------- */
/* Result: the score over time stays in view, small (the full explanation is
   in Match details). Lines keep their width however the graph is stretched. */
.recap-chart.compact { margin: 0; padding: 4px 8px; border-radius: 12px; background: rgba(3, 6, 20, .35); border: 1px solid var(--line-soft); }
.recap-chart.compact .recap-svg { height: 58px; }
.recap-chart.compact .recap-svg * { vector-effect: non-scaling-stroke; }
.recap-chart[hidden] { display: none; }
.recap > summary { min-height: 44px; }
.recap-body .result-rival { margin-top: 2px; }
.recap-body .feedback-row { justify-content: flex-start; }
.recap-insight:empty { display: none; }
#rematch-status:empty { display: none; }
/* Daily reward chips: only what the server says this match earned. */
.rp-reward[data-qualified="true"] { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.rw-label { font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.rw-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 10px 2px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--gold-hot); background: rgba(var(--tk-line-rgb), .12); border: 1px solid var(--line);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rw-chip svg { width: 16px; height: 16px; flex: none; }
.rw-chip .chest-art { width: 18px; height: 18px; }
.rw-chip .ch-glow, .rw-chip .ch-beam, .rw-chip .ch-lit { opacity: 0; }
.rw-chip { flex: none; max-width: 100%; }
.rw-chip.auto { color: var(--text); white-space: normal; flex: 0 1 auto; }
@media (max-height: 680px) {
  .recap-chart.compact .recap-svg { height: 44px; }
  .result-card .result-progress .rp-note { font-size: 12px; }
}

/* Journey: one entry to the Battle log sheet. */
.log-entry { width: 100%; }
.log-entry svg { color: var(--gold-hot); }
.log-sheet { width: min(460px, calc(100% - 20px)); }
.log-body { display: flex; flex-direction: column; gap: 6px; }
.log-body .recent-list { margin-top: 0; }
.log-body .recent-empty:empty { display: none; }
.log-fine { font-size: 11.5px; line-height: 1.4; }
/* Reduced motion: the reveal never glows, beams or sparkles, in any state. */
.chest-stage[data-motion="reduced"] .ch-glow,
.chest-stage[data-motion="reduced"] .ch-beam,
.chest-stage[data-motion="reduced"] .ch-spark { opacity: 0; animation: none; }
.recap-body .rp-ranked-more, .recap-body .rp-unlock { text-align: left; }
.rp-ranked-more { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--text); font-variant-numeric: tabular-nums; }
