@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;800&family=Noto+Serif+TC:wght@600;700;900&display=swap");

:root {
  --ink: #1d211e;
  --ink-soft: #30372f;
  --night: #141814;
  --night-2: #20261f;
  --paper: #e9dec2;
  --paper-deep: #cdbb92;
  --paper-pale: #f4ecd8;
  --rust: #9c3f2d;
  --rust-dark: #6f2b20;
  --signal: #d45b3d;
  --teal: #3f6f69;
  --teal-light: #79a099;
  --gold: #d4ac58;
  --cream: #f2e8ce;
  --danger: #c64e3e;
  --success: #7da16b;
  --line: rgba(230, 216, 181, .2);
  --paper-line: rgba(45, 46, 37, .2);
  --shadow-low: 0 10px 24px rgba(0, 0, 0, .22);
  --shadow-high: 0 24px 70px rgba(0, 0, 0, .4);
  --radius-sm: 4px;
  --radius-lg: 12px;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: var(--font-body);
  overscroll-behavior: none;
}

body {
  min-width: 320px;
}

body[data-screen="game"] {
  height: 100svh;
  overflow: hidden;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background:
    radial-gradient(circle at 50% 45%, rgba(212, 172, 88, .08), transparent 34%),
    #121612;
  transition: opacity .5s ease, visibility .5s ease;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
}

.boot-seal {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 2px solid #ba5a43;
  color: #d76b50;
  font-family: var(--font-display);
  font-size: 36px;
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 5px #121612, inset 0 0 0 7px #ba5a43;
}

.boot p {
  margin: 0;
  color: #b9ae91;
  font-size: 13px;
  letter-spacing: .3em;
}

.boot-line {
  width: 180px;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
}

.boot-line i {
  display: block;
  width: 60%;
  height: 100%;
  background: var(--signal);
  animation: load-line 1.1s infinite ease-in-out;
}

@keyframes load-line {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(190%); }
}

.opening-film {
  position: fixed;
  z-index: 950;
  inset: 0;
  overflow: hidden;
  background: #9f3d2d;
  color: #f3e8cd;
  isolation: isolate;
}

.opening-film[hidden] {
  display: none;
}

.opening-film::after {
  content: "";
  position: absolute;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: .23;
  background:
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,.23) 0 1px, transparent 1px 5px),
    linear-gradient(105deg, transparent 45%, rgba(23,25,20,.16) 46% 47%, transparent 48%);
  background-size: 8px 9px, 100% 100%;
  mix-blend-mode: soft-light;
}

.opening-field {
  position: absolute;
  inset: -10%;
  background:
    linear-gradient(164deg, transparent 0 61%, #244f4c 61.2% 76%, transparent 76.2%),
    linear-gradient(12deg, #a94330 0 47%, #b85236 47.2% 70%, #a43d2e 70.2%);
  transform: rotate(-2deg) scale(1.08);
}

.opening-station {
  position: absolute;
  z-index: 2;
  top: 8%;
  left: -5%;
  width: 62%;
  height: 72%;
  background:
    linear-gradient(rgba(22,24,20,.2), rgba(22,24,20,.2)),
    url("game-art/td/map-station-district.png") center/cover;
  filter: grayscale(1) contrast(1.45);
  clip-path: polygon(1% 7%, 96% 0, 100% 87%, 12% 100%, 0 82%);
  box-shadow: 18px 22px 0 rgba(27,30,25,.36);
  transform: translate3d(-110%, 10%, 0) rotate(-7deg);
}

.opening-map-paper {
  position: absolute;
  z-index: 4;
  right: -4%;
  bottom: 7%;
  width: 52%;
  height: 58%;
  overflow: hidden;
  background: #306c68;
  clip-path: polygon(3% 4%, 97% 0, 100% 92%, 7% 100%, 0 18%);
  box-shadow: -14px 18px 0 rgba(29,33,28,.32);
  transform: translate3d(105%, 9%, 0) rotate(6deg);
}

.opening-map-paper::before,
.opening-map-paper::after {
  content: "";
  position: absolute;
  border: 5px solid rgba(232,217,183,.48);
  border-radius: 48%;
}

.opening-map-paper::before {
  width: 82%;
  height: 38%;
  left: -11%;
  top: 10%;
  transform: rotate(15deg);
}

.opening-map-paper::after {
  width: 76%;
  height: 44%;
  right: -18%;
  bottom: 0;
  transform: rotate(-22deg);
}

.opening-map-paper i {
  position: absolute;
  display: block;
  width: 92%;
  height: 5px;
  left: 4%;
  top: 35%;
  background: #e4d5af;
  transform: rotate(-12deg);
  box-shadow: 0 11px 0 rgba(228,213,175,.36);
}

.opening-map-paper i:nth-child(2) { top: 58%; transform: rotate(9deg); }
.opening-map-paper i:nth-child(3) { top: 75%; transform: rotate(-4deg); }

.opening-ticket {
  position: absolute;
  z-index: 8;
  top: 14%;
  right: 18%;
  display: grid;
  min-width: 230px;
  padding: 20px 28px;
  background: #d4a94d;
  color: #292b24;
  clip-path: polygon(4% 0, 100% 5%, 96% 95%, 0 100%);
  box-shadow: 10px 14px 0 rgba(34,37,31,.36);
  transform: translateY(-180%) rotate(8deg);
}

.opening-ticket span {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .2em;
}

.opening-ticket b {
  margin-top: 4px;
  font-size: 17px;
  letter-spacing: .5em;
}

.opening-date {
  position: absolute;
  z-index: 9;
  left: 7%;
  bottom: 17%;
  padding: 10px 20px 12px;
  background: #efe3c4;
  color: #712d23;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 34px);
  font-weight: 900;
  letter-spacing: .24em;
  clip-path: polygon(2% 6%, 100% 0, 97% 100%, 0 91%);
  transform: translateX(-140%) rotate(-5deg);
}

.opening-hero {
  position: absolute;
  z-index: 12;
  right: 12%;
  bottom: -6%;
  width: min(36vw, 510px);
  filter: drop-shadow(-13px 18px 0 rgba(25,28,23,.44));
  transform: translate3d(80%, 35%, 0) rotate(9deg);
}

.opening-hero img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}

.opening-rail {
  position: absolute;
  z-index: 7;
  right: -8%;
  bottom: 7%;
  width: 120%;
  height: 16px;
  border-block: 4px solid #292d27;
  transform: translateX(110%) rotate(-8deg);
}

.opening-rail i {
  position: absolute;
  top: -15px;
  width: 9px;
  height: 42px;
  background: #292d27;
}

.opening-rail i:nth-child(1) { left: 12%; }
.opening-rail i:nth-child(2) { left: 37%; }
.opening-rail i:nth-child(3) { left: 62%; }
.opening-rail i:nth-child(4) { left: 87%; }

.opening-title-card {
  position: absolute;
  z-index: 18;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  background: #1f433e;
  text-align: center;
  clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
  transform: translateY(108%) rotate(-2deg);
}

.opening-title-card::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  border: 2px solid rgba(238,225,191,.26);
  clip-path: polygon(0 4%, 100% 0, 97% 100%, 3% 96%);
}

