﻿:root {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  color: #18394b;
  background: #113b52;
  font-synthesis: none;
  --ink: #18394b;
  --teal: #087f9b;
  --line: #c5d5dc;
  --cream: #fffdf4;
  --gold: #ffd178;
}
* {
  box-sizing: border-box;
  min-width: 0;
}
body {
  margin: 0;
  overflow: hidden;
  word-break: keep-all;
  text-wrap: pretty;
}
.phrase-tail {
  white-space: nowrap;
}
button,
input,
textarea {
  font: inherit;
}
button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdf6;
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.25;
  transition: background 0.15s;
  touch-action: manipulation;
}
button:hover {
  background: #e4f5fb;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #efa82a;
  outline-offset: 2px;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button.primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
button.selected {
  background: #ffde8e;
  border-color: #a96715;
  box-shadow: inset 0 -3px #c4872d;
}
p,
li,
button,
h1,
h2,
h3,
span {
  word-break: keep-all;
  text-wrap: pretty;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 24px;
}
h3 {
  font-size: 18px;
}
.small {
  font-size: 1rem;
  font-weight: 500;
  color: #47616f;
}
[hidden] {
  display: none !important;
}
#app {
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-rows: 50px 40px minmax(0, 1fr) auto 54px;
  padding: 0 12px;
}
#topbar {
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #f6faff;
}
.brand {
  background: none;
  color: inherit;
  border: 0;
  font-size: 22px;
  padding: 0;
  letter-spacing: -1px;
  white-space: nowrap;
}
.brand:hover {
  background: none;
  color: #ffd178;
}
#hud {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#hud b {
  font-size: 21px;
  margin-left: 7px;
  color: #ffda7c;
}
#timeLabel {
  min-width: 48px;
}
#pause {
  padding: 6px 15px;
}
#mission {
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 15px;
  background: #1d5268;
  color: #fff;
  padding: 6px 16px;
  border-radius: 12px 12px 0 0;
}
#mission b {
  white-space: nowrap;
  color: #ffda7c;
}
#task {
  line-height: 1.35;
}
#workspace {
  grid-row: 3;
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  background: #a7d6df;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
}
#field {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
#scene {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#sceneLabels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.world-label {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fffdf4eb;
  border: 1px solid #8caab5;
}
.world-label.pick {
  pointer-events: auto;
  cursor: pointer;
}
.world-label.drop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: var(--leader-length, 0px);
  height: 1px;
  background: #416a7b;
  transform: rotate(var(--leader-angle, 0rad));
  transform-origin: left center;
  pointer-events: none;
  z-index: -1;
}
.world-label.pad-number {
  border-radius: 50%;
  min-width: 26px;
  height: 26px;
  padding: 2px;
  box-shadow: 0 2px 3px #18394b33;
}
.world-label.station {
  background: #164651;
  color: white;
}
#fieldCaption {
  position: absolute;
  top: 10px;
  left: 14px;
  color: #214f66;
  font-weight: 650;
}
#selection {
  position: absolute;
  bottom: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  pointer-events: none;
}
#selection:not(:empty) {
  background: #fffdf5f0;
  padding: 7px 10px;
  border-radius: 10px;
  box-shadow: 0 2px 10px #18394b20;
}
#selection > * {
  pointer-events: auto;
}
#selection p {
  margin-right: auto;
}
#selection button {
  padding: 6px 9px;
}
#sidebar {
  background: #f7faf9;
  border-left: 1px solid #c6d8df;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  min-height: 0;
}
.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-heading h2 {
  font-size: 18px;
}
.side-heading button {
  padding: 4px 7px;
}
#story {
  overflow: auto;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}
.bubble {
  padding: 8px;
  border-radius: 0 10px 10px 10px;
  background: #e5f0f5;
  line-height: 1.5;
  flex-shrink: 0;
}
.bubble strong {
  display: block;
  color: #23576d;
  margin-bottom: 3px;
}
.bubble p {
  word-break: keep-all;
  text-wrap: pretty;
}
.bubble.self {
  background: #fff0ca;
  margin-left: 12px;
  border-radius: 10px 0 10px 10px;
}
.bubble img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  float: left;
  margin: 0 7px 3px 0;
}
#clues {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
#clues h3 {
  font-size: 16px;
}
#clueList {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.clue {
  border-radius: 5px;
  padding: 4px 6px;
  color: #47616f;
}
.clue.open {
  background: #fff0cb;
  color: #5d4b20;
  width: 100%;
}
#dock {
  grid-row: 4;
  padding: 7px 0 0;
  display: grid;
  gap: 6px;
}
#towerRow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
#towerRow button {
  padding: 4px 6px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: left;
}
#towerRow button img {
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  object-fit: contain;
}
#towerRow button span {
  line-height: 1.25;
}
#towerRow button small {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  margin-top: 2px;
}
#padRow {
  display: flex;
  gap: 5px;
  align-items: center;
  color: white;
}
#padRow button {
  padding: 5px 7px;
  flex: 1;
}
#padRow .pad-title {
  margin-right: 4px;
}
#inspectDrop {
  flex: 1.6 !important;
  white-space: nowrap;
}
#controls {
  grid-row: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#tools,
