:root {
  color-scheme: light;
  --paper: #f8edc2;
  --blush: #efa0bd;
  --sky: #cfddeb;
  --ink: #101010;
  --soft-ink: rgba(16, 16, 16, 0.68);
  --line: #101010;
  --white: rgba(255, 255, 255, 0.42);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 11% 74%, rgba(239, 160, 189, 0.88), transparent 18rem),
    radial-gradient(circle at 84% 82%, rgba(207, 221, 235, 0.95), transparent 22rem),
    linear-gradient(160deg, #f7eda9 0%, #f7efcf 42%, #f0a0bf 100%);
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

.shell::before {
  content: "goatstrike";
  position: fixed;
  z-index: 2;
  right: -0.08em;
  bottom: 0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(16, 16, 16, 0.12);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5rem, 18vw, 16rem);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.75;
  pointer-events: none;
}

.brand-bar {
  position: fixed;
  z-index: 10;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: lowercase;
  pointer-events: auto;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--ink);
  background: rgba(255, 255, 255, 0.22);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
}

.status-chip {
  min-width: 220px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff8dc;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  line-height: 1.2;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 6px 6px 0 rgba(16, 16, 16, 0.12);
}

.game-layout {
  position: fixed;
  inset: 0;
  display: block;
}

.game-stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  border: 0;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: none;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background: #f5eebd;
  cursor: crosshair;
}

.upgrade-overlay {
  position: absolute;
  z-index: 11;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: rgba(248, 237, 194, 0.56);
  backdrop-filter: blur(4px);
}

.upgrade-title {
  width: min(680px, 100%);
  text-align: center;
}

.upgrade-title span {
  display: block;
  margin-bottom: 4px;
  color: var(--soft-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.upgrade-title strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 6vw, 4rem);
  font-style: italic;
  line-height: 0.92;
  text-transform: lowercase;
}

