/* Clash Cards: page styles on top of ../arcade-common/pz.css */
body { --accent: #ff9f1c; --accent2: #e5383b; --atk1: #ff9a47; --atk2: #e5383b; --def1: #52d0f5; --def2: #2f6fed; --trk1: #c98bff; --trk2: #7b2cbf; --sup1: #7ef0a0; --sup2: #1f9a58; }
body[data-tod="day"] { --accent: #ef7d00; --accent2: #d62839; --glow: rgba(239, 125, 0, .25); }
body[data-tod="night"] { --glow: rgba(255, 159, 28, .22); }
.hint.tiny { font-size: .8rem; margin-top: 8px; }
.hero-card .menu-art { aspect-ratio: 280 / 160; width: 100%; height: auto; max-height: 300px; background: transparent; }
.lobbybox > .card { background: transparent; border: 0; box-shadow: none; padding: 0; }
.lobbybox > .card > h2 { display: none; }
.lobbybox #pzLobbyJoin > .field { display: none; }
.waiting .tabs, .waiting #timerLabel, .waiting #timerPick, .waiting #timerHint { display: none; }
.top { gap: 6px; }
.brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.95rem, 4.2vw, 1.55rem); letter-spacing: -.03em; }
.btn.small, .chips button, .seg button, .icon-btn { min-height: 44px; }
.seg button { min-width: 44px; justify-content: center; } .icon-btn { width: 44px; height: 44px; }
.back { min-width: 44px; justify-content: center; }
@media (max-width: 480px) { .back { padding: 10px 8px; } .seg button { padding: 6px 8px; } .tools { gap: 5px; } }
@media (max-width: 400px) { .seg button[data-tod="auto"] { display: none; } .brand { font-size: .98rem; } }

/* ---------- timer ring ---------- */
.ring { position: relative; width: 52px; height: 52px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 4.5; }
.ring .rb { stroke: var(--line); }
.ring .rf { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke .2s; }
.ring.low .rf { stroke: #ff4d5e; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .95rem; font-variant-numeric: tabular-nums; }
.ring[hidden] { display: none; }

/* ---------- fighter pick ---------- */
.pickwrap { max-width: 900px; margin: 0 auto; display: grid; gap: 14px; }
.pickhead { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.pickhead h2 { margin: 0; font-size: clamp(1.3rem, 5vw, 1.9rem); }
.fighters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fcard { position: relative; border: 3px solid var(--line); background: var(--card); border-radius: 20px; padding: 10px 8px 12px; text-align: center; display: grid; gap: 4px; justify-items: center; box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; min-width: 0; }
.fcard:hover { transform: translateY(-3px); }
.fcard[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow), var(--shadow); transform: translateY(-4px); }
.fport { width: 100%; max-width: 150px; aspect-ratio: 1 / 1.15; display: block; }
.fcard h3 { margin: 0; font-size: 1.05rem; } .fcard .ft { color: var(--muted); font-size: .78rem; font-weight: 700; }
.fcard .perk { font-size: .78rem; line-height: 1.35; color: var(--ink); opacity: .9; }
.fcard .hpchip { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); }
@media (max-width: 720px) { .fighters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fport { max-width: 110px; } }
@media (max-width: 380px) { .fcard { padding: 8px 6px 10px; } .fcard .perk { font-size: .72rem; } }
@media (orientation: landscape) and (max-height: 560px) { .fighters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } .fport { max-width: 84px; } .fcard .perk { display: none; } .pickhead .hint { display: none; } }
.pickwrap .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pickwrap .btn.go { width: auto; min-width: 180px; margin-top: 0; }

