:root {
  --abyss: #07101f; --tide: #0e2a4a; --cyan: #39d7ff; --violet: #9b4dff; --gold: #e2b44a; --wine: #8e1f3f; --foam: #eaf6ff;
  --gold-hi: #fff1b8; --gold-lo: #8a6217;
  --f-disp: "Dela Gothic One", "Barlow Semi Condensed", sans-serif;
  --f-text: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --f-num: "Oxanium", "Barlow Semi Condensed", monospace;
  --goldgrad: linear-gradient(160deg, #fff3c4 0%, #e2b44a 22%, #8a6217 48%, #f4d27a 70%, #9a6b1c 100%);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--abyss); color: var(--foam); font-family: var(--f-text); overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

#viewport { position: fixed; inset: 0; overflow: hidden; }
#bg { position: absolute; inset: 0; background: #07101f url(../assets/ui/bg_port.webp) center/cover no-repeat; }
#bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(7,16,31,0), rgba(7,16,31,.3) 80%); }
body.land #bg { background-image: url(../assets/ui/bg_land.webp); }

#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: grid; }

/* ---------------- layouts ---------------- */
#stage.port {
  width: 420px; gap: 4px 0; padding: 6px 6px 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 58px 30px 106px auto 106px 66px minmax(0, 1fr);
  grid-template-areas: "opanel" "ohand" "oslots" "tide" "mslots" "mpanel" "mhand";
}
#stage.port #turnbox, #stage.port #nextbox, #stage.port #apbox { display: none; }
#stage.port #log { position: absolute; right: 6px; top: 104px; width: 280px; height: 58%; z-index: 40; }
#stage.port #log.closed { display: none; }
#stage.port .topbtns { position: absolute; right: 6px; top: 66px; }
#stage.port #ohand { justify-self: start; }

#stage.land {
  height: 720px; gap: 6px 10px; padding: 8px 10px 0;
  grid-template-columns: 178px minmax(0, 1fr) 196px;
  grid-template-rows: 62px 160px 136px 160px minmax(0, 1fr);
  grid-template-areas: "opanel ohand log" "opanel oslots log" "turnbox tide nextbox" "mpanel mslots apbox" "mpanel mhand apbox";
}
#stage.land #log { grid-area: log; }
#stage.land #log.closed { height: 34px; align-self: start; }
#stage.land #btnLog { display: none; }
#stage.land .topbtns { position: absolute; right: 12px; bottom: 12px; }
#stage.land #tide .tidebar-next { display: none; }

#opanel { grid-area: opanel; } #ohand { grid-area: ohand; } #oslots { grid-area: oslots; }
#turnbox { grid-area: turnbox; } #tide { grid-area: tide; } #nextbox { grid-area: nextbox; }
#mslots { grid-area: mslots; } #mpanel { grid-area: mpanel; } #apbox { grid-area: apbox; } #mhand { grid-area: mhand; }

