:root {
  --background: #fdf9ed;
  --surface: #fffdf6;
  --surface-low: #f3eee2;
  --surface-high: #e6e2d6;
  --surface-ink: #1a1a1a;
  --text: #1d1c15;
  --muted: #68685f;
  --outline: #76786e;
  --outline-soft: #c6c7bc;
  --primary: #5f6b4e;
  --primary-deep: #3f4a30;
  --secondary: #9a5632;
  --secondary-soft: #ffdcbd;
  --danger: #ba1a1a;
  --success: #3f7d48;
  --warning: #f0bd8b;
  --accent: #5f6b4e;
  --line-color: #9a5632;
  --music-pulse: 1;
  --music-beat: 0;
  --shadow-sm: 4px 4px 0 var(--surface-ink);
  --shadow: 6px 6px 0 var(--surface-ink);
  --shadow-lg: 10px 10px 0 var(--surface-ink);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-family: 'Space Grotesk', Inter, Arial, sans-serif;
  background-color: var(--background);
  background-image: radial-gradient(var(--outline-soft) 1px, transparent 1px);
  background-size: 18px 18px;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

body.streak-low {
  box-shadow: inset 0 0 0 8px rgba(95, 107, 78, 0.12);
}

body.streak-mid {
  box-shadow: inset 0 0 0 10px rgba(154, 86, 50, 0.18);
}

body.streak-high {
  box-shadow: inset 0 0 0 12px rgba(186, 26, 26, 0.18);
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.mobile-header {
  display: none;
}

.side-nav {
  width: 288px;
  height: 100vh;
  flex: 0 0 288px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-right: 4px solid var(--surface-ink);
  box-shadow: 6px 0 0 var(--surface-ink);
  z-index: 1200;
}

.app-panel {
  padding: 24px 20px 18px;
  border-bottom: 4px solid var(--surface-ink);
}

.app-panel h1 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
}

.mode-menu,
.sidebar-bottom {
  padding: 18px 16px;
}

.app-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 800;
  text-transform: uppercase;
}

.best-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-low);
  border: 3px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
}

.best-score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.best-score b {
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}

.mode-menu {
  display: grid;
  gap: 12px;
  border-bottom: 4px solid var(--surface-ink);
}

.mode-btn,
.nav-item,
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.mode-btn,
.nav-item {
  justify-content: flex-start;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 2px solid transparent;
}

.mode-btn:hover,
.nav-item:hover {
  background: var(--surface-low);
  border-color: var(--surface-ink);
}

.mode-btn.active {
  background: var(--primary);
  color: #ffffff;
  border: 2px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
}

.btn {
  padding: 14px 18px;
  border: 4px solid var(--surface-ink);
  box-shadow: var(--shadow);
  background: var(--surface);
  text-align: center;
  text-transform: uppercase;
}