.opening-title-card p,
.opening-title-card small {
  position: relative;
  margin: 0;
  font-weight: 700;
  letter-spacing: .32em;
}

.opening-title-card p {
  color: #d6ae54;
  font-size: clamp(14px, 1.6vw, 22px);
}

.opening-title-card h2 {
  position: relative;
  display: grid;
  margin: 18px 0 22px;
  font-family: var(--font-display);
}

.opening-title-card h2 span {
  font-size: clamp(52px, 8vw, 118px);
  line-height: .95;
  letter-spacing: .08em;
}

.opening-title-card h2 strong {
  margin-top: 12px;
  color: #d06b48;
  font-size: clamp(22px, 3vw, 44px);
  letter-spacing: .48em;
}

.opening-title-card small {
  color: #d5c9a9;
  font-size: clamp(13px, 1.2vw, 17px);
}

.skip-opening {
  position: absolute;
  z-index: 30;
  right: 24px;
  top: 22px;
  padding: 10px 14px;
  border: 1px solid rgba(243,232,205,.46);
  border-radius: 2px;
  background: rgba(22,25,20,.72);
  color: #f3e8cd;
  font-size: 14px;
  font-weight: 700;
}

.skip-opening span {
  margin-left: 8px;
  color: #d7b45c;
  font-size: 12px;
}

.opening-film.is-playing .opening-station { animation: opening-station 7.8s steps(6, end) both; }
.opening-film.is-playing .opening-map-paper { animation: opening-map 7.8s steps(7, end) both; }
.opening-film.is-playing .opening-ticket { animation: opening-ticket 7.8s steps(6, end) both; }
.opening-film.is-playing .opening-date { animation: opening-date 7.8s steps(6, end) both; }
.opening-film.is-playing .opening-hero { animation: opening-hero 7.8s steps(8, end) both; }
.opening-film.is-playing .opening-rail { animation: opening-rail 7.8s steps(7, end) both; }
.opening-film.is-playing .opening-title-card { animation: opening-title 7.8s steps(6, end) both; }

@keyframes opening-station {
  0%, 5% { transform: translate3d(-110%,10%,0) rotate(-7deg); }
  16%, 62% { transform: translate3d(0,0,0) rotate(-3deg); }
  72%, 100% { transform: translate3d(-115%,-5%,0) rotate(-9deg); }
}

@keyframes opening-map {
  0%, 13% { transform: translate3d(105%,9%,0) rotate(6deg); }
  26%, 66% { transform: translate3d(0,0,0) rotate(3deg); }
  75%, 100% { transform: translate3d(110%,0,0) rotate(8deg); }
}

@keyframes opening-ticket {
  0%, 23% { transform: translateY(-180%) rotate(8deg); }
  34%, 65% { transform: translateY(0) rotate(4deg); }
  73%, 100% { transform: translateY(-185%) rotate(10deg); }
}

@keyframes opening-date {
  0%, 30% { transform: translateX(-140%) rotate(-5deg); }
  41%, 64% { transform: translateX(0) rotate(-2deg); }
  73%, 100% { transform: translateX(-145%) rotate(-7deg); }
}

@keyframes opening-hero {
  0%, 18% { transform: translate3d(80%,35%,0) rotate(9deg); }
  32%, 67% { transform: translate3d(0,0,0) rotate(1deg); }
  75%, 100% { transform: translate3d(85%,35%,0) rotate(10deg); }
}

@keyframes opening-rail {
  0%, 28% { transform: translateX(110%) rotate(-8deg); }
  40%, 66% { transform: translateX(0) rotate(-6deg); }
  75%, 100% { transform: translateX(-115%) rotate(-10deg); }
}

@keyframes opening-title {
  0%, 69% { transform: translateY(108%) rotate(-2deg); }
  80%, 96% { transform: translateY(0) rotate(0); }
  100% { transform: translateY(-106%) rotate(2deg); }
}

.opening-film.is-closing {
  opacity: 0;
  transition: opacity .35s ease;
}

#app {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.is-active {
  display: block;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
}

.title-screen {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #1b1f1b;
}

.title-map {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(13, 16, 13, .95) 0%, rgba(13, 16, 13, .74) 42%, rgba(13, 16, 13, .18) 74%, rgba(13, 16, 13, .42) 100%),
    linear-gradient(0deg, rgba(11, 13, 11, .8), transparent 48%),
    url("game-art/td/map-civic-district.png");
  background-position: center;
  background-size: cover;
  filter: saturate(.73) contrast(1.05);
  transform: scale(1.03);
  animation: title-drift 22s ease-in-out infinite alternate;
}

@keyframes title-drift {
  to { transform: scale(1.08) translate3d(-1%, -.6%, 0); }
}

.paper-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, .08), transparent 1px),
    radial-gradient(circle at 72% 68%, rgba(0, 0, 0, .12), transparent 1px);
  background-size: 9px 11px, 13px 15px;
  mix-blend-mode: overlay;
}

