:root {
  color-scheme: dark;
  --ink: #1d2332;
  --ink-soft: #2b3345;
  --cream: #fff4db;
  --muted: #b7c0ce;
  --gold: #ffd17a;
  --mint: #a9f1bd;
  --brown: #85533c;
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -12%, rgba(255, 190, 102, 0.18), transparent 47%),
    radial-gradient(ellipse at 2% 96%, rgba(141, 199, 143, 0.12), transparent 35%),
    #171c29;
  color: var(--cream);
  overscroll-behavior: none;
}

button { font: inherit; }

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

.masthead {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 68px;
  margin: 0 0 13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 209, 122, 0.45);
  border-radius: 17px;
  background: linear-gradient(145deg, #46372f, #292832);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  font-size: 28px;
  transform: rotate(-6deg);
}

.eyebrow {
  margin: 0 0 1px;
  color: #e2b876;
  font: 800 10px/1.2 'Nunito', sans-serif;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--cream);
  font: 900 clamp(18px, 3vw, 27px)/1 'Nunito', sans-serif;
  letter-spacing: 0.045em;
}

h1 span { color: var(--gold); }

.best-score {
  margin-left: auto;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font: 800 11px 'Nunito', sans-serif;
}

.best-score strong { margin-left: 6px; color: var(--mint); font-size: 14px; }

.fullscreen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
  font: 800 10px 'Nunito', sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fullscreen-toggle > span:first-child { color: var(--gold); font-size: 18px; line-height: 1; }
.fullscreen-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.fullscreen-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.game-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid rgba(255, 229, 191, 0.23);
  border-radius: 23px;
  background: #aac78e;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32), 0 0 0 7px rgba(255, 255, 255, 0.025);
  isolation: isolate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#arena {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.reticle {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 250, 226, 0.9);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(20, 25, 22, 0.8), inset 0 0 3px rgba(20, 25, 22, 0.55);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.reticle::before,
.reticle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  background: rgba(255, 250, 226, 0.95);
  box-shadow: 0 1px 3px rgba(20, 25, 22, 0.85);
  content: "";
  transform: translate(-50%, -50%);
}

.reticle::before { width: 2px; height: 34px; }
.reticle::after { width: 34px; height: 2px; }

.hud {
  position: absolute;
  z-index: 2;
  inset: 14px 16px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.hud-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 39px;
  padding: 6px 13px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 14px;
  background: rgba(30, 37, 44, 0.82);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.15);
  color: white;
  font: 900 17px/1 'Nunito', sans-serif;
  backdrop-filter: blur(8px);
}