.btn:hover,
.mode-btn.active:hover {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.answer-panel {
  min-height: 0;
  flex: 1;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  border-bottom: 4px solid var(--surface-ink);
}

.answer-panel h2,
.mistakes-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.answer-panel p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

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

.question-mode-btn {
  min-height: 36px;
  padding: 7px 8px;
  color: var(--text);
  background: var(--surface-low);
  border: 2px solid var(--surface-ink);
  box-shadow: 3px 3px 0 var(--surface-ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.question-mode-btn:hover,
.question-mode-btn.active {
  color: #ffffff;
  background: var(--primary);
}

.question-mode-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--surface-ink);
}

.question-mode-btn.active {
  box-shadow: none;
  transform: translate(3px, 3px);
}

.name-pool {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 6px 10px 0;
}

.name-item {
  width: 100%;
  min-height: 46px;
  margin: 0 0 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  background: #ffffff;
  border: 3px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
  text-align: left;
  font-weight: 800;
  line-height: 1.18;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.name-item:hover {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.name-item.selected {
  color: #ffffff;
  background: var(--primary);
}

.name-item.matched {
  opacity: 0.45;
  pointer-events: none;
  text-decoration: line-through;
  background: var(--surface-high);
  box-shadow: none;
}

.name-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.name-item.selected small {
  color: #ffffff;
}

.mistakes-panel {
  display: none;
  padding: 14px 16px;
  background: #fff0ee;
  border-bottom: 4px solid var(--surface-ink);
}

.mistakes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mistake-tag {
  padding: 5px 7px;
  color: #ffffff;
  background: var(--danger);
  border: 2px solid var(--surface-ink);
  font-size: 11px;
  font-weight: 800;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.music-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  background: var(--surface-low);
  border: 3px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
}

.music-select-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.music-track-select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  color: var(--text);
  background: #ffffff;
  border: 2px solid var(--surface-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.btn-music-toggle {
  min-height: 38px;
  padding: 8px 10px;
  border-width: 3px;
  box-shadow: 3px 3px 0 var(--surface-ink);
  font-size: 12px;
}

.music-panel-mobile {
  display: none;
}

.btn-side {
  min-height: 44px;
  justify-content: flex-start;
  padding: 10px 14px;
  background: var(--surface);
  border-width: 2px;
  box-shadow: var(--shadow-sm);
  text-transform: none;
}

.ownership-mark {
  padding-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.game-main {
  min-width: 0;
  height: 100vh;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.objective-bar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, rgba(198, 199, 188, 0.5) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(198, 199, 188, 0.5) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(198, 199, 188, 0.5) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(198, 199, 188, 0.5) 75%);
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  background-size: 8px 8px;
  border: 4px solid var(--surface-ink);
  box-shadow: var(--shadow);
}

.target-card {
  min-width: min(100%, 330px);
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: #ffffff;
  border: 4px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
}

.target-label {
  color: var(--primary-deep);
  font-size: 18px;
  font-weight: 800;
}

.target-card strong {
  flex: 1;
  min-width: 0;
  color: var(--surface-ink);
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.target-card .material-symbols-outlined {
  color: #b89483;
  font-size: 38px;
}

.hud-stats {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.hud-card {
  min-width: 88px;
  padding: 11px 13px;
  display: grid;
  place-items: center;
  background: var(--surface-low);
  border: 3px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
}

.hud-card span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hud-card strong {
  color: var(--text);
  font-size: 21px;
  line-height: 1;
}

.hud-card-life {
  background: var(--secondary-soft);
}

.heart-row {
  display: flex;
  gap: 4px;
}

.heart {
  color: var(--danger);
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
}

.heart:not(.filled) {
  color: var(--primary-deep);
}

.map-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: var(--surface-low);
  border: 4px solid var(--surface-ink);
  box-shadow: var(--shadow);
}

.map-stage-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background-image: repeating-linear-gradient(45deg, var(--surface-ink) 0, var(--surface-ink) 2px, transparent 2px, transparent 10px);
  mix-blend-mode: multiply;
}

#map {
  position: absolute;
  inset: 16px;
  z-index: 1;
  width: auto;
  height: auto;
  background: #f7f1df;
  border: 4px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
}

.leaflet-container {
  font-family: 'Space Grotesk', Inter, Arial, sans-serif;
  background: #f7f1df;
}

.leaflet-tile-pane {
  filter: saturate(0.45) sepia(0.18) contrast(1.05) brightness(1.12);
}

.leaflet-interactive {
  outline: none;
}

.pin {
  --pin-visual-size: 28px;
  width: 44px !important;
  height: 44px !important;
  position: absolute;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
}

.pin::after {
  content: "";
  position: absolute;
  width: var(--pin-visual-size);
  height: var(--pin-visual-size);
  left: 50%;
  top: 50%;
  background: #fffdf6;
  border: 4px solid var(--surface-ink);
  box-shadow: 4px 4px 0 rgba(26, 26, 26, 0.92);
  transform: translate(-50%, -50%) rotate(2deg) scale(var(--music-pulse));
  transition: box-shadow 80ms linear, transform 80ms linear;
}

.pin::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: 50%;
  top: 50%;
  z-index: 1;
  background: var(--primary);
  border: 2px solid var(--primary-deep);
  transform: translate(-50%, -50%) rotate(2deg) scale(calc(1 + (var(--music-beat) * 0.32)));
}

.pin.matched {
  background: transparent;
}

.pin.matched::after {
  background: #ffffff;
  border-color: var(--success);
}

.pin.matched::before {
  background: var(--success);
}

.city-label {
  border: 0;
  background: transparent;
}

.city-label span {
  display: inline-block;
  padding: 2px 5px;
  color: rgba(26, 26, 26, 0.55);
  background: rgba(253, 249, 237, 0.52);
  border: 1px solid rgba(26, 26, 26, 0.12);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.feature-label {
  max-width: 180px;
  padding: 6px 8px;
  color: #ffffff;
  background: var(--surface-ink);
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-sm);
  white-space: normal;
  line-height: 1.2;
  font-size: 11px;
  font-weight: 900;
}

.feature-label.correct {
  color: #ffffff;
  background: var(--success);
}

.feature-label.incorrect {
  color: #ffffff;
  background: var(--danger);
}

#svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 900;
}

.connection-line {
  stroke: var(--line-color);
  stroke-width: 4;
  stroke-dasharray: 10;
  fill: none;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -20;
  }
}

