/* Ninja Showdown: page-specific styles on top of ../arcade-common/pz.css */
body { --accent: #ff5d73; --accent2: #7c5cff; --mv-slash: #ff5d73; --mv-block: #4fa3ff; --mv-dodge: #2fd6b0; --mv-shuriken: #a874ff; --mv-charge: #ffc233; --mv-ultimate: #ff7a1a; --mv-smoke: #8a96c0; }
body[data-tod="day"] { --accent: #e23d5a; --accent2: #6a45f0; --mv-slash: #e23d5a; --mv-block: #2b82e6; --mv-dodge: #14b690; --mv-shuriken: #8a55ee; --mv-charge: #e8a000; --mv-ultimate: #f26200; --mv-smoke: #6f7caa; }
.hint.tiny { font-size: .8rem; margin-top: 8px; }
.hero-card .menu-art { width: 100%; height: auto; aspect-ratio: 5 / 3; border-radius: 16px; background: transparent; margin: 10px 0 4px; }

/* the shared lobby sits inside the right-hand card */
.lobbybox > .card { background: transparent; border: 0; box-shadow: none; padding: 0; }
.lobbybox > .card > h2 { display: none; }
.lobbybox #pzLobbyJoin > .field { display: none; }
.lobbybox .btn.go { margin-top: 4px; }
.waiting .tabs, .waiting #seriesLabel, .waiting #seriesPick { display: none; }

/* ---------------------------------------------------------------- game screen ---------------------------------------------------------------- */
.gamegrid { display: grid; gap: 8px; justify-items: center; grid-template-columns: minmax(0, 1fr); grid-template-areas: "hud" "arena" "hist" "panel"; width: min(100%, 720px); margin: 0 auto; }
.hud { grid-area: hud; display: grid; grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr); gap: 8px; align-items: stretch; width: 100%; }
.arenawrap { grid-area: arena; position: relative; width: 100%; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); border: 2px solid var(--line); background: #0a0f2a; line-height: 0; }
#arena { width: 100%; height: auto; display: block; aspect-ratio: 5 / 3; }
.histwrap { grid-area: hist; width: 100%; min-height: 30px; }
.panel { grid-area: panel; width: 100%; display: grid; gap: 8px; }

.pc { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 8px 10px; min-width: 0; box-shadow: var(--shadow); display: grid; gap: 6px; align-content: start; transition: border-color .2s, box-shadow .2s; --me: #ff5d73; }
.pc.right { --me: #35c8ff; }
.pc.locked { border-color: var(--me); box-shadow: 0 0 0 3px color-mix(in srgb, var(--me) 28%, transparent), var(--shadow); }
.pc.away { opacity: .6; }
.ptop { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex-wrap: wrap; }
.pn { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; border-left: 5px solid var(--me); padding-left: 6px; }
.pr { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--muted); display: block; }
.pips i.w { background: var(--go1); border-color: var(--go1); }
.hp { position: relative; height: 18px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); overflow: hidden; --hp: 100%; }
.hp i { position: absolute; inset: 0; width: var(--hp); border-radius: 99px; background: linear-gradient(90deg, #35d97a, #b6e83a); transition: width .5s cubic-bezier(.2, .8, .2, 1), background .3s; }
.hp.mid i { background: linear-gradient(90deg, #ffb42e, #ffd84a); }
.hp.low i { background: linear-gradient(90deg, #ff3d5a, #ff7a3d); }
.hp span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #0a1030; text-shadow: 0 0 3px rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums; }
body[data-tod="night"] .hp span { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.chi { display: flex; align-items: center; gap: 5px; min-height: 18px; }
.chi i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--muted) 70%, transparent); background: transparent; transition: background .25s, box-shadow .25s, transform .25s; display: block; }
.chi i.on { background: radial-gradient(circle at 35% 30%, #d9fbff, #34d7f0 55%, #1b9bd0); border-color: #7be9ff; box-shadow: 0 0 8px #3ee0ff; transform: scale(1.1); }
.chi em { margin-left: auto; font-style: normal; font-size: 1.1rem; line-height: 1; transition: opacity .3s, filter .3s; }
.chi em.used { opacity: .25; filter: grayscale(1); }

.ringbox { position: relative; display: grid; place-items: center; align-content: center; gap: 0; }
#ring { width: 60px; height: 60px; transform: rotate(-90deg); }
.rt { fill: var(--card); stroke: var(--line); stroke-width: 5; }
.rf { fill: none; stroke: var(--accent2); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 144.5; stroke-dashoffset: 0; }
.ringbox.low .rf { stroke: #ff5d73; }
.ringbox.off #ring { opacity: .35; }
.ringbox b { position: absolute; top: 14px; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ringbox small { color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: -2px; }

.banner { position: absolute; left: 8px; right: 8px; top: 8px; line-height: 1.3; padding: 9px 14px; border-radius: 14px; background: rgba(8, 12, 36, .82); color: #fff; font-weight: 700; font-size: clamp(.82rem, 3.6vw, 1.05rem); text-align: center; opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; pointer-events: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.banner.on { opacity: 1; transform: none; }
.banner b { color: #ffd86b; }
.banner.win { background: rgba(16, 90, 52, .9); } .banner.lose { background: rgba(110, 22, 40, .9); }

.hist { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; justify-content: center; min-height: 30px; }
.hist::-webkit-scrollbar { display: none; }
.hist .h { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 3px 8px; border-radius: 99px; background: var(--card); border: 2px solid var(--line); font-size: .95rem; line-height: 1.2; }
.hist .h.w { border-color: var(--go1); } .hist .h.l { border-color: #ff5d73; } .hist .h.t { opacity: .75; }
.hist .h span { font-size: .6rem; color: var(--muted); margin: 0 2px; }

/* move buttons */
.moves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mv { --c: var(--mv-slash); position: relative; border: 2px solid color-mix(in srgb, var(--c) 55%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, var(--card)), var(--card)); border-radius: 16px; min-height: 76px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--ink); transition: transform .12s, box-shadow .15s, border-color .15s, opacity .2s; touch-action: manipulation; }
.mv .ic { font-size: 1.7rem; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.mv .nm { font-weight: 800; font-size: .86rem; line-height: 1.15; }
.mv .hn { font-size: .62rem; color: var(--muted); line-height: 1.15; text-align: center; padding: 0 2px; }
.mv .ct { position: absolute; top: 4px; right: 5px; font-size: .68rem; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: rgba(0, 0, 0, .35); color: #fff; }
.mv .kb { position: absolute; top: 4px; left: 6px; font-size: .64rem; font-weight: 800; color: var(--muted); opacity: .8; }
.mv:hover:not(:disabled) { transform: translateY(-2px); }
.mv[aria-checked="true"] { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 40%, transparent), 0 8px 22px color-mix(in srgb, var(--c) 40%, transparent); transform: translateY(-2px) scale(1.03); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 55%, var(--card)), color-mix(in srgb, var(--c) 18%, var(--card))); }
.mv:disabled { opacity: .38; cursor: not-allowed; }
.mv[data-move="slash"] { --c: var(--mv-slash); } .mv[data-move="block"] { --c: var(--mv-block); } .mv[data-move="dodge"] { --c: var(--mv-dodge); } .mv[data-move="shuriken"] { --c: var(--mv-shuriken); } .mv[data-move="charge"] { --c: var(--mv-charge); } .mv[data-move="ultimate"] { --c: var(--mv-ultimate); }
.mv[data-move="ultimate"]:not(:disabled) { animation: ult 1.6s ease-in-out infinite; }
@keyframes ult { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--mv-ultimate) 50%, transparent), 0 0 22px color-mix(in srgb, var(--mv-ultimate) 60%, transparent); } }
.mv.smoke { grid-column: 1 / -1; --c: var(--mv-smoke); min-height: 52px; flex-direction: row; gap: 10px; padding: 6px 12px; }
.mv.smoke .ic { font-size: 1.4rem; } .mv.smoke .hn { font-size: .7rem; text-align: left; }
.lockrow .btn.go { margin-top: 0; min-height: 54px; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.actions .btn { min-width: 108px; }
.btn.small { min-height: 44px; } .chips button { min-height: 44px; }

/* curtain for pass & play */
.curtain { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 20px; background: radial-gradient(800px 500px at 50% 20%, color-mix(in srgb, var(--accent2) 45%, #0a0f2a), #070b1f 70%); line-height: 1.4; }
.curtain[hidden] { display: none; }
.ctn { text-align: center; max-width: 380px; color: #fff; display: grid; gap: 10px; justify-items: center; }
.ctn .big { font-size: 4rem; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
.ctn h2 { margin: 0; font-size: 1.5rem; color: #fff; } .ctn .hint { color: #c8d2f5; margin: 0; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* how to play */
.how { text-align: left; max-height: 62dvh; overflow: auto; padding: 0 2px; }
.how h3 { margin: 12px 0 4px; font-size: .95rem; } .how p, .how li { font-size: .86rem; color: var(--muted); line-height: 1.5; margin: 0 0 4px; }
.how ul { margin: 4px 0 8px; padding-left: 18px; } .how b { color: var(--ink); }
.how svg { width: 100%; max-width: 330px; display: block; margin: 6px auto; }
.how .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: .8rem; }

/* wide screens: arena big, controls to the right */
@media (min-width: 1000px) and (min-height: 640px) {
  .gamegrid { width: min(100%, 1120px); grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "hud panel" "arena panel" "hist panel"; grid-template-rows: auto auto auto; align-items: start; gap: 10px 16px; }
  .panel { align-self: start; }
  .moves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mv { min-height: 84px; }
}
/* phones held sideways */
@media (orientation: landscape) and (max-height: 600px) {
  .gamegrid { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(236px, 330px); grid-template-areas: "hud panel" "arena panel" "hist panel"; align-items: start; gap: 6px 10px; }
  .hud { grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); gap: 5px; }
  .pc { padding: 4px 8px; gap: 3px; } .hp { height: 15px; } .chi i { width: 11px; height: 11px; } #ring { width: 48px; height: 48px; } .ringbox b { top: 10px; font-size: .95rem; } .ringbox small { display: none; }
  .arenawrap { max-width: calc((100dvh - 120px) * 1.6667); margin: 0 auto; }
  .moves { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .mv { min-height: 56px; padding: 4px 3px; } .mv .hn { display: none; } .mv .ic { font-size: 1.3rem; } .mv .nm { font-size: .78rem; } .mv.smoke { min-height: 44px; } .mv.smoke .hn { display: block; }
  .lockrow .btn.go { min-height: 48px; } .panel { gap: 5px; } .top { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; } main { padding-top: 0; }
  .banner { font-size: .8rem; padding: 5px 10px; } .actions .btn { min-width: 0; padding: 0 10px; }
}
@media (max-width: 380px) { .pn { font-size: .85rem; } .pr { display: none; } .mv .nm { font-size: .78rem; } .mv .hn { font-size: .58rem; } .pc { padding: 6px 7px; } .hud { gap: 5px; grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr); } #ring { width: 54px; height: 54px; } .ringbox b { top: 12px; font-size: 1rem; } }

/* header: fit one row down to 320 px */
.top { gap: 6px; }
.brand { min-width: 0; overflow: visible; font-size: clamp(.74rem, 3.5vw, 1.5rem); letter-spacing: -.04em; }
@media (max-width: 400px) { .top .seg button { padding: 7px 6px; } .top .seg { gap: 0; } }
@media (max-width: 480px) { .back { padding: 10px 8px; } .seg button { padding: 6px 8px; min-height: 44px; } .icon-btn { width: 44px; height: 44px; } }
@media (max-width: 360px) { .seg button[data-tod="auto"] { display: none; } }
.seg button { min-height: 44px; min-width: 44px; justify-content: center; } .icon-btn { width: 44px; height: 44px; } .back { min-width: 44px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .mv[data-move="ultimate"]:not(:disabled), .ctn .big { animation: none; } }

/* short portrait phones: tighter moves, and the lock button stays reachable while the moves scroll */
@media (orientation: portrait) and (max-height: 720px) {
  .mv { min-height: 56px; padding: 4px 3px; } .mv .hn { display: none; } .mv .ic { font-size: 1.3rem; } .mv.smoke { min-height: 46px; } .mv.smoke .hn { display: block; }
  .lockrow { position: sticky; bottom: 0; z-index: 6; padding: 6px 0 max(6px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg2) 28%); }
}