.title-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1480px, calc(100% - 64px));
  margin: 0 auto;
  padding: 26px 0;
  border-bottom: 1px solid rgba(236, 224, 193, .2);
}

.mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
}

.brand-seal {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d0654c;
  color: #e4775d;
  transform: rotate(-2deg);
}

.nav-actions {
  display: flex;
  gap: 6px;
}

.icon-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: transparent;
  color: #d5cbb2;
  font-size: 13px;
}

.icon-label:hover {
  color: #fff4d9;
}

.title-content {
  position: relative;
  z-index: 2;
  width: min(1480px, calc(100% - 64px));
  margin: 0 auto;
  padding: clamp(72px, 11vh, 142px) 0 110px;
}

.title-content h1 {
  display: flex;
  flex-direction: column;
  margin: 16px 0 20px;
  font-family: var(--font-display);
  line-height: .95;
  text-shadow: 0 8px 30px rgba(0, 0, 0, .42);
}

.title-content h1 span {
  font-size: clamp(46px, 6vw, 90px);
  font-weight: 900;
  letter-spacing: .08em;
}

.title-content h1 strong {
  margin-top: 12px;
  color: var(--signal);
  font-size: clamp(26px, 3vw, 48px);
  letter-spacing: .32em;
}

.title-lead {
  width: min(590px, 100%);
  margin: 0 0 28px;
  color: #d8ceb8;
  font-size: 16px;
  line-height: 1.9;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.primary-cta,
.secondary-cta {
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: .08em;
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  min-width: 194px;
  background: var(--rust);
  color: #fff3dc;
  box-shadow: 0 10px 24px rgba(88, 27, 18, .32);
}

.primary-cta:hover {
  background: #b64a34;
  transform: translateY(-1px);
}

.primary-cta svg {
  fill: currentColor;
  stroke: none;
}

.secondary-cta {
  background: transparent;
  border-color: rgba(237, 224, 190, .35);
  color: var(--cream);
}

.secondary-cta:hover {
  border-color: var(--gold);
  color: #fff8e5;
}

.text-cta {
  padding: 8px;
  background: transparent;
  color: #d6cdb6;
  border-bottom: 1px solid rgba(214, 205, 182, .4);
}

.feature-strip {
  display: flex;
  width: min(610px, 100%);
  margin-top: clamp(50px, 9vh, 100px);
  border-top: 1px solid rgba(236, 224, 193, .24);
  border-bottom: 1px solid rgba(236, 224, 193, .24);
}

.feature-strip div {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px 16px;
  border-right: 1px solid rgba(236, 224, 193, .16);
}

.feature-strip div:last-child {
  border-right: 0;
}

.feature-strip b {
  color: #f0dfb5;
  font-family: var(--font-display);
  font-size: 22px;
}

.feature-strip span {
  margin-top: 3px;
  color: #a9a18e;
  font-size: 11px;
}

.title-disclaimer {
  position: absolute;
  z-index: 2;
  right: clamp(32px, 5vw, 76px);
  bottom: 42px;
  width: 310px;
  padding: 14px 0 0;
  border-top: 1px solid var(--signal);
  color: #bcb39e;
}

.title-disclaimer span {
  color: #e6d9bb;
  font-size: 12px;
  font-weight: 700;
}

.title-disclaimer p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.7;
}

.campaign-screen {
  min-height: 100vh;
  padding: 28px clamp(24px, 4vw, 64px) 48px;
  background:
    linear-gradient(rgba(20, 24, 20, .92), rgba(20, 24, 20, .96)),
    url("game-art/td/map-station-district.png") center/cover fixed;
}

.room-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.room-header h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 38px);
}

.round-button,
.control-button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(235, 220, 185, .22);
  background: rgba(13, 16, 13, .7);
}

.round-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.round-button:hover,
.control-button:hover {
  border-color: var(--gold);
  background: rgba(49, 56, 47, .9);
}

.campaign-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.campaign-total span {
  color: #989582;
  font-size: 11px;
}

.campaign-total strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 20px;
}

.campaign-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(24px, 4vw, 60px);
  max-width: 1500px;
  margin: 0 auto;
}

.map-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  grid-auto-rows: minmax(220px, 1fr);
  gap: 18px;
}

.map-card {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(235, 220, 185, .2);
  border-radius: var(--radius-sm);
  background-position: center;
  background-size: cover;
  text-align: left;
  box-shadow: var(--shadow-low);
  isolation: isolate;
}

.map-card:first-child {
  grid-column: span 2;
  min-height: 320px;
}

.map-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(0deg, rgba(12, 15, 12, .94), rgba(12, 15, 12, .15) 72%);
}

.map-card::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 3px solid transparent;
  pointer-events: none;
}

.map-card.is-selected::after {
  border-color: var(--signal);
}

.map-card:hover {
  border-color: #c8af78;
}

.map-card-content {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 20px;
}

.map-card .map-chapter {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
}

.map-card h3 {
  margin: 5px 0 4px;
  font-family: var(--font-display);
  font-size: 26px;
}

.map-card p {
  margin: 0;
  color: #c7bda8;
  font-size: 12px;
}

.map-stars {
  display: flex;
  gap: 3px;
  margin-top: 12px;
}

.map-stars i,
.result-stars i {
  display: inline-block;
  background: currentColor;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%);
}

.map-stars i {
  width: 14px;
  height: 14px;
  color: rgba(241, 220, 164, .25);
}

.map-stars i.is-earned {
  color: var(--gold);
}

.map-lock {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(12, 15, 12, .72);
}

.map-card.is-locked {
  filter: grayscale(.65) brightness(.62);
}

.briefing-board {
  position: relative;
  align-self: start;
  padding: 34px 30px 30px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 28px 60px rgba(0, 0, 0, .36);
  transform: rotate(.25deg);
}

.board-pin {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7c2b23;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}

.briefing-board .eyebrow {
  color: var(--rust);
}

.briefing-board h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 34px;
}

.brief-date {
  margin: 5px 0 20px;
  color: #6d6757;
  font-size: 12px;
}

.brief-copy {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.9;
}