.pixi-effects-layer,
.dom-effects-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1002;
}

.pixi-runtime-status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1005;
  padding: 6px 8px;
  color: var(--primary);
  background: var(--surface);
  border: 2px solid var(--surface-ink);
  box-shadow: 3px 3px 0 var(--surface-ink);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}

.pixi-runtime-status.fallback {
  color: var(--secondary);
}

.pixi-runtime-status.off {
  color: var(--muted);
}

.map-effect-stamp {
  position: absolute;
  transform: translate(-50%, -50%) scale(0.7);
  padding: 10px 14px;
  border: 4px solid #ffffff;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow);
  animation: stamp-pop 900ms ease-out forwards;
  white-space: nowrap;
}

.map-effect-stamp.success {
  background: var(--success);
}

.map-effect-stamp.danger {
  background: var(--danger);
}

@keyframes stamp-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(-8deg);
  }

  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15) rotate(3deg);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -90%) scale(0.9) rotate(0deg);
  }
}

.footer-actions {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 20px;
}

.btn-reset {
  background: var(--surface-low);
}

.btn-reveal {
  color: #ffffff;
  background: var(--primary);
}

.btn-home {
  color: #ffffff;
  background: var(--secondary);
}

.pixi-prototype-body {
  min-height: 100vh;
  overflow: hidden;
}

.pixi-prototype-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  overflow: hidden;
}

.pixi-prototype-panel {
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 20px;
  background: #ffffff;
  border-right: 4px solid var(--surface-ink);
  box-shadow: 6px 0 0 var(--surface-ink);
  z-index: 2;
}

.pixi-back-link,
.pixi-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface-low);
  border: 3px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
  font-weight: 900;
}

.pixi-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pixi-prototype-panel h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.pixi-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
}

.pixi-target-card,
.pixi-stats {
  padding: 12px;
  background: var(--surface-low);
  border: 3px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
}

.pixi-target-card span,
.pixi-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pixi-target-card strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  line-height: 1.05;
}

.pixi-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pixi-stats b {
  display: block;
  color: var(--primary);
  font-size: 24px;
}

.pixi-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pixi-list {
  min-height: 0;
  overflow-y: auto;
  padding: 4px 6px 10px 0;
}

.pixi-list-item {
  width: 100%;
  min-height: 54px;
  margin: 0 0 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #ffffff;
  border: 3px solid var(--surface-ink);
  box-shadow: var(--shadow-sm);
  text-align: left;
  font-weight: 900;
}

.pixi-list-item span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.pixi-list-item.active {
  color: #ffffff;
  background: var(--primary);
}

.pixi-list-item.active span {
  color: #ffffff;
}

.pixi-list-item:disabled {
  opacity: 0.48;
  text-decoration: line-through;
}

.pixi-stage-wrap {
  min-width: 0;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.pixi-stage-toolbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 4px solid var(--surface-ink);
  box-shadow: var(--shadow);
}

.pixi-stage-toolbar span {
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
}

.pixi-stage-toolbar strong {
  max-width: 62ch;
  line-height: 1.2;
  text-align: right;
}