/* ---------------- gilded crystal plate ---------------- */
.plate-gold, .panel, .log, .turnbox, .seam-plate {
  position: relative; background: linear-gradient(180deg, rgba(14,42,74,.92), rgba(7,16,31,.94));
  border: 2px solid transparent; border-radius: 10px;
  background-clip: padding-box;
  box-shadow: 0 0 0 1px rgba(226,180,74,.9), 0 0 0 3px rgba(60,40,8,.8), inset 0 1px 0 rgba(255,241,184,.35), inset 0 0 18px rgba(57,215,255,.12), 0 6px 18px rgba(0,0,0,.5);
}
.panel.opp { box-shadow: 0 0 0 1px rgba(226,180,74,.9), 0 0 0 3px rgba(60,10,20,.85), inset 0 1px 0 rgba(255,241,184,.3), inset 0 0 22px rgba(142,31,63,.35), 0 6px 18px rgba(0,0,0,.5); background: linear-gradient(180deg, rgba(60,14,30,.9), rgba(14,8,20,.94)); }
.corner { position: absolute; width: 22px; height: 22px; background: url(../assets/ui/corner_gold.webp) center/contain no-repeat; pointer-events: none; filter: drop-shadow(0 1px 2px #000); }
.corner.tl { left: -5px; top: -5px; } .corner.tr { right: -5px; top: -5px; transform: scaleX(-1); }
.corner.bl { left: -5px; bottom: -5px; transform: scaleY(-1); } .corner.br { right: -5px; bottom: -5px; transform: scale(-1,-1); }

/* ---------------- resource panel ---------------- */
.panel { display: flex; gap: 8px; padding: 6px 8px; align-items: center; }
#stage.land .panel { flex-direction: column; align-items: stretch; padding: 8px; gap: 6px; }
.panel .who { font-family: var(--f-disp); font-size: 13px; letter-spacing: .04em; color: var(--foam); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.panel .who img { width: 22px; height: 22px; object-fit: contain; }
.panel .who small { font-family: var(--f-text); font-weight: 700; font-size: 11px; color: var(--gold); letter-spacing: .08em; }
#stage.land .panel .who { justify-content: center; padding: 3px 0 4px; border-bottom: 1px solid rgba(226,180,74,.4); font-size: 14px; }
#stage.port .panel .who { flex-direction: column; align-items: flex-start; gap: 0; font-size: 12px; min-width: 64px; }
.res { display: flex; align-items: center; gap: 6px; }
.res .num { font-family: var(--f-num); font-weight: 800; font-size: 20px; line-height: 1; }
.res .lbl { font-weight: 700; font-size: 10px; letter-spacing: .08em; color: #a9c6e6; text-transform: uppercase; line-height: 1; }
.res img { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 0 4px rgba(57,215,255,.5)); }
.vial { position: relative; width: 16px; height: 40px; border-radius: 8px 8px 6px 6px; background: rgba(0,0,0,.55); box-shadow: 0 0 0 1.5px var(--gold), inset 0 0 6px rgba(0,0,0,.8); overflow: hidden; }
.vial i { position: absolute; left: 2px; right: 2px; bottom: 2px; border-radius: 5px; background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: 0 0 8px var(--c1); transition: height .5s ease; }
.vial::after { content: ""; position: absolute; left: 3px; top: 3px; width: 4px; height: 60%; border-radius: 3px; background: rgba(255,255,255,.25); }
.lp .num { font-size: 26px; }
.lp .num small { font-size: 12px; margin-left: 2px; color: #a9c6e6; }
.apbadge { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 30px; background: radial-gradient(circle at 30% 30%, rgba(155,77,255,.55), rgba(40,10,80,.8)); box-shadow: 0 0 0 1.5px var(--gold), 0 0 14px rgba(155,77,255,.6); }
.apbadge img { width: 34px; height: 34px; }
.apbadge .num { font-size: 30px; color: #f2e6ff; text-shadow: 0 0 10px var(--violet); }
.apbadge .lbl { color: #e3d0ff; }
.builder img { width: 22px; height: 22px; filter: drop-shadow(0 0 3px rgba(226,180,74,.6)); }
.builder .num { font-size: 16px; color: var(--gold); }
.panel.glow-target { box-shadow: 0 0 0 2px #ff5577, 0 0 22px #ff3355 !important; animation: pulse 0.9s infinite; }
#stage.land .panel .res { justify-content: flex-start; }
#stage.land .panel .lpwrap { display: flex; gap: 8px; align-items: center; }
#stage.land .panel .vial { height: 54px; width: 20px; }
#stage.land .panel .lp .num { font-size: 34px; }
#stage.port .panel .builder .lbl, #stage.port .panel .fcpool .lbl { display: none; }
#stage.port .panel .meta { display: none; }
.panel .meta { font-size: 11px; color: #a9c6e6; font-weight: 600; letter-spacing: .05em; display: flex; justify-content: space-between; }
.panel .meta b { font-family: var(--f-num); color: var(--foam); }
#stage.port .panel.me { justify-content: space-between; }
#stage.port .panel { justify-content: space-between; }

/* big AP box (landscape) */
.apbox { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding-top: 8px; }
.apbox .bigap { width: 150px; height: 150px; position: relative; display: grid; place-items: center; }
.apbox .bigap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 18px rgba(155,77,255,.75)); }
.apbox .bigap .num { position: relative; margin-top: 92px; font-family: var(--f-num); font-weight: 800; font-size: 44px; color: #fff; text-shadow: 0 0 12px var(--violet), 0 2px 0 #000; background: rgba(20,6,40,.82); padding: 0 16px; border-radius: 12px; box-shadow: 0 0 0 1.5px var(--gold); }
.apbox .cap { font-family: var(--f-disp); font-size: 12px; letter-spacing: .1em; color: #e3d0ff; }

/* ---------------- hands ---------------- */
.ohand { position: relative; height: 100%; width: 100%; pointer-events: none; }
.ohand .back { position: absolute; top: 0; width: 22px; height: 30px; border-radius: 3px; background: url(../assets/ui/card_back.webp) center/cover; box-shadow: 0 0 0 1px var(--gold), 0 2px 6px rgba(0,0,0,.6); transform-origin: 50% 160%; }
#stage.land .ohand .back { width: 42px; height: 58px; top: -6px; }
#stage.port .ohand { width: 250px; }
.ohand .count { position: absolute; right: 0; top: 4px; font-family: var(--f-num); font-weight: 700; font-size: 12px; color: #e7b6c4; }

.mhand { position: relative; width: 100%; height: 100%; }
.mhand .hc { position: absolute; bottom: auto; transform-origin: 50% 120%; transition: transform .18s ease, filter .18s; }
.mhand .hc .card { width: 100%; }
.mhand .hc.sel { z-index: 30 !important; }
.mhand .hc.dim .card { filter: saturate(.55) brightness(.7); }
.mhand .hc.playable .card .fr { box-shadow: 0 0 0 1.2cqw rgba(57,215,255,.95), 0 0 8cqw rgba(57,215,255,.6); }
.mhand .empty { position: absolute; inset: 0; display: grid; place-items: center; color: #7f9cc0; font-size: 13px; letter-spacing: .1em; }
@media (hover: hover) { .mhand .hc:hover { transform: translateY(-34px) rotate(0deg) scale(1.08) !important; z-index: 29 !important; } }

/* ---------------- slots ---------------- */
.slots { display: flex; justify-content: center; align-items: center; gap: 5px; }
#stage.land .slots { gap: 14px; }
.slot { position: relative; height: 100%; aspect-ratio: 5 / 7; border-radius: 8px; background: url(../assets/ui/slot_blue.webp) center/cover; box-shadow: inset 0 0 14px rgba(0,0,0,.85), 0 0 0 1px rgba(226,180,74,.5); }
.slots.opp .slot { background-image: url(../assets/ui/slot_wine.webp); }
.slot::before { content: ""; position: absolute; inset: 0; border-radius: 8px; background: rgba(7,16,31,.35); }
.slot .esock { position: absolute; left: -4px; top: 50%; width: 9px; height: 22px; transform: translateY(-50%); border-radius: 4px; background: linear-gradient(180deg, #0b1d33, #050b14); box-shadow: 0 0 0 1px var(--gold), inset 0 0 4px #000; z-index: 3; }
.slot .card { position: absolute; inset: 0; width: 100%; }
.slot.target { box-shadow: 0 0 0 2px var(--cyan), 0 0 18px var(--cyan); animation: pulse .9s infinite; }
.slot.lifetarget { box-shadow: 0 0 0 2px #ff5577, 0 0 18px #ff3355; animation: pulse .9s infinite; }
.slot.lifetarget::after { content: "STRIKE\A LIFE"; white-space: pre; position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-family: var(--f-disp); font-size: 11px; color: #ffd0da; text-shadow: 0 0 6px #ff3355; z-index: 2; }
.slot .lanebadge { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font-size: 9px; color: rgba(234,246,255,.35); font-weight: 700; letter-spacing: .1em; z-index: 1; }
@keyframes pulse { 50% { filter: brightness(1.35); } }

/* ---------------- tide line ---------------- */
.tide { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 5px; padding: 4px 0; }
.seam { position: absolute; left: -6px; right: -6px; top: 22px; height: 22px; background: linear-gradient(180deg, rgba(57,215,255,0), rgba(57,215,255,.18) 45%, rgba(155,77,255,.22) 55%, rgba(57,215,255,0)); pointer-events: none; }
#stage.land .seam { left: -190px; right: -210px; top: 20px; }
.filament { width: 100%; height: 100%; overflow: visible; }
.filament polyline { fill: none; stroke: #bfefff; stroke-width: 1.6; filter: drop-shadow(0 0 3px #39d7ff) drop-shadow(0 0 6px #9b4dff); vector-effect: non-scaling-stroke; }
.track { position: relative; display: flex; justify-content: space-between; align-items: center; height: 56px; padding: 0 6px; background: linear-gradient(180deg, rgba(14,42,74,.9), rgba(7,16,31,.92)); border-radius: 28px; box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 3px rgba(40,26,6,.9), inset 0 0 14px rgba(57,215,255,.15); }
.node { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 1; }
.node .gem { width: 18px; height: 18px; transform: rotate(45deg); border-radius: 3px; background: linear-gradient(135deg, #bff2ff, #39d7ff 45%, #0e2a4a); box-shadow: 0 0 0 1.5px var(--gold), 0 0 10px rgba(57,215,255,.7); transition: all .3s; }
.node .nm { white-space: nowrap; font-family: var(--f-text); font-weight: 800; font-size: 10px; letter-spacing: .04em; color: #cfe6ff; transition: all .3s; }
.node.done .gem { background: linear-gradient(135deg, #1b3a5e, #0e2a4a); box-shadow: 0 0 0 1.5px rgba(226,180,74,.45); }
.node.done .nm { color: #5d7ea6; }
.node.on .gem { width: 24px; height: 24px; background: radial-gradient(circle at 35% 35%, #fff7d6, #e2b44a 50%, #8a6217); box-shadow: 0 0 0 2px #fff1b8, 0 0 16px #e2b44a, 0 0 30px rgba(226,180,74,.6); }
.node.on .nm { font-family: var(--f-disp); font-size: 11px; color: #ffe9a8; text-shadow: 0 0 8px rgba(226,180,74,.9); }
#stage.land .node .nm { font-size: 12px; } #stage.land .node.on .nm { font-size: 13px; }
.runner { position: absolute; top: 50%; width: 40px; height: 6px; margin-top: -14px; border-radius: 3px; background: radial-gradient(ellipse, #fff7d6, rgba(226,180,74,.8) 40%, rgba(226,180,74,0) 70%); pointer-events: none; z-index: 2; }

.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.pill { font-family: var(--f-text); font-weight: 800; font-size: 12px; letter-spacing: .06em; padding: 6px 11px; border-radius: 16px; border: none; color: #e9fbff;
  background: linear-gradient(180deg, #1c5e8c, #0e2a4a); box-shadow: 0 0 0 1.5px var(--cyan), 0 0 10px rgba(57,215,255,.45), inset 0 1px 0 rgba(255,255,255,.25); }
#stage.land .pill { font-size: 13px; padding: 7px 14px; }
.pill.off { color: #6d7f95; background: linear-gradient(180deg, #2a3442, #161c26); box-shadow: 0 0 0 1px #4a5668, inset 0 1px 0 rgba(255,255,255,.08); }
.pill.go { background: linear-gradient(180deg, #3a7cc0, #13406e); box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(226,180,74,.55); }
.pill.next { display: none; }
#stage.port .pill.next { display: inline-block; font-family: var(--f-disp); font-weight: 400; color: #3a2200; background: var(--goldgrad); box-shadow: 0 0 0 1.5px #fff1b8, 0 0 14px rgba(226,180,74,.6); padding: 6px 14px; }
.hint { min-height: 30px; font-size: 13px; line-height: 1.2; font-weight: 600; text-align: center; color: #d5ecff; padding: 4px 10px; border-radius: 8px; background: rgba(7,16,31,.78); box-shadow: inset 0 0 0 1px rgba(57,215,255,.25); }
.hint b { color: var(--gold); font-weight: 800; }
.hint.warn { color: #ffd2dc; box-shadow: inset 0 0 0 1px rgba(255,85,119,.6); }
.tidehead { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #a9c6e6; padding: 0 4px; }
.tidehead .turn { font-family: var(--f-disp); font-size: 13px; color: var(--foam); letter-spacing: .04em; }
.tidehead .turn em { font-style: normal; color: var(--cyan); }
.tidehead .turn em.rb { color: #ff7d9a; }
.tidehead b { font-family: var(--f-num); color: var(--foam); }
#stage.land .tidehead { display: none; }

.turnbox { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6px; gap: 3px; text-align: center; }
.turnbox .t1 { font-family: var(--f-disp); font-size: 20px; }
.turnbox .t2 { font-family: var(--f-disp); font-size: 17px; color: var(--cyan); }
.turnbox .t2.rb { color: #ff7d9a; }
.turnbox .t3 { font-size: 11px; color: #a9c6e6; font-weight: 700; letter-spacing: .05em; }
.turnbox .t3 b { font-family: var(--f-num); color: var(--foam); }
.nextbox { display: grid; place-items: center; }
.next-btn { width: 176px; height: 96px; border: none; font-family: var(--f-disp); font-size: 22px; line-height: 1.05; color: #3a2200; text-shadow: 0 1px 0 rgba(255,240,190,.7);
  clip-path: polygon(14% 0, 86% 0, 100% 50%, 86% 100%, 14% 100%, 0 50%); background: var(--goldgrad); filter: drop-shadow(0 0 10px rgba(226,180,74,.7)); }
.next-btn:active, .pill:active { transform: scale(.96); }
.next-btn.off { filter: grayscale(.8) brightness(.6); }

/* ---------------- cards ---------------- */
.card { position: relative; aspect-ratio: 5 / 7; container-type: inline-size; border-radius: 5cqw; }
.card .fr { position: absolute; inset: 0; border-radius: 5cqw; padding: 2.6cqw; background: var(--goldgrad); box-shadow: 0 3px 10px rgba(0,0,0,.6), inset 0 0 0 .6cqw rgba(255,241,184,.6); }
.card .in { position: relative; width: 100%; height: 100%; border-radius: 3.4cqw; overflow: hidden; background: linear-gradient(180deg, #0c2340, #07101f); box-shadow: inset 0 0 0 .8cqw var(--fac, #39d7ff); }
.card.f-rb .in { --fac: #c2203f; background: linear-gradient(180deg, #2a0a14, #0a0508); }
.card.f-cx .in { --fac: #9fd8ff; }
.card.f-neutral .in { --fac: #39d7ff; }
.card .nm { position: absolute; left: 0; right: 0; top: 0; height: 13%; display: flex; align-items: center; justify-content: center; padding: 0 15cqw; background: linear-gradient(180deg, #0a1426, #050a14); border-bottom: .8cqw solid var(--gold); font-weight: 800; font-size: 7.6cqw; line-height: 1; text-transform: uppercase; letter-spacing: .02em; text-align: center; color: var(--foam); z-index: 2; }
.card.f-rb .nm { background: linear-gradient(180deg, #1c0610, #0a0306); }
.card .nm span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .el { position: absolute; left: 1.5cqw; top: .8cqw; width: 12cqw; height: 12cqw; object-fit: contain; z-index: 3; }
.card .gem { position: absolute; right: 2.4cqw; top: 2.4cqw; width: 8cqw; height: 8cqw; transform: rotate(45deg); border-radius: 1.4cqw; z-index: 3; box-shadow: 0 0 0 .6cqw #fff1b8, 0 0 3cqw var(--gc); background: radial-gradient(circle at 35% 30%, #fff, var(--gc) 55%, #000 130%); }
.r-common { --gc: #9aa8b8; } .r-uncommon { --gc: #3fd46a; } .r-rare { --gc: #39d7ff; } .r-epic { --gc: #9b4dff; } .r-legendary { --gc: #e2b44a; } .r-mythic { --gc: #ff3d7f; }
.r-evolutionary .gem { background: conic-gradient(#ff5, #5f5, #5ff, #55f, #f5f, #f55, #ff5); animation: prism 3s linear infinite; }
@keyframes prism { to { filter: hue-rotate(360deg); } }
.card .art { position: absolute; left: 0; right: 0; top: 13%; height: 43%; background-size: cover; background-position: center 40%; }
.card .art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -3cqw 6cqw rgba(0,0,0,.6); }
.card.r-legendary .art::before, .card.r-mythic .art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 45%, transparent 60%); background-size: 250% 100%; animation: foil 4s linear infinite; mix-blend-mode: screen; }
@keyframes foil { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.card .cost { position: absolute; left: 2cqw; top: 15%; z-index: 3; min-width: 13cqw; height: 13cqw; padding: 0 2cqw; display: grid; place-items: center; font-family: var(--f-num); font-weight: 800; font-size: 8cqw; color: #08202e; background: radial-gradient(circle at 40% 35%, #d9fbff, #39d7ff 55%, #0b6c8a); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.card .evoap { position: absolute; right: 2cqw; top: 15%; z-index: 3; height: 11cqw; padding: 0 2.2cqw; border-radius: 6cqw; display: grid; place-items: center; font-family: var(--f-num); font-weight: 800; font-size: 6.2cqw; color: #f2e6ff; background: linear-gradient(180deg, #6a2ad0, #2c0b63); box-shadow: 0 0 0 .5cqw var(--gold); }
.card .emb { position: absolute; left: 2cqw; top: 46%; width: 10cqw; height: 10cqw; object-fit: contain; z-index: 3; filter: drop-shadow(0 0 1cqw #000); }
.card .emb.emb2 { left: auto; right: 2cqw; }
.card .badges { position: absolute; left: 14cqw; right: 2cqw; top: 46%; display: flex; flex-wrap: wrap; gap: 1cqw; z-index: 4; }
.card .bd { font-size: 5.4cqw; font-weight: 800; letter-spacing: .04em; padding: .6cqw 1.8cqw; border-radius: 2cqw; background: rgba(5,10,20,.88); color: var(--foam); box-shadow: 0 0 0 .4cqw rgba(255,255,255,.3); }
.bd.guard { color: #9fe8ff; box-shadow: 0 0 0 .4cqw var(--cyan); } .bd.dis { color: #ff9ab0; box-shadow: 0 0 0 .4cqw #ff3355; }
.bd.prot { color: #ffe9a8; box-shadow: 0 0 0 .4cqw var(--gold); } .bd.new { color: #a9c6e6; } .bd.mut { color: #d9b8ff; box-shadow: 0 0 0 .4cqw var(--violet); }
.card .chev { position: absolute; left: 0; right: 0; top: 56%; height: 5.6%; display: flex; justify-content: center; align-items: center; gap: 1cqw; background: #050a14; }
.card .chev i { width: 8cqw; height: 3.4cqw; clip-path: polygon(0 0, 50% 60%, 100% 0, 100% 40%, 50% 100%, 0 40%); background: #22344c; }
.card .chev i.on { background: linear-gradient(180deg, #fff1b8, #e2b44a); filter: drop-shadow(0 0 1cqw var(--gold)); }
.card .chev .lv { position: absolute; left: 2.5cqw; font-family: var(--f-num); font-weight: 700; font-size: 4.6cqw; color: #a9c6e6; }
.card .stats { position: absolute; left: 2cqw; right: 2cqw; top: 62.5%; height: 10%; display: flex; gap: 1.6cqw; }
.card .stats b { flex: 1; display: flex; align-items: center; justify-content: center; gap: 1cqw; border-radius: 2cqw; font-family: var(--f-num); font-weight: 800; font-size: 9cqw; line-height: 1; color: #fff; background: linear-gradient(180deg, var(--s1), var(--s2)); box-shadow: inset 0 0 0 .5cqw rgba(255,255,255,.25); }
.card .stats b s { text-decoration: none; font-family: var(--f-text); font-size: 4.4cqw; font-weight: 800; opacity: .85; }
.card .stats .a { --s1: #b4253f; --s2: #5a0c1e; } .card .stats .d { --s1: #2a6fb8; --s2: #0e2a4a; } .card .stats .h { --s1: #2a9a5a; --s2: #0b3d24; }
.card .stats b.up { color: #c7ffd9; text-shadow: 0 0 2cqw #39ff8a; } .card .stats b.down { color: #ffb3c2; }
.card .stats b.hurt { color: #ffd0d8; }
.card .rail { position: absolute; left: 2cqw; right: 2cqw; top: 74%; height: 6.4%; display: flex; gap: .8cqw; }
.card .rail i { position: relative; flex: 1; border-radius: 1.4cqw; background: #0b1626; box-shadow: inset 0 0 0 .4cqw #24405f; font-style: normal; font-family: var(--f-num); font-weight: 700; font-size: 4cqw; color: #4f6a8a; display: grid; place-items: center; }
.card .rail i.on { background: linear-gradient(180deg, #7fe9ff, #1a8fb5); color: #04202c; box-shadow: 0 0 2cqw rgba(57,215,255,.8); }
.card .rail.evo i.on { background: linear-gradient(180deg, #d2b0ff, #6a2ad0); color: #fff; box-shadow: 0 0 2cqw rgba(155,77,255,.9); }
.card .rail .tl { position: absolute; bottom: 105%; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--f-text); font-weight: 800; font-size: 4.2cqw; color: #fff; background: rgba(5,10,20,.9); padding: .2cqw 1.4cqw; border-radius: 1.2cqw; box-shadow: 0 0 0 .3cqw var(--cyan); }
.card .rail.evo .tl { box-shadow: 0 0 0 .3cqw var(--violet); }
.card .tx { position: absolute; left: 2.5cqw; right: 2.5cqw; top: 82%; bottom: 2cqw; font-size: 5.2cqw; line-height: 1.12; color: #d8e8f7; overflow: hidden; }
.card .tx b { color: var(--gold); font-weight: 800; }
.card .coins { position: absolute; right: 2cqw; top: 40%; z-index: 5; display: flex; align-items: flex-end; gap: .8cqw; }
.card .tower { position: relative; width: 13cqw; height: 22cqw; }
.card .tower img { position: absolute; left: 0; width: 13cqw; height: 12cqw; object-fit: contain; filter: drop-shadow(0 .5cqw .6cqw rgba(0,0,0,.7)); }
.card .coins .x { font-family: var(--f-num); font-weight: 800; font-size: 7.4cqw; color: #fff; background: rgba(5,10,20,.88); padding: 0 1.6cqw; border-radius: 2cqw; box-shadow: 0 0 0 .4cqw var(--gold); margin-bottom: 1cqw; }
.card .stk { position: absolute; left: 2cqw; top: 40%; z-index: 4; display: none; }
/* support cards */
.card.sup .art { height: 50%; }
.card.sup .kindbar { position: absolute; left: 0; right: 0; top: 63%; height: 8%; display: grid; place-items: center; font-weight: 800; font-size: 5.6cqw; letter-spacing: .06em; color: var(--gold); background: #050a14; text-transform: uppercase; }
.card.sup .tx { top: 73%; font-size: 6cqw; }
/* mini (in slots) */
.card.mini .tx { display: none; }
.card.mini .nm { font-size: 9cqw; padding: 0 2cqw 0 13cqw; justify-content: flex-start; text-align: left; }
.card.mini .gem { width: 7cqw; height: 7cqw; }
.card.mini .stats { top: 64%; height: 14%; }
.card.mini .stats b { font-size: 12cqw; flex-direction: column; gap: 0; }
.card.mini .stats b s { font-size: 5.6cqw; }
.card.mini .rail { top: 82%; height: 9%; }
.card.mini .rail i { font-size: 5cqw; }
.card.mini .chev { top: 56%; height: 6%; }
.card.mini .chev .lv { display: none; }
.card.mini .evoap, .card.mini .emb { display: none; }
.card.mini .cost { display: none; }
.card.mini .badges { left: 2cqw; top: 15%; }
.card.mini .bd { font-size: 7cqw; }
.card.mini .coins { top: 34%; }
.card.mini .tower { width: 17cqw; height: 26cqw; } .card.mini .tower img { width: 17cqw; height: 15cqw; }
.card.mini .coins .x { font-size: 10cqw; }
.card.mini.sup .kindbar { font-size: 7cqw; }
.card.spent .in { filter: saturate(.6) brightness(.8); }
.card.sel { outline: none; }
.card.sel .fr { box-shadow: 0 0 0 1cqw #fff1b8, 0 0 6cqw var(--gold), 0 0 12cqw rgba(226,180,74,.6); }
.card.tgt .fr { box-shadow: 0 0 0 1.2cqw #ff5577, 0 0 8cqw #ff3355; animation: pulse .9s infinite; }
.card.tgt-ally .fr { box-shadow: 0 0 0 1.2cqw var(--cyan), 0 0 8cqw var(--cyan); animation: pulse .9s infinite; }
.card.can .fr { box-shadow: 0 0 0 .8cqw rgba(57,215,255,.9), 0 0 6cqw rgba(57,215,255,.5); }

/* ---------------- battle log ---------------- */
.log { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.log header { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-family: var(--f-disp); font-size: 12px; letter-spacing: .08em; border-bottom: 1px solid rgba(226,180,74,.5); }
.log header button { border: none; background: none; font-size: 14px; color: var(--cyan); padding: 0 4px; }
.log.closed header button { transform: rotate(180deg); }
.log ol { list-style: none; margin: 0; padding: 4px 8px; overflow-y: auto; flex: 1; font-size: 12px; line-height: 1.25; }
.log li { padding: 3px 0; border-bottom: 1px solid rgba(57,215,255,.1); color: #cfe2f5; }
.log li .tn { font-family: var(--f-num); font-size: 10px; color: #6f8cae; margin-right: 4px; }
.log li.p0 { border-left: 2px solid var(--cyan); padding-left: 5px; } .log li.p1 { border-left: 2px solid #ff5577; padding-left: 5px; }
.log li.k-ap { color: #e0c8ff; } .log li.k-dmg { color: #ffc2cf; } .log li.k-win { color: var(--gold); font-weight: 800; } .log li.k-turn { color: #fff; font-weight: 700; }
.log.closed ol { display: none; }

.topbtns { display: flex; gap: 5px; z-index: 45; }
.icon-btn { min-width: 32px; height: 32px; padding: 0 7px; border: none; border-radius: 9px; font-weight: 800; font-size: 12px; letter-spacing: .04em; background: linear-gradient(180deg, #1a3c63, #0a1b31); box-shadow: 0 0 0 1.5px var(--gold); }
.icon-btn.off { color: #6d7f95; text-decoration: line-through; }

/* ---------------- combat plate ---------------- */
.plate { position: absolute; z-index: 60; width: 270px; padding: 10px 12px; border-radius: 12px; text-align: center; background: linear-gradient(180deg, rgba(14,42,74,.97), rgba(7,16,31,.98)); box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px rgba(40,26,6,.9), 0 10px 30px rgba(0,0,0,.7), 0 0 30px rgba(155,77,255,.35); }
.plate .eq { font-family: var(--f-num); font-weight: 800; font-size: 19px; letter-spacing: .02em; }
.plate .eq em { font-style: normal; color: var(--gold); }
.plate .sub { font-size: 12px; color: #a9c6e6; margin-top: 3px; font-weight: 600; }
.plate .elline { margin-top: 5px; font-size: 11px; letter-spacing: .08em; font-weight: 800; color: #7f9cc0; border-top: 1px solid rgba(226,180,74,.35); padding-top: 4px; }
.plate .res2 { margin-top: 4px; font-weight: 800; font-size: 13px; color: #ffd0da; }
.plate .row { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.plate .row button { font-family: var(--f-disp); font-size: 14px; padding: 7px 18px; border: none; border-radius: 16px; }
.plate .strike { color: #3a2200; background: var(--goldgrad); box-shadow: 0 0 12px rgba(226,180,74,.7); }
.plate .cancel { background: #1d2a3a; box-shadow: 0 0 0 1px #4a5668; }

/* ---------------- fx ---------------- */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 70; overflow: visible; }
.float { position: absolute; font-family: var(--f-num); font-weight: 800; font-size: 26px; transform: translate(-50%, -50%); text-shadow: 0 2px 0 #000, 0 0 10px currentColor; white-space: nowrap; }
.float.red { color: #ff4d6d; } .float.green { color: #5dffa0; } .float.violet { color: #d4b0ff; } .float.cyan { color: #8deaff; font-size: 20px; } .float.gold { color: #ffe08a; font-size: 18px; }
.ring { position: absolute; border-radius: 50%; border: 3px solid var(--cyan); box-shadow: 0 0 16px var(--cyan), inset 0 0 12px var(--cyan); transform: translate(-50%, -50%); }
.spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #dff8ff; box-shadow: 0 0 8px var(--cyan); }
.ghost { position: absolute; pointer-events: none; }
.shard { position: absolute; }
.bolt { position: absolute; left: 0; top: 0; overflow: visible; }
.bolt polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.flycoin { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; }
.banner { position: absolute; left: 0; right: 0; top: 46%; z-index: 65; text-align: center; font-family: var(--f-disp); font-size: 26px; letter-spacing: .06em; color: #fff; text-shadow: 0 0 14px var(--cyan), 0 3px 0 #000; pointer-events: none; }
.banner.rb { text-shadow: 0 0 14px #ff3355, 0 3px 0 #000; }

/* ---------------- overlays ---------------- */
.overlay { position: absolute; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(3,7,15,.78); backdrop-filter: blur(3px); padding: 12px; }
.close { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border: none; border-radius: 50%; font-size: 16px; background: #10243d; box-shadow: 0 0 0 1.5px var(--gold); z-index: 3; }
.inspect-box { position: relative; display: flex; gap: 16px; align-items: flex-start; max-width: 760px; max-height: 100%; overflow-y: auto; padding: 16px; border-radius: 14px; background: linear-gradient(180deg, rgba(14,42,74,.96), rgba(7,16,31,.98)); box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px rgba(40,26,6,.9), 0 20px 60px #000; }
.inspect-card { width: 260px; flex: none; }
.inspect-info { flex: 1; min-width: 240px; font-size: 14px; line-height: 1.35; padding-right: 26px; }
.inspect-info h2 { font-family: var(--f-disp); font-weight: 400; font-size: 20px; margin: 0 0 2px; }
.inspect-info .meta { color: #a9c6e6; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.inspect-info h3 { font-family: var(--f-text); font-weight: 800; font-size: 12px; letter-spacing: .1em; color: var(--gold); margin: 12px 0 4px; text-transform: uppercase; }
.inspect-info .ab { margin: 4px 0; padding: 6px 8px; border-radius: 8px; background: rgba(5,10,20,.6); box-shadow: inset 0 0 0 1px rgba(57,215,255,.2); }
.inspect-info .ab b { color: var(--foam); }
.inspect-info .ab .why { display: block; font-size: 12px; color: #ffb3c2; margin-top: 2px; }
.inspect-info .ab .usebtn { margin-top: 6px; }
.inspect-info .grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.inspect-info .grid span:nth-child(odd) { color: #a9c6e6; }
.inspect-info .stk { display: flex; gap: 4px; flex-wrap: wrap; }
.inspect-info .stk i { font-style: normal; font-family: var(--f-num); font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #0e2a4a; box-shadow: inset 0 0 0 1px var(--cyan); font-size: 12px; }
.inspect-info .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
#stage.port ~ .overlay .inspect-box, body.port .inspect-box { flex-direction: column; align-items: center; }
body.port .inspect-card { width: min(230px, 58vw); }
body.port .inspect-info { min-width: 0; width: 100%; padding-right: 0; }

.sheet { position: relative; max-width: 640px; max-height: 100%; overflow-y: auto; padding: 18px 18px 22px; border-radius: 14px; font-size: 14px; line-height: 1.4; background: linear-gradient(180deg, rgba(14,42,74,.97), rgba(7,16,31,.98)); box-shadow: 0 0 0 2px var(--gold), 0 20px 60px #000; }
.sheet h2 { font-family: var(--f-disp); font-weight: 400; margin: 0 0 8px; font-size: 20px; }
.sheet h3 { color: var(--gold); font-size: 13px; letter-spacing: .1em; margin: 14px 0 4px; }
.sheet ul { margin: 4px 0; padding-left: 18px; } .sheet li { margin: 2px 0; }
.sheet b { color: var(--cyan); }

.menu { display: block; overflow-x: hidden; overflow-y: auto; padding: 12px; background: linear-gradient(180deg, rgba(3,7,15,.9), rgba(3,7,15,.7) 40%, rgba(3,7,15,.8)); backdrop-filter: blur(2px); }
.menu .mbox { position: relative; width: 100%; max-width: 560px; margin: 0 auto; text-align: center; padding: 6px 0 18px; overflow: hidden; }
.wordmark { display: block; white-space: nowrap; font-family: var(--f-disp); font-size: min(64px, 8.4vw); padding: 4px 4% 6px; line-height: 1.05; letter-spacing: .01em; background: linear-gradient(180deg, #ffffff 0%, #bff2ff 35%, #39d7ff 60%, #9b4dff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(57,215,255,.6)) drop-shadow(0 3px 0 #0a1a33); }
.subtitle { font-family: var(--f-disp); font-size: min(24px, 4.6vw); margin-top: 2px; letter-spacing: .03em; white-space: nowrap; }
.subtitle .cx { color: #9fe8ff; } .subtitle .rb { color: #ff6d8c; } .subtitle .vs { color: var(--gold); font-size: .8em; }
.tagline { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: #cfe2f5; margin: 8px auto 10px; max-width: 420px; line-height: 1.3; }
.mplate { position: relative; margin: 12px 4px 0; padding: 12px 12px 14px; border-radius: 12px; background: linear-gradient(180deg, rgba(14,42,74,.9), rgba(7,16,31,.94)); box-shadow: 0 0 0 1.5px rgba(226,180,74,.85), 0 0 0 3px rgba(40,26,6,.85), inset 0 1px 0 rgba(255,241,184,.3), 0 8px 24px rgba(0,0,0,.5); }
.mlabel { font-family: var(--f-disp); font-weight: 400; font-size: 15px; letter-spacing: .08em; color: var(--gold); margin: 0 0 10px; text-shadow: 0 0 8px rgba(226,180,74,.5); }
.factions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fbtn { position: relative; min-width: 0; padding: 14px 10px 14px; border: none; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--foam);
  clip-path: polygon(10% 0, 90% 0, 100% 8%, 100% 92%, 90% 100%, 10% 100%, 0 92%, 0 8%);
  background:
    linear-gradient(125deg, rgba(255,255,255,.16) 0 14%, transparent 14% 40%, rgba(255,255,255,.07) 40% 52%, transparent 52%),
    linear-gradient(235deg, rgba(57,215,255,.18) 0 22%, transparent 22% 60%, rgba(155,77,255,.14) 60% 72%, transparent 72%),
    linear-gradient(180deg, #16416b, #0a1c33 60%, #07101f);
  box-shadow: inset 0 0 0 2px rgba(226,180,74,.55), inset 0 0 24px rgba(57,215,255,.18); transition: filter .2s, transform .2s; }
.fbtn.rb { background:
    linear-gradient(125deg, rgba(255,255,255,.14) 0 14%, transparent 14% 40%, rgba(255,255,255,.06) 40% 52%, transparent 52%),
    linear-gradient(235deg, rgba(255,61,127,.2) 0 22%, transparent 22% 60%, rgba(155,77,255,.12) 60% 72%, transparent 72%),
    linear-gradient(180deg, #4a1226, #1c0710 60%, #0a0306); box-shadow: inset 0 0 0 2px rgba(226,180,74,.55), inset 0 0 24px rgba(142,31,63,.4); }
.fwrap { position: relative; filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.fwrap .corner { width: 26px; height: 26px; z-index: 2; }
.fwrap.on.cx { filter: drop-shadow(0 0 3px #fff1b8) drop-shadow(0 0 16px rgba(57,215,255,.95)); }
.fwrap.on.rb { filter: drop-shadow(0 0 3px #fff1b8) drop-shadow(0 0 16px rgba(255,51,85,.95)); }
.fwrap.on .fbtn { box-shadow: inset 0 0 0 3px #f4d27a, inset 0 0 0 5px rgba(255,241,184,.5), inset 0 0 30px rgba(226,180,74,.35); }
.fwrap:not(.on) .fbtn { filter: saturate(.55) brightness(.75); }
.fbtn img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(57,215,255,.6)); }
.fbtn.rb img { filter: drop-shadow(0 0 12px rgba(255,51,85,.7)); }
.fbtn b { font-family: var(--f-disp); font-weight: 400; font-size: 17px; letter-spacing: .03em; }
.fbtn small { font-size: 13px; font-weight: 600; color: #d5e6f7; line-height: 1.25; background: rgba(5,10,20,.6); padding: 4px 6px; border-radius: 6px; }
.fbtn .tick { font-family: var(--f-text); font-weight: 800; font-size: 12px; letter-spacing: .12em; color: #3a2200; background: var(--goldgrad); padding: 2px 10px; border-radius: 10px; visibility: hidden; }
.fwrap.on .tick { visibility: visible; }
.modes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mbtn { position: relative; padding: 10px 16px; border: none; border-radius: 10px; font-weight: 800; font-size: 15px; letter-spacing: .05em; color: #b9cde3;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
  background: linear-gradient(125deg, rgba(255,255,255,.1) 0 20%, transparent 20%), linear-gradient(180deg, #1a3557, #0a1a30); box-shadow: inset 0 0 0 1.5px rgba(226,180,74,.45); }
.mbtn.on { color: #3a2200; background: var(--goldgrad); box-shadow: inset 0 0 0 2px #fff1b8; text-shadow: 0 1px 0 rgba(255,240,190,.6); }
.mbtn.on::before { content: "✓ "; }
.mwrap { display: inline-block; }
.mwrap.on { filter: drop-shadow(0 0 10px rgba(226,180,74,.85)); }
.mnote { font-size: 13px; color: #cfe2f5; margin-top: 8px; line-height: 1.3; }
.big { margin-top: 14px; font-family: var(--f-disp); font-size: 22px; padding: 13px 38px; border: none; border-radius: 30px; color: #3a2200; background: var(--goldgrad); box-shadow: 0 0 0 2px #fff1b8, 0 0 22px rgba(226,180,74,.8); }
.big.alt { font-size: 15px; padding: 9px 22px; margin-left: 6px; color: var(--foam); background: linear-gradient(180deg, #2a4a6e, #0e2a4a); box-shadow: 0 0 0 1.5px var(--gold); }
.summary { font-size: 14px; font-weight: 700; color: #e6f3ff; margin-top: 8px; }
.summary .cx { color: #9fe8ff; } .summary .rb { color: #ff8aa3; }
.record { margin: 14px 4px 0; font-size: 14px; color: #cfe2f5; font-weight: 600; background: rgba(5,10,20,.7); padding: 8px 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(226,180,74,.35); }
.record b { font-family: var(--f-num); color: var(--foam); }
.scope { font-size: 13px; color: #a9c6e6; margin-top: 6px; line-height: 1.3; }

.handoff { background: rgba(3,7,15,.28); backdrop-filter: none; align-items: flex-end; padding-bottom: 6vh; }
.handoff .sheet { text-align: center; max-width: 360px; padding: 12px 16px 14px; }
.handoff .sheet p { margin: 6px 0 0; font-size: 13px; color: #cfe2f5; }
.handoff .big { margin-top: 10px; }
.handoff .who { font-family: var(--f-disp); font-size: 26px; margin: 6px 0; }

.victory { flex-direction: column; text-align: center; background: rgba(2,5,12,.82); overflow: hidden; }
.victory .flood { position: absolute; left: 0; right: 0; height: 55%; pointer-events: none; }
.victory .flood svg { width: 100%; height: 100%; }
.victory .vbox { position: relative; z-index: 2; }
.victory .wordmark { font-size: clamp(34px, 10.5vw, 96px); }
.victory .wins { font-family: var(--f-disp); font-size: clamp(22px, 6vw, 38px); margin-top: 6px; color: #fff; text-shadow: 0 0 16px var(--gold); }
.victory .why { margin-top: 6px; color: #cfe2f5; font-weight: 600; }
.victory .vstats { margin-top: 10px; font-size: 13px; color: #a9c6e6; }
.victory .vstats b { font-family: var(--f-num); color: #fff; }

#stage.port .panel .vial { height: 32px; width: 14px; }
#stage.port .panel .lp .num { font-size: 24px; }

/* ---------------- evolution, weapons, spacecraft ---------------- */
.card .form { position: absolute; left: 0; right: 0; top: 50.5%; height: 5.5%; z-index: 4; display: grid; place-items: center; font-family: var(--f-text); font-weight: 800; font-size: 4.8cqw; letter-spacing: .06em; color: #fff; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--elc) 70%, #000) 20%, color-mix(in srgb, var(--elc) 70%, #000) 80%, transparent); text-shadow: 0 0 2cqw #000; white-space: nowrap; overflow: hidden; }
.card.mini .form { font-size: 6cqw; top: 49%; height: 7%; }
.card.evx .art::after { background: radial-gradient(ellipse at 50% 60%, transparent 35%, color-mix(in srgb, var(--elc) 55%, transparent) 100%); mix-blend-mode: screen; }
.card.lv2 .fr { box-shadow: 0 3px 10px rgba(0,0,0,.6), inset 0 0 0 .6cqw rgba(255,241,184,.6), 0 0 3cqw color-mix(in srgb, var(--elc) 60%, transparent); }
.card.lv3 .fr, .card.lv4 .fr { box-shadow: 0 3px 10px rgba(0,0,0,.6), inset 0 0 0 .6cqw rgba(255,241,184,.6), 0 0 5cqw var(--elc); }
.card.lv3 .in, .card.lv4 .in, .card.lv5 .in { box-shadow: inset 0 0 0 1.2cqw var(--elc); }
.card.lv4 .fr { animation: evoglow 2.2s ease-in-out infinite; }
.card.lv5 .fr { background: conic-gradient(from 0deg, #ffe680, #7ff0ff, #c79bff, #ff8ad8, #ffe680); animation: evoglow 1.8s ease-in-out infinite; box-shadow: 0 0 7cqw #ffd84a, inset 0 0 0 .6cqw #fff; }
.card.lv5 .art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 45%, transparent 60%); background-size: 250% 100%; animation: foil 3s linear infinite; mix-blend-mode: screen; }
@keyframes evoglow { 50% { filter: brightness(1.25) saturate(1.3); } }
.r-evolutionary { --gc: #ffd84a; }
.card .wchip { position: absolute; left: 2cqw; right: 2cqw; top: 41%; z-index: 4; font-size: 5cqw; font-weight: 800; letter-spacing: .03em; color: #ffe9a8; background: rgba(5,10,20,.9); border-radius: 2cqw; padding: .4cqw 1.6cqw; box-shadow: 0 0 0 .4cqw var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.card.mini .wchip { font-size: 6.6cqw; top: 38%; right: 22cqw; }
.card .shipbar { position: absolute; left: 0; right: 0; bottom: 0; height: 6%; display: grid; place-items: center; font-size: 4.4cqw; font-weight: 800; letter-spacing: .08em; color: #9fe8ff; background: rgba(5,10,20,.85); }
.card.f-rb .shipbar { color: #ff9ab0; }
.card.wpn .kindbar { color: #ffd0a0; }

.labbox { position: relative; width: min(820px, 100%); max-height: 100%; overflow-y: auto; padding: 14px 16px 18px; border-radius: 14px; background: linear-gradient(180deg, rgba(30,14,70,.97), rgba(7,16,31,.98)); box-shadow: 0 0 0 2px var(--violet), 0 0 0 4px rgba(40,26,6,.9), 0 20px 60px #000; font-size: 13.5px; line-height: 1.35; }
.labbox .mlabel { font-family: var(--f-disp); color: #d9b8ff; letter-spacing: .08em; font-size: 15px; margin-bottom: 8px; }
.labgrid { display: flex; gap: 14px; align-items: flex-start; }
.labcard { width: 220px; flex: none; position: sticky; top: 0; }
.labinfo { flex: 1; min-width: 0; }
.labinfo h2 { font-family: var(--f-disp); font-weight: 400; font-size: 19px; margin: 0; padding-right: 30px; }
.labinfo .meta { color: #a9c6e6; font-size: 12px; font-weight: 700; }
.labinfo .chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.labinfo .chips span { font-family: var(--f-num); font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 8px; background: #0e2a4a; box-shadow: inset 0 0 0 1px var(--cyan); }
.labinfo .chips .v { box-shadow: inset 0 0 0 1px var(--violet); color: #e5d2ff; } .labinfo .chips .g { box-shadow: inset 0 0 0 1px var(--gold); color: #ffe9a8; } .labinfo .chips .r { box-shadow: inset 0 0 0 1px #ff3355; color: #ffb3c2; }
.labinfo .path { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(5,10,20,.55); box-shadow: inset 0 0 0 1px rgba(155,77,255,.35); }
.labinfo h3 { margin: 0 0 4px; font-size: 12px; letter-spacing: .1em; color: var(--gold); }
.labinfo .path b { color: #fff; }
.labinfo .path .pill { margin-top: 8px; }
.labinfo .why { margin-top: 6px; color: #ffb3c2; font-size: 12.5px; }
.labinfo .odds { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12.5px; }
.labinfo .odds td { padding: 2px 4px; white-space: nowrap; }
.labinfo .odds td:nth-child(3) { width: 40%; } .labinfo .odds td i { display: block; height: 7px; border-radius: 4px; background: linear-gradient(90deg, #6a2ad0, #d2b0ff); }
.labinfo .odds td:last-child { text-align: right; font-family: var(--f-num); font-weight: 700; }
.labinfo .odds .t-common { color: #9aa8b8; } .labinfo .odds .t-rare { color: #39d7ff; } .labinfo .odds .t-epic { color: #c79bff; } .labinfo .odds .t-legendary { color: var(--gold); }
.eli { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; margin-right: 3px; }
.labinfo .rules { margin-top: 4px; font-size: 11.5px; color: #a9c6e6; }
.labinfo .combo { margin-top: 3px; font-size: 12.5px; color: #cfe2f5; } .labinfo .combo.done { color: #ffe9a8; }
body.port .labgrid { flex-direction: column; align-items: center; }
body.port .labcard { position: static; width: min(190px, 50vw); }
body.port .labinfo { width: 100%; }

.evofx { z-index: 120; background: radial-gradient(ellipse at 50% 45%, rgba(40,90,160,.55), rgba(3,7,15,.92) 70%); }
.evofx.rb { background: radial-gradient(ellipse at 50% 45%, rgba(140,20,45,.55), rgba(3,3,6,.94) 70%); }
.evobox { width: min(440px, 100%); max-height: 100%; overflow-y: auto; text-align: center; }
.evobox .mlabel { font-family: var(--f-disp); letter-spacing: .08em; color: #9fe8ff; font-size: 15px; }
.evofx.rb .evobox .mlabel { color: #ff9ab0; }
.evobox .req { margin: 4px 0 8px; font-weight: 800; color: #eaf6ff; font-size: 14px; }
.stagecard { position: relative; width: min(200px, 46vw); margin: 0 auto; perspective: 800px; }
.stagecard .old, .stagecard .new { width: 100%; }
.stagecard .new { position: absolute; inset: 0; }
.stagecard .burst { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(255,255,255,.9), rgba(159,232,255,.6) 30%, transparent 65%); }
.reel { position: relative; width: 74px; height: 64px; margin: 10px auto 0; overflow: visible; }
.reel::before { content: ""; position: absolute; inset: -3px; border-radius: 10px; box-shadow: 0 0 0 2px var(--gold), 0 0 16px var(--gold); z-index: 2; pointer-events: none; }
.reel { -webkit-mask: linear-gradient(90deg, transparent, #000 40%, #000 60%, transparent); mask: none; }
.reel .strip { position: absolute; left: 0; top: 0; display: flex; }
.reel .strip span { width: 74px; height: 64px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #cfe2f5; }
.reel .strip span .eli { width: 34px; height: 34px; margin: 0; }
.reel .strip span.hit { color: #fff; text-shadow: 0 0 8px var(--gold); }
.reveal { margin-top: 10px; }
.reveal .rname { font-family: var(--f-disp); font-size: 20px; color: #fff; text-shadow: 0 0 12px var(--violet); }
.reveal .rstats { margin-top: 4px; font-family: var(--f-num); font-weight: 700; font-size: 14px; }
.reveal .rstats em { font-style: normal; color: #7dffad; margin-left: 2px; } .reveal .rstats em.dn { color: #ffb3c2; }
.reveal .rab { margin-top: 6px; font-size: 13.5px; } .reveal .rab b { color: var(--gold); }
.reveal .rwhy { margin-top: 6px; font-size: 12px; color: #a9c6e6; line-height: 1.35; }
.reveal .big { margin-top: 10px; }
.card:has(.emb2) .badges { right: 14cqw; }