.modifier {
  padding: 12px 14px;
  border: 1px solid rgba(111, 43, 32, .38);
  background: rgba(120, 99, 63, .09);
}

.modifier span,
.difficulty-picker legend {
  color: var(--rust-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.modifier p {
  margin: 4px 0 0;
  color: #4d4d42;
  font-size: 12px;
  line-height: 1.7;
}

.difficulty-picker {
  margin: 20px 0 15px;
  padding: 0;
  border: 0;
}

.difficulty-picker legend {
  margin-bottom: 8px;
}

#difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.difficulty-option {
  position: relative;
}

.difficulty-option input {
  position: absolute;
  opacity: 0;
}

.difficulty-option label {
  display: flex;
  flex-direction: column;
  min-height: 56px;
  padding: 8px;
  border: 1px solid rgba(58, 55, 44, .24);
  text-align: center;
  cursor: pointer;
}

.difficulty-option label strong {
  font-size: 12px;
}

.difficulty-option label small {
  margin-top: 2px;
  color: #716c5d;
  font-size: 9px;
}

.difficulty-option input:checked + label {
  border-color: var(--rust);
  background: rgba(147, 52, 37, .1);
  color: var(--rust-dark);
}

.brief-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 15px 0;
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}

.brief-stats div {
  display: flex;
  flex-direction: column;
  padding: 10px 8px;
  border-right: 1px solid var(--paper-line);
}

.brief-stats div:last-child {
  border: 0;
}

.brief-stats span {
  color: #756e5e;
  font-size: 9px;
}

.brief-stats strong {
  margin-top: 2px;
  font-size: 13px;
}

.briefing-board .primary-cta,
.briefing-board .secondary-cta {
  width: 100%;
}

.briefing-board .secondary-cta {
  margin-top: 8px;
  border-color: rgba(48, 45, 36, .35);
  color: var(--ink);
}

.game-screen {
  min-height: 100svh;
  overflow: hidden;
  background: #111511;
}

.game-hud {
  display: grid;
  grid-template-columns: auto minmax(150px, .8fr) minmax(500px, 2fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(224, 211, 177, .16);
  background-color: #1b211b;
  background-image: radial-gradient(circle, rgba(239, 224, 188, .11) 0 1px, transparent 1.2px);
  background-size: 13px 13px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .32);
}

.hud-mission {
  display: flex;
  flex-direction: column;
}

.hud-mission span {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: .14em;
}

.hud-mission strong {
  font-family: var(--font-display);
  font-size: 16px;
}

.hud-metrics {
  display: flex;
  justify-content: center;
  height: 46px;
}

.hud-metrics > div {
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  min-width: 105px;
  padding: 0 17px;
  border-left: 1px solid rgba(224, 211, 177, .13);
}

.hud-metrics svg {
  grid-row: span 2;
  align-self: center;
  margin-right: 9px;
  color: var(--gold);
  font-size: 21px;
}

.hud-metrics span {
  color: #909584;
  font-size: 9px;
}

.hud-metrics strong {
  font-size: 16px;
}

.hud-metrics i {
  font-style: normal;
}

.time-controls {
  display: flex;
  gap: 4px;
}

.control-button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: #aaa997;
  font-size: 11px;
}

.control-button.is-active {
  border-color: var(--gold);
  background: #39433a;
  color: #f2e5c3;
}

.battle-layout {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) 278px;
  height: calc(100svh - 64px);
}

.build-dock,
.intel-panel {
  position: relative;
  z-index: 4;
  background-color: #1b211b;
  background-image: radial-gradient(circle, rgba(239, 224, 188, .08) 0 1px, transparent 1.2px);
  background-size: 14px 14px;
}

.build-dock {
  overflow-y: auto;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}

.dock-heading {
  display: flex;
  flex-direction: column;
  padding: 14px 10px 10px;
}

.dock-heading span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

.dock-heading small {
  margin-top: 4px;
  color: #777c70;
  font-size: 8px;
}

.tower-deck {
  display: grid;
  gap: 4px;
  padding: 0 7px 10px;
}

.tower-button {
  position: relative;
  display: grid;
  grid-template-columns: 43px 1fr;
  align-items: center;
  min-height: 60px;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: #252c25;
  text-align: left;
}

.tower-button:hover {
  border-color: rgba(212, 172, 88, .6);
  background: #303830;
}

.tower-button.is-selected {
  border-color: var(--signal);
  background: #3b3029;
}

.tower-button.is-poor {
  opacity: .48;
}

.tower-thumb {
  width: 43px;
  height: 43px;
  background-image: url("game-art/td/tower-atlas.png");
  background-repeat: no-repeat;
  background-size: 172px 86px;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .35));
}

.tower-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tower-label strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-label small {
  overflow: hidden;
  margin-top: 1px;
  color: #9ca296;
  font-size: 7px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-label span {
  margin-top: 2px;
  color: var(--gold);
  font-size: 9px;
}

.tower-hotkey {
  position: absolute;
  top: 3px;
  right: 4px;
  color: #686e64;
  font-size: 8px;
}

.cancel-build {
  width: calc(100% - 14px);
  margin: 0 7px 10px;
  padding: 8px 4px;
  border: 1px dashed rgba(224, 211, 177, .25);
  background: transparent;
  color: #aaa794;
  font-size: 9px;
}

kbd {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border: 1px solid rgba(231, 219, 187, .25);
  border-radius: 3px;
  background: rgba(255, 255, 255, .05);
  color: #e6d8b8;
  font-family: var(--font-body);
  font-size: 9px;
  box-shadow: inset 0 -1px rgba(0, 0, 0, .45);
}

.battlefield {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #0c100d;
  background-position: center;
  background-size: cover;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: none;
  cursor: crosshair;
}

.battlefield.is-shaking canvas {
  animation: screen-shake .28s linear;
}

@keyframes screen-shake {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-4px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}

.canvas-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 8px solid rgba(239, 224, 188, .08);
  box-shadow: inset 0 0 80px 12px rgba(0, 0, 0, .42);
}