.chip-icon { font-size: 15px; }
.timer-chip { color: var(--gold); }
.ko-chip { color: var(--mint); }
.ko-chip small { color: #e1e7dc; font: 700 10px 'Nunito', sans-serif; }
.score-chip { gap: 6px; color: #fff2d9; }
.score-chip small { margin-left: 2px; color: #ccd1ce; font: 800 8px 'Nunito', sans-serif; }
.score-side { font: 800 9px 'Nunito', sans-serif; }
.score-side strong { color: var(--mint); font-size: 17px; }
.score-dash { color: var(--gold); }
.life-chip { gap: 8px; color: #fff0df; font-size: 13px; }
.life-divider { color: rgba(255, 255, 255, 0.5); }

.toast {
  position: absolute;
  z-index: 4;
  top: 24%;
  left: 50%;
  padding: 9px 18px;
  border: 1px solid rgba(255, 241, 216, 0.26);
  border-radius: 999px;
  background: rgba(39, 30, 26, 0.88);
  color: var(--gold);
  font: 900 clamp(16px, 3vw, 23px)/1.15 'Nunito', sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) scale(0.9);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.toast.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.ko { color: var(--mint); }

.start-screen {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 28, 34, 0.43);
  backdrop-filter: blur(4px);
  transition: opacity 200ms ease;
}

.start-screen.hidden { opacity: 0; pointer-events: none; }

.start-card {
  width: min(640px, 96%);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 26px 18px;
  border: 1px solid rgba(255, 225, 182, 0.3);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(47, 43, 42, 0.97), rgba(31, 35, 45, 0.97));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.33);
  text-align: center;
}

.hero-poop {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 8px;
  border-radius: 20px;
  background: rgba(255, 209, 122, 0.12);
  font-size: 38px;
  transform: rotate(-8deg);
}

.start-card h2 {
  margin: 5px 0 5px;
  color: var(--cream);
  font: 900 clamp(20px, 4vw, 27px)/1.15 'Nunito', sans-serif;
}

.screen-copy {
  max-width: 500px;
  margin: 0 auto 15px;
  color: #c9c7c0;
  font: 600 13px/1.55 'Baloo 2', sans-serif;
}

.avatar-picker { margin: 8px 0 12px; }
.avatar-picker-title {
  margin: 0 0 6px;
  color: #e6bd79;
  font: 900 10px/1.2 'Nunito', sans-serif;
  letter-spacing: 0.14em;
}
.avatar-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.avatar-option {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--cream);
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.avatar-option:hover { background: rgba(255, 255, 255, 0.09); }
.avatar-option:active { transform: translateY(1px); }
.avatar-option.selected { border: 2px solid var(--gold); padding: 5px 2px; background: rgba(255, 209, 122, 0.13); }
.avatar-option:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.avatar-symbol {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 20px;
  line-height: 1;
}
.avatar-option strong { font: 900 10px/1.1 'Nunito', sans-serif; }
.avatar-option small { color: #c8c5b9; font: 700 8px/1.1 'Nunito', sans-serif; }

.weapon-picker { margin: 10px 0 15px; text-align: left; }
.weapon-picker-title {
  margin: 0 0 7px;
  color: #e6bd79;
  font: 900 10px/1.2 'Nunito', sans-serif;
  letter-spacing: 0.14em;
  text-align: center;
}
.weapon-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.weapon-option {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--cream);
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.weapon-option:hover { background: rgba(255, 255, 255, 0.09); }
.weapon-option:active { transform: translateY(1px); }
.weapon-option.selected {
  border: 2px solid var(--gold);
  padding: 8px 6px 7px;
  background: rgba(255, 209, 122, 0.13);
  box-shadow: 0 0 17px rgba(255, 190, 102, 0.12);
}
.weapon-option:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.weapon-symbol { font-size: 22px; line-height: 1.05; }
.weapon-option strong { font: 900 12px/1.15 'Nunito', sans-serif; }
.weapon-option small { color: #c8c5b9; font: 700 10px/1.2 'Nunito', sans-serif; }
.weapon-stats { color: #9ba8aa; font: 800 7px/1.3 'Nunito', sans-serif; letter-spacing: 0.025em; }
.weapon-stats b { color: var(--mint); letter-spacing: 0.08em; }

.private-duel {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  background: rgba(8, 12, 19, 0.35);
}
.duel-section-title {
  margin: 0 0 7px;
  color: #f2d39b;
  font: 900 10px/1.2 'Nunito', sans-serif;
  letter-spacing: 0.15em;
}
.game-mode-label { display: block; margin: 0 0 4px; color: #b7c0ce; font: 900 8px 'Nunito', sans-serif; letter-spacing: .1em; text-align: left; }
.game-mode-select { width: 100%; min-height: 34px; margin-bottom: 2px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: #252b36; color: var(--cream); font: 800 10px 'Nunito', sans-serif; }
.game-mode-select:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.game-mode-note { margin: 0 0 8px; color: #9ea7b2; font: 700 7px/1.3 'Nunito', sans-serif; text-align: left; }
.team-size-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 8px; }
.team-size-option {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream);
  cursor: pointer;
  font: 900 12px 'Nunito', sans-serif;
}
.team-size-option.selected { border-color: var(--gold); background: rgba(255, 209, 122, 0.17); color: var(--gold); }
.team-size-option:focus-visible,
.game-mode-select:focus-visible,
.room-action:focus-visible,
.room-start-button:focus-visible,
.team-move-button:focus-visible,
.room-code-row button:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.nickname-input,
.room-code-input {
  min-width: 0;
  min-height: 35px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: rgba(5, 9, 15, 0.65);
  color: var(--cream);
  font: 700 11px 'Nunito', sans-serif;
  outline: none;
  text-align: center;
}
.nickname-input { width: 100%; margin-bottom: 7px; }
.nickname-input:focus,
.room-code-input:focus { border-color: var(--gold); }
.nickname-input::placeholder,
.room-code-input::placeholder { color: #929aa5; }
.room-action {
  min-height: 35px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  cursor: pointer;
  font: 900 9px 'Nunito', sans-serif;
  letter-spacing: 0.07em;
}
.room-action:disabled,
.room-start-button:disabled { opacity: 0.52; cursor: default; }
.primary-room-action { width: 100%; border-color: rgba(255, 209, 122, 0.55); background: rgba(255, 209, 122, 0.12); color: var(--gold); }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 7px; }
.room-code-input { width: 100%; text-transform: uppercase; letter-spacing: 0.1em; }
.room-panel.hidden { display: none; }
.room-panel { margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.room-code-row { display: flex; align-items: center; justify-content: center; gap: 9px; color: #b8c1c9; font: 800 9px 'Nunito', sans-serif; }
.room-code-row strong { color: var(--gold); font: 900 17px 'Nunito', sans-serif; letter-spacing: 0.16em; }
.room-code-row button { padding: 5px 8px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 7px; background: rgba(255,255,255,.06); color: var(--cream); cursor: pointer; font: 900 8px 'Nunito', sans-serif; }
.room-status { min-height: 14px; margin: 6px 0 8px; color: #b7c0ce; font: 700 9px 'Nunito', sans-serif; }
.team-rosters { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 7px; }
.team-roster { min-width: 0; padding: 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.035); text-align: left; }
.team-roster > strong { display: block; margin-bottom: 4px; font: 900 8px 'Nunito', sans-serif; letter-spacing: .08em; }
.team-blue > strong { color: #87c7ff; }
.team-red > strong { color: #ff9c91; }
.team-player { display: flex; min-width: 0; min-height: 19px; align-items: center; justify-content: space-between; gap: 3px; color: #e4e1d6; font: 700 9px/1.4 'Nunito', sans-serif; }
.team-player-name { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-move-button { flex: 0 0 auto; padding: 2px 4px; border: 1px solid rgba(255,255,255,.14); border-radius: 5px; background: rgba(255,255,255,.06); color: #d8dfeb; cursor: pointer; font: 900 6px/1.2 'Nunito', sans-serif; white-space: nowrap; }
.team-move-button:hover { border-color: var(--gold); color: var(--gold); }
.team-empty { color: #77818d; font: 700 8px/1.6 'Nunito', sans-serif; }
.teams-vs { align-self: center; color: #828b95; font: 900 8px 'Nunito', sans-serif; }
.room-start-button { width: 100%; min-width: 0; margin-top: 8px; }
.practice-button { min-height: 40px; min-width: 190px; font-size: 13px; }

.start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 196px;
  min-height: 48px;
  padding: 9px 19px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #ffd885, #ffb85e);
  box-shadow: 0 7px 0 #b87842, 0 12px 24px rgba(255, 177, 86, 0.18);
  color: #33241b;
  cursor: pointer;
  font: 900 16px 'Nunito', sans-serif;
  transition: transform 100ms ease, box-shadow 100ms ease;
  touch-action: manipulation;
}

.start-button:hover { filter: brightness(1.04); }
.start-button:active { box-shadow: 0 3px 0 #b87842; transform: translateY(4px); }
.start-button span { font-size: 19px; }

.screen-controls {
  margin: 14px 0 0;
  color: #aeb4bc;
  font: 700 10px/1.6 'Nunito', sans-serif;
}

.touch-controls { display: none; }
.touch-controls.hidden { display: none !important; }

.footer-note {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 5px 3px 0;
  color: #aeb8be;
  font: 700 11px 'Nunito', sans-serif;
}

.footer-note > span:first-child { color: var(--gold); font-size: 17px; }
.desktop-hint { margin-left: auto; color: #808c98; }

@media (pointer: coarse), (max-width: 760px) {
  body { min-height: 100dvh; }
  .app { padding: max(10px, env(safe-area-inset-top)) 12px max(9px, env(safe-area-inset-bottom)); }
  .masthead { min-height: 53px; gap: 9px; margin-bottom: 9px; }
  .brand-mark { width: 43px; height: 43px; border-radius: 14px; font-size: 23px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: clamp(15px, 3.8vw, 21px); }
  .best-score { padding: 6px 9px; font-size: 9px; }
  .best-score strong { font-size: 12px; }
  .best-score { display: none; }
  .fullscreen-toggle { min-width: 39px; min-height: 39px; margin-left: auto; padding: 0 9px; }
  .fullscreen-label { display: none; }
  .game-frame { border-radius: 17px; }
  .hud { inset: 9px 9px auto; }
  .hud-chip { min-height: 32px; gap: 5px; padding: 5px 8px; border-radius: 11px; font-size: 14px; }
  .chip-icon { font-size: 12px; }
  .ko-chip small { font-size: 8px; }
  .score-chip { gap: 4px; padding: 5px 7px; }
  .score-chip small { font-size: 7px; }
  .score-side { font-size: 8px; }
  .score-side strong { font-size: 14px; }
  .life-chip { gap: 4px; padding: 5px 6px; font-size: 9px; }
  .start-card { width: min(620px, 96%); padding: 12px 12px 11px; border-radius: 18px; }
  .hero-poop { width: 43px; height: 43px; margin-bottom: 4px; border-radius: 14px; font-size: 27px; }
  .start-card .eyebrow { font-size: 8px; }
  .start-card h2 { margin: 3px 0; font-size: clamp(17px, 4vw, 22px); }
  .screen-copy { margin-bottom: 9px; font-size: 11px; line-height: 1.35; }
  .avatar-picker { margin: 6px 0 8px; }
  .avatar-picker-title { margin-bottom: 4px; font-size: 8px; }
  .avatar-options { gap: 4px; }
  .avatar-option { gap: 2px; padding: 5px 2px; border-radius: 9px; }
  .avatar-option.selected { padding: 4px 1px; }
  .avatar-symbol { width: 25px; height: 25px; border-radius: 8px; font-size: 16px; }
  .avatar-option strong { font-size: clamp(7px, 2vw, 9px); }
  .avatar-option small { font-size: 7px; }
  .weapon-picker { margin: 7px 0 10px; }
  .weapon-picker-title { margin-bottom: 5px; font-size: 8px; }
  .weapon-options { gap: 5px; }
  .weapon-option { gap: 2px; padding: 7px 4px 6px; border-radius: 10px; }
  .weapon-option.selected { padding: 6px 3px 5px; }
  .weapon-symbol { font-size: 18px; }
  .weapon-option strong { font-size: clamp(8px, 2.3vw, 11px); }
  .weapon-option small { font-size: 8px; }
  .weapon-stats { font-size: 6px; }
  .private-duel { margin-bottom: 9px; padding: 8px; }
  .game-mode-select { min-height: 30px; font-size: 9px; }
  .game-mode-note { margin-bottom: 6px; font-size: 6px; }
  .team-size-options { gap: 5px; margin-bottom: 6px; }
  .team-size-option { min-height: 29px; font-size: 11px; }
  .nickname-input, .room-code-input { min-height: 31px; font-size: 10px; }
  .room-action { min-height: 31px; padding: 5px 9px; font-size: 8px; }
  .room-code-row { gap: 6px; font-size: 8px; }
  .room-code-row strong { font-size: 15px; }
  .room-status { margin: 4px 0 6px; font-size: 8px; }
  .team-rosters { gap: 4px; }
  .team-roster { padding: 5px; }
  .team-player { font-size: 8px; }
  .practice-button { min-height: 36px; min-width: 150px; font-size: 11px; }
  .start-button { min-height: 39px; min-width: 160px; gap: 10px; padding: 6px 14px; border-radius: 12px; font-size: 14px; }
  .screen-controls { margin-top: 8px; font-size: 8px; line-height: 1.4; }
  .footer-note { min-height: 27px; font-size: 9px; }
  .desktop-hint { display: none; }

  .touch-controls:not(.hidden) { display: block; position: absolute; z-index: 3; inset: 0; pointer-events: none; }
  .joystick {
    position: absolute;
    left: 20px;
    bottom: max(17px, env(safe-area-inset-bottom));
    width: clamp(84px, 13vw, 118px);
    height: clamp(84px, 13vw, 118px);
    border-radius: 50%;
    background: rgba(32, 39, 42, 0.18);
    pointer-events: auto;
    touch-action: none;
  }
  .joystick-ring {
    position: absolute;
    inset: 7px;
    border: 2px solid rgba(255, 247, 225, 0.56);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.12);
  }
  .joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 41%;
    height: 41%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(255, 220, 162, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }
  .fire-button {
    position: absolute;
    right: 21px;
    bottom: max(20px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(76px, 12vw, 106px);
    height: clamp(76px, 12vw, 106px);
    border: 3px solid rgba(255, 244, 218, 0.8);
    border-radius: 50%;
    background: linear-gradient(145deg, #ffdb88, #ef9e50);
    box-shadow: 0 7px 0 rgba(138, 77, 43, 0.85), 0 11px 24px rgba(27, 22, 16, 0.25);
    color: #3c291d;
    pointer-events: auto;
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  .fire-button span { font-size: clamp(23px, 4vw, 31px); line-height: 1; }
  .fire-button strong { margin-top: 2px; font: 900 11px 'Nunito', sans-serif; }
  .fire-button:active, .fire-button.active { box-shadow: 0 2px 0 rgba(138, 77, 43, 0.85); transform: translateY(4px) scale(0.98); }
  .toast { top: 23%; padding: 7px 13px; font-size: clamp(13px, 3vw, 19px); }
}

@media (max-height: 620px) and (orientation: landscape) {
  .app { width: min(1000px, 100%); padding-top: 5px; padding-bottom: 4px; }
  .masthead { min-height: 40px; margin-bottom: 5px; }
  .brand-mark { width: 34px; height: 34px; font-size: 19px; }
  .footer-note { min-height: 18px; padding-top: 1px; }
  .start-card { padding: 7px 15px; }
  .hero-poop { width: 34px; height: 34px; font-size: 22px; }
  .start-card h2 { font-size: 18px; }
  .screen-copy { font-size: 10px; margin-bottom: 5px; }
  .screen-controls { margin-top: 4px; }
}

body.fullscreen-active { overflow: hidden; }

.app:fullscreen,
.app.fullscreen-fallback {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: #171c29;
}

.app:fullscreen .masthead,
.app.fullscreen-fallback .masthead { flex: 0 0 auto; min-height: 44px; margin-bottom: 7px; }
.app:fullscreen .game-frame,
.app.fullscreen-fallback .game-frame { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; border-radius: 14px; }
.app:fullscreen .footer-note,
.app.fullscreen-fallback .footer-note { flex: 0 0 auto; min-height: 25px; }

@media (max-height: 620px) and (orientation: landscape) {
  .app:fullscreen .masthead,
  .app.fullscreen-fallback .masthead { min-height: 36px; margin-bottom: 4px; }
  .app:fullscreen .footer-note,
  .app.fullscreen-fallback .footer-note { min-height: 19px; padding-top: 1px; }
}
