/* Planning aids and the match HUD round: damage preview, threat toggle, unit cards, phase tracker. */

/* Damage preview on unit labels: the chunk the aimed ability would take, striped; red-hot when it kills. */
.bar em.pv { position: absolute; top: 0; bottom: 0; z-index: 2; background: repeating-linear-gradient(135deg, #fff2c8 0 3px, #ff8a3c 3px 6px); animation: pvpulse .9s ease-in-out infinite alternate; }
.bar em.pv.kill { background: repeating-linear-gradient(135deg, #fff 0 3px, #ff2a4a 3px 6px); }
@keyframes pvpulse { from { opacity: .55; } to { opacity: 1; } }
.ulabel .pvn { font: 900 15px/1 var(--ui); color: #ffb35a; -webkit-text-stroke: 3px #120604; paint-order: stroke fill; margin-bottom: 1px; white-space: nowrap; }
.ulabel .pvn small { font-size: 11px; color: #d8ecff; }
.ulabel .pvn.kill { color: #ff3a5a; font-size: 17px; animation: pvkill .7s ease-in-out infinite alternate; }
@keyframes pvkill { from { transform: scale(1); } to { transform: scale(1.12); } }
.ulabel .pvn.later { color: #c9a7ff; }
.ulabel.pvon { z-index: 3; }

/* Toggle buttons in the top bar that are on. */
.ibtn.on { border-color: #ff5a6a; background: rgba(255,58,74,.22); box-shadow: 0 0 12px rgba(255,58,74,.35); }

/* ---- Unit cards: your team left, the enemy right ---- */
.cards { position: fixed; top: 60px; display: flex; flex-direction: column; gap: 6px; width: 212px; z-index: 2; }
#cardsL { left: 12px; } #cardsR { right: 12px; top: 64px; }
.ucard { display: grid; grid-template-columns: 30px 1fr auto; column-gap: 8px; row-gap: 3px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ac, var(--ally)); border-radius: 10px; padding: 6px 9px 6px 6px; backdrop-filter: blur(6px); font-size: 11px; }
.ucard.t1 { border-left-color: var(--enemy); }
#cardsR .ucard { border-left-width: 1px; border-right: 3px solid var(--enemy); }
.ucard.me { border-color: rgba(53,224,255,.55); border-left: 3px solid var(--ally); box-shadow: 0 0 14px rgba(53,224,255,.15); }
.ucard.dead { opacity: .45; } .ucard.ghost { opacity: .75; border-style: dashed; } .ucard.unseen { opacity: .5; border-style: dashed; }
.ucard .pt { grid-row: span 2; width: 28px; height: 28px; display: grid; place-items: center; font: 700 16px var(--title); color: var(--muted); }
.ucard .pt .svgi { background: #dff6ff; width: 26px; height: 26px; }
.ucard .nm { font: 600 12px var(--ui); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard .nm small { color: var(--ally); font-weight: 700; }
.ucard .nm .ok { color: var(--prep); font-style: normal; } .ucard .nm .wait { color: var(--muted); font-style: normal; }
.ucard .kda { font: 700 10.5px var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.ucard .hpb { grid-column: 2 / span 2; position: relative; height: 12px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.ucard .hpb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #6dffa0, #2fbf6a); }
.ucard.t1 .hpb i { background: linear-gradient(180deg, #ff7a8a, #e0364f); }
.ucard .hpb s { position: absolute; top: 0; bottom: 0; background: #d8ecff; opacity: .9; }
.ucard .hpb em { position: absolute; inset: 0; font: 700 9.5px/12px var(--ui); font-style: normal; text-align: center; color: #fff; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.ucard .enb { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; }
.ucard .enb i { display: block; height: 100%; background: #b07cff; }
.ucard .sub { grid-column: 1 / -1; color: var(--muted); font-size: 10.5px; }
.ucard .row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.ucard .chip { font: 600 10px var(--ui); padding: 1px 5px; border-radius: 99px; background: rgba(255,255,255,.07); color: var(--fg); }
.ucard .chip b { color: #fff; }
.ucard .chip.st-might, .ucard .chip.st-haste, .ucard .chip.st-energized, .ucard .chip.st-unstoppable { background: rgba(95,227,160,.16); }
.ucard .chip.st-slow, .ucard .chip.st-root, .ucard .chip.st-marked, .ucard .chip.st-revealed { background: rgba(255,90,110,.18); }
.ucard .cds { display: flex; gap: 2px; margin-left: auto; }
.ucard .cd { position: relative; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 4px; background: rgba(0,0,0,.35); opacity: .45; font-size: 10px; }
.ucard .cd .svgi { width: 12px; height: 12px; background: #dff6ff; }
.ucard .cd.ready { opacity: 1; } .ucard .cd.ult.ready { box-shadow: 0 0 6px #ffd43b; }
.ucard .cd b { position: absolute; right: -2px; bottom: -3px; font: 800 9px var(--ui); color: #fff; text-shadow: 0 0 2px #000; }
.ucard .stl { font-style: normal; font-size: 9.5px; font-weight: 700; padding: 0 4px; border-radius: 99px; }
.ucard .stl.hidden { color: #9fffc0; background: rgba(60,180,100,.18); } .ucard .stl.spotted { color: #ff8a9a; background: rgba(255,61,90,.18); }
.ucard .stl.revealed, .ucard .stl.sudden { color: #ffd36a; background: rgba(255,200,60,.16); }
#ucardTip { position: fixed; z-index: 8; width: 220px; pointer-events: none; filter: drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
#ucardTip[hidden] { display: none; }
#ucardTip .ucard { background: rgba(10,14,21,.97); }

/* ---- Phase tracker under the turn header ---- */
#phases { position: fixed; top: 46px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
#phases[hidden] { display: none; }
#phases .steps { display: flex; align-items: center; gap: 4px; background: rgba(10,14,21,.82); border: 1px solid var(--line); border-radius: 99px; padding: 3px 8px; backdrop-filter: blur(6px); }
#phases .step { font: 700 10.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 2px 7px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; }
#phases .step.on { color: #0a0e15; background: var(--ph); box-shadow: 0 0 12px var(--ph); }
#phases .step.done { color: var(--ph); opacity: .55; }
#phases .arr { color: rgba(255,255,255,.25); font-size: 11px; }
#phases .pc { display: inline-flex; gap: 2px; } #phases .pc i { font-style: normal; display: grid; place-items: center; }
#phases .pc .svgi { width: 12px; height: 12px; background: var(--ph); }
#phases .step.on .pc .svgi { background: #0a0e15; }
#phases .wt { font: 600 10.5px var(--ui); color: #ffd36a; text-shadow: 0 1px 3px #000; }
#phases .wt.ok { color: var(--prep); }

/* ---- Ability tooltip, from the data ---- */
#tip { max-width: 330px; }
#tip .ad-shape { color: var(--fg); margin: 2px 0 4px; }
#tip .ad-fx { margin: 0 0 4px; padding-left: 14px; color: var(--fg); }
#tip .ad-fx li { margin: 1px 0; }
#tip .ad-fx .dm { color: #ff9a6a; } #tip .ad-fx .hl { color: #6dffa0; } #tip .ad-fx .sh { color: #bfe0ff; } #tip .ad-fx .st { color: #ffd36a; }
#tip .ad-fx .sd { color: var(--muted); }
#tip .ad-ph { font-size: 11px; color: var(--muted); }

/* ---- Bottom dock: catalysts | ability bar | lock-in, one row (desktop) ---- */
@media (min-width: 641px) {
  #dock { grid-template-columns: auto auto auto; grid-template-rows: auto; column-gap: 14px; align-items: center; }
  #cats { grid-column: 1; grid-row: 1; flex-direction: column; gap: 5px; align-items: stretch; }
  #cats .cat { justify-content: flex-start; }
  #bar { grid-column: 2; grid-row: 1; }
  #lockwrap { grid-column: 3; grid-row: 1; }
  #hint { bottom: calc(118px + env(safe-area-inset-bottom)); }
}
/* Below 1180 px wide the side cards narrow. */
@media (max-width: 1180px) and (min-width: 641px) { .cards { width: 180px; } }
/* Phones: compact cards (portrait, HP, energy), statuses only as icons; tracker smaller. */
@media (max-width: 640px) {
  .cards { width: 92px; top: 54px; gap: 4px; } #cardsL { left: 6px; } #cardsR { right: 6px; top: 54px; }
  .ucard { grid-template-columns: 18px 1fr; padding: 3px 5px 3px 3px; column-gap: 4px; row-gap: 2px; }
  .ucard .pt { width: 18px; height: 18px; font-size: 11px; grid-row: auto; } .ucard .pt .svgi { width: 16px; height: 16px; }
  .ucard .nm, .ucard .kda, .ucard .sub, .ucard .cds { display: none; }
  .ucard .hpb { grid-column: 2; height: 9px; } .ucard .hpb em { font-size: 8px; line-height: 9px; }
  .ucard .chip { font-size: 9px; padding: 0 3px; } .ucard .chip .sn { display: none; }
  /* Only the current step is named; the others are coloured dots. */
  #phases { top: 58px; max-width: 190px; } #phases .step { font-size: 9px; padding: 1px 6px; letter-spacing: .06em; } #phases .wt { font-size: 9.5px; text-align: center; }
  #phases .steps { padding: 2px 5px; gap: 3px; }
  #phases .step:not(.on) { font-size: 0; padding: 0; width: 7px; height: 7px; background: var(--ph); opacity: .45; } #phases .step:not(.on) .pc { display: none; }
  #phases .step.done { opacity: .8; } #phases .arr { display: none; }
}
/* Below the cards. */
#turnsum { top: 312px; }
@media (max-width: 1100px) and (min-width: 641px) { #turnlog { top: 312px; } #turnsum { top: auto; bottom: 120px; } }
@media (max-width: 640px) { #turnsum { top: 290px; left: 6px; } }
/* Scoreboard: Match / Round tabs and team totals. */
.sb-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.sb-tabs button { font: 700 11px var(--ui); letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.sb-tabs button.on { color: #041018; background: var(--ally); border-color: var(--ally); }
.sb-teams { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font: 600 12px var(--ui); margin-bottom: 6px; }
.sb-teams .s0 { color: var(--ally); } .sb-teams .s1 { color: var(--enemy); }
/* Toasts below the phase tracker. */
#toasts { top: 104px; z-index: 6; }
@media (max-width: 640px) { #toasts { top: 130px; } }

/* ---- Lobby: role tabs, champion grid, 3D preview with stats and kit ---- */
:root { --r-tank: #5fb8ff; --r-dps: #ff6a4a; --r-support: #5dff9a; --r-flex: #c08bff; }
.lobby-card.wide { width: min(1080px, 100%); position: relative; }
.lb-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
.roles { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.roles button { font: 700 11px var(--ui); letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.roles button small { font-weight: 600; opacity: .7; letter-spacing: 0; }
.roles button.on { color: #041018; background: var(--ally); border-color: var(--ally); }
.lobby-card.wide .chars { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.lobby-card.wide .ch { align-items: center; text-align: center; padding: 10px 6px 8px; gap: 2px; border-bottom: 3px solid var(--rc); }
.lobby-card.wide .ch .ic { width: 38px; height: 38px; }
.lobby-card.wide .ch b { font-size: 12.5px; line-height: 1.15; }
.lobby-card.wide .ch small { font-size: 10.5px; color: var(--rc); text-transform: none; font-weight: 700; }
.lobby-card.wide .ch.on { box-shadow: 0 0 0 2px var(--ally), 0 0 22px rgba(53,224,255,.25); }
.lb-show { background: radial-gradient(ellipse at 50% 30%, rgba(40,60,90,.45), rgba(10,14,21,.2) 70%); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stage { position: relative; height: 300px; }
.stage canvas.showcase { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.st-hd { position: absolute; left: 0; top: 0; z-index: 1; display: flex; gap: 10px; align-items: center; pointer-events: none; }
.st-hd .ic { width: 40px; height: 40px; } .st-hd .ic .svgi { width: 40px; height: 40px; background: #dff6ff; }
.st-hd h2 { margin: 0; font: 800 22px var(--title); letter-spacing: .06em; }
.st-hd .role { font: 800 10.5px var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.st-hd .role.r-tank { color: var(--r-tank); } .st-hd .role.r-dps { color: var(--r-dps); } .st-hd .role.r-support { color: var(--r-support); } .st-hd .role.r-flex { color: var(--r-flex); }
.st-hd small { color: var(--muted); font-size: 11px; }
.lb-stats { display: grid; gap: 4px; margin: 6px 0 10px; }
.lb-stats .sb { display: grid; grid-template-columns: 70px 1fr 82px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.lb-stats .track { height: 7px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.lb-stats .track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2aa8d8, #7eeeff); }
.lb-stats b { color: var(--fg); font-variant-numeric: tabular-nums; } .lb-stats b small { color: var(--muted); font-weight: 500; }
.lb-kit { display: grid; gap: 5px; }
.lb-kit .ka { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--ph); cursor: help; }
.lb-kit .ki .svgi { width: 24px; height: 24px; background: var(--ph); }
.lb-kit b { font-size: 12.5px; } .lb-kit .kp { font: 700 9.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ph); }
.lb-kit small { display: block; color: var(--muted); font-size: 11px; }
.lb-tip { position: absolute; z-index: 3; width: 320px; background: rgba(8,11,17,.97); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 12px; color: var(--muted); box-shadow: 0 10px 30px rgba(0,0,0,.5); pointer-events: none; }
.lb-tip[hidden] { display: none; }
.lb-tip b { color: #fff; } .lb-tip .tph { font: 800 9.5px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ph); margin-left: 4px; }
.lb-tip .ad-shape { color: var(--fg); margin: 2px 0 4px; } .lb-tip .ad-fx { margin: 0 0 4px; padding-left: 14px; color: var(--fg); }
.lb-tip .ad-fx .dm { color: #ff9a6a; } .lb-tip .ad-fx .hl { color: #6dffa0; } .lb-tip .ad-fx .sh { color: #bfe0ff; } .lb-tip .ad-fx .st { color: #ffd36a; } .lb-tip .ad-fx .sd { color: var(--muted); }
.lb-tip .ad-ph, .lb-tip .tcd { font-size: 11px; }
@media (max-width: 820px) {
  .lb-main { grid-template-columns: 1fr; }
  .stage { height: 230px; }
  .lobby-card.wide .chars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Undo the older phone lobby rules for this layout. */
  .lobby-card.wide .ch.on { grid-column: auto; }
  .lobby-card.wide .ch .ic { width: 30px; height: 30px; }
  .lb-tip { width: calc(100% - 16px); }
}
/* Phones: champions, then the preview, then the options. */
@media (max-width: 820px) {
  .lb-main { display: flex; flex-direction: column; gap: 10px; }
  .lb-pick { display: contents; }
  .lb-show { order: 1; } .lb-opts { order: 2; }
}