.placement-tip {
  position: absolute;
  top: 14px;
  left: 50%;
  padding: 8px 13px;
  border: 1px solid rgba(240, 216, 153, .4);
  border-radius: 3px;
  background: rgba(19, 23, 19, .9);
  color: #f0e1bd;
  font-size: 11px;
  transform: translateX(-50%);
}

.wave-banner {
  position: absolute;
  top: 16px;
  left: 16px;
  width: min(330px, 35%);
  padding: 11px 14px;
  border: 2px solid rgba(239, 224, 188, .72);
  background-color: rgba(125, 48, 38, .94);
  background-image: radial-gradient(circle, rgba(20, 24, 20, .18) 0 1px, transparent 1.3px);
  background-size: 11px 11px;
  box-shadow: 5px 6px 0 rgba(9, 12, 9, .3);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}

.wave-banner.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
}

.wave-banner span {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: .16em;
}

.wave-banner strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 18px;
}

.wave-banner p {
  margin: 3px 0 0;
  color: #b6b3a2;
  font-size: 9px;
  line-height: 1.6;
}

.hero-card {
  position: absolute;
  right: 13px;
  bottom: 12px;
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: min(470px, calc(100% - 26px));
  padding: 8px 9px;
  border: 2px solid rgba(239, 224, 188, .45);
  border-radius: var(--radius-sm);
  background: rgba(22, 27, 22, .94);
  box-shadow: var(--shadow-low);
}

.hero-portrait {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  border: 3px solid #efe0bc;
  background: #a83f30;
  color: #eadbb7;
  font-family: var(--font-display);
  font-size: 14px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .32);
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transform: scale(1.85) translateY(11%);
  filter: saturate(.88) contrast(1.08);
}

.hero-portrait span {
  position: absolute;
  right: 1px;
  bottom: 1px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #efe0bc;
  background: #243a35;
  line-height: 1;
}

.hero-vitals {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-vitals > span {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-hp {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  background: #394139;
}

.hero-hp i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--success);
  transform-origin: left center;
  transition: transform .2s cubic-bezier(.22, 1, .36, 1);
}

.hero-skills {
  display: flex;
  gap: 5px;
}

.hero-skills button {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 3px;
  min-width: 60px;
  min-height: 35px;
  overflow: hidden;
  padding: 4px;
  border: 1px solid rgba(232, 218, 184, .18);
  background: #2c342d;
}

.hero-skills button:hover {
  border-color: var(--gold);
}

.hero-skills button.is-cooling {
  color: #777b71;
}

.hero-skills button span {
  position: relative;
  z-index: 1;
  font-size: 8px;
}

.hero-skills button i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0;
  background: rgba(10, 12, 10, .7);
}

.intel-panel {
  overflow-y: auto;
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
}

.intel-toggle {
  display: none;
}

.panel-section {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.panel-title small {
  color: #888d80;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.next-enemies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 62px;
  margin: 12px 0;
}

.enemy-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border: 1px solid rgba(228, 215, 181, .14);
  background: #242b24;
  font-size: 8px;
}

.enemy-chip > span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.enemy-chip small {
  color: #8f9689;
  font-size: 7px;
}

.enemy-chip i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 50% 50% 42% 42%;
  background: var(--enemy-color);
}

.enemy-chip b {
  color: var(--gold);
}

.wave-cta {
  display: grid;
  grid-template-columns: auto 1fr;
  width: 100%;
  min-height: 48px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid #9e4a38;
  background: #7d3427;
  color: #f8ead0;
  text-align: left;
}

.wave-cta:hover {
  background: #99402f;
}

.wave-cta svg {
  grid-row: span 2;
  margin-right: 10px;
  fill: currentColor;
  stroke: none;
}

.wave-cta span {
  font-size: 11px;
  font-weight: 700;
}

.wave-cta small {
  color: #d8bc8d;
  font-size: 8px;
}

.auto-wave-row {
  margin-top: 9px;
  color: #8c9185;
  font-size: 9px;
}

.auto-wave-row label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector {
  background: #202720;
}

.mini-close {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  background: transparent;
  color: #8e9184;
}

.inspector-role {
  margin: 7px 0 12px;
  color: #a9aa9d;
  font-size: 9px;
  line-height: 1.7;
}

.inspector-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.inspector-stats div {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-right: 1px solid var(--line);
}

.inspector-stats div:last-child {
  border: 0;
}

.inspector-stats span {
  color: #787e73;
  font-size: 8px;
}

.inspector-stats strong {
  margin-top: 2px;
  font-size: 11px;
}

.tower-record {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  color: #858c80;
  font-size: 8px;
}

.tower-record div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.tower-record b {
  color: #e5cc8a;
  font-size: 11px;
}

.tower-record small {
  color: #737a70;
  font-size: 7px;
}

.target-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  color: #aeb0a3;
  font-size: 9px;
}

.target-select span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.target-select select {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #171c18;
  color: var(--cream);
  font-size: 9px;
}

.upgrade-choices {
  display: grid;
  gap: 6px;
}

.upgrade-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 7px 8px;
  border: 1px solid rgba(229, 216, 183, .15);
  background: #2a322b;
  text-align: left;
}

.upgrade-button:hover {
  border-color: var(--gold);
}

.upgrade-button.is-locked {
  opacity: .34;
}

.upgrade-button svg {
  color: var(--gold);
}

.upgrade-button span {
  display: flex;
  flex-direction: column;
}

.upgrade-button b {
  font-size: 9px;
}

.upgrade-button small {
  margin-top: 2px;
  color: #868c80;
  font-size: 8px;
}

.upgrade-button strong {
  color: var(--gold);
  font-size: 9px;
}

.sell-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(196, 84, 62, .3);
  background: transparent;
  color: #c99183;
  font-size: 9px;
}

.sell-button strong {
  margin-left: auto;
}

.compact-help {
  color: #92978b;
  font-size: 9px;
  line-height: 1.7;
}

.compact-help > span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
}

.compact-help p {
  margin: 7px 0 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(7, 9, 7, .72);
  backdrop-filter: blur(3px);
}

dialog {
  z-index: 100;
  border: 0;
}

dialog::backdrop {
  background: rgba(7, 9, 7, .72);
  backdrop-filter: blur(3px);
}

