@font-face {
  font-family: "Press Start 2P";
  src: url("/assets/fonts/press-start-2p.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #071a3d;
  --navy-2: #0d2858;
  --cobalt: #183ddb;
  --cobalt-dark: #102ba8;
  --cyan: #42e3f5;
  --cyan-dark: #1699b8;
  --cream: #f4f7e9;
  --ink-muted: #a9bedb;
  --grass: #86bd35;
  --grass-dark: #639e2b;
  --grass-light: #a6d94b;
  --pink: #ec5f9c;
  --gold: #f0bd36;
  --danger: #ff6d5a;
  --app-height: 100vh;
  font-family: "Courier New", monospace;
}

@supports (height: 100dvh) {
  :root { --app-height: 100dvh; }
}

* { box-sizing: border-box; }

body, body * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input {
  -webkit-user-select: text;
  user-select: text;
}

html, body {
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #020612;
  color: var(--navy);
}

button, input { font: inherit; }
button { touch-action: manipulation; }

.mobile-blocker {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(rgba(2, 6, 18, .76), rgba(2, 6, 18, .92)),
    url("/assets/dlicom-menu-backdrop.webp") center / cover no-repeat;
  color: var(--cream);
}
.mobile-blocker::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(66, 227, 245, .22) 3px 4px);
}
.mobile-blocker-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(430px, calc(100vw - 48px));
  justify-items: center;
  padding: 34px 24px 38px;
  background: rgba(7, 26, 61, .96);
  text-align: center;
}
.mobile-blocker-panel img { width: 78px; height: 78px; border: 3px solid var(--cyan); object-fit: cover; }
.mobile-blocker-panel p { margin: 20px 0 0; color: var(--cyan); font-size: 9px; font-weight: 900; }
.mobile-blocker-panel h1 { margin: 16px 0 20px; color: var(--cream); font-size: clamp(22px, 7vw, 38px); line-height: 1.35; }
.mobile-blocker-panel strong { margin-top: 4px; color: var(--cyan); font-family: "Press Start 2P", monospace; font-size: 10px; line-height: 1.7; }
.mobile-blocker-panel small { max-width: 280px; margin-top: 11px; color: var(--ink-muted); font-size: 12px; line-height: 1.55; }

.menu-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: #020612;
  color: #f5fbff;
}

.pixel-scene {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #020612 url("/assets/dlicom-menu-backdrop.webp") center / cover no-repeat;
  filter: saturate(.92) brightness(.64);
  transform: scale(1.01);
}

.pixel-scene::before,
.pixel-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pixel-scene::before {
  background:
    linear-gradient(90deg, rgba(2, 6, 18, .82), rgba(2, 6, 18, .12) 35%, rgba(2, 6, 18, .16) 68%, rgba(2, 6, 18, .76)),
    linear-gradient(180deg, rgba(2, 6, 18, .42), transparent 45%, rgba(2, 6, 18, .3));
}
.pixel-scene::after {
  opacity: .2;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(65, 244, 255, .14) 3px 4px);
  animation: scan-shift 8s linear infinite;
}