.pixi-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background-color: #f7f1df;
  background-image: repeating-linear-gradient(45deg, rgba(26, 26, 26, 0.12) 0, rgba(26, 26, 26, 0.12) 2px, transparent 2px, transparent 10px);
  border: 4px solid var(--surface-ink);
  box-shadow: var(--shadow);
}

.pixi-prototype-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 3000;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 18px;
  color: var(--text);
  background: #ffffff;
  border: 4px solid var(--surface-ink);
  border-left-width: 12px;
  box-shadow: var(--shadow);
  font-weight: 800;
  animation: slideIn 180ms ease;
}

@keyframes slideIn {
  from {
    transform: translateX(110%);
  }

  to {
    transform: translateX(0);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(26, 26, 26, 0.72);
}

.modal-content {
  width: min(420px, 100%);
  padding: 34px;
  color: var(--text);
  background: #ffffff;
  border: 4px solid var(--surface-ink);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.modal-content h1 {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 32px;
}

.modal-content p {
  margin: 0 0 16px;
  font-weight: 800;
}

#final-streak {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 56px;
  line-height: 1;
  font-weight: 900;
}

.modal-content .btn {
  width: 100%;
  margin-top: 18px;
}

.material-symbols-outlined {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--surface-low);
  border-left: 3px solid var(--surface-ink);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-ink);
  border: 2px solid var(--surface-low);
}