.paper-modal {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100svh - 40px);
  overflow-y: auto;
  padding: 36px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-high);
}

.paper-modal .eyebrow {
  color: var(--rust);
}

.paper-modal h2 {
  margin: 5px 0 24px;
  font-family: var(--font-display);
  font-size: 30px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: transparent;
  color: #4f5045;
}

.archive-content {
  display: grid;
  gap: 14px;
}

.archive-entry {
  padding: 13px 15px;
  border-top: 1px solid rgba(111, 43, 32, .42);
  background: rgba(106, 92, 61, .07);
}

.archive-entry h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 17px;
}

.archive-entry p {
  margin: 0;
  color: #565649;
  font-size: 13px;
  line-height: 1.9;
}

.source-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--rust-dark);
  font-size: 12px;
  font-weight: 700;
}

.settings-modal {
  width: min(480px, calc(100% - 32px));
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--paper-line);
  font-size: 13px;
}

.setting-row input[type="range"] {
  width: 180px;
  accent-color: var(--rust);
}

.setting-row input[type="checkbox"],
.auto-wave-row input {
  accent-color: var(--rust);
}

.danger-link {
  margin-top: 24px;
  padding: 8px 0;
  background: transparent;
  color: var(--rust-dark);
  border-bottom: 1px solid currentColor;
  font-size: 11px;
}

.result-modal {
  width: min(570px, calc(100% - 30px));
  overflow: hidden;
  padding: 42px;
  background: #1f271f;
  color: var(--cream);
  text-align: center;
  box-shadow: var(--shadow-high);
}

.result-rays {
  position: absolute;
  inset: -50%;
  opacity: .12;
  background: repeating-conic-gradient(from 0deg, var(--gold) 0 6deg, transparent 6deg 16deg);
  animation: rays 28s linear infinite;
}

@keyframes rays {
  to { transform: rotate(1turn); }
}

.result-modal > *:not(.result-rays) {
  position: relative;
}

.result-modal h2 {
  margin: 5px 0 14px;
  font-family: var(--font-display);
  font-size: 38px;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
}

.result-stars i {
  width: 34px;
  height: 34px;
  color: #4b5147;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, .4));
}

.result-stars i.is-earned {
  color: var(--gold);
  animation: star-in .48s backwards cubic-bezier(.22, 1, .36, 1);
}

.result-stars i:nth-child(2) { animation-delay: .16s; }
.result-stars i:nth-child(3) { animation-delay: .32s; }

@keyframes star-in {
  from { transform: scale(.1) rotate(-25deg); opacity: 0; }
}

#result-copy {
  margin: 0 auto 22px;
  max-width: 390px;
  color: #b7b5a6;
  font-size: 12px;
  line-height: 1.8;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-stats div {
  display: flex;
  flex-direction: column;
  padding: 14px 8px;
  border-right: 1px solid var(--line);
}

.result-stats div:last-child {
  border: 0;
}

.result-stats span {
  color: #858b7e;
  font-size: 9px;
}