.brand-lockup {
  position: absolute;
  left: clamp(26px, 4vw, 64px);
  right: clamp(26px, 4vw, 64px);
  top: clamp(22px, 3vw, 42px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #f5fbff;
}

.brand-logo {
  width: 66px;
  height: 66px;
  border: 2px solid rgba(65, 244, 255, .82);
  object-fit: cover;
  image-rendering: auto;
  box-shadow: 0 0 0 4px rgba(3, 15, 53, .78), 0 0 30px rgba(25, 231, 255, .22);
}

.brand-name {
  display: grid;
  gap: 7px;
  color: #f5fbff;
  font-family: "Press Start 2P", monospace;
  font-size: 17px;
  line-height: 1;
  text-shadow: 3px 3px 0 #041034;
}
.brand-name small { color: #41f4ff; font-size: 7px; letter-spacing: .1em; }

.menu-utilities {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.server-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(65, 244, 255, .3);
  background: rgba(2, 9, 31, .74);
  color: #9db5d6;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: .04em;
}
.server-badge i { width: 7px; height: 7px; background: #41f4ff; box-shadow: 0 0 12px #41f4ff; animation: status-pulse 1.8s steps(2, end) infinite; }

.menu-content {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(480px, 1.15fr) minmax(170px, .52fr) minmax(360px, 420px);
  align-items: center;
  gap: clamp(20px, 2.5vw, 44px);
  padding: 96px clamp(28px, 5vw, 76px) 48px;
}

.menu-copy {
  align-self: center;
  max-width: 720px;
  --menu-rail-width: min(380px, 100%);
}

.kicker {
  display: inline-block;
  margin: 0 0 24px;
  padding: 9px 11px 8px;
  border-left: 5px solid #41f4ff;
  background: rgba(3, 13, 45, .82);
  color: #41f4ff;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(7px, .7vw, 10px);
  line-height: 1.6;
  letter-spacing: .08em;
  box-shadow: 6px 6px 0 rgba(5, 25, 80, .45);
}

h1 {
  margin: 0;
  color: #f5fbff;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(38px, 4.7vw, 76px);
  line-height: 1.22;
  letter-spacing: -.06em;
  text-shadow: 5px 5px 0 #061b58, 0 0 36px rgba(25, 231, 255, .14);
}
h1 span { color: #41f4ff; }

.intro-copy {
  max-width: 570px;
  margin: 24px 0 0;
  color: #a9bedb;
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 800;
  line-height: 1.6;
}

.arena-facts {
  display: flex;
  align-items: stretch;
  width: var(--menu-rail-width);
  margin-top: 30px;
  border: 1px solid rgba(65, 244, 255, .28);
  background: rgba(2, 9, 31, .78);
  box-shadow: 8px 8px 0 rgba(3, 21, 70, .42);
}
.arena-facts span { display: grid; flex: 1; gap: 6px; min-width: 0; padding: 13px 16px 11px; color: #7894bc; font-size: 9px; font-weight: 900; }
.arena-facts span + span { border-left: 1px solid rgba(65, 244, 255, .22); }
.arena-facts b { color: #f5fbff; font-family: "Press Start 2P", monospace; font-size: 14px; }

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: var(--menu-rail-width);
  min-width: 0;
  margin-top: 18px;
  padding: 12px 12px 11px 15px;
  border: 1px solid rgba(65, 244, 255, .52);
  border-radius: 0;
  background: rgba(2, 9, 31, .84);
  color: #f5fbff;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  cursor: pointer;
  box-shadow: 6px 6px 0 rgba(3, 21, 70, .55);
}
.secondary-button b { color: #41f4ff; font-size: 14px; }
.secondary-button:hover, .secondary-button:focus-visible { border-color: #41f4ff; background: #071a3d; outline: none; }

.mascot-showcase {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(21vw, 300px);
  aspect-ratio: 1;
  animation: mascot-bob 1.25s steps(2, end) infinite;
}

.mascot-ring {
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(65, 244, 255, .62);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 231, 255, .2), rgba(10, 62, 174, .08) 46%, transparent 68%);
  box-shadow: 0 0 28px rgba(25, 231, 255, .18), inset 0 0 32px rgba(25, 231, 255, .11);
}
.mascot-ring::before, .mascot-ring::after { content: ""; position: absolute; background: #41f4ff; box-shadow: 0 0 10px #41f4ff; }
.mascot-ring::before { left: -10%; right: -10%; top: 50%; height: 2px; }
.mascot-ring::after { top: -10%; bottom: -10%; left: 50%; width: 2px; }

.mascot-pixel {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("/assets/dlicom-mascot-spritesheet.webp");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: 0 0;
  image-rendering: pixelated;
  filter: drop-shadow(10px 12px 0 rgba(2, 6, 18, .48));
}

.menu-mascot-weapon {
  position: absolute;
  z-index: 3;
  top: 43%;
  left: 59%;
  width: 34%;
  height: 34%;
  image-rendering: pixelated;
  transform: rotate(var(--menu-gun-angle, -5deg));
  transform-origin: 22% 58%;
  filter: drop-shadow(5px 6px 0 rgba(2, 6, 18, .45));
}
.menu-mascot-weapon.is-facing-left {
  left: 7%;
  transform: rotate(var(--menu-gun-left-angle, 0deg)) scaleX(-1);
  transform-origin: 78% 58%;
}
.menu-mascot-weapon.is-firing { animation: menu-gun-recoil-right .2s steps(2, end); }
.menu-mascot-weapon.is-facing-left.is-firing { animation-name: menu-gun-recoil-left; }
.menu-muzzle {
  position: absolute;
  z-index: 4;
  top: 51%;
  left: 87%;
  width: 8%;
  aspect-ratio: 1;
  opacity: 0;
  background: #f4f7e9;
  clip-path: polygon(0 32%, 38% 32%, 50% 0, 64% 34%, 100% 22%, 78% 54%, 100% 82%, 61% 69%, 48% 100%, 37% 68%, 0 68%);
  filter: drop-shadow(0 0 8px #f0bd36);
}
.menu-muzzle.is-firing { animation: menu-muzzle-flash .15s steps(2, end); }

.mascot-shadow {
  position: absolute;
  left: 22%;
  right: 18%;
  bottom: 7%;
  height: 11%;
  background: rgba(2, 6, 18, .6);
  transform: skewX(-12deg);
}

.pixel-frame {
  position: relative;
  border: 6px solid var(--cream);
  background: var(--navy);
  box-shadow: 10px 10px 0 var(--cobalt-dark), 16px 16px 0 rgba(7, 26, 61, .2);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, calc(100% - 14px) 7px, 100% 7px, 100% calc(100% - 14px), calc(100% - 7px) calc(100% - 14px), calc(100% - 7px) 100%, 14px 100%, 14px calc(100% - 7px), 0 calc(100% - 7px), 0 14px, 7px 14px, 7px 7px, 14px 7px);
}

.join-panel {
  width: 100%;
  height: 610px;
  padding: 20px;
  border-color: rgba(245, 251, 255, .94);
  background: rgba(3, 11, 36, .92);
  color: #f5fbff;
  box-shadow: 9px 9px 0 #0b3dab, 16px 16px 0 rgba(2, 6, 18, .42);
}
.join-panel::before { content: ""; position: absolute; left: 18px; right: 18px; top: -6px; height: 6px; background: #41f4ff; box-shadow: 0 0 20px rgba(65, 244, 255, .58); }

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 2px solid #173b77;
}
.panel-heading div { display: grid; gap: 9px; }
.panel-heading span { color: #41f4ff; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.panel-heading strong { font-family: "Press Start 2P", monospace; font-size: 13px; }
.panel-heading em { color: #12357b; font-family: "Press Start 2P", monospace; font-size: 34px; font-style: normal; }

#join-form { display: grid; gap: 9px; }
label, legend { color: var(--cream); font-family: "Press Start 2P", monospace; font-size: 9px; line-height: 1.5; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mode-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 51px; gap: 7px; margin-bottom: 3px; }
.mode-button {
  display: grid;
  gap: 5px;
  min-width: 0;
  width: 100%;
  height: 51px;
  min-height: 51px;
  padding: 4px;
  place-content: center;
  border: 2px solid #244a83;
  background: #061530;
  color: #7894bc;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  text-align: center;
  box-shadow: inset 0 -4px 0 #030b20;
}
.mode-button strong { overflow: hidden; font-size: 8px; line-height: 1.4; text-overflow: ellipsis; }
.mode-button span { font-family: Arial, sans-serif; font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.mode-button:hover, .mode-button:focus-visible { border-color: #41f4ff; color: #dffcff; outline: none; }
.mode-button.is-active { border-color: #41f4ff; background: #0b3dab; color: #fff; box-shadow: inset 0 -4px 0 #062477, 3px 3px 0 #087d9f; }

input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 2px solid #365b94;
  border-radius: 0;
  outline: none;
  background: #061530;
  color: var(--cream);
  font-weight: 900;
  text-transform: uppercase;
  transition: border-color .12s steps(2, end), box-shadow .12s steps(2, end);
}
input[type="text"]::placeholder { color: #7d97bf; }
input[type="text"]:focus { border-color: #41f4ff; box-shadow: 4px 4px 0 #087d9f; }
small { color: var(--ink-muted); font-size: 11px; line-height: 1.5; }
fieldset { min-width: 0; margin: 5px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; }

.color-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.color-option { position: relative; min-width: 0; }
.color-option input { position: absolute; opacity: 0; pointer-events: none; }
.color-option span {
  display: grid;
  min-width: 0;
  min-height: 42px;
  place-items: center;
  border: 4px solid transparent;
  color: var(--navy);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  transition: transform .1s steps(2, end), border-color .1s steps(2, end);
}
.color-option span:hover { transform: translateY(-4px); }
.color-option input:focus-visible + span { outline: 4px solid var(--cyan); outline-offset: 3px; }
.color-option input:checked + span { border-color: var(--cream); box-shadow: inset 0 0 0 3px var(--navy); }
.color-blue span { background: var(--cobalt); color: var(--cream); }
.color-pink span { background: var(--pink); }
.color-yellow span { background: var(--gold); }

.primary-button {
  min-height: 58px;
  padding: 14px 18px;
  border: 4px solid var(--cream);
  border-radius: 0;
  background: var(--cyan);
  color: var(--navy);
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 7px 7px 0 var(--cyan-dark);
  transition: transform .1s steps(2, end), box-shadow .1s steps(2, end);
}
.join-panel .primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 3px; padding-left: 20px; padding-right: 14px; border-width: 2px; background: #41f4ff; box-shadow: 7px 7px 0 #087d9f; }
.join-panel .primary-button[hidden] { display: none; }
.join-panel .primary-button b { display: grid; width: 34px; height: 30px; place-items: center; background: #071a3d; color: #41f4ff; font-size: 20px; }
.primary-button:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 var(--cyan-dark); }
.primary-button:active { transform: translate(5px, 5px); box-shadow: 2px 2px 0 var(--cyan-dark); }
.primary-button:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }
.primary-button:disabled { opacity: .65; cursor: wait; }
.form-error { min-height: 14px; margin: 0; color: #ff9f8e; font-size: 11px; font-weight: 900; }

.private-room-controls { display: grid; gap: 6px; padding: 8px; border: 2px solid #244a83; background: rgba(6, 21, 48, .82); }
.private-room-controls[hidden] { display: none; }
.private-room-controls > p { margin: 0; color: #41f4ff; font-family: "Press Start 2P", monospace; font-size: 6px; line-height: 1.6; text-align: center; }
.private-create-button, #join-private-button {
  min-height: 38px;
  border: 2px solid #f5fbff;
  background: #173fca;
  color: #fff;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  box-shadow: 4px 4px 0 #062477;
}
.private-create-button:hover, .private-create-button:focus-visible, #join-private-button:hover, #join-private-button:focus-visible { border-color: #41f4ff; outline: none; transform: translate(-1px, -1px); }
.private-create-button:disabled, #join-private-button:disabled { opacity: .6; cursor: wait; }
.private-divider { display: flex; align-items: center; gap: 7px; color: #7894bc; font-size: 7px; font-weight: 900; }
.private-divider::before, .private-divider::after { content: ""; flex: 1; height: 1px; background: #244a83; }
.private-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 7px; }
#private-room-code { padding: 9px 10px; color: #41f4ff; font-family: "Press Start 2P", monospace; font-size: 18px; letter-spacing: .28em; text-align: center; }
#private-room-code::placeholder { color: #365b94; }
#join-private-button { background: #41f4ff; color: #061530; box-shadow: 4px 4px 0 #087d9f; }
.battle-size-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.battle-size-picker button {
  min-height: 32px;
  border: 2px solid #244a83;
  background: #061530;
  color: #7894bc;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 6px;
}
.battle-size-picker button:hover, .battle-size-picker button:focus-visible, .battle-size-picker button.is-active { border-color: #41f4ff; color: #fff; outline: none; }
.battle-size-picker button.is-active { background: #0b3dab; box-shadow: inset 0 -3px 0 #062477; }
.battle-random-button { background: #e4b93f; color: #071a3d; box-shadow: 4px 4px 0 #8f6214; }
#join-battle-button { min-height: 38px; border: 2px solid #f5fbff; background: #41f4ff; color: #061530; cursor: pointer; font-family: "Press Start 2P", monospace; font-size: 7px; box-shadow: 4px 4px 0 #087d9f; }
#battle-room-code { padding: 9px 10px; color: #41f4ff; font-family: "Press Start 2P", monospace; font-size: 18px; letter-spacing: .28em; text-align: center; }

.controls-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid #173b77;
  color: var(--ink-muted);
  font-size: 9px;
}
.controls-note b { color: var(--cyan); }

.menu-footer {
  position: absolute;
  right: clamp(26px, 4vw, 64px);
  bottom: 23px;
  left: clamp(26px, 4vw, 64px);
  display: flex;
  justify-content: space-between;
  padding-top: 11px;
  border-top: 1px solid rgba(65, 244, 255, .24);
  color: #607da8;
  font-family: "Press Start 2P", monospace;
  font-size: 6px;
  letter-spacing: .06em;
}
.menu-footer a { color: #7894bc; text-decoration: none; }
.menu-footer a:hover, .menu-footer a:focus-visible { color: #41f4ff; outline: none; text-decoration: underline; }

.guide-button {
  position: absolute;
  z-index: 4;
  right: clamp(26px, 4vw, 64px);
  bottom: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(65, 244, 255, .5);
  border-radius: 0;
  background: rgba(2, 9, 31, .9);
  color: #41f4ff;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  cursor: pointer;
  box-shadow: 4px 4px 0 #0b3dab;
}
.menu-utilities .guide-button { position: static; min-height: 27px; padding: 9px 11px 8px; }
.guide-button:hover, .guide-button:focus-visible { background: #41f4ff; color: #071a3d; outline: none; }
.game-guide-button, .game-back-button { position: fixed; z-index: 8; right: 18px; width: 82px; min-height: 31px; padding: 8px 6px; }
.game-guide-button { bottom: 18px; }
.game-back-button { bottom: 60px; }

.menu-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(1, 4, 14, .82);
  backdrop-filter: blur(5px);
}
.menu-modal[hidden] { display: none; }
.modal-panel { width: min(620px, 100%); max-height: min(760px, calc(100dvh - 44px)); overflow-y: auto; padding: 30px; color: #f5fbff; }
.modal-close { position: absolute; top: 15px; right: 17px; width: 36px; height: 36px; border: 1px solid #365b94; border-radius: 0; background: #061530; color: #41f4ff; font-size: 24px; line-height: 1; cursor: pointer; }
.modal-close:hover, .modal-close:focus-visible { border-color: #41f4ff; outline: none; }
.modal-kicker { margin: 0 0 10px; color: #41f4ff; font-family: "Press Start 2P", monospace; font-size: 7px; letter-spacing: .12em; }
.modal-panel h2 { margin: 0; padding: 0 52px 20px 0; border-bottom: 2px solid #173b77; font-family: "Press Start 2P", monospace; font-size: clamp(18px, 4vw, 28px); line-height: 1.4; }
.modal-status { margin: 16px 0 12px; color: #7894bc; font-size: 10px; font-weight: 900; }
.all-time-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.all-time-list li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; min-height: 42px; padding: 8px 11px; border-left: 3px solid #183ddb; background: #061530; }
.all-time-list li:nth-child(1) { border-color: #f0bd36; }
.all-time-list li:nth-child(2) { border-color: #d4e5f5; }
.all-time-list li:nth-child(3) { border-color: #d18354; }
.all-time-rank { color: #607da8; font-family: "Press Start 2P", monospace; font-size: 9px; }
.all-time-name { overflow: hidden; color: #f5fbff; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.all-time-score { color: #41f4ff; font-family: "Press Start 2P", monospace; font-size: 9px; }
.guide-panel { width: min(560px, 100%); }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.guide-grid span { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px; border: 1px solid #173b77; background: #061530; }
.guide-grid kbd { color: #41f4ff; font-family: "Press Start 2P", monospace; font-size: 7px; }
.guide-grid b { color: #a9bedb; font-size: 9px; }
.guide-tip { margin: 17px 0 0; color: #a9bedb; font-size: 12px; font-weight: 900; line-height: 1.6; }
.mobile-guide { display: none !important; }

.game-shell { position: fixed; inset: 0; background: var(--grass); }
#game-canvas { display: block; width: 100%; height: 100%; outline: none; cursor: crosshair; touch-action: none; image-rendering: pixelated; }

.hud {
  position: fixed;
  z-index: 5;
  border: 4px solid var(--cream);
  border-radius: 0;
  background: var(--navy);
  box-shadow: 6px 6px 0 rgba(7, 26, 61, .28);
  color: var(--cream);
  font-weight: 900;
}
.hud::before, .hud::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--cyan);
}
.hud::before { left: -4px; top: -4px; }
.hud::after { right: -4px; bottom: -4px; }

.hud-top-left { left: 14px; top: 14px; width: min(310px, calc(100vw - 28px)); padding: 9px 10px; }
.stat-row, .combat-stats { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 8px; }
.stat-row { color: var(--cyan); font-family: "Press Start 2P", monospace; font-size: 7px; }
.health-track { height: 13px; margin: 8px 0 7px; overflow: hidden; border: 2px solid var(--cream); background: #27375e; box-shadow: inset 0 0 0 2px #132750; }
.health-fill { width: 100%; height: 100%; background: repeating-linear-gradient(90deg, var(--cyan) 0 24px, #27c7dc 24px 28px); transform-origin: left; transition: width .12s steps(3, end); }
.combat-stats { flex-wrap: wrap; }
.medkit-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; margin-top: 7px; padding-top: 6px; border-top: 2px solid #27487e; }
.medkit-caption { color: var(--cyan); font-family: "Press Start 2P", monospace; font-size: 6px; }
.medkit-pips { display: flex; gap: 3px; }
.medkit-pip { width: 13px; height: 10px; border: 2px solid #5d75a0; background: #152d5c; }
.medkit-pip.is-full { border-color: var(--cream); background: var(--cyan); box-shadow: inset 4px 0 0 #fff; }
#medkits-label { font-size: 8px; }

.private-room-badge {
  position: fixed;
  z-index: 7;
  right: 18px;
  bottom: 104px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px 10px;
  min-width: 190px;
  padding: 8px 11px;
  border: 3px solid var(--cream);
  background: var(--navy);
  color: var(--cream);
  box-shadow: 5px 5px 0 rgba(7, 26, 61, .3);
  pointer-events: none;
}
.private-room-badge[hidden] { display: none; }
.private-room-badge::before, .private-room-badge::after { content: ""; position: absolute; width: 6px; height: 6px; background: var(--cyan); }
.private-room-badge::before { left: -3px; top: -3px; }
.private-room-badge::after { right: -3px; bottom: -3px; }
.private-room-badge span { color: var(--cyan); font-family: "Press Start 2P", monospace; font-size: 6px; line-height: 1.4; }
.private-room-badge strong { grid-row: span 2; color: var(--cyan); font-family: "Press Start 2P", monospace; font-size: 18px; letter-spacing: .12em; line-height: 1; }
.private-room-badge small { color: #a9bedb; font-size: 7px; font-weight: 900; letter-spacing: .08em; }

.weapon-hud { left: 50%; bottom: 18px; min-width: 230px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 18px 8px 10px; transform: translateX(-50%); text-align: left; }
.weapon-hud[hidden] { display: none; }
.weapon-hud canvas { width: 56px; height: 56px; border-right: 3px solid #27487e; image-rendering: pixelated; }
.weapon-copy { min-width: 118px; }
.weapon-hud span, .weapon-hud strong { display: block; }
.weapon-hud span { color: var(--cyan); font-family: "Press Start 2P", monospace; font-size: 8px; }
.weapon-hud strong { margin-top: 5px; font-size: 18px; }

.leaderboard { top: 18px; right: 18px; width: 240px; padding: 13px; }
.leaderboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.leaderboard h2 { margin: 0; color: var(--cyan); font-family: "Press Start 2P", monospace; font-size: 9px; }
.leaderboard-heading span { color: var(--ink-muted); font-size: 8px; }
.leaderboard ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style-position: inside; font-size: 11px; }
.leaderboard li { display: grid; grid-template-columns: 20px 1fr auto; gap: 5px; overflow: hidden; white-space: nowrap; }
.leaderboard li span { overflow: hidden; text-overflow: ellipsis; }
.leaderboard li strong { color: var(--gold); }
#minimap-canvas { display: block; width: 100%; height: 112px; margin-top: 12px; border: 3px solid #5270a6; background: #639e2b; image-rendering: pixelated; }

.kill-feed { position: fixed; z-index: 8; left: 50%; top: 18px; width: min(520px, calc(100vw - 680px)); min-width: 280px; transform: translateX(-50%); pointer-events: none; }
.kill-feed[hidden] { display: none; }
.feed-item { overflow: hidden; padding: 10px 14px; border: 3px solid var(--cream); background: var(--navy); color: var(--cream); font-size: 11px; font-weight: 900; text-align: center; text-overflow: ellipsis; white-space: nowrap; box-shadow: 5px 5px 0 rgba(7, 26, 61, .25); animation: notification-in .16s steps(2, end); }
.notification-name { font-family: "Press Start 2P", monospace; font-size: 9px; text-shadow: 2px 2px 0 #071a3d; }
.notification-name-player { color: var(--cyan); }
.notification-name-killer { color: var(--gold); }
.notification-name-target { color: #ff8fbd; }
.pickup-prompt { position: fixed; z-index: 6; left: 50%; bottom: 102px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 3px solid var(--cream); background: var(--navy); color: var(--cream); transform: translateX(-50%); font-size: 11px; font-weight: 900; box-shadow: 5px 5px 0 rgba(7, 26, 61, .28); }
.pickup-prompt[hidden] { display: none; }
.pickup-prompt kbd { display: grid; width: 29px; height: 29px; place-items: center; border: 3px solid var(--navy); background: var(--cyan); color: var(--navy); font-family: "Press Start 2P", monospace; font-size: 9px; box-shadow: 3px 3px 0 var(--cyan-dark); }

.match-overlay, .result-dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 26, 61, .52);
}
.match-overlay[hidden], .result-dialog[hidden] { display: none; }
.overlay-panel, .result-panel { width: min(540px, 100%); padding: 30px; color: var(--cream); text-align: center; }
.overlay-panel p, .result-panel p { margin: 0; color: var(--ink-muted); font-weight: 900; }
.overlay-panel h2, .result-panel h2 { margin: 16px 0; color: var(--cyan); font-family: "Press Start 2P", monospace; font-size: clamp(20px, 5vw, 38px); line-height: 1.4; }
.battle-score { z-index: 7; left: 50%; top: 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; min-width: 310px; padding: 10px 14px; transform: translateX(-50%); font-family: "Press Start 2P", monospace; font-size: 8px; }
.battle-score[hidden] { display: none; }
.battle-score > strong { color: #f5fbff; font-size: 13px; }
.battle-score span { display: flex; align-items: center; gap: 7px; }
.battle-score span:last-child { justify-content: flex-end; }
.battle-team-blue { color: #41f4ff; }
.battle-team-red { color: #ff6d9f; }
.battle-team-picker { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 18px; }
.battle-team-picker[hidden] { display: none; }
.battle-team-picker button { display: grid; gap: 7px; min-height: 70px; place-content: center; border: 3px solid #365b94; background: #061530; color: #fff; cursor: pointer; font-family: "Press Start 2P", monospace; }
.battle-team-picker button:first-child { border-color: #42e3f5; }
.battle-team-picker button:nth-of-type(2) { border-color: #ff6d9f; }
.battle-team-picker button.is-selected { background: #0b3dab; box-shadow: inset 0 -6px 0 #062477; }
.battle-team-picker button:nth-of-type(2).is-selected { background: #9e2457; box-shadow: inset 0 -6px 0 #5d1232; }
.battle-team-picker button strong { font-size: 8px; }
.battle-team-picker button span { color: #dffcff; font-size: 7px; }
.battle-team-picker > b { color: #7894bc; font-family: "Press Start 2P", monospace; font-size: 8px; }
.battle-team-picker > small { grid-column: 1 / -1; min-height: 14px; color: #ff9f8e; font-size: 8px; }
.result-dialog { z-index: 20; background: rgba(7, 26, 61, .84); }
.result-ranking { display: grid; gap: 5px; margin: 22px 0; text-align: left; }
.ranking-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 3px solid var(--cobalt); }
.result-panel .primary-button { width: 100%; }

.touch-controls { display: none; position: fixed; align-items: end; justify-content: space-between; pointer-events: none; }
.touch-movement { display: grid; gap: 5px; justify-items: start; pointer-events: none; }
.touch-caption { padding: 5px 7px; border-left: 3px solid var(--cyan); background: rgba(7, 26, 61, .9); color: var(--cream); font-family: "Press Start 2P", monospace; font-size: 6px; line-height: 1; }
.touch-stick {
  position: relative;
  width: 108px;
  height: 108px;
  border: 0;
  border-radius: 50%;
  background: transparent url("/assets/mobile-pixel-button-frame.png") center / 100% 100% no-repeat;
  filter: drop-shadow(4px 5px 0 rgba(7, 26, 61, .42));
  image-rendering: pixelated;
  pointer-events: auto;
  touch-action: none;
}
.touch-stick::before, .touch-stick::after { content: ""; position: absolute; opacity: .38; background: var(--cyan); pointer-events: none; }
.touch-stick::before { left: 50%; top: 12px; bottom: 12px; width: 2px; transform: translateX(-50%); }
.touch-stick::after { left: 12px; right: 12px; top: 50%; height: 2px; transform: translateY(-50%); }
.touch-stick span {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent url("/assets/mobile-pixel-button-frame.png") center / 100% 100% no-repeat;
  filter: brightness(1.12);
  image-rendering: pixelated;
  transform: translate(-50%, -50%);
}
.touch-actions { position: relative; width: 164px; height: 162px; pointer-events: auto; }
.touch-actions button {
  position: absolute;
  width: 48px;
  min-width: 0;
  min-height: 0;
  height: 48px;
  padding: 0 4px;
  border: 0;
  border-radius: 50%;
  background: transparent url("/assets/mobile-pixel-button-frame.png") center / 100% 100% no-repeat;
  color: var(--cream);
  font-family: "Press Start 2P", monospace;
  font-size: 6px;
  line-height: 1.25;
  filter: drop-shadow(3px 3px 0 rgba(7, 26, 61, .44));
  image-rendering: pixelated;
  touch-action: none;
  user-select: none;
}
.touch-actions button:active { transform: scale(.94); filter: brightness(.84) drop-shadow(1px 2px 0 rgba(7, 26, 61, .44)); }
#touch-heal { top: 0; left: 88px; color: var(--cyan); }
#touch-melee { top: 38px; left: 22px; color: var(--gold); }
#touch-reload { top: 114px; left: 22px; color: var(--ink-muted); font-size: 5px; }
.touch-actions .touch-fire {
  right: 0;
  top: 48px;
  display: grid;
  width: 104px;
  height: 104px;
  place-content: center;
  justify-items: center;
  gap: 5px;
  overflow: hidden;
  background: transparent url("/assets/mobile-pixel-button-frame.png") center / 100% 100% no-repeat;
  color: var(--cream);
  filter: drop-shadow(4px 5px 0 rgba(7, 26, 61, .52));
}
.touch-actions .touch-fire.is-active { transform: scale(.96); filter: brightness(.86) drop-shadow(2px 3px 0 rgba(7, 26, 61, .52)); }
.touch-fire i { position: absolute; left: 50%; top: 50%; font-family: "Press Start 2P", monospace; font-size: 18px; font-style: normal; opacity: .24; transform: translate(-50%, -50%); }
.touch-fire strong { position: relative; z-index: 1; font-size: 11px; }
.touch-fire small { position: relative; z-index: 1; font-size: 5px; }

@keyframes mascot-bob { 50% { transform: translateY(-9px); } }
@keyframes scan-shift { to { transform: translateY(16px); } }
@keyframes status-pulse { 50% { opacity: .38; } }
@keyframes menu-gun-recoil-right { 50% { transform: translate(-8px, 3px) rotate(var(--menu-gun-angle, -9deg)); } }
@keyframes menu-gun-recoil-left { 50% { transform: translate(8px, 3px) rotate(var(--menu-gun-left-angle, 0deg)) scaleX(-1); } }
@keyframes menu-muzzle-flash { 40% { opacity: 1; transform: scale(1.35); } }
@keyframes feed-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes notification-in { from { opacity: 0; transform: translateY(-9px); } }

@media (max-width: 1100px) {
  .menu-shell { height: 100dvh; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
  .menu-content { grid-template-columns: minmax(0, 1fr) minmax(330px, 410px); padding-top: 96px; padding-bottom: 48px; }
  .mascot-showcase { position: absolute; left: 44%; bottom: 7%; width: 215px; opacity: .86; }
  .join-panel { grid-column: 2; grid-row: 1; }
  .menu-copy { grid-column: 1; grid-row: 1; }
  .arena-facts span { min-width: 105px; padding-inline: 12px; }
}

@media (max-width: 760px) {
  html, body { overflow-x: hidden; overflow-y: auto; }
  .pixel-scene { background-position: 57% center; filter: saturate(.9) brightness(.48); }
  .brand-lockup { position: relative; left: auto; right: auto; top: auto; margin: 20px 18px 0; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-name { font-size: 13px; }
  .brand-name small { font-size: 6px; }
  .server-badge { display: none; }
  .menu-shell { height: auto; min-height: 100dvh; overflow: visible; }
  .menu-content { min-height: auto; grid-template-columns: 1fr; gap: 19px; padding: 42px 18px 72px; }
  .menu-copy, .join-panel { grid-column: 1; grid-row: auto; }
  .kicker { margin-bottom: 16px; font-size: 6px; }
  h1 { font-size: clamp(28px, 9.5vw, 45px); }
  .intro-copy { margin-top: 16px; font-size: 13px; }
  .arena-facts { width: 100%; margin-top: 22px; }
  .arena-facts span { min-width: 0; flex: 1; padding: 10px 8px; font-size: 7px; }
  .arena-facts b { font-size: 11px; }
  .secondary-button { width: 100%; min-width: 0; }
  .mascot-showcase { position: relative; left: auto; right: auto; bottom: auto; grid-column: 1; grid-row: 2; width: 172px; margin: -22px auto -24px; }
  .join-panel { grid-row: 3; height: auto; min-width: 0; padding: 21px 18px; }
  .panel-heading { align-items: center; }
  #join-form { min-width: 0; }
  .color-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .color-option span { min-width: 0; font-size: 10px; }
  .menu-footer { right: 18px; left: 18px; bottom: 16px; }
  .menu-footer span:first-child { display: none; }
  .menu-footer span:last-child { margin-left: auto; }
  .guide-button { position: absolute; right: 18px; bottom: 44px; }
  .game-guide-button { position: fixed; top: 16px; right: 16px; bottom: auto; }
  .modal-panel { padding: 24px 18px; }
  .guide-grid { grid-template-columns: 1fr; }
  .leaderboard { display: none; }
  .kill-feed { top: 126px; width: calc(100vw - 32px); min-width: 0; }
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .mobile-blocker { display: grid; }
  #menu, #game, #guide-modal { display: none !important; }
  html, body { overflow: hidden; }
}

@media (hover: none) and (pointer: coarse) {
  html, body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--app-height);
    min-height: 0;
    max-height: var(--app-height);
    overflow: hidden;
    touch-action: none;
  }
  .mobile-blocker, .menu-shell, .game-shell { height: var(--app-height); min-height: var(--app-height); max-height: var(--app-height); }
  .game-shell { width: 100vw; overflow: hidden; }
  #game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .touch-controls { display: flex; }
  #game-canvas { cursor: default; }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  html, body { overflow: hidden; }
  .mobile-blocker { display: none; }

  .menu-shell { height: var(--app-height); min-height: var(--app-height); max-height: var(--app-height); overflow-y: auto; }
  .brand-lockup { position: absolute; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); top: 10px; gap: 10px; margin: 0; }
  .brand-logo { width: 44px; height: 44px; }
  .brand-name { gap: 4px; font-size: 11px; }
  .brand-name small { font-size: 5px; }
  .server-badge { display: none; }
  .menu-content { min-height: var(--app-height); grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 18px; padding: 66px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); }
  .menu-copy { grid-column: 1; grid-row: 1; align-self: center; }
  .menu-copy .kicker { margin-bottom: 10px; font-size: 6px; }
  #game-title { font-size: clamp(28px, 5.4vw, 44px); }
  .intro-copy { display: none; }
  .arena-facts { display: none; }
  .secondary-button { width: min(310px, 100%); min-width: 0; margin-top: 18px; padding: 11px 13px; font-size: 7px; }
  .mascot-showcase { display: none; }
  .join-panel { grid-column: 2; grid-row: 1; align-self: center; height: 420px; padding: 14px; }
  .panel-heading { display: none; }
  .panel-heading span { font-size: 6px; }
  .panel-heading strong { margin-top: 5px; font-size: 10px; }
  #join-form { gap: 7px; }
  #join-form label, #join-form legend { font-size: 6px; }
  #player-name { padding: 9px 10px; font-size: 16px; }
  #name-help { display: none; }
  #join-form fieldset { margin: 1px 0 0; }
  .color-option span { min-height: 35px; font-size: 8px; }
  .mode-button { min-height: 40px; gap: 2px; }
  .mode-button strong { font-size: 6px; }
  .mode-button span { font-size: 6px; }
  .private-room-controls { gap: 6px; padding: 7px; }
  .private-room-controls > p { display: none; }
  .private-create-button, #join-private-button, #join-battle-button { min-height: 31px; font-size: 6px; }
  #private-room-code, #battle-room-code { padding: 5px 7px; font-size: 14px; }
  .primary-button { padding: 11px 13px; font-size: 8px; }
  .menu-footer { display: none; }
  .menu-shell > .guide-button { position: fixed; left: max(16px, env(safe-area-inset-left)); right: auto; bottom: max(11px, env(safe-area-inset-bottom)); padding: 8px 9px; }

  .hud-top-left { left: max(9px, env(safe-area-inset-left)); top: max(8px, env(safe-area-inset-top)); width: 158px; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .hud-top-left::before, .hud-top-left::after { display: none; }
  .hud-top-left .stat-row, .hud-top-left .combat-stats, .hud-top-left .medkit-row { text-shadow: 1px 1px 0 var(--navy), -1px -1px 0 var(--navy); }
  .stat-row { gap: 3px; font-size: 4px; }
  .health-track { height: 7px; margin: 3px 0; border-width: 1px; box-shadow: inset 0 0 0 1px #132750; }
  .combat-stats { gap: 3px; flex-wrap: nowrap; font-size: 5px; }
  .medkit-row { display: flex; width: max-content; gap: 3px; margin-top: 3px; padding: 0; border: 0; }
  .medkit-caption { font-size: 4px; }
  .medkit-pips { gap: 2px; }
  .medkit-pip { width: 8px; height: 6px; border-width: 1px; }
  #medkits-label { font-size: 5px; }
  .leaderboard { display: block; top: max(8px, env(safe-area-inset-top)); right: max(9px, env(safe-area-inset-right)); width: 128px; padding: 5px 6px; border-width: 2px; background: rgba(7, 26, 61, .84); box-shadow: 3px 3px 0 rgba(7, 26, 61, .28); }
  .leaderboard::before, .leaderboard::after { width: 5px; height: 5px; }
  .leaderboard::before { left: -2px; top: -2px; }
  .leaderboard::after { right: -2px; bottom: -2px; }
  .leaderboard-heading { margin-bottom: 5px; }
  .leaderboard h2 { font-size: 0; }
  .leaderboard h2::after { content: "ROOM TOP 3"; font-size: 5px; }
  .leaderboard-heading span { display: none; }
  .leaderboard ol { gap: 2px; font-size: 6px; }
  .leaderboard li { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 2px; }
  .leaderboard li:nth-child(n + 4) { display: none; }
  .leaderboard li strong { font-size: 5px; }
  #minimap-canvas { display: none; }
  .private-room-badge { left: max(9px, env(safe-area-inset-left)); right: auto; top: max(56px, calc(env(safe-area-inset-top) + 56px)); bottom: auto; min-width: 138px; gap: 3px 6px; padding: 5px 7px; border-width: 2px; box-shadow: 3px 3px 0 rgba(7, 26, 61, .3); }
  .private-room-badge::before, .private-room-badge::after { width: 4px; height: 4px; }
  .private-room-badge::before { left: -2px; top: -2px; }
  .private-room-badge::after { right: -2px; bottom: -2px; }
  .private-room-badge span { font-size: 4px; }
  .private-room-badge strong { font-size: 11px; }
  .private-room-badge small { font-size: 4px; }
  .game-guide-button, .game-back-button { position: fixed; right: auto; left: max(9px, env(safe-area-inset-left)); bottom: auto; width: 48px; height: 21px; min-height: 21px; padding: 5px 3px; border: 1px solid rgba(65, 244, 255, .5); border-radius: 0; background: rgba(2, 9, 31, .86); color: #41f4ff; font-size: 5px; line-height: normal; box-shadow: 2px 2px 0 #0b3dab; filter: none; image-rendering: auto; }
  .game-back-button { top: max(56px, calc(env(safe-area-inset-top) + 56px)); }
  .game-guide-button { top: max(84px, calc(env(safe-area-inset-top) + 84px)); }
  .game-shell.has-private-code .game-back-button { top: max(92px, calc(env(safe-area-inset-top) + 92px)); }
  .game-shell.has-private-code .game-guide-button { top: max(120px, calc(env(safe-area-inset-top) + 120px)); }
  .kill-feed { top: max(8px, env(safe-area-inset-top)); width: min(300px, calc(100vw - 500px)); min-width: 220px; }
  .feed-item { padding: 7px 9px; font-size: 8px; }
  .notification-name { font-size: 7px; }
  .weapon-hud { bottom: max(8px, env(safe-area-inset-bottom)); min-width: 132px; gap: 5px; padding: 3px 7px 3px 4px; border-width: 2px; box-shadow: 3px 3px 0 rgba(7, 26, 61, .25); }
  .weapon-hud canvas { width: 32px; height: 32px; border-right-width: 2px; }
  .weapon-copy { min-width: 70px; }
  .weapon-hud span { font-size: 5px; }
  .weapon-hud strong { margin-top: 2px; font-size: 9px; }
  .pickup-prompt { display: none !important; }

  .match-overlay { padding: 0; background: transparent; pointer-events: none; }
  .match-overlay .overlay-panel { width: auto; min-width: 210px; max-width: 260px; padding: 9px 13px; border-width: 2px; background: rgba(7, 26, 61, .82); box-shadow: 3px 3px 0 rgba(7, 26, 61, .3); }
  .match-overlay .overlay-panel::before, .match-overlay .overlay-panel::after { width: 5px; height: 5px; }
  .match-overlay .overlay-panel p { font-size: 6px; }
  .match-overlay .overlay-panel h2 { margin: 5px 0 0; font-size: 10px; line-height: 1.4; white-space: nowrap; }
  #overlay-copy { display: none; }
  .battle-score { top: max(8px, env(safe-area-inset-top)); min-width: 190px; gap: 7px; padding: 5px 7px; border-width: 2px; font-size: 5px; box-shadow: 3px 3px 0 rgba(7, 26, 61, .28); }
  .battle-score > strong { font-size: 8px; }
  .battle-score span { gap: 3px; }
  .battle-team-picker { gap: 5px; margin-top: 7px; pointer-events: auto; }
  .battle-team-picker button { min-height: 38px; border-width: 2px; }
  .battle-team-picker button strong { font-size: 5px; }
  .battle-team-picker button span, .battle-team-picker > b, .battle-team-picker > small { font-size: 5px; }

  .touch-controls {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .menu-modal { padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); }
  .modal-panel { width: min(640px, 100%); max-height: calc(var(--app-height) - 20px); padding: 18px; }
  .modal-panel h2 { padding-bottom: 10px; font-size: 17px; }
  .modal-kicker { margin-bottom: 5px; font-size: 5px; }
  .modal-close { top: 9px; right: 11px; width: 31px; height: 31px; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
  .guide-grid span { min-height: 34px; padding: 7px; }
  .guide-grid kbd { font-size: 5px; }
  .guide-grid b { font-size: 7px; }
  .desktop-guide { display: none !important; }
  .mobile-guide { display: flex !important; }
  .guide-tip.mobile-guide { display: block !important; margin-top: 9px; font-size: 9px; line-height: 1.45; }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 375px) {
  .brand-lockup { top: 6px; }
  .brand-logo { width: 38px; height: 38px; }
  .brand-name { font-size: 10px; }
  .menu-content { padding-top: 54px; padding-bottom: 8px; }
  .menu-shell > .guide-button { bottom: max(6px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