/* ---------- game layout ---------- */
.gamegrid { display: grid; gap: 10px; max-width: 760px; margin: 0 auto; grid-template-columns: minmax(0, 1fr); }
.hud { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); min-width: 0; transition: border-color .2s, box-shadow .2s, opacity .2s; }
.fp.r { grid-template-columns: auto minmax(0, 1fr) auto; }
.fp.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow), var(--shadow); }
.fp.away { opacity: .6; }
.fpic { width: 52px; height: 52px; border-radius: 12px; background: radial-gradient(circle at 50% 30%, var(--glow), var(--card2)); }
.fpi { min-width: 0; display: grid; gap: 3px; }
.fpn { display: grid; gap: 0; min-width: 0; line-height: 1.15; }
.fpn b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpn small { color: var(--muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hpw { position: relative; height: 18px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); overflow: hidden; }
.hpw i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #35d07f, #9be15d); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1), background .3s; }
.hpw.mid i { background: linear-gradient(90deg, #ffb703, #ffd166); } .hpw.low i { background: linear-gradient(90deg, #e5383b, #ff6b6b); }
.hpw span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); font-variant-numeric: tabular-nums; }
.hpw.hit { animation: hpshake .4s; }
@keyframes hpshake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.enr { display: flex; gap: 6px; align-items: center; min-height: 18px; flex-wrap: wrap; }
.en { display: inline-flex; gap: 3px; } .en i { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); background: linear-gradient(135deg, #ffe66d, #ff9f1c); box-shadow: 0 0 6px rgba(255, 190, 40, .6); } .en i.off { background: var(--card2); box-shadow: none; border: 1px solid var(--line); }
.bd { display: inline-flex; gap: 4px; flex-wrap: wrap; } .bd em { font-style: normal; font-size: .64rem; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: rgba(120, 220, 120, .22); color: var(--ink); border: 1px solid rgba(120, 220, 120, .6); }
.bd em.pz { background: rgba(150, 90, 220, .22); border-color: rgba(170, 110, 240, .7); } .bd em.cb { background: rgba(255, 150, 40, .22); border-color: rgba(255, 150, 40, .7); }
.wins { font-size: 1.35rem; font-weight: 800; min-width: 1.2ch; text-align: center; font-variant-numeric: tabular-nums; }

.stagewrap { position: relative; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); border: 2px solid var(--line); background: #0b1030; }
#stage { display: block; width: 100%; height: auto; }
.reveal { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: start; pointer-events: none; padding: 8px 6px; gap: 6px; }
.rv { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-content: flex-start; }
.rvc { width: clamp(44px, 12vw, 70px); aspect-ratio: 3 / 4; perspective: 500px; }
@supports (width: 1cqw) { .stagewrap { container-type: inline-size; } .rvc { width: clamp(38px, 11.5cqw, 68px); } }
.rvc > div { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2, .9, .3, 1.2); transform: rotateY(180deg); }
.rvc.up > div { transform: rotateY(0); }
.rvc .f, .rvc .bk { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 9px; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
.rvc .bk { transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #2b2f6b 0 6px, #3a3f8c 6px 12px); border: 2px solid #aab2ff; }
.rvc .f { color: #fff; border: 2px solid rgba(255, 255, 255, .85); background: linear-gradient(160deg, var(--c1), var(--c2)); text-align: center; }
.rvc .f svg { width: 54%; } .rvc .f b { font-size: clamp(.5rem, 1.9vw, .66rem); letter-spacing: .02em; display: block; line-height: 1; margin-top: 3px; }
.banner { position: absolute; left: 0; right: 0; top: 42%; text-align: center; font-weight: 900; font-size: clamp(1.5rem, 8vw, 3rem); letter-spacing: .04em; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, .5), 0 0 24px var(--accent); pointer-events: none; opacity: 0; transform: scale(.6); }
.banner.on { animation: bannerIn 1.4s ease both; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(.5); } 15% { opacity: 1; transform: scale(1.12); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }

.statusrow { display: flex; gap: 10px; align-items: center; }
.statusrow .status { flex: 1; min-width: 0; min-height: 52px; font-size: .95rem; text-align: center; }
.log { list-style: none; margin: 0; padding: 8px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 3px; font-size: .82rem; color: var(--muted); min-height: 38px; max-height: 118px; overflow-y: auto; }
.log li { line-height: 1.35; } .log li b { color: var(--ink); }
.log:empty::before { content: 'The battle log appears here after each turn.'; opacity: .7; }

.handwrap { display: grid; gap: 8px; }
.handtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meter { font-weight: 800; font-size: .9rem; } .meter i { font-style: normal; color: var(--accent); }
.mine { color: var(--muted); font-size: .8rem; }
.hand { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 10px; }
.cc { position: relative; --c1: var(--atk1); --c2: var(--atk2); border: 2px solid rgba(255, 255, 255, .75); border-radius: 15px; background: linear-gradient(160deg, var(--c1), var(--c2)); color: #fff; padding: 6px 4px 5px; min-height: 82px; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; gap: 2px; box-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 10px 18px rgba(0, 0, 0, .22); transition: transform .14s, box-shadow .14s, filter .14s, opacity .14s; touch-action: manipulation; user-select: none; -webkit-user-select: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); min-width: 0; }
.cc[data-kind="defend"] { --c1: var(--def1); --c2: var(--def2); } .cc[data-kind="trick"] { --c1: var(--trk1); --c2: var(--trk2); } .cc[data-kind="support"] { --c1: var(--sup1); --c2: var(--sup2); }
.cc svg { width: 34px; height: 34px; color: #fff; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.cc .nm { font-weight: 800; font-size: .8rem; line-height: 1.05; text-align: center; }
.cc .tx { display: none; font-size: .68rem; line-height: 1.25; text-align: center; opacity: .95; text-shadow: none; padding: 0 2px; }
.cc .cost { position: absolute; top: -9px; left: -7px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .85rem; color: #3a2200; background: linear-gradient(135deg, #fff3b0, #ffb703); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); text-shadow: none; }
.cc .ord { position: absolute; top: -9px; right: -7px; min-width: 24px; height: 24px; border-radius: 50%; display: none; place-items: center; font-weight: 900; font-size: .8rem; color: #fff; background: #111a44; border: 2px solid #fff; }
.cc .key { position: absolute; bottom: 3px; right: 6px; font-size: .6rem; opacity: .55; display: none; }
.cc.sel { transform: translateY(-9px) scale(1.04); box-shadow: 0 0 0 4px #fff, 0 0 22px var(--accent), 0 14px 22px rgba(0, 0, 0, .35); z-index: 2; }
.cc.sel .ord { display: grid; }
.cc:disabled, .cc.off { filter: grayscale(.8) brightness(.8); opacity: .55; box-shadow: none; cursor: not-allowed; }
.cc.sel:disabled { opacity: 1; filter: none; }
.cc:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (hover: hover) { .cc:not(:disabled):hover { transform: translateY(-4px); } .cc.sel:hover { transform: translateY(-9px) scale(1.04); } }
@media (min-width: 560px) { .cc { min-height: 108px; padding: 8px 6px 7px; } .cc svg { width: 42px; height: 42px; } .cc .nm { font-size: .92rem; } .cc .tx { display: block; } .cc .key { display: block; } }
@media (max-width: 380px) { .cc { min-height: 74px; } .cc svg { width: 30px; height: 30px; } .cc .nm { font-size: .74rem; } .hud { gap: 6px; } .fp { padding: 6px 7px; gap: 6px; } .fpic { width: 40px; height: 40px; } .wins { font-size: 1.1rem; } }
.handwrap .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.handwrap .actions .btn.go { width: auto; flex: 1 1 150px; margin-top: 0; max-width: 260px; }
.handwrap .actions .btn { min-width: 96px; }
.handwrap.locked .hand { pointer-events: none; opacity: .55; }
.handwrap.hidden-hand .hand { visibility: hidden; }

/* wide screens: stage left, hand right */
@media (min-width: 1000px) and (min-height: 640px) {
  .gamegrid { max-width: 1080px; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); grid-template-areas: "hud hand" "stage hand" "status hand" "log hand"; align-items: start; }
  .hud { grid-area: hud; } .stagewrap { grid-area: stage; } .statusrow { grid-area: status; } .log { grid-area: log; } .handwrap { grid-area: hand; align-self: start; }
  .hand { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* phones held sideways */
@media (orientation: landscape) and (max-height: 560px) {
  .gamegrid { max-width: none; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); grid-template-areas: "hud hand" "stage hand" "status hand" "log hand"; align-items: start; gap: 6px 10px; }
  .hud { grid-area: hud; } .stagewrap { grid-area: stage; max-width: calc((100dvh - 200px) * 1.94); justify-self: center; width: 100%; } .statusrow { grid-area: status; } .log { grid-area: log; display: none; } .handwrap { grid-area: hand; }
  .statusrow .status { min-height: 40px; font-size: .85rem; padding: 4px 8px; } .fpic { width: 36px; height: 36px; } .fpn small { display: none; }
  .cc { min-height: 64px; padding: 4px 3px; } .cc svg { width: 26px; height: 26px; } .cc .nm { font-size: .7rem; } .hand { gap: 6px; } .top { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; } main { padding-top: 0; }
  .handwrap .actions .btn { min-height: 44px; }
}

/* pass & play curtain */
.curtain { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 50% 30%, #2a2060, #070b1f); }
.curtain[hidden] { display: none; }
.curtain .card { text-align: center; width: min(420px, 100%); } .curtain .big { font-size: 3.4rem; line-height: 1; } .curtain h2 { margin: 6px 0; } .curtain .btn { width: 100%; margin-top: 14px; }

/* how to play */
.howto { text-align: left; display: grid; gap: 8px; max-height: 58dvh; overflow: auto; padding-right: 4px; }
.howto p { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--muted); } .howto p b { color: var(--ink); }
.howto .cards { display: grid; grid-template-columns: 1fr; gap: 6px; }
.howto .hrow { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.howto .hrow .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(160deg, var(--c1), var(--c2)); color: #fff; } .howto .hrow .ic svg { width: 26px; height: 26px; }
.howto .hrow b { font-size: .88rem; display: block; } .howto .hrow span { font-size: .78rem; color: var(--muted); display: block; line-height: 1.3; }
.howto .hrow[data-kind="attack"] { --c1: var(--atk1); --c2: var(--atk2); } .howto .hrow[data-kind="defend"] { --c1: var(--def1); --c2: var(--def2); } .howto .hrow[data-kind="trick"] { --c1: var(--trk1); --c2: var(--trk2); } .howto .hrow[data-kind="support"] { --c1: var(--sup1); --c2: var(--sup2); }
.rlist { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: .84rem; color: var(--muted); }
.stats { color: var(--muted); }