.actions {
  display: flex;
  gap: 6px;
}
#tools button {
  padding: 7px 10px;
}
.actions button {
  min-width: 88px;
}
#next {
  min-width: 94px;
}
#next.ready {
  animation: ready 1.2s ease-in-out infinite;
  background: #ffd178;
  border-color: #ffd178;
  color: #15394c;
}
#showStory {
  display: none;
}
#screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #f4f7f7;
  overflow: hidden;
}
#screen:empty {
  display: none;
}
.screen-inner {
  height: 100%;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.eyebrow {
  color: #346378;
  font-weight: 750;
}
.start {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 32px 50px;
  isolation: isolate;
}
.cover-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(135deg, #c9f0ff, #56b6c7);
  overflow: hidden;
}
.cover-art .start-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
}
.cover-art:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #edfaffee 0%, #edfaffc9 28%, #edfaff22 60%, transparent 75%);
}
.cover-art > :not(img) {
  display: none;
}
.cover-art.image-failed > :not(img) {
  display: block;
}
.cover-river {
  position: absolute;
  width: 150%;
  height: 90px;
  top: 48%;
  background: #c4f8ff;
  transform: rotate(-20deg);
  border: 8px solid #e1edb9;
}
.cover-tower {
  position: absolute;
  width: 65px;
  height: 95px;
  background: #f8ecd3;
  border: 8px solid #d7c99c;
  border-radius: 15px;
}
.cover-tower.a {
  left: 65%;
  top: 22%;
}
.cover-tower.b {
  right: 10%;
  bottom: 13%;
}
.cover-drop {
  position: absolute;
  width: 40px;
  height: 50px;
  background: #829eb1;
  border-radius: 55%;
  left: 70%;
  top: 60%;
}
.start-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  max-width: 520px;
}
.start h1 {
  font-size: clamp(42px, 5.1vw, 68px);
  letter-spacing: -3px;
  line-height: 1.12;
  color: #123f5d;
}
.start h2 {
  font-size: 22px;
  color: #236078;
}
.start p {
  line-height: 1.6;
}
.start label {
  margin-top: 14px;
  font-weight: 750;
}
.entry {
  display: flex;
  gap: 8px;
  align-items: center;
}
.entry input {
  width: 170px;
  border: 1px solid #a3bac6;
  border-radius: 9px;
  padding: 10px;
  background: white;
}
.start-cast {
  position: absolute;
  right: 10%;
  bottom: 0;
  width: 36%;
  height: 76%;
  pointer-events: none;
}
.start-cast img {
  position: absolute;
  object-fit: contain;
  width: 90%;
  height: 100%;
  bottom: 0;
}
.start-cast .captain-full {
  right: 14%;
}
.start-cast .rit-full {
  right: -25%;
  width: 66%;
  height: 65%;
}
.stage-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.stage-heading p {
  margin-left: auto;
}
.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.stage-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  overflow: hidden;
  background: #fff;
  border: 1px solid #a8c9d8;
  border-radius: 12px;
  box-shadow: 0 3px 0 #c4dce5;
}
.stage-card:hover {
  border-color: #087f9b;
  box-shadow: 0 0 0 3px #087f9b;
}
.mini-art {
  flex: 1;
  min-height: 0;
  position: relative;
  width: 100%;
  background: linear-gradient(140deg, #b9d99e 35%, #8ed9e5 36%, #8ed9e5 60%, #c4e6a5 61%);
  display: grid;
  place-items: center;
  font-size: 36px;
}
.mini-art img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge {
  display: inline-block;
  font-size: 1rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: #ffdc8c;
  color: #4c3e1c;
}
.mini-art .badge {
  position: absolute;
  left: 8px;
  top: 8px;
  box-shadow: 0 2px 8px #18394b33;
}
.stars {
  color: #976116;
}
.mini-art .stars {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 21px;
  line-height: 1;
  color: #ffd576;
  background: #123d53e8;
  border-radius: 6px;
  padding: 4px 6px;
  letter-spacing: 1px;
}
.stage-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 10px;
  width: 100%;
}
.stage-line h3 {
  font-size: 1rem;
  line-height: 1.35;
}
.stage-pages {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 13px;
  color: #3d5e70;
  white-space: nowrap;
}
.stage-detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
  flex: 1;
  min-height: 0;
}
.brief-info,
.dialogue {
  border-radius: 12px;
  padding: 16px 20px;
  overflow: auto;
}
.brief-info {
  background: #fff;
}
.brief-info > .badge {
  display: none;
}
.brief-info p {
  line-height: 1.5;
  margin: 7px 0;
}
.brief-info h3 {
  margin-top: 10px;
}
.curious-list {
  padding-left: 22px;
  line-height: 1.5;
  margin: 7px 0 0;
}
.dialogue {
  background: #e0eff6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.portrait {
  width: 88px;
  height: 88px;
  object-fit: contain;
  flex-shrink: 0;
}
.dialogue p {
  font-size: 19px;
  line-height: 1.65;
}
.question-layout {
  max-width: 850px;
  width: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.question-layout h2 {
  font-size: 23px;
  line-height: 1.5;
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choices button {
  text-align: left;
  padding: 12px 16px;
  min-height: 46px;
}
.choices button.correct {
  background: #d7edcf;
  border-color: #5f9e6b;
  opacity: 1;
}
.choices button.wrong {
  background: #ffe5d9;
  border-color: #d78a69;
}
.feedback {
  min-height: 36px;
  line-height: 1.5;
  color: #285569;
}
.question-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #47616f;
}
.writing-box {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
  flex: 1;
  min-height: 0;
}
.writing-copy {
  padding: 18px;
  border-radius: 12px;
  background: #e6f1f5;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
}
.writing-copy h3 {
  font-size: 21px;
  line-height: 1.6;
}
.writing-copy p {
  line-height: 1.6;
}
.writing-input {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
}
.writing-input textarea {
  width: 100%;
  flex: 1;
  min-height: 90px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  line-height: 1.7;
  background: #fffdf7;
  color: var(--ink);
}
.writing-input .entry {
  justify-content: space-between;
}
.result-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 26px;
  margin: auto;
  max-width: 900px;
  width: 100%;
  min-height: 0;
}
.result-medal {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 16px;
  background: #dcedf1;
  padding: 16px;
}
.result-medal .result-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.17;
  z-index: -1;
}
.result-medal .score {
  font-size: 54px;
  font-weight: 850;
  letter-spacing: -3px;
}
.result-medal img:not(.result-scene) {
  width: 100px;
  height: 100px;
  object-fit: contain;
}
.score .small {
  letter-spacing: 0;
  margin-left: 8px;
}
.result-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.result-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.result-dialogue {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.55;
}
.result-dialogue .portrait {
  width: 65px;
  height: 65px;
}
.word {
  font: inherit;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: none;
  color: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  display: inline;
}
.word.key {
  color: #076f87;
  font-weight: 750;
}
.word:hover {
  background: #d7edf3;
}
#modalLayer {
  position: fixed;
  inset: 0;
  background: #112f497d;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal {
  background: #fffdf5;
  border-radius: 18px;
  padding: 25px;
  width: min(610px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  box-shadow: 0 20px 80px #14343144;
}
.modal h2 {
  margin-bottom: 15px;
}
.modal p {
  line-height: 1.6;
  margin-bottom: 12px;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.word-list {
  max-height: 310px;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 15px;
}
.word-list button {
  text-align: left;
}
.word-list p {
  margin: 5px 0 0;
}
#tourLayer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
.tour-highlight {
  position: fixed;
  border: 4px solid #ffcb64;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px #123a4777;
  z-index: 1;
}
.tour-card {
  position: absolute;
  width: min(365px, 80vw);
  background: #fffdf4;
  border: 2px solid #e9b85e;
  border-radius: 16px;
  padding: 19px;
  pointer-events: auto;
  box-shadow: 0 14px 50px #16424866;
  z-index: 2;
}
.tour-card p {
  line-height: 1.55;
  margin: 12px 0;
}
.tour-card .modal-actions {
  justify-content: flex-end;
}
#toast {
  position: fixed;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  background: #193f48;
  color: white;
  border-radius: 12px;
  padding: 6px 12px;
  line-height: 1.35;
  pointer-events: none;
  max-width: 80vw;
  z-index: 55;
  box-shadow: 0 6px 25px #163b4244;
}
.story-folded #workspace {
  grid-template-columns: minmax(0, 1fr);
}
.story-folded #sidebar {
  display: none;
}
.story-folded #showStory {
  display: block;
}
body:not(.in-battle) #dock,
body:not(.in-battle) #speed,
body:not(.in-battle) #waveStart,
body:not(.in-battle) #showStory {
  display: none;
}
body:not(.in-battle) #workspace {
  grid-template-columns: minmax(0, 1fr);
}
body:not(.in-battle) #hud {
  visibility: hidden;
}
@keyframes ready {
  50% {
    box-shadow: 0 0 0 3px #ffd17855;
  }
}
@media (max-width: 1100px) {
  :root {
    font-size: 15px;
  }
  #app {
    padding: 0 10px;
    grid-template-rows: 48px 39px minmax(0, 1fr) auto 52px;
  }
  #topbar {
    gap: 12px;
  }
  .brand {
    font-size: 20px;
  }
  #hud {
    gap: 18px;
  }
  #hud b {
    font-size: 20px;
  }
  #workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  #sidebar {
    display: none;
  }
  #showStory {
    display: block;
  }
  body.story-open #sidebar {
    display: flex;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 310px;
    z-index: 6;
    box-shadow: -10px 0 25px #214d4a33;
  }
  #towerRow {
    gap: 4px;
  }
  #towerRow button {
    padding: 4px 3px;
    gap: 3px;
  }
  #towerRow button img {
    width: 34px;
    height: 42px;
    flex-basis: 34px;
  }
  #tools button {
    padding: 7px 8px;
  }
  .actions button {
    padding: 8px 10px;
  }
  .screen-inner {
    padding: 14px 18px;
    gap: 10px;
  }
  .start {
    padding: 25px 34px;
  }
  .start-copy {
    gap: 14px;
  }
  .start h1 {
    font-size: 52px;
  }
  .stage-grid {
    gap: 10px;
  }
  .stage-line {
    gap: 5px;
    padding: 10px 8px;
  }
  .stage-line h3 {
    font-size: 15px;
  }
  .stage-pages {
    font-size: 12px;
  }
  .stage-heading h2 {
    font-size: 22px;
  }
  .stage-detail {
    gap: 15px;
  }
  .brief-info,
  .dialogue {
    padding: 14px 16px;
  }
  .brief-info {
    padding-block: 10px;
  }
  .brief-info p,
  .curious-list {
    margin-top: 5px;
    margin-bottom: 5px;
  }
  .brief-info h3 {
    margin-top: 8px;
  }
  .dialogue p {
    font-size: 18px;
  }
  .question-layout h2 {
    font-size: 21px;
  }
}
@media (max-width: 900px) {
  #towerRow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #topbar {
    gap: 8px;
  }
  #hud {
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
/* Phase-two integration: one identity strip, one report button, paused helper. */
#hub-identity-status{display:none!important}
#hubStars{font-size:13px;white-space:nowrap}
#lostBar{position:fixed;top:0;left:0;right:0;z-index:10000;display:flex;align-items:center;justify-content:center;gap:12px;padding:8px;background:#fff2bb;color:#243a3a}
#linkStatus{font-size:13px;min-height:0;margin:6px 0}
#loginSeat{font-weight:700;margin:6px 0}
.start .entry{flex-wrap:wrap}
#askLayer{position:fixed;inset:0;background:#173a4688;z-index:9000;display:grid;place-items:center;padding:14px}
.ask-box{width:min(720px,96vw);max-height:calc(100dvh - 28px);display:flex;flex-direction:column;gap:8px;background:#fffdf5;color:#183d42;border:3px solid #338378;border-radius:18px;padding:18px;box-shadow:0 12px 48px #1235;overflow:auto;word-break:keep-all;text-wrap:pretty}
.ask-box h2,.ask-box p{margin:0}.ask-box h2{text-wrap:balance}.ask-head,.ask-actions{display:flex;justify-content:space-between;align-items:center;gap:8px}.ask-box>p{font-size:14px}.ask-box textarea{width:100%;resize:none;min-height:56px}.ask-box label{font-size:14px}
#qaList{flex:1;min-height:45px;max-height:210px;overflow:auto;background:#f2f7f3;border-radius:8px;padding:8px}.qa-question{font-weight:700;margin-top:8px}.qa-answer{white-space:pre-wrap}.qa-suggest{display:flex;flex-wrap:wrap;gap:5px}.qa-suggest button{font-size:13px;padding:6px 9px}.ask-box small{font-size:12px;color:#506a64}.ask-box #qaStatus{font-size:12px;min-height:18px}
@media(max-height:640px){.ask-box{padding:12px;gap:5px}#qaList{max-height:140px}.ask-box button{min-height:32px}.ask-box>p{font-size:13px}}

.word-nb {
  white-space: nowrap;
}

/* Combat graphics: fixed plinth numbers, drop states and quality selector. */
.world-label.pad-number {border-radius:5px;background:#193c49;color:#fff9db;border:2px solid #f4e0ac;min-width:25px;height:25px;box-shadow:0 2px 5px #102c4266;}
.world-label.pad-number.occupied {background:#526970;border-color:#b7cac8;}
.world-label.pad-number.selected {background:#ffe09a;color:#253c45;border-color:#fff4d4;}
.world-label.drop {border-radius:10px;background:#f5ffffed;border-color:#7d999e;font-size:13px;padding:1px 5px;}
.world-label.drop.tough {border:2px solid #273d48;}
.world-label.drop.boss {border:2px solid #273d48;font-weight:900;}
.world-label.drop.danger {border-color:#c36533;background:#fff0cf;}
.world-label.drop.rebound {outline:2px solid #ec9b42;}
#fieldCaption {background:#163c48d9;color:#f2f4e5;padding:4px 8px;border-radius:4px;font-size:13px;pointer-events:none;}
.gfx-quality {display:flex;align-items:center;gap:12px;margin:10px 0;}
.gfx-quality select {font:inherit;border:1px solid #8ba9ad;background:#fffef4;color:#183b49;border-radius:7px;padding:7px 14px;}

.world-label.station.danger {background:#a94e30;border-color:#ffe0a4;color:#fff9df;}

/* Round 2: daylight combat, local status markers and compact equipment cards. */
.in-battle #workspace {grid-template-columns:minmax(0,1fr);}
.in-battle #sidebar {display:none;}
.in-battle #showStory {display:block;}
.in-battle.story-open #sidebar {display:flex;position:absolute;right:0;top:0;bottom:0;width:260px;z-index:6;box-shadow:-8px 0 20px #245a4a33;}
.world-label.drop::after {display:none;}
.world-label.drop {font-size:12px;min-height:0;line-height:1.3;padding:1px 4px;box-shadow:0 1px 3px #15485822;}
.world-label.pad-number {min-width:22px;height:22px;font-size:12px;line-height:16px;border-width:1px;background:#496969;box-shadow:none;}
.world-label.drop-mark {font-size:14px;padding:0;border:0;background:transparent;color:#214b60;text-shadow:0 1px 1px white;pointer-events:none;line-height:1;}
.world-label.drop-mark.no-change {color:#714e14;text-shadow:0 0 2px #fff8b0;}
.world-label.drop-meter {padding:0;border:1px solid #315864;border-radius:3px;width:22px;height:5px;background:linear-gradient(to right,#fff7b6 var(--strength),#466d79 var(--strength));pointer-events:none;}
.world-label.drop-meter.boss-meter {width:120px;height:7px;}
#fieldCaption {background:#eefcffdd;color:#285765;font-size:12px;}
.in-battle #towerRow {display:flex;gap:4px;}
.in-battle #towerRow button {flex:1;max-width:195px;height:70px;min-height:70px;padding:4px;gap:4px;}
.in-battle #towerRow button img {width:44px;height:44px;flex-basis:44px;}
.in-battle #towerRow button span {font-size:14px;line-height:1.18;text-wrap:balance;}
.in-battle #towerRow button small {font-size:12px;margin-top:3px;}
.in-battle #towerRow [data-tower="sprayBase"],.in-battle #towerRow [data-tower="trapAcid"] {margin-left:6px;}
.in-battle #padRow button {background:#e8f0eb;min-height:28px;padding-block:4px;}

.in-battle #towerRow [data-tower="phenol"] span {font-size:13px;}

.in-battle #towerRow [data-tower="trapBase"] span {font-size:13px;}

.in-battle #selection {top:8px;bottom:auto;left:auto;right:10px;width:min(430px,calc(100% - 180px));}
.in-battle #selection p {margin:0;flex-basis:100%;font-size:13px;}

/* Round 3: one selection mode, readable equipment groups and impact feedback. */
.in-battle #towerRow {gap:4px;}
.in-battle #towerRow button {flex:1.05 1 0;min-width:0;border-top:4px solid #4c87a0;padding:3px 4px;gap:5px;}
.in-battle #towerRow button img {width:36px;height:52px;flex-basis:36px;object-fit:contain;transform:scale(1.14);}
.in-battle #towerRow button span {min-width:0;font-size:14px;line-height:17px;text-wrap:pretty;}
.in-battle #towerRow button small {font-size:12px;line-height:14px;margin-top:2px;}
.in-battle #towerRow [data-tower="litmus"] {flex-grow:.90;}
.in-battle #towerRow [data-tower="phenol"],.in-battle #towerRow [data-tower="trapBase"] {flex-grow:1.30;}
.in-battle #towerRow [data-tower="phenol"] span,.in-battle #towerRow [data-tower="trapBase"] span {font-size:14px;}
.in-battle #towerRow [data-tower^="spray"] {border-top-color:#bd854b;}
.in-battle #towerRow [data-tower^="trap"] {border-top-color:#7d9160;}
.in-battle #towerRow [data-tower="sprayBase"],.in-battle #towerRow [data-tower="trapAcid"] {margin-left:4px;}
.world-label.pad-number.selected {background:#d2f5fc;border:2px solid #36b8d4;color:#234d59;}
.world-label.pad-number.building {background:#fff0c4;border:2px solid #ffc857;color:#59451a;}
.in-battle #padRow button.selected {background:#d2f5fc;border-color:#36b8d4;}
.world-label.drop-meter {background:linear-gradient(to right,#fff7b6 0 var(--strength),#ef9e51 var(--strength) var(--previous-strength),#466d79 var(--previous-strength) 100%);}
.world-label.drop-meter.boss-meter {width:120px;height:8px;border-width:2px;z-index:3;}
.world-label.drop.rebound {background:#fff4da;border-color:#b65720;outline-color:#f39232;z-index:4;}
.world-label.boss-entry {width:280px;text-align:center;z-index:8;background:#315c67;border:2px solid #fff2bd;}
.world-label.station.impact {font-size:18px;background:#d85b3c;color:white;transform:translate(-50%,calc(-100% - 24px));z-index:7;}
#health.gfx-impact {outline:3px solid #d85b3c;outline-offset:4px;border-radius:4px;color:#fff0d6;}

/* Round 4: painted battlefield, compact grouped tools, isolated notifications. */
body:not(.in-battle) #sceneLabels {display:none;}
#toast {top:96px;max-width:calc(100vw - 32px);pointer-events:none;}
.in-battle #dock {padding-top:3px;gap:3px;}
.in-battle #towerRow {gap:8px;}
.in-battle .tower-group {flex:var(--count) 1 0;min-width:0;max-width:calc(var(--count) * 220px);}
.in-battle .tower-role {display:block;font-size:12px;line-height:14px;color:#d5e9e4;margin:0 0 2px 6px;}
.in-battle .tower-options {display:flex;gap:4px;}
.in-battle #towerRow button {height:58px;min-height:58px;max-width:none;padding:4px;gap:3px;border-width:2px;margin:0;}
.in-battle #towerRow button.selected {border:3px solid #ffc857;}
.in-battle #towerRow button img {width:40px;height:46px;flex-basis:40px;transform:scale(1.13);}
.in-battle #towerRow button span {font-size:13px;line-height:15px;word-break:keep-all;text-wrap:pretty;}
.in-battle #towerRow [data-tower="phenol"] span,.in-battle #towerRow [data-tower="trapBase"] span {font-size:13px;}
.in-battle #towerRow button small {line-height:13px;margin-top:1px;}
.in-battle #padRow button {min-height:24px;height:24px;padding:2px 8px;}
.in-battle #app {grid-template-rows:48px 39px minmax(0,1fr) auto 46px;}
.world-label.drop.urgent {border-color:#c04435;background:#ffe2d8;}
.world-label.drop-meter.boss-meter {z-index:3;box-shadow:0 1px 2px #234b65;}
.world-label.station.source {font-size:12px;}

.in-battle .tower-group:last-child {flex-grow:2.35;}
.in-battle #towerRow [data-tower="trapAcid"] {flex-grow:1.1;}

.in-battle #app {grid-template-rows:38px 32px minmax(0,1fr) auto 42px;}
.in-battle #topbar {min-height:0;}
.in-battle #topbar button {min-height:32px;padding-block:4px;}
.in-battle #taskbar {min-height:0;}
.in-battle #toast {top:80px;}

/* Round 5 battle readability: installed towers, upgrades and failed spray. */
.in-battle #towerRow button.gfx-rebound {outline:3px solid #f39a38;outline-offset:-3px;background:#fff0d8;}
.world-label.pad-number.occupied::before {content:'';position:absolute;left:50%;top:-8px;transform:translateX(-50%);width:5px;height:4px;border:1px solid #244754;background:#f4cb63;}
.world-label.pad-number[data-level="2"]::before {width:12px;background:linear-gradient(to right,#f4cb63 0 5px,#244754 5px 7px,#f4cb63 7px);}
.world-label.pad-number.building {font-size:14px;outline:3px dashed #ffd15c;outline-offset:2px;}
.world-label.station.impact {transform:translate(-50%,-100%);}

/* Round 6: local battle information, clear damage trails and body ownership. */
.world-label.drop-meter {width:24px;height:4px;background:linear-gradient(to right,#c4eff3 0 var(--strength),#fff0a8 var(--strength) var(--previous-strength),#466d79 var(--previous-strength) 100%);}
.world-label.drop-meter.boss-meter::after {content:'';position:absolute;left:calc(50% - 1px);top:6px;width:2px;height:10px;background:#ecf8f5;box-shadow:1px 0 #355766;}
.world-label.drop.rebound {font-size:13px;background:#fff4d8;color:#743c17;border-color:#f39a38;}
.world-label.station.impact {transform:translate(-50%,calc(-100% - 18px));}

/* Feature rooms keep the illustrated battlefield and cream research cards. */
.feature-open #dock{display:none}.feature-open #controls{visibility:hidden}
.features-enabled .stage-card .stars{display:none}
.challenge-stars:before{content:'도전';font-size:12px;line-height:20px;color:#315966;margin-right:3px}
.feature-screen{height:100%;padding:14px;display:flex;flex-direction:column;gap:12px;background:#e5f0f1;font-size:14px}
.feature-card{background:#fffdf6;border:1px solid #ccdde0;border-radius:12px;padding:18px;min-height:0}
.feature-card h2,.feature-overlay h2{font-size:21px;color:#16435b}
.feature-card h3{font-size:16px}
.feature-card header{display:flex;justify-content:space-between;align-items:center;gap:12px}
.feature-primary{background:#ffdc87!important;color:#183e51!important;border-color:#e9b449!important;box-shadow:inset 0 -3px #eab955}
.feature-footer{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-shrink:0;min-height:42px}
.feature-footer>span,.feature-footer>p{margin-right:auto;font-size:13px}
.feature-footer button{white-space:nowrap;min-height:40px}
.lab-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:14px;flex:1;min-height:0}
.lab-main{display:flex;flex-direction:column;gap:12px;padding:14px}
#labTimer{white-space:nowrap;background:#fff0c4;padding:9px;border-radius:8px;color:#775213}
.lab-tray{display:grid;grid-template-columns:repeat(var(--wells),minmax(0,1fr));gap:10px;flex:1;min-height:0;padding:12px;background:linear-gradient(145deg,#d5f5e8,#ebfaf4);border-radius:12px}
.lab-well{display:flex;flex-direction:column;gap:5px;align-items:stretch;text-align:center;position:relative;min-height:0}
.lab-well>b{font-size:15px;min-height:20px}
.well-art{position:relative;flex:1;min-height:55px;max-height:155px;background:linear-gradient(#fff,#e0e5e9);border:5px solid #f7faf9;border-radius:28%;box-shadow:0 3px 0 #b6c7cb,0 6px 6px #426b7040;overflow:hidden}
.well-liquid{position:absolute;inset:15%;border-radius:50%;background:#d4e0df;box-shadow:inset 3px 5px 9px #6b828650,0 2px white;transition:background 1s,transform .6s;transform:scale(.82)}
.filled .well-liquid{background:var(--liquid);transform:scale(1);box-shadow:inset 2px 4px 7px #7c919755,inset -5px -6px 7px #ffffff99}
.well-liquid:after{content:'';position:absolute;inset:12% 15% 64%;border-radius:50%;border-top:3px solid #ffffffb0}
.lab-paper{position:absolute;width:13%;height:62%;left:45%;top:20%;background:var(--paper);border:1px solid #ffffff90;transform:rotate(-20deg);opacity:0;box-shadow:2px 2px 3px #455e6150;transition:background 1s}
.observed .lab-paper{opacity:1}
.lab-pipette,.lab-tweezers{position:absolute;right:17%;top:-20px;transform:rotate(30deg);height:70px;width:12px;border:3px solid #789ca8;border-radius:8px 8px 3px 3px;background:#dcf9fb;opacity:0}
.lab-pipette:before{content:'';position:absolute;width:20px;height:26px;background:#344b60;border-radius:9px;left:-7px;top:-4px;box-shadow:inset 3px 2px #72899b}
.lab-tweezers{width:9px;background:transparent;border-radius:0;border-top:0}
.observing .lab-pipette,.observing .lab-tweezers{animation:lab-tool 1.2s ease both}
.lab-drip{position:absolute;top:40%;left:53%;width:8px;height:12px;border-radius:50%;background:#f0ccff;opacity:0}
.observing .lab-drip{animation:lab-drop 1s ease both}
.observing .well-liquid{animation:lab-ripple 1.1s ease}
.well-result{font-size:12px;min-height:32px;display:grid;place-content:center}
.lab-well button{font-size:13px;padding:8px 4px;min-height:36px}
#labSafety{font-size:12px;line-height:1.5;display:grid;grid-template-columns:1fr 1fr;gap:5px 12px}
.lab-record{display:flex;flex-direction:column;gap:10px;overflow:auto}
.color-row{display:grid;grid-template-columns:42% 58%;align-items:center;gap:5px;padding:10px 0;border-bottom:1px solid #e2e9e9;font-size:13px}
.color-row small{display:block;font-size:11px;font-weight:400;line-height:1.5;margin-top:4px;color:#486675}
.color-row.heading{color:#66838e;font-size:12px}
.color-dot{display:inline-block;width:12px;height:12px;border:1px solid #50697844;border-radius:50%;margin-right:8px}
.feature-source{font-size:12px;color:#66838e}
.feature-dialogue{display:flex;align-items:center;gap:10px;background:#e5f3f5;padding:12px;border-radius:10px;margin-top:auto;font-size:13px}
.feature-dialogue img{width:44px;height:44px;object-fit:contain}
body[data-screen=lab] #hud{visibility:visible}
.in-battle.plan-active #workspace{grid-template-columns:minmax(0,1fr) 31%}
#wavePlan{display:flex;flex-direction:column;gap:10px;margin:10px 10px 10px 0;overflow:hidden;font-size:13px;padding:14px}
#wavePlan h2{font-size:20px}
.wave-counts{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.drop-icon{background:#edf3f2;border-radius:8px;display:flex;flex-direction:column;align-items:center;padding:6px 3px;gap:2px;position:relative}
.drop-icon img{width:38px;height:38px;object-fit:contain}
.drop-icon.quick img{transform:scale(.8,1.12)}
.drop-icon.tough img{border-bottom:3px solid #496b78;border-radius:50%}
.drop-icon.boss img{transform:scale(1.15)}
.drop-icon b{font-size:20px}
#recommendedPads{border-top:1px solid #d2dfe0;padding-top:10px;flex:1}
#recommendedPads>div{padding-top:8px;display:grid;grid-template-columns:64px 1fr;gap:6px}
#recommendedPads b{color:#a16913}
#recommendedPads p{font-size:12px;line-height:1.5}
#wavePlanStart{align-self:flex-end}
.path-arrow{pointer-events:none!important;background:none!important;border:0!important;padding:0!important;width:38px;height:14px;transform:translate(-50%,-50%) rotate(var(--angle))!important;filter:drop-shadow(0 1px 1px #fff)}
.path-arrow:before{content:'';position:absolute;inset:0;background:#efa823;clip-path:polygon(0 35%,65% 35%,65% 0,100% 50%,65% 100%,65% 65%,0 65%);animation:route-pulse 1.5s infinite}
.world-label.pad-number.recommended{background:#ffe7a1;outline:3px solid #ffc64c;color:#684912;animation:pad-glow 1.5s infinite}
.feature-overlay{position:absolute;inset:10px;z-index:12;background:#e5f0f1;border:1px solid #c8d9dc;border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:12px;box-shadow:0 10px 35px #163f5633;font-size:14px}
.feature-body{flex:1;min-height:0;overflow:auto}
.feature-side{left:48%;background:#fffdf6}
.feature-side-open #selection{visibility:hidden}
.upgrade-heading{display:flex;gap:12px;align-items:center}
.upgrade-heading img{width:52px;height:52px;object-fit:contain}
.upgrade-heading span{font-size:12px;color:#607f8e}
.upgrade-steps{margin:12px 0;background:#eaf3f4;padding:9px;border-radius:7px;font-size:12px}
.branch-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.branch-card{display:flex;flex-direction:column;gap:9px;border:1px solid #c9dce1;border-radius:10px;padding:12px;background:#fffef9}
.branch-card:first-child{background:#fff4d3;border:2px solid #e9b342;padding:11px}
.branch-card h3{font-size:17px}.branch-card p{font-size:13px;line-height:1.6;min-height:42px}.branch-card>b{font-size:13px;color:#825713;margin-top:auto}
.branch-card button{font-size:13px}
.branch-art{height:52px;background:#edf4f3;border-radius:7px;display:flex;justify-content:center;align-items:center;gap:4px}
.branch-art img{width:35px;height:42px;object-fit:contain}.branch-art img:nth-of-type(n+2){width:24px}
.branch-ray{width:30px;height:5px;background:#67bfcd;clip-path:polygon(0 20%,70% 20%,70% 0,100% 50%,70% 100%,70% 80%,0 80%)}
.codex-layout{display:grid;grid-template-columns:18% 1fr;gap:14px;height:100%}
.codex-layout nav{display:flex;flex-direction:column;gap:10px;background:#fffdf6;border-radius:10px;padding:12px}
.codex-layout nav>span{font-size:13px;line-height:1.6;padding-top:12px}
[role=tab][aria-selected=true]{background:#ffdfa0;border-color:#edbb62}
.codex-content{display:flex;gap:14px;min-height:0;overflow:auto}
.codex-drops{width:37%;flex-shrink:0;display:flex;flex-direction:column;gap:8px;overflow:auto}
.codex-drop{display:flex;gap:10px;padding:10px;border:1px solid #cddfe0;border-radius:9px;background:#fffdf6;align-items:center}
.codex-drop img{width:48px;height:58px;object-fit:contain}.codex-drop h3{font-size:15px}.codex-drop p,.codex-drop small{font-size:12px;line-height:1.5}.codex-drop.locked{min-height:66px;background:#dce6e7;color:#526e7a}.codex-drop.locked>span{font-size:28px;padding:0 10px}
.codex-drop.tough img{border-bottom:3px solid #56727e;border-radius:50%}
.codex-reference{flex:1;background:#fffdf6;padding:16px;border-radius:10px}
.indicator-table{width:100%;background:#fffdf6;border-radius:10px;padding:12px}
.indicator-row{display:grid;grid-template-columns:25% 1fr 1fr;gap:10px;align-items:center;border-bottom:1px solid #dce6e7;padding:12px 0;font-size:13px}
.indicator-row span{background:#edf3f2;padding:10px;border-radius:7px;line-height:1.5}.indicator-row small{grid-column:1/-1;color:#69818b;font-size:11px}
#codexLabRecords{width:100%;overflow:auto;background:#fffdf6;padding:12px;border-radius:10px}
#codexLabRecords>section{margin-bottom:15px}
.new-card{position:absolute;right:12px;top:12px;z-index:4;display:flex;gap:8px;align-items:center;background:#fff4cc;font-size:12px;max-width:290px;text-align:left;box-shadow:0 3px 9px #294f6040;animation:card-enter .3s ease}
.new-card img{width:38px;height:42px;object-fit:contain}.new-card small{display:block;margin-top:4px}
#selection:not(:empty)~.new-card{top:auto;bottom:10px}
.feature-star{display:inline-block;flex-shrink:0;width:26px;height:26px;background:#c6d4d8;clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%)}
.feature-star.earned{background:#f5b53c}
.challenge-stars{position:absolute;right:10px;bottom:8px;display:flex;gap:4px;background:#fffdf1d9;border-radius:7px;padding:3px}
.challenge-stars .feature-star{width:20px;height:20px}
.challenge-layout{display:grid;grid-template-columns:44% 28% 1fr;gap:12px;height:100%}
.challenge-row{display:flex;align-items:center;gap:14px;background:#eef4f3;border:1px solid #d7e3e4;border-radius:9px;padding:10px 16px;margin-top:8px}
.challenge-row h3{font-size:15px}.challenge-row span{font-size:12px;color:#4d707e;display:block;margin-top:6px}
#challengeStage{font:inherit;font-size:13px;border:1px solid #c9dbe0;background:#fffdf6;color:#214c60;border-radius:6px;padding:6px;width:100%;margin-top:10px}
.endless-hero{background:linear-gradient(#183f5366,#143d51ed),url('assets/start-bg.webp') center/cover;color:white;border-radius:12px;display:flex;flex-direction:column;gap:18px;padding:20px;min-height:0}
.endless-hero h2{color:white;font-size:27px}.endless-hero p{font-size:14px;line-height:1.7}.endless-hero button{margin-top:auto}
#endlessBest{margin-top:auto;font-size:14px}#endlessBest strong,.endless-record{display:block;font-size:48px;color:#ffda81}#endlessBest small,.endless-record small{font-size:16px;color:white}
.ranking{display:flex;flex-direction:column;gap:10px}.ranking h2{font-size:18px}#classRanking{overflow:auto;flex:1;font-size:13px}#endlessMyRank{font-size:13px;background:#fff0bc;padding:10px;border-radius:7px}
.rank-row{display:flex;gap:9px;justify-content:space-between;padding:8px 0;border-bottom:1px solid #e1e9e9}.rank-row span{flex:1;overflow-wrap:anywhere}
#endlessMyRank:empty{display:none}
.result-challenges{display:flex;align-items:center;gap:8px}.result-challenges button{margin-left:auto;font-size:13px;padding:6px 10px}
.endless-result{display:grid;grid-template-columns:1fr 1fr;gap:14px;flex:1;min-height:0}
@keyframes lab-tool{0%,100%{opacity:0;translate:0 -18px}30%,75%{opacity:1;translate:0 10px}}
@keyframes lab-drop{0%,40%{opacity:0;translate:0 -20px}50%{opacity:1}95%,100%{opacity:0;translate:0 18px}}
@keyframes lab-ripple{50%{scale:1.06}}
@keyframes route-pulse{50%{translate:7px 0;opacity:.65}}
@keyframes pad-glow{50%{box-shadow:0 0 0 9px #ffdf7370}}
@keyframes card-enter{from{translate:15px 0;opacity:0}to{translate:0;opacity:1}}
@media(max-width:1100px){
 .feature-screen{padding:10px;gap:8px}.lab-layout{grid-template-columns:60% 1fr;gap:10px}.lab-main{padding:10px;gap:8px}.lab-record{padding:12px;gap:7px}.lab-tray{gap:6px;padding:8px}.lab-tray[style*="4"]{grid-template-columns:repeat(2,1fr)}.lab-tray[style*="4"] .lab-well{display:grid;grid-template-columns:70px 1fr;gap:3px 8px;text-align:left;align-items:center}.lab-tray[style*="4"] .well-art{grid-column:1;grid-row:1/4;height:84px;min-height:0}.lab-tray[style*="4"] .lab-well>b{font-size:13px}.lab-tray[style*="4"] .well-result{min-height:0;place-content:start;font-size:11px}.lab-tray[style*="4"] button{grid-column:2;min-height:30px;font-size:12px;padding:4px}.lab-well>b{font-size:13px}.color-row{padding:7px 0;font-size:12px}.lab-record h2{font-size:20px}.feature-dialogue{font-size:12px;padding:8px}.feature-footer{gap:7px}.feature-footer>span{font-size:11px;max-width:260px}.feature-footer button{font-size:13px}#labSafety{font-size:11px;gap:4px 7px}
 .in-battle.plan-active #workspace{grid-template-columns:minmax(0,1fr) 34%}#wavePlan{gap:5px;padding:10px;margin:8px 8px 8px 0}#wavePlan h2{font-size:18px}.wave-counts{grid-template-columns:repeat(4,1fr);gap:4px}.drop-icon img{width:30px;height:30px}.drop-icon b{font-size:17px}#recommendedPads{padding-top:5px}#recommendedPads>div{padding-top:5px;grid-template-columns:60px 1fr}#recommendedPads p{font-size:11px}#wavePlan>p{font-size:12px}#wavePlanStart{font-size:12px;padding:6px 10px}
 .feature-overlay{padding:12px;gap:8px}.feature-side{left:39%;inset-block:6px}.feature-side>header h2{font-size:18px}.upgrade-heading img{width:38px;height:42px}.upgrade-heading h2{font-size:18px}.upgrade-steps{margin:6px 0;padding:6px}.branch-card{gap:6px;padding:9px}.branch-card:first-child{padding:8px}.branch-card h3{font-size:15px}.branch-card p{font-size:12px;min-height:38px}.branch-art{height:38px}.branch-art img{height:34px}.feature-side .feature-footer{min-height:32px}.feature-side .feature-footer button{min-height:32px}
 .codex-layout{display:flex;flex-direction:column;gap:8px}.codex-layout nav{flex-direction:row;align-items:center;padding:8px}.codex-layout nav>span{margin-left:auto;padding:0}.codex-drops{width:100%;display:grid;grid-template-columns:1fr 1fr;overflow:visible}.codex-reference{display:none}.codex-drop{padding:9px}.codex-drop p{font-size:12px}.indicator-row{padding:9px 0}.indicator-table{padding:10px}.codex-content{overflow:auto}
 .challenge-layout{grid-template-columns:48% 1fr;gap:10px}.challenge-layout>.feature-card:first-child{grid-row:1/3;padding:12px}.challenge-row{padding:12px 10px}.challenge-row h3{font-size:14px}.challenge-layout .endless-hero{padding:12px;gap:7px;display:grid;grid-template-columns:1fr 1fr}.endless-hero h2{font-size:24px}.challenge-layout .endless-hero .badge{grid-column:1/-1;font-size:12px}.challenge-layout #endlessBest{grid-column:2;grid-row:2/4;margin:0}.challenge-layout #endlessBest strong{font-size:35px}.challenge-layout .endless-hero p{font-size:12px}.challenge-layout .endless-hero button{grid-column:1/-1}.challenge-layout .ranking{padding:10px;gap:5px}.challenge-layout .ranking h2{font-size:16px}.rank-row{padding:4px 0}#endlessMyRank{padding:6px}.result-challenges{gap:5px}.result-challenges .feature-star{width:21px;height:21px}
 #tools{gap:4px}#tools button{font-size:12px;padding-inline:8px}
}
@media(prefers-reduced-motion:reduce){.path-arrow:before,.recommended,.observing *,.new-card{animation:none!important}}
.codex-feature{background:#fffdf6;border:1px solid #cadde1;border-radius:10px;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.codex-feature-art{min-height:90px;flex:1;display:grid;place-items:center;background:linear-gradient(#dff2f4,#eff7f4)}
.codex-feature-art img{width:125px;height:135px;object-fit:contain}.codex-feature-art>span{font-size:65px;color:#668491}
.codex-feature.strong .codex-feature-art img{scale:1.08}.codex-feature.quick .codex-feature-art img{scale:.78 1.08}.codex-feature.tough .codex-feature-art img{border-bottom:5px solid #56727e;border-radius:50%}.codex-feature.boss .codex-feature-art img{scale:1.15}
.codex-feature-copy{padding:16px;display:flex;flex-direction:column;gap:12px}.codex-feature-copy h2{font-size:23px}.codex-feature-copy p{line-height:1.6;font-size:14px}.codex-tip{background:#fff0c3;border-radius:8px;padding:10px}
.codex-card-picks{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;flex-shrink:0}.codex-card-picks .codex-drop{height:48px;min-height:0;padding:3px;justify-content:center;font-size:23px}.codex-card-picks .codex-drop img{height:40px;width:36px}.codex-card-picks [aria-pressed=true]{background:#fff0bf;border-color:#e8b54a}
@media(max-width:1100px){.codex-drops{display:flex;flex-direction:column}.codex-feature{flex-direction:row}.codex-feature-art{width:32%;flex:none}.codex-feature-copy{flex:1;justify-content:center;gap:12px}.codex-feature-art img{width:130px;height:150px}.codex-card-picks .codex-drop{height:48px}.codex-card-picks{gap:8px}.codex-feature-copy h2{font-size:25px}}

/* Painted battle sprites: meters stay attached to their own body. */
.world-label.drop-meter.boss-meter::after {height:var(--connector,16px);width:2px;top:6px;background:#f4ffff;box-shadow:1px 0 #315567;}
.world-label.pad-number.occupied::before {width:7px;height:5px;top:-10px;}
.world-label.pad-number[data-level="2"]::before {width:16px;background:linear-gradient(to right,#f4cb63 0 7px,#244754 7px 9px,#f4cb63 9px);}
.world-label.pad-number[data-level="3"]::before {width:25px;background:repeating-linear-gradient(to right,#f4cb63 0 7px,#244754 7px 9px);}

/* Graphics round 9: rotating painted-metal nozzle layer, battle only. */
.gfx-nozzles{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1;}
body:not(.in-battle) .gfx-nozzles{display:none;}
.world-label.drop-mark{font-size:12px;text-shadow:1px 0 #effaff,-1px 0 #effaff,0 1px #effaff,0 -1px #effaff;}

/* Persistent coaching reserves space above the river instead of covering targets. */
.in-battle #app{grid-template-rows:38px 114px minmax(0,1fr) auto 42px}
.in-battle #mission{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:27px minmax(0,1fr);gap:3px 12px;padding:3px 12px 6px}
#battleCoach{grid-column:1/-1;display:flex;align-items:center;gap:10px;background:#fff8de;color:#173f53;border-radius:9px;padding:7px 10px;min-height:0}
#battleCoach[hidden]{display:none}
#battleCoach>img{width:43px;height:51px;object-fit:contain;flex-shrink:0}
#battleCoach>div{flex:1}#battleCoach b{color:#795011;font-size:15px;display:block;margin-bottom:3px}
#battleCoach p{font-size:15px;line-height:1.45}#battleCoach button{font-size:12px;padding:7px;flex-shrink:0}
#hubStars{background:#fff3cf;color:#755010;border:1px solid #e7be60;flex-shrink:0}
.coach-guide{display:flex;flex-direction:column;gap:13px;font-size:15px;line-height:1.55}
.coach-guide table{border-collapse:collapse;width:100%;font-size:14px}.coach-guide th,.coach-guide td{padding:9px;text-align:left;border:1px solid #cadadf}.coach-guide th{background:#e9f3f3}
.coach-dot{display:inline-block;width:13px;height:13px;border-radius:50%;margin-right:5px;border:1px solid #456}.coach-dot.red{background:#d94040}.coach-dot.blue{background:#3b6fd9}
.earned-stars{display:flex;flex-direction:column;gap:13px;line-height:1.55}.earned-stars>b{font-size:42px;color:#a06808}.star-rule{display:flex;gap:12px;align-items:center;padding:13px;background:#fff1c8;border-radius:10px}.star-rule strong{margin-left:20px}
#rewardNotice{position:fixed;right:20px;top:45px;z-index:120;background:#fff1c1;color:#67450d;border:2px solid #e8bd55;border-radius:12px;padding:10px 17px;font-size:19px;font-weight:750;pointer-events:none;box-shadow:0 3px 12px #18394b33}
@media(max-width:1100px){#battleCoach{gap:7px;padding:5px 8px}#battleCoach p{font-size:14px}#battleCoach b{font-size:14px}#battleCoach>img{width:34px;height:43px}#battleCoach button{font-size:11px;padding:6px}#topbar{gap:12px}#hud{gap:12px}}
@media(prefers-reduced-motion:reduce){#hubStars{transition:none}}

@media(max-height:700px){
 #wavePlan{gap:5px;padding:10px;margin:8px 8px 8px 0}#wavePlan h2{font-size:18px}
 .drop-icon img{width:30px;height:30px}.drop-icon b{font-size:17px}
 #recommendedPads{padding-top:5px}#recommendedPads>div{padding-top:5px}
 #wavePlanStart{font-size:12px;padding:6px 10px;flex-shrink:0}
}
