/* Santos Fighter: the page (phone first). The arena is a canvas; everything else is plain HTML on top of or around it. */
:root { --bg: #0f172a; --text: #f1f5f9; --muted: #94a3b8; --accent: #f97316; --border: rgba(255,255,255,.16); }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font-family: -apple-system, 'Segoe UI', system-ui, sans-serif; touch-action: none; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; padding-top: calc(6px + env(safe-area-inset-top)); }
.top img.logo { height: 32px; flex: none; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
/* the opening: tap to start, lightning, the logo slams in, the four fighters enter, FIGHT! */
#splash { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(circle at 50% 42%, #5b2a86, #12102e 72%); transition: opacity .5s; overflow: hidden; }
#splash.gone { opacity: 0; pointer-events: none; }
#splash.shake { animation: shake .4s; }
#spFlash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#spFlash.on { animation: flashA .3s ease-out; }
#spLogo { width: min(86vw, 560px); opacity: 0; filter: drop-shadow(0 0 26px rgba(249,115,22,.7)); }
#spLogo.slam { animation: slam .6s cubic-bezier(.2, 1.6, .3, 1) forwards; }
#spTap { position: absolute; font-weight: 900; letter-spacing: .2em; color: #fde047; animation: blink 1s infinite alternate; }
#spCast { display: flex; gap: 8px; }
.cast { width: 21vw; max-width: 120px; text-align: center; opacity: 0; transform: translateY(46px) scale(.7); transition: .35s cubic-bezier(.2, 1.5, .4, 1); border: 2px solid var(--c); border-radius: 12px; background: rgba(0,0,0,.45); padding: 4px 2px 6px; }
.cast.in { opacity: 1; transform: none; }
.cast img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.cast b { display: block; font-size: .95rem; color: var(--c); text-shadow: 0 1px 2px #000; }
#spTitle { font-size: 2.6rem; font-weight: 900; letter-spacing: .12em; color: #fde047; text-shadow: 0 4px 0 #b91c1c, 0 0 18px #000; opacity: 0; }
#spTitle.in { animation: slam .5s cubic-bezier(.2, 1.6, .3, 1) forwards; }
@keyframes slam { 0% { transform: scale(3.2) rotate(-6deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes flashA { from { opacity: .9; } to { opacity: 0; } }
@keyframes shake { 20% { transform: translate(-9px, 6px); } 40% { transform: translate(8px, -6px); } 60% { transform: translate(-5px, 4px); } 80% { transform: translate(4px, -3px); } }
@keyframes blink { to { opacity: .3; } }
#ko { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; font-size: 68px; font-weight: 900; font-style: italic; color: #fde047; text-shadow: 0 5px 0 #b91c1c, 0 0 22px #000; }
#ko.pop { animation: slam .45s cubic-bezier(.2, 1.6, .3, 1); }
#movesBtn { background: rgba(255,255,255,.1); border: 1px solid var(--border); border-radius: 10px; padding: 3px 8px; font-weight: 800; font-size: .75rem; }
#moves { position: fixed; inset: 0; z-index: 15; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.7); padding: 12px; }
#moves .card { width: min(100%, 430px); max-height: 100%; overflow-y: auto; background: #1e293b; border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
#moves h3 { font-size: 1.25rem; margin-bottom: 4px; } #moves h4 { margin: 10px 0 4px; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.mv { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.08); }
.mv b { font-size: .9rem; } .mv .mm { font-weight: 900; color: #fde047; font-size: .9rem; text-align: right; } .mv small { grid-column: 1 / 3; color: var(--muted); font-size: .75rem; }
.mvNote { margin: 10px 0; color: var(--muted); font-size: .72rem; } #mvClose { width: 100%; background: var(--accent); border-radius: 10px; padding: 9px; font-weight: 800; }
#mute { background: rgba(255,255,255,.1); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; font-size: .85rem; }
.chips { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; min-width: 0; }
.chip { padding: 2px 7px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.08); border: 1px solid var(--border); white-space: nowrap; }
.chip.ok { color: #22c55e; } .chip.bad { color: #ef4444; }
button { font: inherit; color: #fff; border: 0; touch-action: none; }
#reset { background: #ef4444; border-radius: 10px; padding: 5px 10px; font-weight: 800; font-size: .8rem; }
.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 6px 4px; }
.hb { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px 5px; min-width: 0; opacity: .45; }
.hb.on { opacity: 1; }
.hb .nm { font-size: .92rem; font-weight: 900; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.hb .nm small { font-size: .62rem; }
.bar { height: 7px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; margin-top: 2px; }
.bar > i { display: block; height: 100%; width: 0; transition: width .12s; }
.hp > i { background: #22c55e; } .sp > i { background: #facc15; } .sp.full > i { animation: flash .4s infinite alternate; }
@keyframes flash { to { filter: brightness(2); } }
/* on a phone the arena is as wide as the screen; on a wide PC window it is held to under half the height, so the controller stays in view */
#stage { position: relative; width: min(100%, calc(46vh * 320 / 220)); margin: 0 auto; aspect-ratio: 320 / 220; flex: none; background: #000; }
canvas { width: 100%; height: 100%; display: block; }
#bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubble { position: absolute; transform: translate(-50%, -100%); max-width: 46%; background: #fff; color: #111; border: 2px solid var(--c); border-radius: 10px; padding: 3px 7px; font-weight: 800; font-size: 12px; line-height: 1.15; text-align: center; animation: pop .18s ease-out; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--c); border-bottom: 0; }
.bubble.big { font-size: 15px; background: #fde047; }
@keyframes pop { from { transform: translate(-50%, -80%) scale(.5); opacity: 0; } }
#banner { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 26px; font-weight: 900; text-shadow: 0 3px 0 #000, 0 0 12px #000; pointer-events: none; }
#banner small { font-size: 13px; font-weight: 700; }
#banner em { font-size: 34px; font-style: italic; color: #fde047; text-shadow: 0 4px 0 #b91c1c, 0 0 18px #000; animation: slam .5s cubic-bezier(.2, 1.6, .3, 1); }
#clock { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); min-width: 52px; text-align: center; padding: 1px 8px; border-radius: 8px; background: rgba(0,0,0,.55); border: 1px solid var(--border); font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; color: #fde047; pointer-events: none; }
#clock.low { color: #ef4444; animation: blink .5s infinite alternate; }
.stars { color: #fde047; font-size: .8em; }
.ctrl { width: 100%; max-width: 560px; margin: 0 auto; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-evenly; padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); }
.pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pick button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 12px; background: rgba(255,255,255,.08); border: 2px solid var(--border); font-size: .98rem; font-weight: 900; }
.pick button.mine { border-color: var(--c); background: color-mix(in srgb, var(--c) 30%, transparent); }
.pick button.taken { opacity: .35; }
.thumb { width: 34px; height: 34px; border-radius: 8px; background: var(--c); display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 900; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.pad { display: flex; justify-content: space-between; align-items: center; }
.stick { width: 142px; height: 142px; border-radius: 50%; position: relative; background: radial-gradient(circle, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 2px solid var(--border); touch-action: none; }
.knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: #475569; border: 2px solid rgba(255,255,255,.35); box-shadow: 0 4px 10px rgba(0,0,0,.4); pointer-events: none; }
/* punch north, kick east, taunt west, and the round Super button up in the corner (no block button: hold the stick away from the enemy to block) */
.face { display: grid; grid-template-columns: repeat(3, 62px); grid-template-rows: repeat(2, 62px); gap: 14px; align-content: center; justify-content: center; width: 214px; height: 182px; }
.face button { width: 62px; height: 62px; border-radius: 50%; font-size: .85rem; font-weight: 900; border: 2px solid rgba(255,255,255,.35); line-height: 1.1; }   /* all six buttons the same size, in a 3 x 2 grid */
.face button { font-size: 1.7rem; position: relative; }   /* icons, not words: fist, strong fist, foot, leg, taunt face, lightning */
.ic { width: 30px; height: 30px; color: #fff; display: block; filter: drop-shadow(0 1px 0 rgba(0,0,0,.5)); }
.x3 { display: flex; align-items: center; justify-content: center; }   /* heavy: three of the light icon, smaller */
.x3 .ic { width: 17px; height: 17px; margin: 0 -1.5px; }
#super .ic { color: #fde047; }
.face button { box-shadow: 0 4px 0 rgba(0,0,0,.45), inset 0 2px 5px rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; }   /* arcade style: round, glossy, standing up from the pad */
.face button:active, .face button.down { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.45), inset 0 2px 5px rgba(255,255,255,.25); }
.face button::after { content: attr(data-key); display: none; position: absolute; right: 2px; bottom: 1px; min-width: 16px; padding: 0 3px; border-radius: 5px; background: rgba(0,0,0,.6); color: #fff; font-size: .62rem; font-weight: 900; line-height: 1.3; }
body.pc .face button::after { display: block; }   /* on a computer each button shows its key */
.face .lp { grid-area: 1 / 1; } .face .hp { grid-area: 1 / 2; } #super { grid-area: 1 / 3; } .face .lk { grid-area: 2 / 1; } .face .hk { grid-area: 2 / 2; } .face .taunt { grid-area: 2 / 3; background: #9333ea; }
.face .punch { background: #dc2626; } .face .kick { background: #2563eb; } .face .hp, .face .hk { border-color: #fde047; }
.wide { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.wide button { border-radius: 14px; padding: 12px 6px; font-weight: 900; font-size: 1rem; border: 2px solid rgba(255,255,255,.3); }
#taunt { background: #9333ea; } #super { background: #475569; } #super.ready { background: linear-gradient(90deg, #f97316, #facc15); color: #111; animation: flash .35s infinite alternate; }
.down { transform: scale(.93); filter: brightness(1.35); }
#toast { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); background: #fff; color: #111; font-weight: 800; padding: 8px 14px; border-radius: 12px; z-index: 30; display: none; text-align: center; max-width: 86vw; }

/* ---- the pick screen: whenever you have no fighter. Big cards, one obvious choice, nothing else to set up ---- */
#choose { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto; background: radial-gradient(circle at 50% 30%, #5b2a86, #12102e 75%); }
#choose .chooseLogo { width: min(62vw, 300px); filter: drop-shadow(0 0 18px rgba(249,115,22,.55)); }
#choose h2 { font-size: 1.5rem; font-weight: 900; letter-spacing: .04em; text-align: center; text-shadow: 0 3px 0 #000; }
#choose .pick { grid-template-columns: repeat(2, 1fr); gap: 10px; width: min(100%, 420px); }
#choose .pick button { gap: 6px; padding: 10px 6px; border-radius: 16px; font-size: 1.2rem; border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 16%, rgba(255,255,255,.04)); }
#choose .pick button:active { transform: scale(.96); }
#choose .thumb { width: 84px; height: 84px; border-radius: 16px; }
.opp { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 800; }
.oppLine { display: flex; align-items: center; justify-content: center; gap: 10px; }
.oppLine > span { min-width: 98px; text-align: right; }
.seg { display: flex; gap: 4px; background: rgba(255,255,255,.08); padding: 3px; border-radius: 12px; }
.seg button { background: transparent; border-radius: 9px; padding: 8px 12px; font-weight: 800; font-size: .95rem; }
.seg button.on { background: var(--accent); }
#choose .hint { color: var(--muted); font-size: .9rem; text-align: center; max-width: 340px; }
.chooseBtns { display: flex; gap: 10px; }
.chooseBtns button { background: rgba(255,255,255,.12); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; font-weight: 800; }
.chooseBtns #invite { background: #16a34a; border-color: transparent; }

/* small controls in the top bar */
#change { display: none; background: rgba(255,255,255,.1); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: .74rem; font-weight: 800; }
#watchBar { display: none; align-items: center; justify-content: center; gap: 10px; padding: 4px 10px 6px; font-size: .85rem; font-weight: 800; text-align: center; }
#watchBar button { background: #16a34a; border-radius: 10px; padding: 5px 14px; font-weight: 800; }

/* "get ready", "here comes a new challenger" and "fight!" over the arena */
#call { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; pointer-events: none; }
#call.challenger { background: rgba(140, 10, 30, .62); animation: alarm .4s infinite alternate; }
#call .alarm { font-size: 1.7rem; line-height: 1.05; font-weight: 900; font-style: italic; color: #fde047; text-shadow: 0 4px 0 #b91c1c, 0 0 20px #000; animation: slam .45s cubic-bezier(.2, 1.6, .3, 1); }
#call .alarm.go { font-size: 3.4rem; }
#call img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(0,0,0,.8)); animation: slam .6s .25s cubic-bezier(.2, 1.6, .3, 1) both; }
#call b { font-size: 1.5rem; font-weight: 900; text-shadow: 0 2px 0 #000; }
@keyframes alarm { to { background: rgba(40, 0, 10, .7); } }

#choose .tips { color: var(--muted); font-size: .8rem; text-align: center; max-width: 340px; }