.upgrade-grid {
  display: grid;
  width: min(760px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.upgrade-card {
  min-height: 150px;
  padding: 14px;
  border: 3px solid var(--ink);
  background: #fff8dc;
  box-shadow: 7px 7px 0 var(--blush);
  text-align: left;
}

.upgrade-card span {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 800;
  line-height: 0.95;
  text-transform: lowercase;
}

.upgrade-card p {
  margin: 10px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.upgrade-card em {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 7px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff8dc;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.decision-overlay {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(16, 16, 16, 0.22);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.decision-card {
  width: min(560px, 100%);
  padding: 16px 18px;
  border: 3px solid var(--ink);
  background: rgba(255, 248, 220, 0.96);
  box-shadow: 8px 8px 0 rgba(16, 16, 16, 0.24);
  text-align: center;
}

.decision-overlay.is-left .decision-card {
  box-shadow: 8px 8px 0 var(--blush);
}

.decision-overlay.is-right .decision-card {
  box-shadow: 8px 8px 0 var(--sky);
}

.decision-card span {
  display: block;
  color: var(--soft-ink);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.decision-card strong {
  display: block;
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 7vw, 3.4rem);
  font-style: italic;
  line-height: 0.92;
  text-transform: lowercase;
}

.decision-card p {
  margin: 10px auto 0;
  max-width: 42em;
  font-size: clamp(0.78rem, 3.2vw, 1rem);
  font-weight: 900;
  line-height: 1.2;
}

.decision-card button {
  min-height: 42px;
  margin-top: 13px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff8dc;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.level-report {
  gap: 18px;
}

.level-report .upgrade-title p {
  width: min(520px, 100%);
  margin: 12px auto 0;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.45;
}

.evolution-strip {
  display: grid;
  width: min(680px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.evolution-strip div {
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--ink);
  background: rgba(255, 248, 220, 0.82);
  box-shadow: 5px 5px 0 rgba(16, 16, 16, 0.12);
}

.evolution-strip strong,
.evolution-strip em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evolution-strip strong {
  margin-top: 7px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.evolution-strip em {
  margin-top: 3px;
  color: var(--soft-ink);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 800;
}

.level-evolution {
  width: min(560px, 100%);
  grid-template-columns: 1fr 0.78fr 1fr;
}

.level-evolution .evolution-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fff8dc;
}

.level-evolution .evolution-arrow span {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1.15;
  text-transform: uppercase;
}

.mini-goat {
  position: relative;
  display: block;
  width: 64px;
  height: 32px;
  margin: 0 auto;
  border: 3px solid var(--ink);
  background: #fff8dc;
  transform: rotate(-7deg);
}

.mini-goat::before,
.mini-goat::after {
  content: "";
  position: absolute;
  top: -15px;
  width: 31px;
  height: 31px;
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.mini-goat::before {
  left: -18px;
  border-color: var(--blush);
}

.mini-goat::after {
  right: -18px;
  border-color: var(--sky);
}

.level-reel {
  box-shadow: 9px 9px 0 var(--sky);
}

.level-reel .reel-goat {
  animation-duration: 2.1s;
}

.goat-plain {
  background: #fff8dc;
}

.goat-megaphone {
  background: var(--blush);
}

.goat-megaphone::after {
  background: var(--yellow);
}

.goat-magnet {
  background: #8ee6a8;
  box-shadow: 0 0 0 8px rgba(142, 230, 168, 0.28);
}

.goat-shield {
  background: var(--sky);
  box-shadow: 0 0 0 10px rgba(207, 221, 235, 0.55);
}

.goat-splitter::before,
.goat-splitter::after {
  border-color: var(--yellow);
}

.goat-crown {
  background: var(--yellow);
}

.goat-crown::after {
  border-radius: 0;
  background: var(--yellow);
  clip-path: polygon(0 100%, 18% 25%, 38% 100%, 54% 10%, 72% 100%, 100% 22%, 100% 100%);
}

.goat-sunglasses {
  background: var(--ink);
}

.goat-sunglasses::before,
.goat-sunglasses::after {
  border-color: var(--ink);
}

.hud {
  position: absolute;
  z-index: 7;
  top: calc(max(8px, env(safe-area-inset-top)) + 44px);
  left: max(12px, env(safe-area-inset-left));
  right: auto;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  width: auto;
  gap: 6px;
  pointer-events: none;
}

.hud div,
.control-panel,
.overlay {
  border: 2px solid var(--ink);
  background: rgba(248, 237, 194, 0.76);
}

.hud div {
  min-width: 76px;
  min-height: 34px;
  padding: 5px 7px;
  box-shadow: 3px 3px 0 rgba(16, 16, 16, 0.1);
}

.hud span,
.metric-list span,
.panel-header p,
.title-block p {
  display: block;
  color: var(--soft-ink);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  margin-top: 1px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  line-height: 1;
}

.big-comment {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 26%;
  width: min(88vw, 720px);
  padding: clamp(12px, 2.2vw, 20px);
  border: 4px solid var(--ink);
  background: rgba(255, 248, 220, 0.92);
  box-shadow: 12px 12px 0 rgba(239, 160, 189, 0.82);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4.8vw, 4.2rem);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-transform: lowercase;
  transform: translate(-50%, -50%) scale(0.92) rotate(-1deg);
  transition: opacity 150ms ease, transform 180ms ease;
}

.big-comment.is-visible {
  opacity: 1;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1) rotate(-1deg);
}

.big-comment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: clamp(14px, 3vw, 26px);
  padding: 0 26px;
  border: 3px solid var(--ink);
  background: var(--ink);
  color: #fff8dc;
  font-family: "Courier New", monospace;
  font-size: clamp(0.78rem, 2.6vw, 1.08rem);
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.big-comment-action[hidden] {
  display: none;
}

.big-comment-action:hover {
  transform: translateY(-1px);
}

.political-choice {
  position: absolute;
  z-index: 8;
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  bottom: calc(max(8px, env(safe-area-inset-bottom)) + 56px);
  display: grid;
  gap: 6px;
  pointer-events: auto;
}

.political-question,
.political-actions button {
  border: 2px solid var(--ink);
  background: rgba(248, 237, 194, 0.88);
  box-shadow: 5px 5px 0 rgba(16, 16, 16, 0.13);
}

.political-question {
  padding: 7px 9px;
  text-align: center;
}

.political-question span {
  display: block;
  color: var(--soft-ink);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.political-question strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.86rem, 3.9vw, 1.35rem);
  font-style: italic;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: lowercase;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.political-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.political-actions button {
  min-height: 45px;
  padding: 7px 6px;
  font-size: clamp(0.66rem, 3.2vw, 0.82rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.political-actions button small {
  display: block;
  margin-top: 2px;
  font-family: "Courier New", monospace;
  font-size: clamp(0.48rem, 2.2vw, 0.58rem);
  letter-spacing: 0.02em;
}

.political-actions button:first-child {
  background: rgba(239, 160, 189, 0.9);
}

.political-actions button:last-child {
  background: rgba(207, 221, 235, 0.94);
}

.overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  padding: 30px;
  text-align: center;
  backdrop-filter: blur(2px);
}

.briefing-reel {
  position: relative;
  width: min(520px, calc(100vw - 28px));
  aspect-ratio: 16 / 8.2;
  overflow: hidden;
  border: 3px solid var(--ink);
  background:
    linear-gradient(rgba(16, 16, 16, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 16, 16, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, #cfddeb 0%, #f8edc2 58%, #efa0bd 100%);
  background-size: 100% 12px, 18px 100%, 100% 100%;
  box-shadow: 9px 9px 0 var(--blush);
}

.briefing-reel::before {
  content: "classified nonsense";
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 3;
  padding: 5px 8px;
  background: var(--ink);
  color: #fff8dc;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.briefing-reel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: repeating-linear-gradient(0deg, transparent 0 8px, rgba(255, 255, 255, 0.18) 9px 10px);
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: reel-scan 0.7s linear infinite;
}

.reel-skyline {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 0 16px;
}

.reel-skyline span {
  flex: 1;
  height: var(--h, 54px);
  border: 2px solid var(--ink);
  border-bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 248, 220, 0.75) 0 5px, transparent 5px 14px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(16, 16, 16, 0.08));
}

.reel-skyline span:nth-child(1) { --h: 72px; }
.reel-skyline span:nth-child(2) { --h: 118px; }
.reel-skyline span:nth-child(3) { --h: 88px; }
.reel-skyline span:nth-child(4) { --h: 132px; }
.reel-skyline span:nth-child(5) { --h: 64px; }

.reel-drone,
.reel-ticker,
.reel-blip {
  position: absolute;
  z-index: 5;
  border: 2px solid var(--ink);
  background: #fff8dc;
  color: var(--ink);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reel-drone {
  right: 12px;
  top: 10px;
  padding: 5px 8px;
}

.reel-ticker {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 7px 10px;
  background: var(--ink);
  color: #fff8dc;
  white-space: nowrap;
  animation: ticker-wobble 1.1s steps(2) infinite;
}

.reel-goat {
  position: absolute;
  z-index: 5;
  left: 13%;
  top: 28%;
  width: 104px;
  height: 58px;
  border: 3px solid var(--ink);
  background: #fff8dc;
  border-radius: 46% 38% 42% 36%;
  box-shadow: inset -14px -8px 0 rgba(111, 88, 68, 0.2);
  transform-origin: 50% 80%;
  animation: goat-briefing 1.35s ease-in-out infinite;
}

.reel-goat::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 9px;
  width: 20px;
  height: 12px;
  border: 3px solid var(--ink);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  background: #fff8dc;
}

.goat-head {
  position: absolute;
  right: -26px;
  top: -8px;
  width: 42px;
  height: 36px;
  border: 3px solid var(--ink);
  border-radius: 48% 42% 52% 38%;
  background: #fff8dc;
  transform: rotate(-10deg);
  animation: goat-head-bob 0.7s ease-in-out infinite;
}

.goat-head::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.goat-horn {
  position: absolute;
  z-index: 2;
  top: -22px;
  width: 12px;
  height: 20px;
  border: 3px solid var(--ink);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #f8edc2;
}

.horn-a {
  right: 2px;
  transform: rotate(-22deg);
}

.horn-b {
  right: -14px;
  transform: rotate(12deg);
}

.goat-beard {
  position: absolute;
  right: -16px;
  top: 25px;
  width: 10px;
  height: 24px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: beard-swing 0.45s ease-in-out infinite;
}

.goat-leg {
  position: absolute;
  bottom: -24px;
  width: 8px;
  height: 28px;
  border: 3px solid var(--ink);
  background: #6f5844;
  transform-origin: 50% 0;
}

.leg-a { left: 16px; animation: leg-dance-a 0.45s ease-in-out infinite; }
.leg-b { left: 40px; animation: leg-dance-b 0.45s ease-in-out infinite; }
.leg-c { right: 34px; animation: leg-dance-b 0.45s ease-in-out infinite; }
.leg-d { right: 10px; animation: leg-dance-a 0.45s ease-in-out infinite; }

.dance-note {
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 22px;
  border: 3px solid var(--ink);
  border-left: 0;
  border-bottom: 0;
  opacity: 0.88;
}

.dance-note::after {
  content: "";
  position: absolute;
  left: -9px;
  bottom: -8px;
  width: 13px;
  height: 9px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--blush);
}

.note-a {
  left: -34px;
  top: -18px;
  animation: note-float 1.2s ease-in-out infinite;
}

.note-b {
  right: -58px;
  top: 16px;
  transform: scale(0.82);
  animation: note-float 1.2s ease-in-out 0.32s infinite;
}

.reel-blip {
  padding: 5px 7px;
  box-shadow: 4px 4px 0 rgba(16, 16, 16, 0.16);
}

.blip-a {
  left: 52%;
  top: 37%;
  transform: rotate(3deg);
}

.blip-b {
  right: 12%;
  top: 58%;
  transform: rotate(-4deg);
}

@keyframes goat-briefing {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  25% { transform: translate(74%, -16%) rotate(8deg); }
  50% { transform: translate(148%, 9%) rotate(-5deg); }
  75% { transform: translate(218%, -10%) rotate(7deg); }
}

@keyframes goat-head-bob {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50% { transform: rotate(7deg) translateY(4px); }
}

@keyframes beard-swing {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(16deg); }
}

@keyframes leg-dance-a {
  0%, 100% { transform: rotate(14deg); }
  50% { transform: rotate(-18deg); }
}

@keyframes leg-dance-b {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(20deg); }
}

@keyframes note-float {
  0%, 100% { opacity: 0.28; transform: translateY(10px) rotate(-8deg); }
  45% { opacity: 0.96; transform: translateY(-6px) rotate(8deg); }
}

@keyframes reel-scan {
  from { transform: translateY(-10px); }
  to { transform: translateY(10px); }
}

@keyframes ticker-wobble {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

.overlay.is-visible {
  display: flex;
}

.overlay.is-result .briefing-reel,
.overlay.is-death .briefing-reel {
  display: none;
}

.overlay.is-result {
  justify-content: end;
  gap: 12px;
  padding-top: 34vh;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.overlay.is-result .title-block h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 6vw, 4rem);
}

.overlay.is-result .title-block span {
  font-size: clamp(0.78rem, 1.8vw, 0.98rem);
  line-height: 1.25;
}

.overlay.is-result .leaderboard {
  background: rgba(255, 248, 220, 0.96);
  box-shadow: 8px 8px 0 rgba(239, 160, 189, 0.72);
}

.overlay.is-death {
  gap: 22px;
  padding: clamp(18px, 5vw, 42px);
}

.overlay.is-death .title-block {
  width: min(820px, 100%);
}

.overlay.is-death .title-block h1 {
  margin: 8px 0 14px;
  padding: clamp(14px, 3vw, 28px);
  border: 4px solid var(--ink);
  background: rgba(255, 248, 220, 0.94);
  box-shadow: 12px 12px 0 rgba(239, 160, 189, 0.82);
  font-size: clamp(2rem, 7vw, 5.6rem);
  line-height: 0.9;
  text-transform: lowercase;
}

.overlay.is-death .title-block span {
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: clamp(0.8rem, 2vw, 1rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overlay.is-death .leaderboard {
  display: none;
}

.title-block {
  width: min(680px, 100%);
}

.title-block h1 {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 7vw, 5.8rem);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.9;
}

.title-block span {
  display: block;
  color: var(--soft-ink);
  font-size: clamp(0.94rem, 2vw, 1.16rem);
  line-height: 1.55;
}

.leaderboard {
  width: min(520px, 100%);
  padding: 10px;
  border: 3px solid var(--ink);
  background: rgba(255, 248, 220, 0.82);
  box-shadow: 7px 7px 0 rgba(16, 16, 16, 0.12);
  text-align: left;
}

.leaderboard-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.leaderboard-head span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: lowercase;
}

.leaderboard-head strong {
  color: var(--soft-ink);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
}

.leaderboard-form {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-bottom: 8px;
}

.leaderboard.is-finished.is-qualified .leaderboard-form {
  display: grid;
}

.leaderboard-form input,
.leaderboard-form button {
  min-height: 38px;
  border: 2px solid var(--ink);
  border-radius: 0;
  font-family: "Courier New", monospace;
  font-weight: 900;
}

.leaderboard-form input {
  min-width: 0;
  padding: 0 9px;
  background: #fff8dc;
  color: var(--ink);
}

.leaderboard-form button {
  padding: 0 12px;
  background: var(--ink);
  color: #fff8dc;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.leaderboard-form button:disabled {
  opacity: 0.62;
}

.leaderboard-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin: 0;
  padding-left: 20px;
  font-family: "Courier New", monospace;
  font-size: clamp(0.68rem, 1.8vw, 0.82rem);
  font-weight: 900;
}

.leaderboard-list li {
  min-width: 0;
  padding-right: 2px;
}

.leaderboard-list li::marker {
  color: var(--soft-ink);
}

.leaderboard-list span {
  display: inline-block;
  max-width: 68%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.leaderboard-list strong {
  float: right;
  margin-left: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95em;
}

.primary-action,
.secondary-action {
  min-height: 52px;
  padding: 0 28px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff8dc;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.control-panel {
  position: fixed;
  z-index: 10;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.panel-header h2 {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-style: italic;
  letter-spacing: 0;
  line-height: 0.96;
  text-transform: lowercase;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-list div {
  min-width: 0;
  padding: 8px;
  border: 2px solid rgba(16, 16, 16, 0.18);
  background: rgba(255, 255, 255, 0.24);
}

.metric-list strong {
  display: block;
  margin-top: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.secondary-action {
  width: auto;
  min-height: 44px;
  min-width: 104px;
  margin-top: 0;
  padding: 0 18px;
  background: rgba(255, 248, 220, 0.76);
  color: var(--ink);
  pointer-events: auto;
  box-shadow: 5px 5px 0 rgba(16, 16, 16, 0.12);
}

@media (max-width: 860px) {
  .shell {
    width: 100vw;
    height: 100dvh;
    padding: 0;
  }

  .brand-bar {
    display: flex;
    gap: 8px;
  }

  .status-chip {
    width: auto;
    min-width: 0;
    flex: 1;
    padding-inline: 10px;
    letter-spacing: 0.12em;
  }

  canvas {
    height: 100%;
    aspect-ratio: auto;
  }

  .overlay {
    gap: 12px;
    padding: 14px;
  }

  .briefing-reel {
    width: min(390px, calc(100vw - 28px));
    aspect-ratio: 16 / 8.8;
    box-shadow: 6px 6px 0 var(--blush);
  }

  .reel-skyline span:nth-child(2),
  .reel-skyline span:nth-child(4) {
    height: 88px;
  }

  .reel-goat {
    width: 78px;
    height: 44px;
  }

  .reel-goat::before {
    left: -13px;
    top: 8px;
    width: 17px;
    height: 10px;
  }

  .goat-head {
    right: -22px;
    top: -6px;
    width: 35px;
    height: 30px;
  }

  .goat-horn {
    top: -18px;
    width: 10px;
    height: 16px;
  }

  .goat-leg {
    bottom: -20px;
    width: 7px;
    height: 23px;
  }

  .note-b {
    right: -43px;
  }

  .reel-blip {
    font-size: 0.5rem;
  }

  .title-block h1 {
    margin-bottom: 8px;
    font-size: clamp(2.1rem, 10vw, 3.1rem);
  }

  .title-block span {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .leaderboard {
    padding: 8px;
  }

  .leaderboard-form {
    grid-template-columns: 1fr;
  }

  .leaderboard-list {
    grid-template-columns: 1fr;
    max-height: 112px;
    overflow: auto;
  }

  .level-evolution {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .level-evolution .evolution-arrow {
    min-height: 38px;
  }

  .mini-goat {
    width: 54px;
    height: 27px;
  }

  .mini-goat::before,
  .mini-goat::after {
    top: -13px;
    width: 26px;
    height: 26px;
  }

  .mini-goat::before {
    left: -15px;
  }

  .mini-goat::after {
    right: -15px;
  }

  .primary-action,
  .secondary-action {
    min-height: 48px;
    padding: 0 18px;
    letter-spacing: 0.14em;
  }

  .hud {
    top: calc(max(8px, env(safe-area-inset-top)) + 48px);
    left: max(10px, env(safe-area-inset-left));
    right: auto;
    width: auto;
    gap: 5px;
  }

  .hud div {
    min-width: 68px;
    min-height: 32px;
    padding: 4px 6px;
  }

  .hud span {
    font-size: 0.5rem;
    letter-spacing: 0.06em;
  }

  .hud strong {
    font-size: 0.9rem;
  }

  .big-comment {
    top: 50%;
    width: min(92vw, 520px);
    padding: 12px;
    border-width: 3px;
    box-shadow: 7px 7px 0 rgba(239, 160, 189, 0.82);
    font-size: clamp(1.6rem, 9vw, 3.5rem);
  }

  .political-choice {
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: calc(max(6px, env(safe-area-inset-bottom)) + 48px);
    gap: 4px;
  }

  .political-question {
    padding: 5px 7px;
  }

  .political-question span {
    font-size: 0.48rem;
    letter-spacing: 0.09em;
  }

  .political-question strong {
    font-size: clamp(0.74rem, 3.4vw, 1.05rem);
  }

  .political-actions {
    gap: 4px;
  }

  .political-actions button {
    min-height: 38px;
    padding: 5px 4px;
    font-size: clamp(0.58rem, 2.7vw, 0.7rem);
    letter-spacing: 0.05em;
  }

  .political-actions button small {
    font-size: clamp(0.42rem, 1.9vw, 0.5rem);
  }

  .control-panel {
    left: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    padding: 0;
  }

  .panel-header {
    display: none;
  }

  .panel-header h2 {
    font-size: 1rem;
  }

  .metric-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .metric-list div {
    padding: 6px;
  }

  .metric-list strong {
    font-size: 0.72rem;
  }

  .secondary-action {
    width: auto;
    min-width: 86px;
    min-height: 42px;
    padding-inline: 13px;
  }

  .upgrade-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .upgrade-card {
    min-height: 86px;
    padding: 11px;
  }

  .upgrade-card span {
    font-size: 1.05rem;
  }

  .upgrade-card p {
    margin-top: 6px;
    font-size: 0.72rem;
  }

  .upgrade-card em {
    margin-top: 8px;
    font-size: 0.5rem;
  }

  .level-report .upgrade-title p {
    font-size: 0.8rem;
  }
}

@media (max-height: 620px) {
  .political-choice {
    bottom: calc(max(5px, env(safe-area-inset-bottom)) + 42px);
  }

  .political-question {
    display: none;
  }

  .political-actions button {
    min-height: 34px;
  }

  .political-actions button small {
    display: none;
  }

  .decision-card {
    padding: 12px 14px;
  }

  .decision-card strong {
    font-size: clamp(1.2rem, 5.6vw, 2.4rem);
  }
}
