﻿:root {
      --ink: #26161b;
      --paper: #fff8df;
      --hot: #ff4d6d;
      --gold: #ffd166;
      --mint: #2ed8a0;
      --blue: #3d9bff;
      --violet: #9158f7;
      --shadow: rgba(38, 22, 27, 0.24);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--ink);
      font-family: "Trebuchet MS", "Comic Sans MS", system-ui, sans-serif;
      background:
        radial-gradient(circle at 15% 12%, rgba(255, 209, 102, 0.78), transparent 22rem),
        radial-gradient(circle at 86% 10%, rgba(46, 216, 160, 0.65), transparent 20rem),
        linear-gradient(145deg, #70d6ff 0%, #fff176 48%, #ff9770 100%);
    }

    button { font: inherit; }

    .app {
      width: min(1120px, 100%);
      margin: 0 auto;
      padding: 12px;
    }

    header {
      display: grid;
      gap: 8px;
      margin-bottom: 10px;
      text-align: center;
    }

    .top-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .brand-mark {
      width: 54px;
      height: 54px;
      object-fit: contain;
      filter: drop-shadow(0 5px 0 rgba(38, 22, 27, 0.35));
    }

    .language-picker,
    .music-picker {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 6px 8px;
      border: 3px solid var(--ink);
      border-radius: 8px;
      background: rgba(255, 248, 223, 0.94);
      box-shadow: 0 4px 0 var(--ink);
      font-size: 0.86rem;
      font-weight: 1000;
    }

    .language-picker select,
    .music-picker select {
      max-width: 132px;
      border: 2px solid var(--ink);
      border-radius: 6px;
      background: #fff;
      font: inherit;
    }

    .music-picker select { max-width: 210px; }

    h1 {
      margin: 0;
      font-size: clamp(2rem, 8vw, 4.4rem);
      line-height: 0.94;
      text-shadow: 0 5px 0 rgba(255, 255, 255, 0.58), 0 8px 18px var(--shadow);
    }

    .tagline {
      margin: 0;
      font-size: clamp(1rem, 3vw, 1.28rem);
      font-weight: 900;
    }

    .panel, .pile-card, .action-btn, .modal-card {
      border: 4px solid var(--ink);
      border-radius: 8px;
      box-shadow: 0 7px 0 var(--ink), 0 12px 22px var(--shadow);
    }

    .scoreboard {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .scoreboard.arcade-hud {
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 8px;
    }

    .vs-badge {
      min-width: 62px;
      min-height: 62px;
      display: grid;
      place-items: center;
      border: 4px solid var(--ink);
      border-radius: 50%;
      background: var(--hot);
      color: #fff;
      box-shadow: 0 6px 0 var(--ink);
      font-size: 1.25rem;
      font-weight: 1000;
    }

    .panel {
      background: rgba(255, 248, 223, 0.95);
      padding: 10px;
    }

    .fighter {
      display: grid;
      gap: 7px;
    }

    .fighter h2 {
      margin: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: clamp(1rem, 3vw, 1.4rem);
    }

    .badge {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 3px 7px;
      border: 3px solid var(--ink);
      border-radius: 999px;
      background: var(--gold);
      font-size: 0.8rem;
      font-weight: 900;
    }

    .hud-icon {
      display: inline-grid;
      place-items: center;
      min-width: 34px;
      min-height: 24px;
      padding: 2px 5px;
      border: 3px solid var(--ink);
      border-radius: 6px;
      background: #fff;
      color: var(--ink);
      font-size: 0.75rem;
      font-weight: 1000;
      box-shadow: 0 3px 0 var(--ink);
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }

    .arcade-hud .stats {
      grid-template-columns: 1fr;
    }

    .stat {
      min-height: 44px;
      padding: 5px 7px;
      border: 3px solid var(--ink);
      border-radius: 8px;
      background: #fff;
      font-size: 0.9rem;
      font-weight: 900;
    }

    .arcade-hud .stat {
      min-height: 34px;
      padding: 4px 7px;
    }

    .arcade-hud .extra-stat,
    .arcade-hud .badge {
      display: none;
    }

    .power-bar {
      overflow: hidden;
      height: 16px;
      margin-top: 4px;
      border: 3px solid var(--ink);
      border-radius: 999px;
      background: #fff;
    }

    .power-fill {
      height: 100%;
      width: 50%;
      background: linear-gradient(90deg, var(--mint), var(--gold), var(--hot));
      transition: width 180ms ease;
    }

    .cup-fill {
      background: linear-gradient(90deg, var(--blue), var(--violet), var(--gold));
    }

    .power-label {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      font-size: 0.82rem;
    }

    .wide { grid-column: 1 / -1; }

    .game-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      align-items: start;
      margin-top: 10px;
    }

    .action-panel {
      display: grid;
      gap: 10px;
      background: rgba(255, 248, 223, 0.9);
    }

    .arena {
      position: relative;
      min-height: 560px;
      overflow: hidden;
      margin-top: 10px;
      background:
        linear-gradient(180deg, rgba(21, 28, 55, 0.08), rgba(21, 28, 55, 0.24)),
        radial-gradient(circle at 50% 88%, rgba(255, 209, 102, 0.75), transparent 18rem),
        linear-gradient(180deg, #a9ecff 0%, #77d58b 58%, #4f8b56 59%, #345c3d 100%);
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
    }

    .arena.bg-rooftop { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 430'%3E%3Crect width='900' height='430' fill='%23172142'/%3E%3Ccircle cx='760' cy='72' r='48' fill='%23fff8b5'/%3E%3Crect y='235' width='900' height='195' fill='%23212733'/%3E%3Crect x='28' y='132' width='120' height='120' fill='%232d3659'/%3E%3Crect x='188' y='98' width='150' height='154' fill='%2338466f'/%3E%3Crect x='560' y='116' width='180' height='136' fill='%232a3455'/%3E%3Cg fill='%23ffd166'%3E%3Crect x='55' y='160' width='18' height='20'/%3E%3Crect x='88' y='188' width='18' height='20'/%3E%3Crect x='220' y='130' width='20' height='22'/%3E%3Crect x='270' y='174' width='20' height='22'/%3E%3Crect x='600' y='150' width='20' height='22'/%3E%3C/g%3E%3Cpath d='M0 260 C160 230 260 286 430 250 S760 238 900 260 L900 430 L0 430Z' fill='%233c465f'/%3E%3C/svg%3E"); }

    .arena.bg-market { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 430'%3E%3Crect width='900' height='430' fill='%23ffb86d'/%3E%3Crect y='250' width='900' height='180' fill='%2331583a'/%3E%3Crect x='70' y='118' width='250' height='138' rx='8' fill='%23fff0a8'/%3E%3Cpath d='M70 118 L195 58 L320 118Z' fill='%23ff4d6d'/%3E%3Crect x='560' y='134' width='220' height='120' rx='8' fill='%23fff8df'/%3E%3Cpath d='M560 134 L670 82 L780 134Z' fill='%232ed8a0'/%3E%3Cg fill='%2326161b' opacity='.24'%3E%3Ccircle cx='145' cy='288' r='26'/%3E%3Ccircle cx='240' cy='300' r='18'/%3E%3Ccircle cx='620' cy='286' r='22'/%3E%3C/g%3E%3Cpath d='M0 310 C160 270 270 336 430 300 S735 282 900 318 L900 430 L0 430Z' fill='%234f8b56'/%3E%3C/svg%3E"); }

    .arena.bg-junkyard { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 430'%3E%3Crect width='900' height='430' fill='%238fd2ff'/%3E%3Crect y='238' width='900' height='192' fill='%232d3438'/%3E%3Cg fill='%23536066'%3E%3Cpath d='M40 252 L140 130 L238 252Z'/%3E%3Cpath d='M300 252 L420 112 L548 252Z'/%3E%3Cpath d='M625 252 L760 118 L858 252Z'/%3E%3C/g%3E%3Cg fill='%23ffd166'%3E%3Crect x='118' y='202' width='54' height='34'/%3E%3Crect x='470' y='190' width='70' height='44'/%3E%3Crect x='692' y='202' width='62' height='36'/%3E%3C/g%3E%3Cpath d='M0 300 C190 250 322 340 480 296 S760 260 900 312 L900 430 L0 430Z' fill='%23525b63'/%3E%3C/svg%3E"); }

    .arena.bg-neon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 430'%3E%3Crect width='900' height='430' fill='%2319142f'/%3E%3Crect y='252' width='900' height='178' fill='%23142126'/%3E%3Crect x='86' y='88' width='174' height='166' fill='%23352154'/%3E%3Crect x='600' y='74' width='190' height='180' fill='%23263945'/%3E%3Cg fill='none' stroke-width='9'%3E%3Crect x='112' y='120' width='112' height='54' stroke='%239158f7'/%3E%3Crect x='630' y='110' width='124' height='58' stroke='%232ed8a0'/%3E%3Cpath d='M328 145 L505 145' stroke='%23ff4d6d'/%3E%3C/g%3E%3Cpath d='M0 316 C150 270 300 328 450 292 S740 286 900 320 L900 430 L0 430Z' fill='%23263945'/%3E%3C/svg%3E"); }

    .arena.bg-apocalypse { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 430'%3E%3Crect width='900' height='430' fill='%23ffbd69'/%3E%3Ccircle cx='470' cy='112' r='82' fill='%23ff4d6d' opacity='.82'/%3E%3Crect y='240' width='900' height='190' fill='%2326161b'/%3E%3Cg fill='%235f3030'%3E%3Cpath d='M55 248 L180 80 L305 248Z'/%3E%3Cpath d='M575 248 L710 68 L845 248Z'/%3E%3C/g%3E%3Cg fill='%23ffd166'%3E%3Crect x='118' y='178' width='56' height='28'/%3E%3Crect x='710' y='168' width='64' height='30'/%3E%3C/g%3E%3Cpath d='M0 310 C175 260 320 348 492 300 S760 260 900 314 L900 430 L0 430Z' fill='%235f3030'/%3E%3C/svg%3E"); }

    .arena.bg-market {
      background-image:
        linear-gradient(180deg, #ffd98c 0 48%, transparent 48%),
        radial-gradient(circle at 18% 22%, #ff6b7a 0 56px, transparent 57px),
        linear-gradient(90deg, transparent 0 8%, #fff8df 8% 34%, transparent 34% 62%, #2ed8a0 62% 88%, transparent 88%),
        linear-gradient(180deg, transparent 0 56%, #4f8b56 56% 100%);
    }

    .arena.bg-rooftop {
      background-image:
        radial-gradient(circle at 78% 16%, #fff8b5 0 48px, transparent 49px),
        linear-gradient(180deg, #172142 0 52%, transparent 52%),
        linear-gradient(90deg, #2d3659 0 18%, transparent 18% 34%, #38466f 34% 54%, transparent 54% 72%, #2a3455 72% 100%),
        linear-gradient(180deg, transparent 0 56%, #3c465f 56% 100%);
    }

    .arena.bg-junkyard {
      background-image:
        linear-gradient(180deg, #8fd2ff 0 48%, transparent 48%),
        linear-gradient(135deg, transparent 0 16%, #536066 16% 29%, transparent 29% 45%, #6f7880 45% 58%, transparent 58%),
        linear-gradient(180deg, transparent 0 56%, #525b63 56% 100%);
    }

    .arena.bg-neon {
      background-image:
        linear-gradient(180deg, #19142f 0 50%, transparent 50%),
        radial-gradient(circle at 22% 24%, rgba(145, 88, 247, .85) 0 70px, transparent 71px),
        radial-gradient(circle at 78% 26%, rgba(46, 216, 160, .75) 0 62px, transparent 63px),
        linear-gradient(90deg, #352154 0 24%, transparent 24% 66%, #263945 66% 100%),
        linear-gradient(180deg, transparent 0 56%, #263945 56% 100%);
    }

    .arena.bg-apocalypse {
      background-image:
        radial-gradient(circle at 50% 18%, #ff4d6d 0 80px, transparent 81px),
        linear-gradient(180deg, #ffbd69 0 48%, transparent 48%),
        linear-gradient(135deg, transparent 0 20%, #5f3030 20% 36%, transparent 36% 65%, #7b3f51 65% 78%, transparent 78%),
        linear-gradient(180deg, transparent 0 56%, #26161b 56% 100%);
    }

    .arena::before {
      content: "";
      position: absolute;
      inset: 56% -10% 0;
      background:
        repeating-linear-gradient(90deg, rgba(38, 22, 27, 0.18) 0 18px, transparent 18px 46px),
        linear-gradient(180deg, #525b63, #2f343a);
      border-top: 5px solid var(--ink);
      transform: rotate(-1deg);
    }

    .moon {
      position: absolute;
      top: 20px;
      right: 26px;
      width: 64px;
      height: 64px;
      border: 4px solid var(--ink);
      border-radius: 50%;
      background: #fff8b5;
      box-shadow: 0 0 28px rgba(255, 248, 181, 0.75);
    }

    .dumpster {
      position: absolute;
      left: 50%;
      bottom: 48px;
      width: min(360px, 70%);
      height: 132px;
      transform: translateX(-50%);
      border: 5px solid var(--ink);
      border-radius: 8px 8px 18px 18px;
      background: linear-gradient(180deg, #35d6a3, #139160);
      box-shadow: 0 9px 0 var(--ink);
    }

    .dumpster::before {
      content: "";
      position: absolute;
      left: 18px;
      right: 18px;
      top: 26px;
      padding: 7px;
      border: 3px solid var(--ink);
      border-radius: 6px;
      background: #fff8df;
      text-align: center;
      font-size: 0.82rem;
      font-weight: 1000;
    }

    .dumpster::after {
      content: "";
      position: absolute;
      left: 20px;
      right: 20px;
      top: -28px;
      height: 30px;
      border: 5px solid var(--ink);
      border-radius: 10px 10px 0 0;
      background: #208758;
      transform: rotate(-3deg);
      transform-origin: bottom left;
    }

    .weapon-bin {
      position: absolute;
      left: 50%;
      bottom: 44px;
      width: 64px;
      height: 74px;
      border: 5px solid var(--ink);
      border-radius: 8px 8px 14px 14px;
      background: linear-gradient(180deg, #6f7880, #3f474d);
      box-shadow: 0 6px 0 var(--ink);
      transform: translateX(-50%) rotate(5deg);
      z-index: 3;
    }

    .weapon-bin::before {
      content: "";
      position: absolute;
      left: -8px;
      right: -8px;
      top: -18px;
      height: 18px;
      border: 5px solid var(--ink);
      border-radius: 8px;
      background: #8c969f;
    }

    .weapon-bin::after {
      content: "";
      position: absolute;
      left: 17px;
      top: 20px;
      width: 22px;
      height: 28px;
      border: 4px solid var(--ink);
      border-radius: 4px;
      opacity: 0.55;
    }

    .weapon-bin.hidden {
      display: none;
    }

    .trash-sprinkles {
      position: absolute;
      inset: 0;
      pointer-events: none;
      background:
        radial-gradient(circle at 18% 74%, #ffd166 0 7px, transparent 8px),
        radial-gradient(circle at 75% 72%, #ff4d6d 0 8px, transparent 9px),
        radial-gradient(circle at 32% 86%, #fff8df 0 6px, transparent 7px),
        radial-gradient(circle at 84% 86%, #9b5de5 0 6px, transparent 7px),
        radial-gradient(circle at 58% 78%, #3d9bff 0 7px, transparent 8px);
    }

    .animal {
      position: absolute;
      bottom: 54px;
      width: 132px;
      height: 156px;
      transform-origin: 50% 100%;
      transition: transform 180ms ease;
      z-index: 2;
    }

    .animal.player {
      left: clamp(10px, 7vw, 86px);
    }

    .animal.ai {
      right: clamp(10px, 7vw, 86px);
      transform: scaleX(-1);
    }

    .animal.ai .name-tag,
    .animal.ai .crown {
      transform: scaleX(-1);
    }

    .brow {
      position: absolute;
      top: 30px;
      width: 23px;
      height: 5px;
      border-radius: 999px;
      background: #fff;
      z-index: 6;
    }

    .brow.left { left: 28px; transform: rotate(18deg); }
    .brow.right { right: 28px; transform: rotate(-18deg); }

    .mouth {
      position: absolute;
      left: 39px;
      top: 68px;
      width: 26px;
      height: 12px;
      border: 4px solid var(--ink);
      border-top: 0;
      border-radius: 0 0 999px 999px;
      z-index: 6;
    }

    .animal.winning .mouth { border-radius: 0 0 999px 999px; }
    .animal.losing .mouth {
      top: 72px;
      border-top: 4px solid var(--ink);
      border-bottom: 0;
      border-radius: 999px 999px 0 0;
    }

    .animal.hurt .head { animation: headWobble 520ms ease; }
    .animal.hurt .eye { height: 5px; top: 42px; border-radius: 999px; }
    .animal.shielded .eye { background: #3d9bff; }

    .body {
      position: absolute;
      left: 24px;
      bottom: 0;
      width: 84px;
      height: 106px;
      border: 5px solid var(--ink);
      border-radius: 48% 48% 34% 34%;
      background: linear-gradient(90deg, #6c7078, #a7adb6 45%, #5d626c);
    }

    .body::before {
      content: "";
      position: absolute;
      left: 18px;
      top: 22px;
      width: 42px;
      height: 54px;
      border: 3px solid rgba(38, 22, 27, 0.35);
      border-radius: 50%;
      background: rgba(255, 248, 223, 0.34);
    }

    .body::after {
      content: "";
      position: absolute;
      left: 14px;
      top: 12px;
      width: 18px;
      height: 12px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.34);
    }

    .head::after {
      content: "";
      position: absolute;
      left: 18px;
      top: 18px;
      width: 24px;
      height: 12px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.28);
      z-index: 7;
    }

    .mask::after {
      content: "";
      position: absolute;
      left: -8px;
      right: -8px;
      bottom: -18px;
      height: 12px;
      border-top: 3px solid rgba(38, 22, 27, 0.75);
      border-bottom: 3px solid rgba(38, 22, 27, 0.75);
      transform: rotate(-6deg);
    }

    .animal.rat .body,
    .animal.rat .head { background: linear-gradient(90deg, #7f7c83, #c8c1c8 45%, #6a666e); }
    .animal.trash-cat .body,
    .animal.trash-cat .head { background: linear-gradient(90deg, #30272c, #675158 45%, #21191d); }
    .animal.scrap-dog .body,
    .animal.scrap-dog .head { background: linear-gradient(90deg, #9a6a3d, #d2a46d 45%, #70441f); }
    .animal.pigeon .body,
    .animal.pigeon .head { background: linear-gradient(90deg, #596778, #b9c8d2 45%, #4d5665); }
    .animal.possum .body,
    .animal.possum .head { background: linear-gradient(90deg, #dad6cf, #fff4e8 45%, #a39b94); }

    .animal.rat {
      width: 120px;
      height: 118px;
      bottom: 48px;
    }

    .animal.rat .body {
      left: 10px;
      width: 92px;
      height: 66px;
      border-radius: 62% 70% 38% 42%;
    }

    .animal.rat .head {
      width: 66px;
      height: 54px;
      left: 0;
      top: 32px;
      border-radius: 58% 42% 45% 55%;
    }

    .animal.rat .ear { width: 24px; height: 24px; top: -11px; }
    .animal.rat .mask { width: 50px; height: 22px; top: 18px; left: 7px; }
    .animal.rat .eye { top: 25px; }
    .animal.rat .eye.left { left: 20px; }
    .animal.rat .eye.right { right: 20px; }
    .animal.rat .brow { top: 18px; width: 17px; }
    .animal.rat .nose { left: 3px; top: 34px; width: 18px; height: 12px; }
    .animal.rat .mouth { left: 20px; top: 42px; }

    .animal.rat .tail {
      width: 108px;
      height: 16px;
      right: -74px;
      bottom: 22px;
      background: #c59aa2;
      transform: rotate(-18deg);
      animation: tailFlick 900ms ease-in-out infinite;
    }

    .animal.trash-cat .ear {
      border-radius: 8px;
      clip-path: polygon(50% 0, 100% 100%, 0 100%);
    }

    .animal.trash-cat .body {
      width: 78px;
      height: 98px;
      border-radius: 44% 44% 28% 28%;
    }

    .animal.trash-cat .head {
      height: 82px;
      border-radius: 42% 42% 34% 34%;
    }

    .animal.trash-cat .tail {
      width: 42px;
      height: 118px;
      right: -12px;
      background: #30272c;
      transform: rotate(18deg);
      animation: tailFlick 1100ms ease-in-out infinite;
    }

    .animal.trash-cat .arm {
      width: 48px;
      height: 15px;
      background: #21191d;
    }

    .animal.trash-cat .mask::after {
      left: -18px;
      right: -18px;
      height: 16px;
      border-top: 2px solid #fff8df;
      border-bottom: 2px solid #fff8df;
    }

    .animal.scrap-dog .ear {
      height: 52px;
      border-radius: 40% 40% 60% 60%;
      top: 6px;
      background: #70441f;
    }

    .animal.scrap-dog .head {
      width: 118px;
      height: 82px;
      left: 8px;
      border-radius: 42% 42% 48% 48%;
    }

    .animal.scrap-dog .body {
      left: 16px;
      width: 102px;
      height: 94px;
      border-radius: 40% 52% 28% 28%;
    }

    .animal.scrap-dog .nose {
      width: 36px;
      height: 18px;
      left: 34px;
      border-radius: 999px;
    }

    .animal.scrap-dog .arm {
      width: 46px;
      height: 22px;
    }

    .animal.scrap-dog .mask {
      background: rgba(38, 22, 27, 0.42);
    }

    .animal.pigeon .body {
      left: 25px;
      width: 82px;
      height: 112px;
      border-radius: 68% 68% 40% 40%;
    }

    .animal.pigeon .head {
      width: 74px;
      height: 68px;
      left: 29px;
      top: 2px;
      border-radius: 64% 64% 48% 48%;
    }

    .animal.pigeon .arm {
      width: 52px;
      height: 38px;
      border-radius: 50%;
      background: #7b91a8;
      animation: wingIdle 1200ms ease-in-out infinite;
    }

    .animal.pigeon .nose {
      width: 22px;
      height: 10px;
      left: 42px;
      background: #ffd166;
      clip-path: polygon(0 0, 100% 50%, 0 100%);
    }

    .animal.pigeon .tail {
      width: 76px;
      height: 34px;
      right: -22px;
      bottom: 18px;
      border-radius: 12px;
      transform: rotate(18deg);
    }

    .animal.pigeon .leg {
      width: 14px;
      height: 34px;
      background: #ffd166;
    }

    .animal.pigeon .body::before {
      background: rgba(255, 248, 223, 0.55);
      width: 46px;
      height: 60px;
    }

    .animal.possum .body {
      left: 14px;
      width: 98px;
      height: 90px;
      border-radius: 58% 64% 34% 38%;
    }

    .animal.possum .head {
      width: 92px;
      height: 78px;
      left: 9px;
      top: 20px;
      border-radius: 70% 42% 48% 58%;
    }

    .animal.possum .nose {
      width: 28px;
      height: 17px;
      left: 8px;
      top: 50px;
      background: #f5a7b8;
    }

    .animal.possum .tail {
      width: 96px;
      height: 19px;
      right: -62px;
      bottom: 20px;
      background: #f0b4bf;
    }

    .animal.scrap-dog .head {
      animation: dogBounce 1200ms ease-in-out infinite;
    }

    .head {
      position: absolute;
      left: 15px;
      top: 0;
      width: 102px;
      height: 92px;
      border: 5px solid var(--ink);
      border-radius: 46% 46% 42% 42%;
      background: #a7adb6;
    }

    .ear {
      position: absolute;
      top: -12px;
      width: 32px;
      height: 34px;
      border: 5px solid var(--ink);
      border-radius: 50% 50% 35% 35%;
      background: #6c7078;
      z-index: -1;
    }

    .ear.left { left: 12px; transform: rotate(-28deg); }
    .ear.right { right: 12px; transform: rotate(28deg); }

    .mask {
      position: absolute;
      left: 11px;
      top: 28px;
      width: 80px;
      height: 34px;
      border: 4px solid var(--ink);
      border-radius: 999px;
      background: #24272d;
    }

    .eye {
      position: absolute;
      top: 38px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #fff;
      box-shadow: inset 0 0 0 4px var(--ink);
      z-index: 2;
    }

    .eye.left { left: 34px; }
    .eye.right { right: 34px; }

    .nose {
      position: absolute;
      left: 44px;
      top: 58px;
      width: 16px;
      height: 12px;
      border-radius: 50%;
      background: var(--ink);
      z-index: 3;
    }

    .arm {
      position: absolute;
      top: 78px;
      width: 38px;
      height: 18px;
      border: 4px solid var(--ink);
      border-radius: 999px;
      background: #8c929c;
      z-index: 4;
    }

    .arm.left { left: 4px; transform: rotate(24deg); }
    .arm.right { right: 4px; transform: rotate(-24deg); }

    .leg {
      position: absolute;
      bottom: -7px;
      width: 28px;
      height: 20px;
      border: 4px solid var(--ink);
      border-radius: 999px;
      background: #686d76;
      z-index: 3;
    }

    .leg.left { left: 34px; transform: rotate(-8deg); }
    .leg.right { right: 34px; transform: rotate(8deg); }

    .tail {
      position: absolute;
      right: -18px;
      bottom: 20px;
      width: 52px;
      height: 88px;
      border: 5px solid var(--ink);
      border-radius: 50%;
      background:
        repeating-linear-gradient(160deg, #52565f 0 12px, #d4d8dd 12px 23px);
      z-index: -1;
    }

    .crown {
      position: absolute;
      left: 38px;
      top: -23px;
      font-size: 2rem;
      transform: rotate(-8deg);
      z-index: 5;
      filter: drop-shadow(0 3px 0 var(--ink));
    }

    .name-tag {
      position: absolute;
      left: 0;
      right: 0;
      bottom: -28px;
      padding: 3px 5px;
      border: 3px solid var(--ink);
      border-radius: 999px;
      background: #fff;
      text-align: center;
      font-size: 0.78rem;
      font-weight: 1000;
      display: none;
    }

    .speech {
      position: absolute;
      left: 50%;
      top: 12px;
      width: min(430px, 72%);
      min-height: 54px;
      padding: 8px 10px;
      border: 4px solid var(--ink);
      border-radius: 8px;
      background: #fff8df;
      box-shadow: 0 5px 0 var(--ink);
      transform: translateX(-50%);
      text-align: center;
      font-weight: 1000;
      z-index: 3;
      opacity: 0;
      pointer-events: none;
      transform: translateX(-50%) translateY(-16px) scale(0.96);
    }

    .effects {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 4;
    }

    .effect {
      position: absolute;
      left: 50%;
      top: 48%;
      transform: translate(-50%, -50%);
      font-size: clamp(2.8rem, 10vw, 5.6rem);
      opacity: 0;
      text-shadow: 0 5px 0 var(--ink);
    }

    .combo-banner {
      position: absolute;
      left: 50%;
      top: 88px;
      width: min(520px, 88%);
      padding: 8px 12px;
      border: 4px solid var(--ink);
      border-radius: 8px;
      background: var(--hot);
      color: #fff;
      box-shadow: 0 6px 0 var(--ink);
      transform: translateX(-50%) scale(0.7);
      opacity: 0;
      text-align: center;
      font-size: clamp(1rem, 4vw, 1.8rem);
      font-weight: 1000;
      z-index: 7;
    }

    .prop {
      position: absolute;
      opacity: 0;
      font-size: clamp(1.8rem, 6vw, 3.4rem);
      filter: drop-shadow(0 4px 0 var(--ink));
    }

    .prop.one { left: 18%; top: 54%; }
    .prop.two { left: 69%; top: 48%; }
    .prop.three { left: 46%; top: 28%; }
    .prop.four { left: 38%; top: 66%; }
    .prop.five { left: 54%; top: 58%; --dx: -110px; --dy: -120px; }
    .prop.six { left: 26%; top: 40%; --dx: 130px; --dy: -80px; }
    .prop.seven { left: 78%; top: 66%; --dx: -140px; --dy: -50px; }

    .action-caption {
      position: absolute;
      left: 50%;
      bottom: 14px;
      width: min(520px, 88%);
      min-height: 38px;
      padding: 7px 10px;
      border: 3px solid var(--ink);
      border-radius: 999px;
      background: #fff;
      box-shadow: 0 4px 0 var(--ink);
      transform: translateX(-50%);
      text-align: center;
      font-weight: 1000;
      z-index: 6;
      opacity: 0;
      pointer-events: none;
      transform: translateX(-50%) translateY(16px) scale(0.96);
    }

    .arena.message .speech,
    .arena.message .action-caption {
      animation: textPop 1450ms ease;
    }

    .rat-swarm {
      position: absolute;
      left: 50%;
      bottom: 40px;
      transform: translateX(-50%);
      font-size: clamp(2rem, 7vw, 4.2rem);
      opacity: 0;
      letter-spacing: 0.3rem;
      z-index: 5;
    }

    .cat-attack {
      position: absolute;
      right: -120px;
      bottom: 82px;
      font-size: clamp(3.2rem, 9vw, 5rem);
      opacity: 0;
      z-index: 5;
    }

    .arena.scavenge .player {
      animation: scavenge 760ms ease;
    }

    .arena.fight .player,
    .arena.ambush .player {
      animation: lunge 680ms ease;
    }

    .arena.defend .player {
      animation: defend 760ms ease;
    }

    .arena.ai-fight .ai,
    .arena.ai-ambush .ai {
      animation: aiLunge 680ms ease;
    }

    .arena.ai-defend .ai {
      animation: aiDefend 760ms ease;
    }

    .arena.clash .player {
      animation: playerCombo 1250ms ease;
    }

    .arena.clash .ai {
      animation: aiCombo 1250ms ease;
    }

    .arena.player-hit .player {
      animation: playerHit 680ms ease;
    }

    .arena.ai-hit .ai {
      animation: aiHit 680ms ease;
    }

    .arena.super .player {
      animation: superMove 1450ms ease;
      filter: drop-shadow(0 0 18px #ffd166);
    }

    .arena.super .combo-banner {
      animation: bannerSlam 1200ms ease;
    }

    .arena.special .player {
      animation: specialAttack 1650ms ease;
      filter: drop-shadow(0 0 20px #ffd166);
    }

    .arena.special .combo-banner {
      animation: bannerSlam 1450ms ease;
    }

    .arena.fight .arm,
    .arena.ambush .arm,
    .arena.clash .arm,
    .arena.special .arm {
      animation: armFlurry 380ms ease-in-out 3;
    }

    .arena.scavenge .leg,
    .arena.fight .leg,
    .arena.ambush .leg,
    .arena.clash .leg,
    .arena.special .leg {
      animation: footShuffle 300ms ease-in-out 4;
    }

    .arena.hit .effect.hit,
    .arena.scavenge .effect.scavenge,
    .arena.defend .effect.defend,
    .arena.ambush .effect.ambush,
    .arena.chaos .effect.chaos,
    .arena.apocalypse .effect.apocalypse {
      animation: popFlash 900ms ease;
    }

    .arena.special .effect.apocalypse {
      animation: popFlash 1300ms ease;
    }

    .arena.bin-grab .weapon-bin {
      animation: binPickup 760ms ease forwards;
    }

    .arena.bin-throw .weapon-bin {
      display: block;
      animation: binThrow 900ms ease forwards;
    }

    .arena.scavenge .prop.one,
    .arena.scavenge .prop.two,
    .arena.scavenge .prop.three,
    .arena.scavenge .prop.four {
      animation: trashRain 950ms ease;
    }

    .arena.fight .prop.one,
    .arena.fight .prop.two,
    .arena.ambush .prop.three,
    .arena.ambush .prop.four {
      animation: projectile 760ms ease;
    }

    .arena.chaos .prop,
    .arena.apocalypse .prop,
    .arena.trash-storm .prop {
      animation: chaosBurst 1200ms ease;
    }

    .arena.rats .rat-swarm {
      animation: ratRun 1200ms ease;
    }

    .arena.cat .cat-attack {
      animation: catSwipe 950ms ease;
    }

    .arena.shake {
      animation: arenaShake 520ms ease;
    }

    @keyframes scavenge {
      0%, 100% { transform: translate(0, 0) rotate(0); }
      20% { transform: translate(54px, -28px) rotate(-10deg) scale(1.05); }
      45% { transform: translate(110px, 18px) rotate(8deg) scale(0.96); }
      70% { transform: translate(64px, -18px) rotate(-5deg); }
    }

    @keyframes lunge {
      0%, 100% { transform: translateX(0) rotate(0); }
      50% { transform: translateX(150px) rotate(12deg) scale(1.08); }
    }

    @keyframes aiLunge {
      0%, 100% { transform: scaleX(-1) translateX(0) rotate(0); }
      50% { transform: scaleX(-1) translateX(150px) rotate(12deg) scale(1.08); }
    }

    @keyframes specialAttack {
      0%, 100% { transform: translateX(0) translateY(0) rotate(0) scale(1); }
      12% { transform: translateX(58px) translateY(-86px) rotate(-24deg) scale(1.16); }
      28% { transform: translateX(210px) translateY(-20px) rotate(28deg) scale(1.24); }
      44% { transform: translateX(92px) translateY(-70px) rotate(-18deg) scale(1.15); }
      62% { transform: translateX(230px) translateY(4px) rotate(32deg) scale(1.26); }
      80% { transform: translateX(135px) translateY(-35px) rotate(-12deg) scale(1.18); }
    }

    @keyframes armFlurry {
      0%, 100% { transform: rotate(12deg); }
      50% { transform: rotate(-54deg) translateX(18px); }
    }

    @keyframes footShuffle {
      0%, 100% { transform: translateX(0) rotate(0); }
      50% { transform: translateX(10px) rotate(14deg); }
    }

    @keyframes headWobble {
      0%, 100% { transform: rotate(0); }
      25% { transform: rotate(-10deg) translateY(-4px); }
      55% { transform: rotate(9deg) translateY(3px); }
      78% { transform: rotate(-5deg); }
    }

    @keyframes textPop {
      0% { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.9); }
      16%, 78% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
      100% { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.96); }
    }

    @keyframes binPickup {
      0% { opacity: 1; transform: translateX(-50%) rotate(5deg) scale(1); }
      100% { opacity: 0; transform: translateX(-210%) translateY(-60px) rotate(-28deg) scale(0.45); }
    }

    @keyframes binThrow {
      0% { opacity: 1; transform: translateX(-250%) translateY(-80px) rotate(-30deg) scale(0.7); }
      55% { opacity: 1; transform: translateX(45%) translateY(-150px) rotate(210deg) scale(1.05); }
      100% { opacity: 0; transform: translateX(210%) translateY(-20px) rotate(390deg) scale(0.9); }
    }

    @keyframes tailFlick {
      0%, 100% { transform: rotate(-18deg); }
      50% { transform: rotate(24deg) translateY(-7px); }
    }

    @keyframes wingIdle {
      0%, 100% { transform: rotate(18deg) translateY(0); }
      50% { transform: rotate(-18deg) translateY(-8px); }
    }

    @keyframes dogBounce {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-6px) rotate(3deg); }
    }

    @keyframes playerCombo {
      0%, 100% { transform: translateX(0) rotate(0); }
      18% { transform: translateX(92px) translateY(-42px) rotate(-14deg) scale(1.08); }
      38% { transform: translateX(178px) rotate(16deg) scale(1.12); }
      58% { transform: translateX(116px) translateY(-24px) rotate(-8deg); }
      78% { transform: translateX(188px) rotate(22deg) scale(1.16); }
    }

    @keyframes aiCombo {
      0%, 100% { transform: scaleX(-1) translateX(0) rotate(0); }
      22% { transform: scaleX(-1) translateX(96px) translateY(-38px) rotate(-14deg) scale(1.08); }
      44% { transform: scaleX(-1) translateX(174px) rotate(16deg) scale(1.12); }
      68% { transform: scaleX(-1) translateX(118px) translateY(-22px) rotate(-8deg); }
    }

    @keyframes playerHit {
      0%, 100% { transform: translateX(0) rotate(0); }
      28% { transform: translateX(-38px) translateY(-18px) rotate(-20deg); }
      55% { transform: translateX(18px) rotate(12deg); }
    }

    @keyframes aiHit {
      0%, 100% { transform: scaleX(-1) translateX(0) rotate(0); }
      28% { transform: scaleX(-1) translateX(-38px) translateY(-18px) rotate(-20deg); }
      55% { transform: scaleX(-1) translateX(18px) rotate(12deg); }
    }

    @keyframes superMove {
      0%, 100% { transform: translateX(0) translateY(0) rotate(0) scale(1); }
      16% { transform: translateX(74px) translateY(-74px) rotate(-20deg) scale(1.15); }
      34% { transform: translateX(185px) translateY(-8px) rotate(18deg) scale(1.2); }
      52% { transform: translateX(82px) translateY(-55px) rotate(-16deg) scale(1.12); }
      74% { transform: translateX(206px) translateY(6px) rotate(26deg) scale(1.22); }
    }

    @keyframes bannerSlam {
      0% { opacity: 0; transform: translateX(-50%) scale(0.2) rotate(-8deg); }
      22%, 76% { opacity: 1; transform: translateX(-50%) scale(1) rotate(2deg); }
      100% { opacity: 0; transform: translateX(-50%) scale(1.15) rotate(-2deg); }
    }

    @keyframes defend {
      0%, 100% { transform: scale(1); filter: none; }
      45% { transform: scale(1.08); filter: drop-shadow(0 0 16px #3d9bff); }
    }

    @keyframes aiDefend {
      0%, 100% { transform: scaleX(-1) scale(1); filter: none; }
      45% { transform: scaleX(-1) scale(1.08); filter: drop-shadow(0 0 16px #3d9bff); }
    }

    @keyframes popFlash {
      0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(-10deg); }
      30% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(6deg); }
      100% { opacity: 0; transform: translate(-50%, -72%) scale(0.75) rotate(-8deg); }
    }

    @keyframes trashRain {
      0% { opacity: 0; transform: translateY(-90px) rotate(-40deg) scale(0.5); }
      25%, 70% { opacity: 1; }
      100% { opacity: 0; transform: translateY(82px) rotate(38deg) scale(1.25); }
    }

    @keyframes projectile {
      0% { opacity: 0; transform: translateX(-150px) rotate(-40deg) scale(0.6); }
      18%, 72% { opacity: 1; }
      100% { opacity: 0; transform: translateX(150px) rotate(55deg) scale(1.2); }
    }

    @keyframes chaosBurst {
      0% { opacity: 0; transform: translate(0, 0) scale(0.2) rotate(0); }
      24%, 72% { opacity: 1; }
      100% { opacity: 0; transform: translate(var(--dx, 60px), var(--dy, -90px)) scale(1.35) rotate(120deg); }
    }

    @keyframes ratRun {
      0% { opacity: 0; transform: translateX(-70%) translateY(18px); }
      25%, 75% { opacity: 1; }
      100% { opacity: 0; transform: translateX(24%) translateY(-4px); }
    }

    @keyframes catSwipe {
      0% { opacity: 0; right: -120px; transform: rotate(0); }
      30% { opacity: 1; right: 18%; transform: rotate(-14deg); }
      70% { opacity: 1; right: 28%; transform: rotate(12deg); }
      100% { opacity: 0; right: 105%; transform: rotate(-8deg); }
    }

    @keyframes arenaShake {
      0%, 100% { transform: translate(0, 0); }
      20% { transform: translate(-5px, 2px); }
      40% { transform: translate(5px, -2px); }
      60% { transform: translate(-4px, -1px); }
      80% { transform: translate(4px, 2px); }
    }

    .round-bar {
      display: grid;
      gap: 8px;
      margin-bottom: 10px;
    }

    .meter-wrap {
      overflow: hidden;
      height: 24px;
      border: 3px solid var(--ink);
      border-radius: 999px;
      background: #fff;
    }

    .meter {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--mint), var(--gold), var(--hot));
      transition: width 220ms ease;
    }

    .piles {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .pile-card {
      min-height: 172px;
      padding: 10px;
      background: #fff;
      color: var(--ink);
      cursor: pointer;
      display: grid;
      align-content: start;
      gap: 7px;
      text-align: left;
      transition: transform 120ms ease, background 120ms ease;
    }

    .pile-card:hover, .pile-card:focus-visible, .pile-card.selected {
      transform: translateY(-4px);
      background: #fff0a8;
      outline: none;
    }

    .pile-title {
      margin: 0;
      font-size: 1rem;
      line-height: 1.05;
    }

    .pile-items {
      margin: 0;
      padding: 0;
      list-style: none;
      font-size: 0.9rem;
      font-weight: 800;
    }

    .controls {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 9px;
    }

    .action-btn {
      min-height: 92px;
      border-color: var(--ink);
      background: var(--mint);
      color: var(--ink);
      cursor: pointer;
      font-weight: 1000;
      font-size: clamp(0.95rem, 2vw, 1.35rem);
      line-height: 1.08;
    }

    .action-btn:nth-child(2) { background: var(--hot); color: #fff; }
    .action-btn:nth-child(3) {
      background: var(--blue);
      color: #fff;
    }
    .action-btn:nth-child(4) {
      background: var(--violet);
      color: #fff;
      min-height: 78px;
    }

    .action-btn.weapon {
      background: var(--gold);
      color: var(--ink);
    }

    .fight-hint {
      margin: 0;
      text-align: center;
      font-size: 0.95rem;
      font-weight: 1000;
    }

    .action-btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none;
    }

    .action-btn.pressed {
      transform: translateY(4px);
      box-shadow: 0 3px 0 var(--ink), 0 7px 14px var(--shadow);
      filter: saturate(1.25);
    }

    .side {
      display: none;
      gap: 10px;
    }

    .inventory-list {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: 7px;
      max-height: 140px;
      overflow: auto;
    }

    .chip {
      padding: 3px 6px;
      border: 2px solid var(--ink);
      border-radius: 999px;
      background: #fff;
      font-size: 0.78rem;
      font-weight: 900;
    }

    .log {
      height: 328px;
      overflow: auto;
      display: flex;
      flex-direction: column;
      gap: 7px;
      padding-right: 4px;
    }

    .log p {
      margin: 0;
      padding: 7px 8px;
      border: 2px solid var(--ink);
      border-radius: 8px;
      background: #fff;
      font-size: 0.92rem;
      font-weight: 800;
    }

    .modal {
      position: fixed;
      inset: 0;
      z-index: 10;
      display: grid;
      place-items: center;
      padding: 14px;
      background: rgba(38, 22, 27, 0.58);
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
    }

    .hidden { display: none !important; }

    .modal-card {
      width: min(620px, 100%);
      max-height: calc(100dvh - 28px);
      overflow-y: auto;
      padding: 18px;
      background: var(--paper);
      text-align: center;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
    }

    .app:focus {
      outline: none;
    }

    .cinematic-card {
      background:
        linear-gradient(180deg, rgba(255, 248, 223, 0.98), rgba(255, 209, 102, 0.92)),
        #05040a;
      animation: cinematicIn 700ms ease both;
    }

    .cinematic-logo {
      width: min(168px, 42vw);
      height: auto;
      margin: 0 auto 8px;
      display: block;
      filter: drop-shadow(0 8px 0 rgba(38, 22, 27, 0.28));
      animation: logoPulse 1800ms ease-in-out infinite;
    }

    .fighter-select {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin: 12px 0;
    }

    .fighter-choice {
      min-height: 78px;
      padding: 8px;
      border: 3px solid var(--ink);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 4px 0 var(--ink);
      cursor: pointer;
      font-weight: 1000;
    }

    .animal-icon {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      margin: 0 auto 4px;
      border: 3px solid var(--ink);
      border-radius: 50%;
      background:
        radial-gradient(circle at 32% 24%, rgba(255,255,255,.8), transparent 24%),
        var(--gold);
      box-shadow: 0 4px 0 var(--ink);
      font-size: 1.65rem;
      line-height: 1;
    }

    .fighter-choice.selected {
      background: var(--gold);
      transform: translateY(-3px);
    }

    .difficulty-select {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      margin: 10px 0 12px;
    }

    .difficulty-choice {
      min-height: 54px;
      padding: 7px;
      border: 3px solid var(--ink);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 4px 0 var(--ink);
      cursor: pointer;
      font-weight: 1000;
    }

    .difficulty-choice.selected {
      background: var(--mint);
      transform: translateY(-3px);
    }

    .start-language-choices {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin: 14px 0 6px;
    }

    .language-choice {
      min-height: 48px;
      padding: 8px;
      border: 3px solid var(--ink);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 4px 0 var(--ink);
      cursor: pointer;
      font-weight: 1000;
    }

    .language-choice.selected {
      background: var(--gold);
      transform: translateY(-3px);
    }

    .modal-card h2 {
      margin: 0 0 8px;
      font-size: clamp(1.8rem, 8vw, 3.5rem);
      line-height: 0.95;
    }

    .end-subtitle {
      margin: 0 auto 10px;
      max-width: 34rem;
      font-weight: 1000;
    }

    .victory-board {
      width: min(900px, 100%);
      padding: clamp(14px, 3vw, 28px);
      background:
        linear-gradient(180deg, rgba(255, 209, 102, 0.98), rgba(255, 248, 223, 0.98)),
        var(--paper);
      text-transform: none;
      animation: victoryRise 760ms cubic-bezier(.2, 1.25, .2, 1) both;
    }

    .victory-board h2 {
      color: var(--ink);
      max-width: 100%;
      font-size: clamp(1.75rem, 7vw, 4.2rem);
      line-height: 0.98;
      overflow-wrap: anywhere;
      hyphens: auto;
      text-shadow: 0 5px 0 #fff, 0 10px 0 rgba(38, 22, 27, 0.22);
    }

    .victory-board p,
    .victory-board .end-subtitle {
      max-width: 46rem;
      overflow-wrap: anywhere;
    }

    .victory-crown {
      width: min(220px, 62vw);
      min-height: 92px;
      display: grid;
      place-items: center;
      margin: 0 auto 12px;
      border: 5px solid var(--ink);
      border-radius: 8px 8px 24px 24px;
      background:
        linear-gradient(135deg, transparent 0 16%, var(--gold) 16% 34%, transparent 34% 42%, var(--gold) 42% 58%, transparent 58% 66%, var(--gold) 66% 84%, transparent 84%),
        linear-gradient(180deg, #fff176, var(--gold));
      color: var(--ink);
      box-shadow: 0 8px 0 var(--ink), 0 0 34px rgba(255, 209, 102, 0.8);
      font-size: clamp(1.4rem, 7vw, 2.8rem);
      font-weight: 1000;
      letter-spacing: 0;
    }

    @keyframes victoryRise {
      from { opacity: 0; transform: translateY(28px) scale(.94); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .primary {
      width: 100%;
      min-height: 64px;
      margin-top: 10px;
      border: 4px solid var(--ink);
      border-radius: 8px;
      background: var(--hot);
      color: #fff;
      box-shadow: 0 6px 0 var(--ink);
      cursor: pointer;
      font-size: 1.2rem;
      font-weight: 1000;
    }

    .level-modal {
      background: #05040a;
      animation: levelFadeIn 520ms ease both;
    }

    .level-card {
      display: grid;
      gap: 14px;
      width: min(720px, 100%);
      padding: 22px;
      border: 0;
      box-shadow: none;
      background: transparent;
      color: #fff;
      text-align: center;
      text-shadow: 0 5px 0 var(--ink), 0 0 28px rgba(255, 209, 102, 0.8);
    }

    .level-logo {
      width: min(132px, 34vw);
      justify-self: center;
      filter: drop-shadow(0 0 24px rgba(255, 209, 102, 0.72));
    }

    .level-card h2 {
      margin: 0;
      color: var(--gold);
      font-size: clamp(4rem, 18vw, 9.5rem);
      line-height: 0.82;
      letter-spacing: 0;
      animation: levelTitlePop 720ms cubic-bezier(.2, 1.3, .25, 1) both;
    }

    .level-card p {
      margin: 0;
      font-size: clamp(1.2rem, 4vw, 2rem);
      font-weight: 1000;
    }

    .level-card .primary {
      width: min(360px, 100%);
      justify-self: center;
      background: var(--gold);
      color: var(--ink);
    }

    @keyframes levelFadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes levelTitlePop {
      from { opacity: 0; transform: scale(0.6) rotate(-4deg); }
      to { opacity: 1; transform: scale(1) rotate(0); }
    }

    @keyframes cinematicIn {
      from { opacity: 0; transform: scale(0.92); }
      to { opacity: 1; transform: scale(1); }
    }

    @keyframes logoPulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.04); }
    }

    .arena.lightning::after,
    .arena.earthquake::after,
    .arena.storm::after,
    .arena.frogs::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 3;
      animation: comboFlash 850ms ease both;
    }

    .arena.lightning::after { background: linear-gradient(120deg, transparent 42%, rgba(255,255,255,.92) 46%, rgba(255,209,102,.9) 50%, transparent 56%); }
    .arena.earthquake::after { background: repeating-linear-gradient(165deg, transparent 0 18px, rgba(38,22,27,.3) 19px 23px); }
    .arena.storm::after { background: radial-gradient(circle at 50% 20%, rgba(61,155,255,.5), transparent 38%), linear-gradient(180deg, rgba(38,22,27,.2), transparent); }
    .arena.frogs::after { background: radial-gradient(circle at 20% 20%, rgba(46,216,160,.8) 0 10px, transparent 11px), radial-gradient(circle at 72% 28%, rgba(46,216,160,.8) 0 9px, transparent 10px), radial-gradient(circle at 48% 12%, rgba(46,216,160,.8) 0 8px, transparent 9px); }

    @keyframes comboFlash {
      from { opacity: 0; transform: scale(1.04); }
      30%, 70% { opacity: 1; }
      to { opacity: 0; transform: scale(1); }
    }

    .animal {
      filter: drop-shadow(0 10px 0 rgba(38, 22, 27, 0.22)) drop-shadow(0 18px 18px rgba(38, 22, 27, 0.24));
    }

    .animal::before {
      content: "";
      position: absolute;
      left: -22px;
      top: 18px;
      width: 176px;
      height: 126px;
      z-index: -1;
      opacity: 0;
      background:
        repeating-linear-gradient(115deg, transparent 0 13px, rgba(255, 255, 255, 0.55) 14px 17px),
        radial-gradient(circle, rgba(255, 209, 102, 0.45), transparent 64%);
      transform: rotate(-8deg);
      transition: opacity 160ms ease;
    }

    .animal.winning::before,
    .animal.shielded::before {
      opacity: 0.8;
    }

    .body,
    .head {
      border-width: 5px;
      box-shadow:
        inset 10px -12px 0 rgba(38, 22, 27, 0.16),
        inset -8px 10px 0 rgba(255, 255, 255, 0.34),
        0 6px 0 rgba(38, 22, 27, 0.18);
    }

    .head {
      width: 108px;
      height: 94px;
      left: 11px;
      top: -6px;
      border-radius: 48% 48% 42% 42%;
    }

    .body {
      width: 86px;
      height: 104px;
      left: 23px;
      border-radius: 48% 48% 32% 32%;
    }

    .head::before {
      content: "";
      position: absolute;
      left: 20px;
      top: 10px;
      width: 44px;
      height: 18px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.48);
      transform: rotate(-18deg);
    }

    .mask {
      top: 31px;
      left: 8px;
      width: 92px;
      height: 36px;
      border-radius: 52% 52% 42% 42%;
      background: linear-gradient(90deg, rgba(38, 22, 27, 0.94), rgba(38, 22, 27, 0.72));
      transform: rotate(-2deg);
    }

    .eye {
      top: 36px;
      width: 22px;
      height: 26px;
      border: 4px solid var(--ink);
      border-radius: 50% 50% 46% 46%;
      background:
        radial-gradient(circle at 34% 26%, #fff 0 4px, transparent 5px),
        radial-gradient(circle at 62% 67%, rgba(61, 155, 255, 0.75) 0 4px, transparent 5px),
        #05040a;
      box-shadow: 0 3px 0 rgba(255, 255, 255, 0.42);
    }

    .eye.left { left: 25px; }
    .eye.right { right: 25px; }

    .brow {
      top: 25px;
      height: 6px;
      background: var(--ink);
      border-radius: 999px;
    }

    .nose {
      top: 60px;
      left: 46px;
      width: 20px;
      height: 13px;
      box-shadow: inset 4px -3px 0 rgba(255, 255, 255, 0.28);
    }

    .mouth {
      top: 72px;
      left: 42px;
      width: 28px;
      height: 15px;
      border-bottom-width: 4px;
    }

    .ear {
      border-width: 5px;
      box-shadow: inset -5px -5px 0 rgba(38, 22, 27, 0.18);
    }

    .arm,
    .leg,
    .tail {
      border-width: 5px;
      box-shadow: inset 6px -7px 0 rgba(38, 22, 27, 0.16);
    }

    .crown {
      left: 27px;
      top: -34px;
      width: 78px;
      height: 30px;
      display: grid;
      place-items: center;
      border: 4px solid var(--ink);
      border-radius: 8px;
      background: var(--gold);
      color: var(--ink);
      font-size: 0.82rem;
      font-weight: 1000;
      box-shadow: 0 4px 0 var(--ink);
    }

    .name-tag {
      border-radius: 6px;
      background: rgba(255, 248, 223, 0.96);
      box-shadow: 0 4px 0 var(--ink);
    }

    .animal.trash-cat .mask,
    .animal.scrap-dog .mask,
    .animal.pigeon .mask,
    .animal.possum .mask {
      background: rgba(38, 22, 27, 0.34);
    }

    .animal.rat .head {
      width: 78px;
      height: 66px;
      top: 24px;
    }

    .animal.rat .eye {
      top: 31px;
      width: 18px;
      height: 22px;
    }

    .animal.rat .nose {
      top: 47px;
      left: 6px;
    }

    .animal.pigeon .nose {
      top: 53px;
      height: 14px;
      border-radius: 50% 12px 12px 50%;
    }

    @media (max-width: 820px) {
      .game-grid, .piles { grid-template-columns: 1fr; }
      .scoreboard.arcade-hud { grid-template-columns: 1fr auto 1fr; }
      header { gap: 5px; margin-bottom: 6px; }
      h1 { font-size: clamp(1.45rem, 7vw, 2.6rem); }
      .tagline { font-size: 0.92rem; }
      .panel { padding: 7px; }
      .stat { min-height: 34px; padding: 4px 6px; }
      .power-bar { height: 13px; }
      .arena { min-height: 340px; margin-top: 6px; }
      .animal { width: 104px; height: 134px; }
      .body { left: 19px; width: 66px; height: 90px; }
      .head { left: 10px; width: 84px; height: 78px; }
      .mask { left: 9px; width: 64px; }
      .eye.left { left: 27px; }
      .eye.right { right: 27px; }
      .nose { left: 36px; }
      .tail { right: -16px; width: 42px; height: 76px; }
      .arm { top: 68px; width: 32px; }
      .crown { left: 29px; }
      .speech {
        top: 10px;
        width: 86%;
        font-size: 0.9rem;
      }
      .pile-card { min-height: 132px; }
      .controls {
        position: sticky;
        bottom: 8px;
        z-index: 4;
      }
      .log { height: 230px; }
      .modal {
        align-items: start;
        place-items: start center;
        padding: 10px;
      }
      .modal-card {
        max-height: calc(100dvh - 20px);
      }
    }

    @media (max-width: 440px) {
      .app { padding: 8px; }
      .brand-mark { width: 42px; height: 42px; }
      .language-picker span,
      .music-picker span { display: none; }
      .music-picker select { max-width: 128px; }
      .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .action-btn { min-height: 58px; font-size: 0.9rem; }
      .action-btn:nth-child(3),
      .action-btn:nth-child(4),
      .action-btn.weapon { grid-column: auto; }
      .arena { min-height: 300px; }
      .vs-badge { min-width: 46px; min-height: 46px; font-size: 0.95rem; }
      .fighter h2 { font-size: 0.9rem; }
      .power-label { font-size: 0.72rem; }
      .round-bar { gap: 5px; margin-bottom: 6px; }
      .modal-card {
        padding: 12px;
      }
      .cinematic-logo {
        width: min(118px, 32vw);
      }
      .fighter-select,
      .difficulty-select,
      .start-language-choices {
        gap: 6px;
        margin: 8px 0;
      }
      .fighter-choice {
        min-height: 64px;
        padding: 6px;
      }
      .difficulty-choice,
      .language-choice {
        min-height: 44px;
        padding: 6px;
      }
      .primary {
        min-height: 54px;
        margin-top: 8px;
      }
      .animal.player { left: 5px; }
      .animal.ai { right: 5px; }
      .dumpster { width: 72%; height: 112px; }
      .dumpster::before { font-size: 0.62rem; left: 10px; right: 10px; }
    }

    .arena.bg-market,
    .arena.bg-rooftop,
    .arena.bg-junkyard,
    .arena.bg-neon,
    .arena.bg-apocalypse {
      background-image:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.55), transparent 92px),
        radial-gradient(circle at 82% 18%, rgba(255, 209, 102, 0.45), transparent 88px),
        linear-gradient(180deg, rgba(169, 236, 255, 0.94) 0 55%, rgba(255, 248, 223, 0.92) 55% 100%);
    }

    .arena.bg-rooftop {
      background-image:
        radial-gradient(circle at 76% 18%, rgba(255, 248, 181, 0.85), transparent 70px),
        linear-gradient(180deg, #172142 0 58%, #2b3048 58% 100%);
    }

    .arena.bg-junkyard {
      background-image:
        linear-gradient(135deg, transparent 0 22%, rgba(83, 96, 102, 0.5) 22% 34%, transparent 34% 64%, rgba(111, 120, 128, 0.42) 64% 76%, transparent 76%),
        linear-gradient(180deg, #8fd2ff 0 58%, #cfd4d6 58% 100%);
    }

    .arena.bg-neon {
      background-image:
        radial-gradient(circle at 24% 20%, rgba(145, 88, 247, .7), transparent 86px),
        radial-gradient(circle at 78% 24%, rgba(46, 216, 160, .55), transparent 82px),
        linear-gradient(180deg, #19142f 0 58%, #241d3a 58% 100%);
    }

    .arena.bg-apocalypse {
      background-image:
        radial-gradient(circle at 50% 18%, rgba(255, 77, 109, .68), transparent 92px),
        linear-gradient(180deg, #ffbd69 0 58%, #5f3030 58% 100%);
    }

    .arena.bg-market,
    .arena.bg-rooftop,
    .arena.bg-junkyard,
    .arena.bg-neon,
    .arena.bg-apocalypse {
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
    }

    .arena.bg-market { background-image: url("../arena/arena1.png"); }
    .arena.bg-rooftop { background-image: url("../arena/arena2.png"); }
    .arena.bg-junkyard { background-image: url("../arena/arena3.png"); }
    .arena.bg-neon { background-image: url("../arena/arena4.png"); }
    .arena.bg-apocalypse { background-image: url("../arena/arena5.png"); }

    .arena::before,
    .moon,
    .dumpster,
    .trash-sprinkles,
    .combo-banner,
    .action-caption,
    .speech {
      display: none !important;
    }

    .arena .effects {
      display: block;
    }

    .arena .weapon-bin,
    .arena .animal {
      display: block;
    }

    .animal {
      width: 82px;
      height: 112px;
      bottom: 58px;
      transition: left 180ms ease, right 180ms ease, transform 180ms ease;
    }

    .animal.player { left: clamp(18px, 10vw, 130px); }
    .animal.ai { right: clamp(18px, 10vw, 130px); }

    .animal.move-forward { left: clamp(88px, 24vw, 260px); }
    .animal.move-back { left: clamp(4px, 3vw, 40px); }
    .animal.move-jump { animation: mangaJump 620ms ease both; }
    .animal.move-squat { transform: scaleY(.72) translateY(34px); }

    .animal.ai.move-squat { transform: scaleX(-1) scaleY(.72) translateY(34px); }

    .head {
      left: 6px;
      top: 0;
      width: 70px;
      height: 68px;
      border-radius: 48% 48% 42% 42%;
      background: linear-gradient(135deg, #f4a261, #ffd0a1 54%, #9c5f36);
    }

    .body {
      left: 20px;
      bottom: 0;
      width: 42px;
      height: 56px;
      border-radius: 42% 42% 28% 28%;
      background: linear-gradient(135deg, #3d9bff, #fff8df 56%, #26161b);
    }

    .mask {
      left: 9px;
      top: 24px;
      width: 52px;
      height: 25px;
      opacity: .88;
    }

    .eye,
    .animal.rat .eye {
      z-index: 5;
      top: 25px;
      width: 17px;
      height: 22px;
      border: 3px solid var(--ink);
      background:
        radial-gradient(circle at 32% 22%, #fff 0 4px, transparent 5px),
        radial-gradient(circle at 62% 68%, #3d9bff 0 4px, transparent 5px),
        #05040a;
      opacity: 1;
      visibility: visible;
    }

    .eye.left,
    .animal.rat .eye.left { left: 17px; }
    .eye.right,
    .animal.rat .eye.right { right: 17px; }

    .nose {
      top: 48px;
      left: 31px;
      width: 12px;
      height: 9px;
    }

    .mouth {
      top: 57px;
      left: 27px;
      width: 20px;
      height: 11px;
    }

    .ear {
      width: 24px;
      height: 24px;
      top: -8px;
    }

    .tail {
      right: -10px;
      bottom: 18px;
      width: 26px;
      height: 52px;
    }

    .arm {
      top: 58px;
      width: 27px;
      height: 14px;
    }

    .leg {
      width: 15px;
      height: 28px;
    }

    .crown {
      left: 9px;
      top: -28px;
      width: 64px;
      height: 24px;
      font-size: .68rem;
    }

    .name-tag {
      top: 104px;
      font-size: .64rem;
      max-width: 132px;
    }

    .arena.player-jump .animal.player { animation: mangaJump 620ms ease both; }
    .arena.player-forward .animal.player { left: clamp(88px, 24vw, 260px); }
    .arena.player-back .animal.player { left: clamp(4px, 3vw, 40px); }
    .arena.player-squat .animal.player { transform: scaleY(.72) translateY(34px); }

    @keyframes mangaJump {
      0%, 100% { transform: translateY(0) scale(1); }
      45% { transform: translateY(-72px) scale(1.04); }
    }