.result-stats strong {
  margin-top: 4px;
  color: var(--gold);
  font-size: 18px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.toast-stack {
  position: fixed;
  z-index: 200;
  top: 78px;
  right: 18px;
  display: grid;
  gap: 7px;
  width: min(320px, calc(100% - 36px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid rgba(212, 172, 88, .46);
  background: rgba(25, 30, 25, .96);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .32);
  animation: toast-in .3s ease both;
}

.toast.is-out {
  animation: toast-out .25s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(25px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(25px); }
}

.toast b {
  color: var(--gold);
  font-size: 10px;
}

.toast p {
  grid-column: 2;
  margin: -4px 0 0;
  color: #b2b3a6;
  font-size: 9px;
}

.mobile-rotate {
  display: none;
}

@media (max-width: 1180px) {
  .battle-layout {
    grid-template-columns: 104px minmax(0, 1fr) 236px;
  }

  .game-hud {
    grid-template-columns: auto minmax(110px, .6fr) minmax(380px, 1.7fr) auto;
  }

  .hud-metrics > div {
    min-width: 84px;
    padding: 0 10px;
  }

  .tower-button {
    grid-template-columns: 36px 1fr;
  }

  .tower-thumb {
    width: 36px;
    height: 36px;
    background-size: 144px 72px;
  }

  .hero-skills button {
    min-width: 48px;
  }
}

@media (max-width: 900px) {
  .title-nav,
  .title-content {
    width: calc(100% - 36px);
  }

  .title-disclaimer {
    right: 18px;
    bottom: 20px;
  }

  .campaign-layout {
    grid-template-columns: 1fr;
  }

  .briefing-board {
    max-width: none;
  }

  .game-hud {
    grid-template-columns: auto 1fr auto;
    min-height: 54px;
    padding: 5px 8px;
  }

  .hud-mission {
    display: none;
  }

  .hud-metrics {
    justify-content: flex-start;
    height: 40px;
  }

  .hud-metrics > div {
    min-width: 68px;
    padding: 0 7px;
  }

  .hud-metrics > div:last-child {
    display: none;
  }

  .hud-metrics svg {
    margin-right: 5px;
    font-size: 15px;
  }

  .hud-metrics span {
    display: none;
  }

  .time-controls .control-button:last-child,
  .speed-button[data-speed="3"] {
    display: none;
  }

  .battle-layout {
    grid-template-columns: 82px minmax(0, 1fr);
    height: calc(100svh - 54px);
  }

  .intel-panel {
    position: absolute;
    top: 54px;
    right: 0;
    z-index: 7;
    width: 220px;
    max-height: calc(100svh - 54px);
    background: rgba(27, 33, 27, .96);
    padding-left: 28px;
    box-shadow: -12px 0 24px rgba(0, 0, 0, .24);
    transform: translateX(calc(100% - 32px));
    transition: transform .2s;
  }

  .intel-toggle {
    position: absolute;
    top: 50%;
    left: 0;
    display: grid;
    width: 28px;
    height: 74px;
    place-items: center;
    border: 1px solid rgba(226, 211, 175, .28);
    border-right: 0;
    background: #293129;
    color: var(--gold);
    transform: translateY(-50%);
  }

  .intel-toggle span {
    font-size: 9px;
    letter-spacing: .08em;
    writing-mode: vertical-rl;
  }

  .intel-panel.is-open .intel-toggle span {
    color: #f0dfb7;
  }

  .intel-panel.is-open {
    transform: translateX(0);
  }

  .hero-card {
    right: 8px;
    bottom: 7px;
    width: min(360px, calc(100% - 16px));
  }

  .hero-skills button span {
    display: none;
  }

  .hero-skills button {
    min-width: 34px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .opening-ticket {
    right: 8%;
    min-width: 150px;
    padding: 14px 18px;
  }

  .opening-ticket span { font-size: 20px; }
  .opening-hero { right: 1%; width: min(58vw, 410px); }
  .opening-station { width: 82%; }
  .opening-map-paper { width: 68%; }
  .opening-title-card h2 strong { letter-spacing: .3em; }

  .title-screen {
    overflow-y: auto;
  }

  .title-map {
    background-image:
      linear-gradient(90deg, rgba(13, 16, 13, .94), rgba(13, 16, 13, .58)),
      linear-gradient(0deg, rgba(11, 13, 11, .88), transparent 48%),
      url("game-art/td/map-civic-district.png");
    background-position: 63% center;
  }

  .title-nav {
    padding: 18px 0;
  }

  .icon-label span {
    display: none;
  }

  .title-content {
    padding: 80px 0 170px;
  }

  .title-content h1 span {
    font-size: 44px;
  }

  .title-content h1 strong {
    font-size: 24px;
    letter-spacing: .2em;
  }

  .title-lead {
    font-size: 14px;
    line-height: 1.9;
  }

  .feature-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 55px;
  }

  .feature-strip div:nth-child(2) {
    border-right: 0;
  }

  .feature-strip div:nth-child(-n+2) {
    border-bottom: 1px solid rgba(236, 224, 193, .16);
  }

  .title-disclaimer {
    right: 18px;
    left: 18px;
    width: auto;
  }

  .campaign-screen {
    padding: 18px 14px 30px;
  }

  .map-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  .map-card,
  .map-card:first-child {
    flex: 0 0 82%;
    grid-column: auto;
    min-height: 220px;
    scroll-snap-align: start;
  }

  .briefing-board {
    padding: 30px 20px 22px;
  }

  .battle-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 75px;
  }

  .battlefield {
    grid-row: 1;
  }

  .build-dock {
    grid-row: 2;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--line);
    border-right: 0;
    scrollbar-width: none;
  }

  .build-dock::-webkit-scrollbar {
    display: none;
  }

  .dock-heading {
    display: none;
  }

  .tower-deck {
    display: flex;
    width: max-content;
    height: 74px;
    padding: 5px;
  }

  .tower-button {
    grid-template-columns: 35px 50px;
    width: 92px;
    min-height: 63px;
  }

  .tower-hotkey {
    display: none;
  }

  .cancel-build {
    display: none !important;
  }

  .hero-card {
    grid-template-columns: auto 1fr;
    bottom: 5px;
  }

  .hero-skills {
    position: absolute;
    top: -42px;
    right: 0;
  }

  .hero-skills button {
    background: rgba(35, 43, 36, .94);
  }

  .wave-banner {
    width: min(270px, calc(100% - 32px));
  }

  .mobile-rotate {
    position: fixed;
    z-index: 300;
    inset: auto 10px 88px;
    display: none;
    padding: 12px 14px;
    border: 1px solid rgba(232, 216, 177, .28);
    background: rgba(20, 25, 20, .96);
    text-align: center;
    box-shadow: var(--shadow-high);
  }

  .mobile-rotate .rotate-mark {
    display: block;
    color: var(--gold);
    font-size: 24px;
  }

  .mobile-rotate strong {
    font-size: 11px;
  }

  .mobile-rotate p {
    margin: 3px 0 0;
    color: #98998f;
    font-size: 9px;
  }

  .game-screen.is-active .mobile-rotate {
    display: block;
    animation: rotate-note 4s 1s both;
  }

  @keyframes rotate-note {
    0%, 80% { opacity: 0; transform: translateY(8px); pointer-events: none; }
    10%, 65% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(8px); visibility: hidden; }
  }
}

@media (max-width: 620px) and (orientation: portrait) {
  body[data-screen="game"] .game-hud,
  body[data-screen="game"] .battle-layout {
    visibility: hidden;
  }

  body[data-screen="game"] .mobile-rotate {
    position: fixed;
    z-index: 400;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 0;
    background:
      linear-gradient(rgba(14, 18, 14, .74), rgba(14, 18, 14, .92)),
      url("game-art/td/map-civic-district.png") center/cover;
    animation: none;
    box-shadow: none;
  }

  body[data-screen="game"] .mobile-rotate .rotate-mark {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    margin-bottom: 20px;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 42px;
    animation: rotate-device 1.8s ease-in-out infinite;
  }

  body[data-screen="game"] .mobile-rotate strong {
    font-family: var(--font-display);
    font-size: 23px;
  }

  body[data-screen="game"] .mobile-rotate p {
    margin-top: 9px;
    color: #d0c6ad;
    font-size: 12px;
  }

  @keyframes rotate-device {
    50% { transform: rotate(90deg); }
  }
}

/* Readable CJK type ramp: secondary 14px, controls and body 16px. */
body {
  font-size: 1rem;
  font-weight: 500;
  font-kerning: normal;
}

.title-lead,
.brief-copy,
.archive-entry p,
#result-copy {
  font-size: 1rem;
  line-height: 1.75;
}

.feature-strip span,
.title-disclaimer p,
.map-card p,
.brief-date,
.modifier span,
.difficulty-option small,
.brief-stats span,
.campaign-total span,
.source-link,
.danger-link,
.mobile-rotate p {
  font-size: .875rem;
  line-height: 1.55;
}

.title-disclaimer span,
.map-card .map-chapter,
.difficulty-option label strong,
.setting-row,
.result-stats span {
  font-size: 1rem;
}

