/* PullVerity Arena: Card Battles */
@media (max-width: 900px) { .tab-desk { display: none; } }

.arena-promo { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 14px; padding: 14px 16px; text-align: left; color: inherit; cursor: pointer; border-radius: 18px;
  border: 2px solid transparent; box-shadow: 0 4px 0 rgba(0,0,0,.25);
  background: linear-gradient(100deg, rgba(227,53,13,.22), rgba(59,111,216,.22)) padding-box, linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(110deg, var(--fire), var(--electric), var(--water)) border-box; transition: transform .15s; }
.arena-promo:hover { transform: translateY(-2px); }
.arena-promo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.arena-promo-ic { flex: 0 0 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff; background: linear-gradient(135deg, var(--fire), var(--red-deep)); box-shadow: 0 0 0 3px var(--accent); }
.arena-promo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.arena-promo-body strong { font-family: var(--font-display); font-size: 18px; }
.arena-promo-body .eyebrow { margin: 0; }

.arena-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
.arena-top .card + .card { margin-top: 0; }
.rank-row { display: flex; gap: 12px; align-items: center; margin: 6px 0 12px; }
.rank-row > div { display: flex; flex-direction: column; min-width: 0; }
.rank-badge { flex: 0 0 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-size: 24px; font-weight: 700; background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 #c99700; }
.rank-name { font-family: var(--font-display); font-size: 22px; }
.rank-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.rank-stats b { display: block; font-size: 18px; color: var(--text); }
.mode { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); margin-top: 10px; }
.mode > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mode .btn { flex: 0 0 auto; }
.sub-toggle { margin-top: 10px; }
.sub-toggle strong { display: block; color: var(--text); }