@media (max-width: 1100px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 1400;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    color: #ffffff;
    background: var(--primary);
    border-bottom: 4px solid var(--surface-ink);
    box-shadow: var(--shadow-sm);
  }

  .mobile-brand {
    font-size: 20px;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    white-space: nowrap;
  }

  .mobile-actions {
    display: flex;
    gap: 12px;
  }

  .app-shell {
    min-height: calc(100dvh - 58px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .mode-menu,
  .objective-bar,
  .map-stage,
  .answer-panel,
  .footer-actions {
    width: calc(100vw - 24px);
    max-width: 100%;
    min-width: 0;
  }

  .side-nav,
  .game-main {
    display: contents;
  }

  .app-panel,
  .mistakes-panel,
  .sidebar-bottom {
    display: none !important;
  }

  .mode-menu {
    order: 1;
    display: flex;
    gap: 8px;
    padding: 0 0 8px;
    overflow-x: auto;
    border-bottom: 0;
    scrollbar-width: none;
  }

  .mode-menu::-webkit-scrollbar {
    display: none;
  }

  .mode-btn {
    width: auto;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 116px;
    min-height: 44px;
    padding: 10px 12px;
    background: #ffffff;
    border: 2px solid var(--surface-ink);
  }

  .answer-panel {
    order: 4;
    max-height: none;
    min-height: 0;
    padding: 12px;
    background: #ffffff;
    border: 3px solid var(--surface-ink);
    box-shadow: var(--shadow-sm);
  }

  .answer-panel h2,
  .answer-panel p {
    display: none;
  }

  .question-mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .question-mode-btn {
    flex: 0 0 104px;
    min-height: 34px;
  }

  .question-mode-toggle::-webkit-scrollbar {
    display: none;
  }

  .name-pool {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 10px;
    scroll-snap-type: x proximity;
  }

  .name-item {
    width: 236px;
    flex: 0 0 236px;
    min-height: 52px;
    margin-bottom: 0;
    scroll-snap-align: start;
  }

  .objective-bar {
    order: 2;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
  }

  .target-card {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    gap: 9px;
  }

  .target-label {
    font-size: 14px;
  }

  .target-card strong {
    font-size: 20px;
  }

  .target-card .material-symbols-outlined {
    font-size: 28px;
  }

  .hud-stats {
    width: 100%;
    min-width: 0;
    display: flex;
    gap: 8px;
    overflow: hidden;
  }

  .hud-card {
    width: 100%;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    padding: 8px 6px;
    overflow: hidden;
  }

  .hud-card span:first-child {
    font-size: 10px;
  }

  .hud-card strong {
    font-size: 18px;
  }

  .heart {
    font-size: 20px;
  }

  .heart-row {
    min-width: 0;
    justify-content: center;
  }

  .map-stage {
    order: 3;
    flex: none;
    height: min(49dvh, 460px);
    min-height: 320px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }

  #map {
    inset: 8px;
    border-width: 3px;
    box-shadow: none;
  }

  .pin {
    --pin-visual-size: 24px;
  }

  .pin::after {
    border-width: 3px;
    box-shadow: 3px 3px 0 rgba(26, 26, 26, 0.92);
  }

  .pin::before {
    width: 7px;
    height: 7px;
    border-width: 1px;
  }

  .feature-label {
    max-width: 132px;
    padding: 4px 6px;
    border-width: 2px;
    font-size: 10px;
  }

  .footer-actions {
    order: 5;
    min-height: 0;
    grid-template-columns: 0.9fr 0.9fr 1.3fr 0.9fr;
    gap: 8px;
  }

  .music-panel-mobile {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 5px;
    box-shadow: 3px 3px 0 var(--surface-ink);
  }

  .music-panel-mobile .music-select-label {
    display: none;
  }

  .music-panel-mobile .music-track-select {
    min-height: 22px;
    padding: 2px 4px;
    font-size: 10px;
  }

  .music-panel-mobile .btn-music-toggle {
    min-height: 22px;
    padding: 2px 4px;
    border-width: 2px;
    box-shadow: none;
    font-size: 10px;
  }

  .music-panel-mobile .material-symbols-outlined {
    font-size: 16px;
  }

  .btn {
    min-height: 48px;
    padding: 9px 8px;
    border-width: 3px;
    box-shadow: var(--shadow-sm);
    font-size: 12px;
  }

  .pixi-prototype-body {
    overflow: auto;
  }

  .pixi-prototype-shell {
    height: auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .pixi-prototype-panel {
    height: auto;
    display: block;
    padding: 16px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 4px solid var(--surface-ink);
    box-shadow: 0 6px 0 var(--surface-ink);
  }

  .pixi-target-card,
  .pixi-stats,
  .pixi-actions,
  .pixi-list,
  .pixi-stage-wrap,
  .pixi-stage-toolbar,
  .pixi-stage {
    width: calc(100vw - 32px);
    max-width: 100%;
    min-width: 0;
  }

  .pixi-copy,
  .pixi-back-link {
    display: none;
  }

  .pixi-prototype-panel h1 {
    font-size: 24px;
  }

  .pixi-target-card,
  .pixi-stats,
  .pixi-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }

  .pixi-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .pixi-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 4px 4px;
  }

  .pixi-list-item {
    width: 230px;
    flex: 0 0 230px;
    margin-bottom: 0;
  }

  .pixi-stage-wrap {
    min-height: 0;
    flex: none;
    padding: 12px;
  }

  .pixi-stage-toolbar {
    min-height: 0;
    display: block;
    padding: 12px;
    box-shadow: var(--shadow-sm);
  }

  .pixi-stage-toolbar strong {
    display: block;
    margin-top: 5px;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .pixi-stage {
    height: 420px;
    flex: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    gap: 10px;
    padding: 10px;
  }

  .mode-menu,
  .objective-bar,
  .map-stage,
  .answer-panel,
  .footer-actions {
    width: calc(100vw - 20px);
  }

  .mobile-actions {
    display: none;
  }

  .mode-btn {
    min-width: 106px;
    font-size: 13px;
  }

  .mode-btn .material-symbols-outlined {
    font-size: 21px;
  }

  .target-card strong {
    font-size: 18px;
  }

  .target-card .material-symbols-outlined {
    display: none;
  }

  .map-stage {
    height: 44dvh;
    min-height: 300px;
  }

  .name-item {
    width: 224px;
    flex-basis: 224px;
  }

  .name-item small {
    max-width: 78px;
  }

  .footer-actions {
    position: sticky;
    bottom: 0;
    z-index: 1300;
    margin: 0 -10px -10px;
    padding: 8px 10px 10px;
    background: var(--background);
    border-top: 3px solid var(--surface-ink);
  }

  .footer-actions .material-symbols-outlined {
    font-size: 20px;
  }

  .btn {
    font-size: 11px;
  }
}