.boot p,
.eyebrow,
.icon-label,
.difficulty-picker legend,
.modifier p,
.control-button,
kbd,
.toast b,
.intel-toggle span {
  font-size: .875rem;
}

.difficulty-option label small {
  font-size: .875rem;
  line-height: 1.45;
}

.brief-stats strong {
  font-size: 1.125rem;
}

.game-screen {
  font-size: 1rem;
}

.hud-mission span,
.hud-metrics span,
.dock-heading small,
.tower-label small,
.tower-hotkey,
.wave-banner span,
.wave-banner p,
.hero-vitals > span,
.hero-skills button span,
.panel-title small,
.enemy-chip,
.enemy-chip small,
.wave-cta small,
.auto-wave-row,
.inspector-role,
.inspector-stats span,
.tower-record,
.tower-record small,
.upgrade-button small,
.compact-help,
.toast p {
  font-size: .875rem;
  line-height: 1.45;
}

.dock-heading span,
.tower-label strong,
.tower-label span,
.placement-tip,
.panel-title,
.wave-cta span,
.inspector-stats strong,
.tower-record b,
.target-select,
.target-select select,
.upgrade-button b,
.upgrade-button strong,
.sell-button,
.compact-help > span,
.cancel-build,
.toast strong {
  font-size: 1rem;
  line-height: 1.35;
}

.hud-mission strong,
.hud-metrics strong {
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.tower-button {
  min-height: 72px;
}

.upgrade-button {
  min-height: 66px;
  padding: 10px;
}

.panel-section {
  padding: 18px 16px;
}

.next-enemies {
  gap: 8px;
  min-height: 78px;
}

.enemy-chip {
  gap: 7px;
  padding: 7px 9px;
}

.wave-cta {
  min-height: 58px;
}

.hero-skills button {
  min-width: 72px;
  min-height: 44px;
  padding: 7px;
}

.support-squad {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(230, 212, 170, .34);
  background:
    linear-gradient(100deg, rgba(33, 43, 36, .97), rgba(20, 25, 21, .96)),
    var(--paper-noise);
  box-shadow: 5px 7px 18px rgba(0, 0, 0, .32);
}

.momentum-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  width: 82px;
  padding: 5px 7px;
  color: #ded2b5;
  font-size: .75rem;
}

.momentum-meter b {
  color: #f0c96b;
  font-variant-numeric: tabular-nums;
}

.momentum-meter > i {
  grid-column: 1 / -1;
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  background: #303a31;
}

.momentum-meter em {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #8f4839, #dfba5b);
  transform-origin: left center;
  transition: transform .18s ease-out;
}

.support-squad button {
  position: relative;
  display: grid;
  grid-template-columns: 38px auto auto;
  align-items: center;
  gap: 6px;
  min-width: 145px;
  min-height: 48px;
  overflow: hidden;
  padding: 3px 7px 3px 3px;
  border: 1px solid rgba(232, 218, 184, .24);
  background: #303931;
  text-align: left;
}

.support-squad button:hover {
  border-color: #e0bc65;
  transform: translateY(-1px);
}

.support-squad button.is-cooling,
.support-squad button.is-poor {
  filter: saturate(.42);
  color: #9a9a8d;
}

.support-squad button > img {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 40px;
  object-fit: cover;
  object-position: center 20%;
  border: 1px solid rgba(239, 224, 188, .38);
  background: #171c18;
}

.support-squad button > kbd,
.support-squad button > span {
  position: relative;
  z-index: 1;
}

.support-squad button > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.support-squad button > span b {
  color: #efe0bc;
  font-size: .8rem;
}

.support-squad button > span small {
  overflow: hidden;
  max-width: 88px;
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-squad button > i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  height: 0;
  background: rgba(8, 10, 8, .76);
  pointer-events: none;
}

.wave-doctrine {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  margin: 10px 0 12px;
  padding: 10px 11px 10px 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--doctrine-color, #d1ad59) 48%, transparent);
  background: linear-gradient(110deg, color-mix(in srgb, var(--doctrine-color, #d1ad59) 14%, #242b25), #202620);
}

.wave-doctrine::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--doctrine-color, #d1ad59);
  content: "";
}

.wave-doctrine span {
  color: #aaa897;
  font-size: .72rem;
  letter-spacing: .08em;
}

.wave-doctrine strong {
  color: #efe0bc;
  font-family: var(--font-display);
  font-size: .9rem;
  text-align: right;
}

.wave-doctrine small {
  grid-column: 1 / -1;
  color: #c0bca9;
  font-size: .75rem;
  line-height: 1.45;
}

.setting-row {
  min-height: 54px;
}

@media (min-width: 1181px) {
  .battle-layout {
    grid-template-columns: 152px minmax(0, 1fr) 340px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .battle-layout {
    grid-template-columns: 136px minmax(0, 1fr) 300px;
  }

  .tower-button {
    grid-template-columns: 40px 1fr;
  }
}

@media (max-width: 900px) {
  .battle-layout {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .intel-panel {
    width: 284px;
  }

  .tower-button {
    grid-template-columns: 36px 1fr;
    min-height: 72px;
  }

  .tower-label small {
    white-space: normal;
  }

  .support-squad {
    right: -2px;
    transform: scale(.88);
    transform-origin: right bottom;
  }
}

@media (max-width: 620px) {
  .battle-layout {
    grid-template-rows: minmax(0, 1fr) 92px;
  }

  .tower-deck {
    height: 91px;
  }

  .tower-button {
    grid-template-columns: 38px 62px;
    width: 112px;
    min-height: 80px;
  }

  .hero-skills button {
    min-width: 64px;
  }

  .support-squad {
    display: none;
  }

  body[data-screen="game"] .mobile-rotate strong {
    font-size: 1.5rem;
  }

  body[data-screen="game"] .mobile-rotate p {
    font-size: .875rem;
  }
}

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

  .opening-film.is-playing .opening-title-card {
    transform: none;
  }

  .opening-film.is-playing > :not(.opening-title-card, .skip-opening) {
    display: none;
  }
}
