/* Splatter Street: a grindhouse comic. Ink black, blood red, acid yellow, halftone dots, Anton headings.
   Its own look; games.css loads first only for the shared rules (no selectable text, the leave pop-up). */
@font-face { font-family: Anton; src: url(/fonts/Anton.woff2) format('woff2'); font-display: swap; }
:root {
  --ss-ink: #16101c; --ss-card: #241830; --ss-card2: #2f2040; --ss-red: #e0142c; --ss-yellow: #ffe14a;
  --ss-green: #5ee06a; --ss-text: #fff8ec; --ss-soft: #c9bde0;
}
html, body.ss { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body.ss { background: var(--ss-ink); color: var(--ss-text); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
.ss #app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.muted { color: var(--ss-soft); }

.ss button, .ss .link { font: inherit; cursor: pointer; }
.ss button {
  color: var(--ss-text); background: var(--ss-card2); border: 3px solid #000; border-radius: 10px; padding: 10px 16px; min-height: 48px;
  font-family: Anton, Impact, sans-serif; font-size: 20px; letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 5px 0 #000; transition: transform .07s, box-shadow .07s;
}
.ss button:active { transform: translateY(4px); box-shadow: 0 1px 0 #000; }
.ss button:focus-visible, .ss .link:focus-visible { outline: 4px solid var(--ss-yellow); outline-offset: 3px; }
.ss button[disabled] { opacity: .5; }
.ss button.big { width: 100%; font-size: 24px; min-height: 58px; }
.ss button.hot { background: var(--ss-red); }
.ss button.soft { background: #3a2c4d; font-size: 18px; }
.ss .link { color: var(--ss-yellow); background: none; border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; font-family: Inter, sans-serif; font-weight: 700; font-size: 16px; text-transform: none; letter-spacing: 0; min-height: 44px; padding: 8px 10px; display: inline-flex; align-items: center; }
.ss button.icon { min-width: 44px; min-height: 44px; padding: 4px 8px; font-size: 20px; border-radius: 50%; }

.ss-top { position: absolute; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 6px; pointer-events: none; }
.ss-top > * { pointer-events: auto; }
#back-slot:empty { display: none; }
.ss button.back, .ss button.back.quiet { background: var(--ss-card2); color: var(--ss-text); border: 3px solid #000; box-shadow: 0 4px 0 #000; min-height: 44px; min-width: 44px; padding: 6px 14px 6px 10px; display: inline-flex; align-items: center; gap: 6px; font-family: Anton, sans-serif; font-size: 16px; }
.playing button.back { font-size: 0; gap: 0; padding: 6px; justify-content: center; }
.playing button.back span { font-size: 22px; }
#sound { margin-left: auto; }
#pause { margin-left: auto; }
.playing #sound { display: none; }

#stage { position: relative; flex: 1; min-height: 0; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.page { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: calc(max(8px, env(safe-area-inset-top)) + 56px) 14px max(14px, env(safe-area-inset-bottom)); overflow-y: auto; }
.on-gate #world { visibility: hidden; }
.on-gate .page.gate { background: #16101c; }
.on-home .page.home { align-items: start; background: linear-gradient(#16101ccc, #16101c00 62%); }
.on-pick .page.pick, .on-how .page.how { background: #16101ce6; }
.on-pick .page.pick, .on-how .page.how, .on-end .page.end, .on-paused .page.paused { background: #16101ce6; }

.card {
  width: min(460px, 100%); background: var(--ss-card); border: 4px solid #000; border-radius: 14px; padding: 20px; position: relative;
  box-shadow: 8px 8px 0 var(--ss-red); display: flex; flex-direction: column; gap: 12px;
  background-image: radial-gradient(#ffffff0d 1.2px, transparent 1.4px); background-size: 9px 9px;
}
.card h1, .card h2 { margin: 0; font-family: Anton, Impact, sans-serif; text-transform: uppercase; letter-spacing: .04em; }
.card h2 { font-size: 30px; text-align: center; }
.stamp { align-self: center; border: 4px solid var(--ss-red); color: var(--ss-red); font-family: Anton, sans-serif; font-size: 34px; padding: 0 14px; transform: rotate(-6deg); border-radius: 8px; letter-spacing: .06em; }
.stamp.small { font-size: 15px; padding: 2px 10px; border-width: 3px; }
.gate-card h1, .logo { font-size: 54px; line-height: .95; text-align: center; color: var(--ss-text); text-shadow: 4px 4px 0 #000; }
.logo span { color: var(--ss-text); }
.logo em { font-style: normal; color: var(--ss-red); }
.warn, .tag { margin: 0; text-align: center; font-size: 17px; line-height: 1.35; }
.gate-card, .home-card { text-align: center; }
.row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* fighter picker */
.pick-card { width: min(960px, 100%); box-shadow: 8px 8px 0 var(--ss-red); }
.fighters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fcard { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 8px; min-height: 0; background: var(--ss-card2); border-radius: 12px; box-shadow: 0 5px 0 #000; font-family: Inter, sans-serif; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; }
.fcard[aria-pressed="true"] { background: #4a2330; border-color: var(--ss-yellow); box-shadow: 0 5px 0 #000, 0 0 0 3px var(--ss-red); }
.fcard canvas { width: 100%; height: 118px; display: block; border-radius: 8px; background: linear-gradient(#3a2550, #1b1226); }
.fcard .nm { font-family: Anton, sans-serif; font-size: 20px; text-transform: uppercase; letter-spacing: .03em; line-height: 1; }
.fcard .tg { color: var(--ss-yellow); font-weight: 700; font-size: 13px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; font-size: 12px; font-weight: 700; color: var(--ss-soft); }
.stats i { display: block; height: 8px; border-radius: 4px; background: #00000066; position: relative; overflow: hidden; }
.stats i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--ss-green); }
.fcard .sw { font-size: 12.5px; line-height: 1.3; color: var(--ss-text); }
.fcard .sw b { color: var(--ss-green); }
.fcard .sw b.w { color: #ff7a6b; }
.fcard .sw ul { margin: 2px 0 4px; padding-left: 16px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; }
.opt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lvl-note { flex-basis: 100%; margin: 0; text-align: center; font-size: 13.5px; color: var(--ss-soft); }
.lbl { font-family: Anton, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--ss-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { min-height: 40px; padding: 4px 12px; font-size: 15px; border-radius: 8px; box-shadow: 0 3px 0 #000; }
.chips button[aria-pressed="true"] { background: var(--ss-yellow); color: #000; }

.how-card { width: min(560px, 100%); }
.how-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 16px; line-height: 1.35; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; background: #00000055; padding: 10px; border-radius: 8px; }
.keys b { color: var(--ss-yellow); }
.small-note { font-size: 13px; margin: 0; }

.end-card { text-align: center; }
.end-card h2 { font-size: 44px; color: var(--ss-red); text-shadow: 3px 3px 0 #000; }
.end-sub { margin: 0; font-size: 18px; }
.end-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.end-parts li { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; background: #00000044; padding: 6px 10px; border-radius: 6px; }
.end-btns { display: grid; gap: 8px; }

/* touch controls: thumbs low and wide, big targets */
.pads { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); pointer-events: none; }
.pads > * { pointer-events: auto; display: grid; gap: 8px; touch-action: none; }
.dpad { grid-template-columns: 78px 78px; grid-template-areas: "up up" "l r"; }
.dpad .jump { grid-area: up; }
.dpad [data-k="l"] { grid-area: l; }
.dpad [data-k="r"] { grid-area: r; }
.acts { grid-template-columns: repeat(2, 78px); }
.pads button { width: 100%; min-width: 0; height: 66px; padding: 0; font-size: 26px; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #2f2040e6; border-radius: 14px; touch-action: none; position: relative; overflow: hidden; }
.pads button small { font-family: Anton, sans-serif; font-size: 11px; letter-spacing: .06em; opacity: .9; }
.pads button.on { background: var(--ss-yellow); color: #000; transform: translateY(4px); box-shadow: 0 1px 0 #000; }
.pads .smash { background: #6a1424e6; }
.pads .special { background: #3a2a7ee6; }
.pads .special::after { content: ""; position: absolute; left: 0; bottom: 0; height: 6px; width: var(--cd, 0%); background: var(--ss-yellow); }
.pads .special.ready { background: #7a52ffee; box-shadow: 0 5px 0 #000, 0 0 14px 2px var(--ss-yellow); }
@media (max-height: 460px) { .dpad { grid-template-columns: 70px 70px; } .acts { grid-template-columns: repeat(4, 66px); } .pads button { height: 58px; } }
@media (pointer: fine) { .pads { display: none !important; } }

/* sideways tip on portrait phones */
@media (orientation: portrait) and (pointer: coarse) {
  body.fighting #world { }
  body.fighting::after { content: "Turn your phone sideways for the full street"; position: fixed; left: 12px; right: 12px; top: 46%; z-index: 40; text-align: center; background: var(--ss-yellow); color: #000; font-family: Anton, sans-serif; letter-spacing: .04em; text-transform: uppercase; padding: 8px 10px; border: 3px solid #000; border-radius: 8px; pointer-events: none; animation: ss-tip 6s forwards; }
}
@keyframes ss-tip { 0%, 80% { opacity: 1 } 100% { opacity: 0; visibility: hidden } }

@media (max-width: 760px) {
  .fighters { grid-template-columns: repeat(2, 1fr); }
  .fcard canvas { height: 96px; }
  .gate-card h1, .logo { font-size: 44px; }
}
@media (max-height: 480px) {
  .page { padding-top: 54px; align-items: start; }
  .card { gap: 8px; padding: 12px 16px; }
  .gate-card h1, .logo { font-size: 38px; }
  .stamp { font-size: 24px; }
  .home-card .tag { display: none; }
  .home-card { flex-direction: row; flex-wrap: wrap; justify-content: center; width: min(760px, 100%); }
  .home-card .big { width: auto; flex: 1 1 200px; }
  .home-card .logo, .home-card .stamp { flex: 1 1 100%; }
  .fighters { grid-template-columns: repeat(4, 1fr); }
  .fcard canvas { height: 70px; }
  .fcard .sw ul { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.playing .lock-btn .lk-word { display: none; }
@media (max-height: 480px) {
  .card h2 { display: none; }
  .pick-card { gap: 6px; padding: 8px 10px; }
  .fcard { padding: 5px; gap: 3px; }
  .fcard canvas { height: 64px; }
  .fcard .tg, .fcard .sw { display: none; }
  .fcard .nm { font-size: 16px; }
  .stats { font-size: 10px; gap: 1px 6px; }
  .stats i { height: 6px; }
  .opts { gap: 4px 14px; }
  #fight { min-height: 46px; font-size: 20px; }
  .stamp.small { transform: none; }
}