.how-arena { margin-top: 18px; }
.plain-steps { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.plain-steps strong, .plain-steps span { display: block; }
.plain-steps span { color: var(--muted); font-size: 13px; }

/* Type colors */
.t-fire { --tc: var(--fire); } .t-water { --tc: var(--water); } .t-grass { --tc: var(--grass); }
.t-electric { --tc: var(--electric); } .t-psychic { --tc: var(--psychic); } .t-fighting { --tc: var(--fighting); }
.t-normal, .t-dark, .t-metal, .t-dragon { --tc: #9aa6c8; }
.tchip { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; color: #fff; background: var(--tc, #9aa6c8); text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.tchip.mintchip { background: var(--accent); color: var(--accent-ink); text-shadow: none; }

/* Abstract type art (no official artwork) */
.acard-art { position: absolute; inset: 0; display: grid; place-items: center; background:
  radial-gradient(circle at 50% 50%, var(--tc) 0 26%, transparent 27%),
  repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.08) 0 10deg, transparent 10deg 20deg),
  linear-gradient(160deg, color-mix(in srgb, var(--tc) 55%, #0a1128), #0a1128); }
.acard-art b { font-family: var(--font-display); font-size: 28px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.acard-art.big b { font-size: 40px; }

/* Team */
.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tcard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; min-width: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 22%, var(--surface)), var(--surface) 45%); border: 3px solid var(--tc); box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.tcard-img { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #0a1128; border: 2px solid rgba(255,255,255,.18); }
.tcard-img img { width: 100%; height: 100%; object-fit: cover; }
.tcard-img .pill { position: absolute; left: 6px; bottom: 6px; }
.tcard-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.tcard-head strong { font-family: var(--font-display); font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.hp { font-weight: 700; color: var(--fail); font-size: 13px; }
.atk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.atk-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
.atk-list li span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* Roster */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.roster-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: inherit; text-align: left; min-width: 0; }
button.roster-item { cursor: pointer; }
button.roster-item:hover { border-color: var(--accent); }
button.roster-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.roster-item.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.roster-item.off { opacity: .8; border-style: dashed; }
.roster-img { position: relative; flex: 0 0 48px; height: 64px; border-radius: 6px; overflow: hidden; background: #0a1128; }
.roster-img img { width: 100%; height: 100%; object-fit: cover; }
.roster-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.roster-check { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--border); }
.roster-item.on .roster-check { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Battle */
.battle-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); }
.battle-bar > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.battle-bar .eyebrow { margin: 0; }
.score { font-size: 18px; font-family: var(--font-display); overflow-wrap: anywhere; }
.field-wrap { margin-top: 12px; padding: 14px; border-radius: 18px; display: grid; gap: 10px; max-width: 720px;
  background: radial-gradient(ellipse at 50% 0%, rgba(59,111,216,.35), transparent 60%), radial-gradient(ellipse at 50% 100%, rgba(120,200,80,.22), transparent 60%), var(--surface); border: 2px solid var(--border); }
.side-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.side-l { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench { display: flex; gap: 6px; }
.bench-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--pass); border: 2px solid rgba(255,255,255,.5); }
.bench-dot.now { box-shadow: 0 0 0 2px var(--accent); }
.bench-dot.ko { background: var(--surface-2); border-color: var(--border); }
.fighter { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; border: 3px solid var(--tc); min-width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 25%, var(--bg)), var(--bg)); }
.fighter-img { position: relative; flex: 0 0 96px; height: 128px; border-radius: 8px; overflow: hidden; background: #0a1128; border: 2px solid rgba(255,255,255,.2); }
.fighter-img img { width: 100%; height: 100%; object-fit: cover; }
.fighter-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.hpbar { height: 12px; border-radius: 99px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25); overflow: hidden; }
.hpbar i { display: block; height: 100%; background: var(--pass); border-radius: inherit; transition: width .5s ease; }
.hpbar.mid i { background: var(--accent); }
.hpbar.low i { background: var(--fail); }
.hp-num { font-size: 13px; font-weight: 700; }
.energy { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.energy i, .atk-cost i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.energy .muted { margin-left: 4px; }
.fighter.hit .fighter-img { animation: shake .4s; }
.dmg { position: absolute; inset: auto 0 40% 0; text-align: center; font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 2px 0 var(--fail), 0 0 8px rgba(0,0,0,.6); animation: pop .8s ease-out forwards; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop { from { transform: translateY(10px) scale(.7); opacity: 0; } 30% { opacity: 1; transform: scale(1.15); } to { transform: translateY(-14px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fighter.hit .fighter-img, .dmg { animation: none; } .hpbar i { transition: none; } }
.vs { justify-self: center; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--fire), var(--red-deep)); box-shadow: 0 0 0 3px var(--accent); }
.moves { margin-top: 12px; max-width: 720px; }
.moves-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.atk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.atk { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; min-height: 52px; padding: 10px 12px; border-radius: 12px; text-align: left; cursor: pointer;
  border: 2px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.atk:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.atk:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.atk:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.atk-cost { display: flex; gap: 3px; }
.atk-name { overflow-wrap: anywhere; }
.atk-dmg { font-size: 18px; }
.atk-note { grid-column: 1 / -1; font-size: 11px; font-weight: 600; color: var(--accent); }
.atk.charge { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
.atk.charge .atk-note { color: var(--muted); }
.blog { list-style: none; margin: 12px 0 0; padding: 10px 14px; max-width: 720px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-size: 13px; display: grid; gap: 4px; }
.blog li:first-child { font-weight: 700; color: var(--text); }
.blog li:not(:first-child) { color: var(--muted); }

.arena-result { text-align: center; max-width: 560px; padding: 28px 20px; }
.result-title { font-size: 34px; margin: 4px 0; }
.arena-result.r-win .result-title { color: var(--pass); }
.arena-result.r-lose .result-title { color: var(--fail); }
.score-big { font-size: 40px; font-weight: 700; margin: 4px 0 8px; }
.score-big .muted { font-size: 16px; }
.arena-result .btn-row { margin-top: 16px; justify-content: center; }

@media (max-width: 760px) { .arena-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .team { grid-template-columns: minmax(0, 1fr); }
  .tcard { flex-direction: row; }
  .tcard-img { flex: 0 0 96px; aspect-ratio: 3 / 4; }
  .tcard-body { flex: 1; min-width: 0; }
  .atk-grid { grid-template-columns: minmax(0, 1fr); }
  .fighter-img { flex-basis: 76px; height: 102px; }
  .rank-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode { flex-wrap: wrap; }
  .field-wrap { padding: 10px; }
}
.arena-top { align-items: start; }
#arenaBody { scroll-margin-top: 72px; }
.arena-result > h2.result-title { justify-content: center; }
.arena-result > h2.result-title::before { display: none; }

/* Rank ladder + Grand Master arenas */
.ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.rung { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); opacity: .6; min-width: 0; }
.rung.got { opacity: 1; }
.rung.now { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,203,5,.25); }
.rung-body { display: flex; flex-direction: column; min-width: 0; }
.rung-body strong { font-family: var(--font-display); }
.rung-badge { flex: 0 0 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: #1a2a66; background: #c9d2ea; }
.rung-1 .rung-badge { background: linear-gradient(135deg, #ffe27a, #e0a800); }
.rung-2 .rung-badge { background: linear-gradient(135deg, #b8a4ff, #6c4fd8); color: #fff; }
.rung-3 .rung-badge, .gm-head .rung-badge { background: linear-gradient(135deg, #ff7a59, #c21f3a 55%, #ffcb05); color: #fff; }
.gm-card { margin-top: 14px; display: grid; gap: 10px; }
.gm-card.locked { opacity: .85; border-style: dashed; }
.gm-head { display: flex; gap: 12px; align-items: center; }
.gm-head h2 { margin: 0; }
.gm-head p { margin: 2px 0 0; }
.gm-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.gm-form .btn-row { grid-column: 1 / -1; }
.my-arena { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--tc); background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 20%, var(--bg)), var(--bg)); }
.my-arena-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.my-arena-body strong { font-family: var(--font-display); font-size: 17px; overflow-wrap: anywhere; }
@media (max-width: 760px) { .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gm-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 420px) { .gm-form { grid-template-columns: minmax(0, 1fr); } }
.join-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.join-form .field { flex: 1 1 200px; margin: 0; }
#joinMsg:empty { display: none; }
.arena-gate { margin-bottom: 14px; border-color: var(--accent); }
.arena-gate .vsteps { margin: 10px 0; }
.arena-gate .btn-row { align-items: center; gap: 10px; }
.roster-body .pill { align-self: flex-start; }
.team-empty { margin: 0 0 8px; }
.rung-badge.fr { background: linear-gradient(135deg, var(--water), #1a3fa8); color: #fff; }
body.arena-off .arena-promo, body.arena-off .tab[data-view="arena"] { display: none !important; }
.arena-legal { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* Online friend battles */
.friends.online .on-form { display: grid; grid-template-columns: 1fr; gap: 10px; max-width: 360px; }
.friends.online .on-form .btn { width: 100%; }
.friends.online .on-split { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 24px; align-items: start; }
.friends.online .on-how { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.friends.online .on-how ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.friends.online .on-how li { font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) { .friends.online .on-split { grid-template-columns: 1fr; } }
.friends.online .on-form .field { margin: 0; }
.friends.online .small.bad { color: #ff8a8a; }
.friends.online .warnline { background: rgba(255, 196, 0, .1); border: 1px solid rgba(255, 196, 0, .35); border-radius: 10px; padding: 8px 12px; }
.friends.online .my-arena.hot { border-color: var(--accent, #ffcb05); box-shadow: 0 0 0 1px var(--accent, #ffcb05) inset; }
.battle-bar .btn-row { gap: 8px; flex-wrap: wrap; }
.battle-bar .muted.small { display: block; }

/* ---------- Battle table: a playmat with you and your opponent across from each other ---------- */
.mat { position: relative; margin-top: 12px; max-width: 760px; padding: 14px; border-radius: 22px; display: grid; gap: 6px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 58px, rgba(255,255,255,.09) 59px 61px, transparent 62px),
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(227,53,13,.28), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(59,111,216,.38), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.018) 0 2px, transparent 2px 9px),
    linear-gradient(#0c2147, #0a1a3a);
  border: 3px solid #26407e; box-shadow: inset 0 0 0 2px rgba(255,203,5,.18), inset 0 0 60px rgba(0,0,0,.55), 0 10px 30px rgba(0,0,0,.35); }
.mat::before { content: ''; position: absolute; inset: 10px; border-radius: 16px; border: 1px dashed rgba(255,255,255,.12); pointer-events: none; z-index: -1; }
.mat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.mat-row.foe .mat-side { justify-self: end; align-items: flex-end; }
.mat-row.me .mat-side { justify-self: start; align-items: flex-start; }
.mat-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mat-tag { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 4px 10px 4px 4px; border-radius: 99px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.mat-tag strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-av { flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; background: linear-gradient(135deg, var(--fire), var(--red-deep)); color: #fff; }
.tag-av.you { background: linear-gradient(135deg, var(--water), var(--blue)); }
.think { display: inline-flex; gap: 3px; margin-left: 2px; }
.think i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: think 1s infinite ease-in-out; }
.think i:nth-child(2) { animation-delay: .15s; } .think i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* Center line */
.mat-line { position: relative; display: flex; justify-content: center; align-items: center; gap: 10px; height: 34px; }
.mat-line::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: linear-gradient(90deg, transparent, rgba(255,203,5,.55), transparent); }
.mat-line .vs { position: relative; width: 34px; height: 34px; font-size: 13px; }
.mat-turn { position: relative; font-family: var(--font-display); font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #0a1a3a; border: 1px solid rgba(255,203,5,.5); color: var(--accent); }
.turn-them .mat-turn { color: #ffb3a9; border-color: rgba(239,106,91,.6); }

/* Cards */
.pcard { --w: 150px; position: relative; width: var(--w); aspect-ratio: 63 / 88; border-radius: 10px; flex: 0 0 auto; }
.pcard.face { display: flex; flex-direction: column; gap: 4px; padding: 7px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 55%, #fff 0%), color-mix(in srgb, var(--tc) 30%, #0a1128) 70%);
  border: 4px solid #f3d36b; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 8px 18px rgba(0,0,0,.45); }
.pc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; min-width: 0; }
.pc-name { font-family: var(--font-display); font-size: 13px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
.pc-hp { flex: 0 0 auto; font-size: 10px; font-weight: 800; }
.pc-art { position: relative; flex: 1; min-height: 0; border-radius: 4px; overflow: hidden; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.55);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tc) 70%, #fff), color-mix(in srgb, var(--tc) 40%, #0a1128)); }
.pc-art img { width: 100%; height: 100%; object-fit: cover; }
.pc-letter { font-family: var(--font-display); font-weight: 700; font-size: 44px; color: rgba(255,255,255,.92); text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.pc-types { display: flex; gap: 3px; flex-wrap: wrap; }
.pc-types .tchip { font-size: 9px; padding: 1px 5px; }
.pcard .hpbar { height: 8px; }
.pcard .hp-num { font-size: 10px; line-height: 1; }
.pcard .energy i { width: 8px; height: 8px; }
.pcard .energy .muted { font-size: 10px; color: rgba(255,255,255,.75); }
.slot { position: relative; display: grid; place-items: center; padding: 6px; border-radius: 14px; border: 2px dashed rgba(255,255,255,.14); }
.turn-you .mat-row.me .slot, .turn-them .mat-row.foe .slot { border-color: rgba(255,203,5,.7); box-shadow: 0 0 22px rgba(255,203,5,.25); }

/* Card back: what you see of your opponent's reserve cards */
.pcard.back { display: grid; place-items: center; background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 4px, transparent 4px 10px),
    radial-gradient(ellipse at 50% 30%, #3b6fd8, #142b6b 70%);
  border: 3px solid #0e1d4a; box-shadow: inset 0 0 0 2px rgba(255,203,5,.35), 0 4px 10px rgba(0,0,0,.4); }
.pcard.back::before { content: ''; width: 46%; aspect-ratio: 1; transform: rotate(45deg); border-radius: 18%; background: linear-gradient(135deg, var(--accent), #e0a800); box-shadow: 0 0 0 3px #142b6b, 0 0 0 5px rgba(255,203,5,.5); }
.pc-logo { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 10px; letter-spacing: .08em; color: #f4f6ff; }
.pc-logo { color: #142b6b; font-size: 11px; }
.pc-logo b { color: #142b6b; }
.mat-hand { display: flex; align-items: center; min-width: 0; }
.mat-row.foe .mat-hand { justify-self: start; }
.mat-row.me .mat-hand { justify-self: end; }
.mat-hand .pcard.back { --w: 54px; }
.mat-hand .pcard.back .pc-logo { font-size: 8px; }
.mat-hand .pcard + .pcard { margin-left: -22px; }
.mat-hand .fan.f0 { transform: rotate(-6deg); } .mat-hand .fan.f1 { transform: rotate(2deg) translateY(2px); } .mat-hand .fan.f2 { transform: rotate(9deg) translateY(5px); }
.pcard.mini { --w: 54px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 3px; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 60%, #fff 0%), color-mix(in srgb, var(--tc) 30%, #0a1128)); border: 2px solid #f3d36b; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.pcard.mini .pc-letter { font-size: 18px; }
.mini-n { font-size: 8px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-hand.mine .pcard + .pcard { margin-left: -14px; }
.hand-empty { font-size: 11px; color: var(--faint); font-weight: 600; }

/* KO pile */
.pile { position: relative; display: flex; align-items: center; gap: 6px; }
.pile-card { width: 22px; height: 30px; border-radius: 4px; background: #1a2a66; border: 2px solid #3b4f8f; }
.pile-card + .pile-card { margin-left: -18px; }
.pile-n { font-weight: 800; font-size: 15px; }
.pile-l { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.pile.empty .pile-n { color: var(--faint); }

/* Motion */
.pcard.reveal { animation: flipin .6s cubic-bezier(.2,.8,.2,1); }
.pcard.deal { animation: dealin .45s cubic-bezier(.2,.8,.2,1); }
.pcard.lunge-up { animation: lungeup .45s ease-out; }
.pcard.lunge-down { animation: lungedown .45s ease-out; }
.pcard.hit { animation: shake .4s .2s; }
.pcard.hit .pc-art::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; animation: flash .4s .2s; }
@keyframes flipin { from { transform: perspective(600px) rotateY(180deg) scale(.85); filter: brightness(.4); } to { transform: none; filter: none; } }
@keyframes dealin { from { transform: translateY(40px) rotate(-6deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lungeup { 40% { transform: translateY(-26px) scale(1.04); } }
@keyframes lungedown { 40% { transform: translateY(26px) scale(1.04); } }
@keyframes flash { 30% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .pcard.reveal, .pcard.deal, .pcard.lunge-up, .pcard.lunge-down, .pcard.hit, .pcard.hit .pc-art::after, .think i { animation: none; } }

@media (max-width: 560px) {
  .mat { padding: 10px 6px; border-radius: 18px; }
  .mat-row { gap: 6px; }
  .pcard { --w: 124px; }
  .pc-letter { font-size: 36px; }
  .mat-hand .pcard.back, .pcard.mini { --w: 40px; }
  .mat-hand .pcard + .pcard { margin-left: -24px; }
  .mat-tag { font-size: 11px; padding-right: 7px; }
  .mat-tag strong { max-width: 64px; }
  .pile-l { font-size: 9px; }
  .slot { padding: 4px; }
}
/* Your own card shows its real picture, full card, nothing cut off */
.pcard.face.has-img { padding: 6px; overflow: hidden; background: #0a1128; }
.pcard.face.has-img .pc-art { position: absolute; inset: 0; border: 0; border-radius: inherit; background: #0a1128; }
.pcard.face.has-img .pc-art img { object-fit: contain; }
.pcard.face.has-img .pc-top, .pcard.face.has-img .pc-types { display: none; }
.pcard.face.has-img::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(to top, rgba(6,10,30,.92), rgba(6,10,30,0)); pointer-events: none; z-index: 1; }
.pcard.face.has-img > .hpbar, .pcard.face.has-img > .energy, .pcard.face.has-img > :not(.pc-art):not(.pc-top):not(.pc-types) { position: relative; z-index: 2; }
.pcard.face.has-img > :nth-child(4) { margin-top: auto; }
