@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=DM+Sans:wght@400;500;600&display=swap");
:root {
  color-scheme: dark;
  font-family: "DM Sans", sans-serif;
  color: #eee9d6;
  background: #101d22;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
}
button:focus-visible {
  outline: 2px solid #e8d696;
  outline-offset: 5px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: 0;
  display: block;
}
.hidden {
  display: none !important;
}
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 51% 41%,
    transparent 35%,
    #06131980 100%
  );
}
#damage-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 110px #be3841;
  opacity: 0;
  transition: opacity 0.3s;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: #c6c7a9;
}
#loading {
  position: fixed;
  inset: 0;
  background: #102127;
  display: grid;
  place-content: center;
  text-align: center;
  letter-spacing: 3px;
  font-size: 11px;
}
.seed-mark {
  font-size: 50px;
  color: #e9d195;
}
#title-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    90deg,
    #071419d9 0%,
    #07141955 40%,
    transparent 65%
  );
}
.title-copy {
  position: absolute;
  top: 50%;
  left: 7%;
  transform: translateY(-50%);
}
h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(90px, 12vw, 170px);
  font-weight: 400;
  letter-spacing: 0.13em;
  line-height: 0.95;
  margin: 20px 0 12px;
  text-shadow: 0 3px 50px #efffc533;
}
.subtitle {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 29px;
  color: #dfd5b5;
  margin: 0 0 27px;
}
.intro {
  font-size: 13px;
  line-height: 1.9;
  color: #b5c3bf;
}
.title-copy > button,
.modal button,
#resume-button {
  background: #dfd3a6;
  color: #1c312c;
  padding: 15px 25px;
  min-width: 205px;
  border: 1px solid #fff3;
  letter-spacing: 0.4px;
  margin-top: 24px;
  border-radius: 2px;
  transition:
    background 0.15s,
    transform 0.15s;
}
.title-copy > button:hover,
.modal button:hover {
  background: #faedbd;
  transform: translateY(-2px);
}
.title-copy > button span {
  margin-left: 36px;
}
.title-small {
  font-size: 9px;
  letter-spacing: 2px;
  margin-top: 20px;
  color: #98afa5;
}
.title-bottom {
  position: absolute;
  bottom: 25px;
  left: 7%;
  right: 4%;
  display: flex;
  justify-content: space-between;
  color: #9cafaa;
  font-size: 11px;
}
.title-bottom button {
  background: none;
  color: #d8d7bd;
}
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#hud button {
  pointer-events: auto;
}
#resources {
  position: absolute;
  top: 25px;
  left: 28px;
  display: flex;
  gap: 25px;
  align-items: center;
  filter: drop-shadow(0 2px 8px #061316);
  padding: 12px 18px;
  background: linear-gradient(100deg, #10272bdd, #10272b77);
  border-bottom: 1px solid #b7c9a622;
  border-radius: 3px;
  backdrop-filter: blur(12px);
}
.heart-stat {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 170px;
}
.heart-icon {
  font-size: 33px;
  color: #d4e1ac;
}
.stat-label {
  font-size: 9px;
  letter-spacing: 1.9px;
  color: #c9d5c3;
}
.stat-label strong {
  font-size: 15px;
  letter-spacing: 0;
  float: right;
  margin-left: 18px;
  color: #f0ebce;
}
.tree-track {
  height: 4px;
  background: #e7e9c722;
  width: 135px;
  margin-top: 9px;
}
.tree-track i {
  height: 100%;
  width: 100%;
  display: block;
  background: #bdcf8a;
  transition:
    width 0.3s,
    background 0.3s;
}
.resource {
  display: flex;
  gap: 9px;
  align-items: center;
}
.resource-symbol {
  font-size: 28px;
  color: #b9c6a1;
}
.sap-symbol {
  color: #ebc980;
}
.resource b {
  display: block;
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.resource small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #adbcad;
  margin-top: 2px;
}
#time-controls {
  position: absolute;
  top: 30px;
  right: 28px;
  display: flex;
  gap: 5px;
}
#time-controls button {
  width: 33px;
  height: 33px;
  background: #12272bb3;
  border: 1px solid #a1bca22e;
  border-radius: 50%;
  font-size: 14px;
  color: #dbdfc8;
}
#time-controls button:hover {
  background: #446452;
}
#objective {
  position: absolute;
  top: 108px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  text-shadow: 0 2px 5px #05171a;
}
.objective-dot {
  width: 5px;
  height: 5px;
  background: #d5d9a3;
  transform: rotate(45deg);
}
#tide {
  position: absolute;
  right: 30px;
  top: 91px;
  text-align: right;
  text-shadow: 0 2px 5px #071719;
}
#tide-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: #c5d1b7;
  display: block;
}
#tide-time {
  font-family: "Cormorant Garamond", serif;
  font-size: 37px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.tide-track {
  height: 2px;
  background: #d3d3b322;
  width: 132px;
  margin-left: auto;
}
.tide-track i {
  display: block;
  height: 100%;
  background: #d8c6a3;
  width: 0;
}
#tide-state {
  display: block;
  font-size: 10px;
  color: #b5c6bd;
  margin-top: 8px;
}
.danger #tide-label,
.danger #tide-time {
  color: #ffc09b;
}
#announcements {
  position: absolute;
  left: 30px;
  bottom: 190px;
  width: 290px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.announcement {
  font-size: 11px;
  line-height: 1.65;
  color: #d8e2cf;
  text-shadow: 0 2px 4px #07232a;
  animation: arrive 0.35s ease-out;
  border-left: 2px solid #cadca077;
  padding: 4px 11px;
  background: linear-gradient(90deg, #142b32b3, transparent);
}
.announcement.danger {
  color: #ffbea0;
  border-color: #fb9b7b;
}
.announcement.good {
  color: #d2e9b5;
}
.announcement.warn {
  color: #f1ce8d;
}
@keyframes arrive {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
#action-hint {
  position: absolute;
  bottom: 152px;
  text-align: center;
  width: 100%;
  font-size: 11px;
  color: #dedfbf;
  text-shadow: 0 2px 6px #091f21;
}
#action-bar {
  position: absolute;
  bottom: 47px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  pointer-events: auto;
  padding: 5px;
  background: #0c202bcc;
  border: 1px solid #b5c49a33;
  border-radius: 6px;
  box-shadow: 0 8px 45px #06131666;
  backdrop-filter: blur(14px);
}
#action-bar button {
  position: relative;
  width: 108px;
  height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#52675933, #263e4333);
  border: 1px solid transparent;
  border-radius: 2px;
  transition:
    background 0.15s,
    border-color 0.15s;
  isolation: isolate;
}
#action-bar button:hover {
  background: #71846344;
  border-color: #abb89077;
}
#action-bar button.active {
  background: #7c8c5a44;
  border-color: #d7dd9e;
  box-shadow: inset 0 0 15px #d3d89018;
}
#action-bar button kbd {
  position: absolute;
  top: 5px;
  left: 7px;
  font:
    8px "DM Sans",
    sans-serif;
  color: #bbc4ab;
  letter-spacing: 0.5px;
}
.action-icon {
  font-family: Georgia, serif;
  font-size: 27px;
  line-height: 1;
  margin: 2px 0 5px;
  color: #dccf9e;
}
#action-bar strong {
  font-size: 11px;
  font-weight: 500;
}
#action-bar small {
  font-size: 9px;
  margin-top: 5px;
  color: #aabbad;
}
.tip {
  display: none;
  position: absolute;
  bottom: 101px;
  width: 210px;
  padding: 12px;
  line-height: 1.6;
  text-align: left;
  background: #172d31f5;
  border: 1px solid #a9bb9833;
  color: #dbe0ca;
  font-size: 11px;
  pointer-events: none;
}
#action-bar button:hover .tip {
  display: block;
}
.bloom-action {
  overflow: visible;
}
#action-bar button.bloom-action .action-icon {
  color: #b6e8dc;
}
.bloom-action i {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #a4dac6;
  width: 100%;
  z-index: -1;
}
#controls-line {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9db2ad;
  text-shadow: 0 1px 4px #072029;
}
#controls-line button {
  font-size: 10px;
  color: #c8d2b7;
  background: none;
}
#selection {
  position: absolute;
  right: 28px;
  bottom: 180px;
  max-width: 230px;
  padding: 14px 16px;
  background: #102a32cc;
  border-left: 2px solid #a7c79566;
  backdrop-filter: blur(10px);
}
#selection .eyebrow {
  font-size: 8px;
  letter-spacing: 2px;
}
#selection strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 500;
  margin: 5px 0;
}
#selection p {
  font-size: 11px;
  color: #b9cbbd;
  line-height: 1.6;
  margin: 0;
}
#arrival {
  position: absolute;
  top: 150px;
  left: 30px;
  font-size: 11px;
  background: #243a36e6;
  border: 1px solid #c7d4a455;
  padding: 12px 15px;
  max-width: 295px;
  pointer-events: auto;
}
#arrival span {
  display: block;
  margin-bottom: 8px;
}
#arrival button {
  background: none;
  color: #e0d39f;
  padding: 0;
  font-size: 11px;
}
#world-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.world-label {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 9px;
  color: #efeed3;
  white-space: nowrap;
  text-shadow: 0 2px 4px #071b1b;
  pointer-events: none;
  background: #09252688;
  border-radius: 3px;
  padding: 4px 7px;
}
.world-label i {
  display: block;
  height: 2px;
  background: #b5d79a;
  margin-top: 4px;
}
.world-label.enemy {
  color: #ffd5b4;
}
.world-label.enemy i {
  background: #fa9f76;
}
#pause-overlay {
  position: absolute;
  inset: 0;
  background: #07151f88;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: auto;
}
h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: 48px;
  line-height: 1.08;
  margin: 12px 0 20px;
}
.modal {
  position: fixed;
  inset: 0;
  background: #071821b8;
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 25px;
  overflow: auto;
}
.modal > div {
  width: min(550px, 100%);
  padding: 30px;
  text-align: center;
  background: #162b31eb;
  border: 1px solid #b4c7a62a;
  border-radius: 4px;
  box-shadow: 0 20px 100px #03151d77;
}
.modal p {
  font-size: 13px;
  line-height: 1.85;
  color: #b8cac0;
}
.modal small {
  font-size: 10px;
  color: #829e97;
}
.modal button {
  margin: 20px 5px 0;
  font-size: 12px;
}
.modal .secondary {
  background: none;
  color: #c4d0b9;
  border: 1px solid #84978455;
}
.modal dl {
  text-align: left;
  font-size: 12px;
  line-height: 1.6;
}
.modal dt {
  color: #dcd7b7;
  margin-top: 13px;
}
.modal dd {
  margin: 3px 0 0;
  color: #a5bfb6;
}
.modal .seed-content {
  width: min(900px, 100%);
}
.seed-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.seed-pair figure {
  margin: 0;
}
.seed-pair img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 2px;
}
.seed-pair figcaption {
  font-size: 10px;
  color: #9ab4a9;
  padding-top: 8px;
}
#end-stats {
  font-size: 12px;
  letter-spacing: 1px;
  color: #d6dcba;
  margin: 20px 0;
}
body.targeting #game {
  cursor: crosshair;
}
body.placing #game {
  cursor: crosshair;
}
@media (max-width: 800px) {
  #resources {
    top: 15px;
    left: 15px;
    gap: 13px;
    padding: 10px;
  }
  .heart-stat {
    min-width: 145px;
  }
  .heart-icon {
    font-size: 25px;
  }
  .tree-track {
    width: 115px;
  }
  .resource-symbol {
    display: none;
  }
  .resource b {
    font-size: 15px;
  }
  .resource small {
    font-size: 7px;
  }
  #time-controls {
    top: 87px;
    right: 15px;
  }
  #objective {
    top: 86px;
    left: 18px;
    max-width: 65%;
    font-size: 10px;
  }
  #tide {
    top: 140px;
    right: 18px;
  }
  #action-bar button {
    width: 92px;
  }
  #selection {
    bottom: 180px;
    right: 15px;
    max-width: 190px;
  }
  #announcements {
    left: 18px;
    width: 220px;
  }
  #arrival {
    top: 120px;
    left: 18px;
    max-width: 230px;
  }
  .title-copy {
    left: 7%;
  }
  .title-copy h1 {
    font-size: 95px;
  }
}
@media (max-width: 520px) {
  #resources {
    right: 15px;
    justify-content: space-between;
    gap: 8px;
  }
  .heart-stat {
    min-width: 125px;
  }
  .tree-track {
    width: 95px;
  }
  .heart-icon {
    display: none;
  }
  .stat-label {
    font-size: 8px;
  }
  .stat-label strong {
    font-size: 13px;
  }
  .resource b {
    font-size: 13px;
  }
  #action-bar {
    bottom: 52px;
    width: calc(100% - 20px);
    gap: 2px;
    padding: 3px;
  }
  #action-bar button {
    width: 20%;
    height: 79px;
  }
  #action-bar strong {
    font-size: 9px;
  }
  #action-bar small {
    font-size: 8px;
  }
  #action-bar button kbd {
    font-size: 7px;
    left: 3px;
  }
  .action-icon {
    font-size: 23px;
  }
  #action-hint {
    bottom: 145px;
    font-size: 10px;
    padding: 0 12px;
  }
  #controls-line {
    left: 15px;
    right: 15px;
    font-size: 8px;
    gap: 10px;
  }
  #controls-line span {
    max-width: 230px;
  }
  #controls-line button {
    font-size: 9px;
  }
  .tip {
    display: none !important;
  }
  #selection {
    display: none !important;
  }
  #announcements {
    bottom: 180px;
    width: 210px;
  }
  .announcement {
    font-size: 10px;
  }
  h2 {
    font-size: 36px;
  }
  .modal {
    padding: 12px;
  }
  .modal > div {
    padding: 22px;
  }
  .seed-pair {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .seed-pair img {
    height: 145px;
  }
  .title-copy h1 {
    font-size: 83px;
  }
  .subtitle {
    font-size: 24px;
  }
  .intro {
    font-size: 12px;
  }
  .title-bottom {
    font-size: 9px;
  }
  .title-small {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* Tower defense battlefield HUD. */
#vignette {
  background: radial-gradient(
    ellipse at 50% 45%,
    transparent 50%,
    #10292755 100%
  );
}
#resources {
  gap: 28px;
  padding: 13px 20px;
}
.life-symbol {
  color: #f0b092;
}
#objective {
  top: 103px;
}
#wave-call {
  position: absolute;
  top: 91px;
  right: 28px;
  text-align: right;
  pointer-events: auto;
}
#next-wave {
  background: #e0cf92;
  color: #283c2d;
  border: 1px solid #f5e0ad88;
  box-shadow: 0 4px 16px #081b2555;
  padding: 13px 17px;
  border-radius: 3px;
  font-size: 12px;
  min-width: 205px;
  display: flex;
  align-items: center;
  gap: 17px;
}
#next-wave span {
  font-size: 10px;
  padding: 3px 5px;
  border: 1px solid #6c714755;
}
#next-wave b {
  margin-left: auto;
}
#next-wave:disabled {
  background: #263e39;
  color: #c8d7bb;
  opacity: 1;
}
#wave-preview {
  display: block;
  font-size: 10px;
  margin-top: 9px;
  color: #e2dfc5;
  text-shadow: 0 1px 4px #071a21;
}
#action-bar {
  bottom: 45px;
}
#action-bar button {
  width: 103px;
  height: 85px;
}
#action-bar .ability {
  background: #5c83702b;
}
#action-bar .ability .action-icon {
  color: #bfe5d1;
}
#action-hint {
  bottom: 147px;
}
#world-labels {
  pointer-events: none;
}
#world-labels .site {
  pointer-events: auto;
  border: 1px solid #d5cb9c77;
  background: #29453aed;
  padding: 5px 10px;
  font-size: 10px;
  min-width: 35px;
  border-radius: 12px;
  color: #f2e4b4;
  cursor: pointer;
  box-shadow: 0 2px 6px #0b241c55;
}
#world-labels .site:hover,
#world-labels .site.chosen {
  background: #e2d499;
  color: #273c2d;
  border-color: #fff3ca;
}
#world-labels .route {
  font-size: 8px;
  letter-spacing: 1.5px;
  background: #1b302d99;
  color: #ffedc6;
}
#world-labels .enemy {
  font-size: 9px;
  padding: 2px 5px;
  background: #422e2bd9;
  color: #ffdaaa;
}
#selection {
  bottom: 177px;
  max-width: 270px;
  pointer-events: auto;
}
#tower-commands {
  display: flex;
  gap: 7px;
  margin-top: 13px;
}
#tower-commands button {
  font-size: 10px;
  background: #d3cb96;
  color: #213c30;
  padding: 8px 10px;
  border-radius: 2px;
}
#tower-commands #sell-button {
  background: #61776444;
  color: #d3dcc5;
}
#announcements {
  bottom: 180px;
  max-width: 250px;
}
.title-copy {
  left: 6%;
}
#title-screen {
  background: linear-gradient(90deg, #071419db, #07141966 40%, transparent 72%);
}
@media (max-width: 900px) {
  #selection {
    bottom: 178px;
    max-width: 230px;
  }
  #action-bar button {
    width: 90px;
  }
  #wave-call {
    top: 134px;
    right: 15px;
  }
  #resources {
    gap: 18px;
  }
  #action-hint {
    font-size: 10px;
  }
  #controls-line span {
    max-width: 65%;
  }
}
@media (max-width: 620px) {
  #resources {
    right: auto;
    gap: 16px;
    padding: 10px 14px;
  }
  #time-controls {
    top: 21px;
    right: 12px;
    gap: 3px;
  }
  #time-controls button {
    width: 25px;
    height: 25px;
    font-size: 11px;
  }
  #objective {
    top: 88px;
    max-width: 90%;
  }
  #wave-call {
    top: 126px;
  }
  #next-wave {
    min-width: 175px;
    padding: 10px 12px;
  }
  #action-bar {
    width: calc(100% - 16px);
  }
  #action-bar button {
    width: 16.666%;
    height: 78px;
  }
  #action-bar strong {
    font-size: 8px;
  }
  #action-bar small {
    font-size: 7px;
  }
  #action-bar kbd {
    font-size: 7px;
  }
  #action-hint {
    bottom: 140px;
  }
  #selection {
    display: block !important;
    bottom: 161px;
    right: 12px;
    max-width: 210px;
    padding: 10px 12px;
  }
  #selection.hidden {
    display: none !important;
  }
  #selection strong {
    font-size: 20px;
  }
  #selection p {
    font-size: 10px;
  }
  #announcements {
    max-width: 150px;
    bottom: 169px;
    left: 12px;
  }
  #controls-line {
    font-size: 8px;
  }
  .tip {
    display: none !important;
  }
  #world-labels .site {
    font-size: 9px;
    padding: 5px 8px;
  }
  .resource-symbol {
    display: none;
  }
}

/* Theme creation is a separate entry flow; gameplay keeps its established HUD. */
:root {
  --theme-accent: #bceaa1;
  --theme-surface: #213d37;
}
#creator {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: radial-gradient(
    ellipse at 78% 42%,
    #25443b 0,
    #152b28 37%,
    #101c1e 72%
  );
  color: #ebe9d9;
  padding: 34px 5vw 24px;
}
.creator-brand,
.creator-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #90a79c;
}
.creator-brand span:first-child {
  font-family: Georgia, serif;
  font-size: 25px;
  letter-spacing: 0.18em;
  color: #e5dfc2;
}
.creator-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 5vw;
  max-width: 1280px;
  margin: 6vh auto 5vh;
  min-height: 65vh;
}
.creator-copy .eyebrow {
  color: #b3c59e;
  font-size: 10px;
  letter-spacing: 0.19em;
}
#creator h1 {
  font-family: Georgia, serif;
  font-size: clamp(42px, 4.7vw, 72px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.045em;
  margin: 23px 0;
}
#creator h1 em {
  font-weight: 400;
  color: #bdd5a2;
}
.creator-copy > p {
  font-size: 14px;
  line-height: 1.8;
  color: #a9bbb1;
  margin-bottom: 30px;
}
#theme-form label {
  display: block;
  font-size: 12px;
  margin-bottom: 11px;
  color: #e0e4d4;
}
#theme-input {
  display: block;
  resize: vertical;
  width: 100%;
  min-height: 85px;
  max-height: 180px;
  border: 1px solid #78938370;
  border-radius: 8px;
  background: #0c1b1c88;
  padding: 16px;
  color: #f2eddb;
  font: 16px/1.5 inherit;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
}
#theme-input:focus {
  border-color: #c1d4a2;
  box-shadow: 0 0 0 3px #b6d29e12;
}
.theme-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 22px;
}
.theme-suggestions button {
  border: 1px solid #74908155;
  border-radius: 30px;
  padding: 8px 11px;
  background: #27413777;
  color: #b8cab9;
  font-size: 10px;
}
.theme-suggestions button:hover {
  background: #49634c;
  color: #fff;
}
#generate-world {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background: #d4ddad;
  color: #24372d;
  border: 0;
  border-radius: 6px;
  padding: 17px 20px;
  font-size: 15px;
  font-weight: 600;
}
#generate-world:hover {
  background: #e6eac8;
}
#creator button:disabled {
  opacity: 0.55;
  cursor: wait;
}
#generation-status {
  color: #97ada1;
  font-size: 11px;
  line-height: 1.6;
  min-height: 35px;
  margin: 12px 0 5px;
  max-width: 520px;
}
#generation-status.error {
  color: #ffc1ac;
}
.quiet-button {
  background: none;
  border: 0;
  color: #bfcdb5;
  padding: 9px 0;
  font-size: 12px;
  margin-right: 16px;
}
.creator-preview {
  height: 490px;
  position: relative;
  overflow: hidden;
  border: 1px solid #7b9b7a22;
  border-radius: 48% 48% 12px 12px;
  background: radial-gradient(ellipse at 50% 30%, #506c4633, transparent 65%);
}
.preview-orbit {
  position: absolute;
  border: 1px solid #a9c59120;
  border-radius: 50%;
  width: 340px;
  height: 340px;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
}
.orbit-two {
  width: 265px;
  height: 265px;
  top: 58px;
  border-style: dashed;
}
.world-emblem {
  position: absolute;
  left: 50%;
  top: 38px;
  width: 320px;
  height: 260px;
  transform: translateX(-50%);
}
.world-emblem > span {
  position: absolute;
  left: 144px;
  top: 8px;
  color: #e4efbb;
  font-size: 38px;
  filter: drop-shadow(0 0 20px #bad28b);
}
.emblem-island {
  position: absolute;
  left: 30px;
  top: 174px;
  width: 260px;
  height: 78px;
  background: linear-gradient(150deg, #768557, #263f38);
  clip-path: polygon(0 20%, 45% 0, 100% 20%, 79% 70%, 49% 100%, 20% 70%);
}
.emblem-tower {
  position: absolute;
  z-index: 1;
  width: 62px;
  height: 120px;
  background: linear-gradient(90deg, #4b6b4e, #9aaa74 55%, #657f52);
  clip-path: polygon(
    50% 0,
    100% 35%,
    73% 40%,
    73% 100%,
    27% 100%,
    27% 40%,
    0 35%
  );
}
.tower-center {
  left: 123px;
  top: 65px;
  height: 142px;
  width: 76px;
}
.tower-left {
  left: 55px;
  top: 110px;
  transform: scale(0.8);
}
.tower-right {
  left: 207px;
  top: 117px;
  transform: scale(0.75);
}
.preview-caption {
  position: absolute;
  bottom: 30px;
  left: 15px;
  right: 15px;
  text-align: center;
}
.preview-caption > span {
  font-size: 9px;
  color: #b3cda3;
  letter-spacing: 0.24em;
}
.preview-caption h2 {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  margin: 14px 0;
  color: #e3e3cf;
}
.preview-caption p {
  font-size: 11px;
  line-height: 1.8;
  color: #8fa79b;
}
.creator-footer {
  border-top: 1px solid #96aa8f22;
  padding-top: 20px;
  letter-spacing: 0.12em;
}
#title-screen h1 {
  font-size: clamp(38px, 5.8vw, 84px);
  max-width: 620px;
  overflow-wrap: anywhere;
  line-height: 1.02;
}
#title-screen .eyebrow {
  max-width: 540px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
#title-screen .intro {
  max-width: 420px;
}
#begin {
  background: var(--theme-accent);
}
#action-bar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.new-world {
  display: block;
  margin: 12px auto 0;
  background: transparent;
  border: 1px solid #adc7aa44;
  padding: 10px 16px;
  border-radius: 4px;
  color: #d5e0c6;
  font-size: 12px;
}
#title-screen .new-world {
  margin: 14px 0 0;
}
#seed-modal h2 {
  overflow-wrap: anywhere;
}
#seed-modal p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  #creator {
    padding: 24px;
  }
  .creator-layout {
    grid-template-columns: 1fr;
    margin: 45px auto 30px;
    min-height: 0;
    gap: 20px;
  }
  .creator-preview {
    display: none;
  }
  .creator-brand span:last-child {
    font-size: 8px;
    max-width: 120px;
    text-align: right;
    line-height: 1.8;
  }
  #creator h1 {
    font-size: 47px;
  }
  .creator-copy > p {
    font-size: 13px;
  }
  .creator-footer {
    font-size: 8px;
    line-height: 1.7;
  }
}
@media (prefers-reduced-motion: reduce) {
  #creator * {
    animation: none !important;
  }
}
.world-label.route {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#creator .error {
  scroll-margin-bottom: 30px;
}

/* Every interface surface derives from the current world's palette. */
:root {
  --ui-bg: #0b1512;
  --ui-panel: #1e3229;
  --ui-raised: #304b3d;
  --ui-text: #eff4ec;
  --ui-muted: #bed1bd;
  --ui-accent: #bceaa1;
  --ui-on-accent: #000;
  --ui-border: #526b50;
  --ui-danger: #ffb39d;
  --ui-success: #b2d396;
  --ui-warm: #ead9b9;
  color: var(--ui-text);
  background: var(--ui-bg);
}
button:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-color: var(--ui-accent);
}
#loading {
  background: var(--ui-bg);
  z-index: 110;
  color: var(--ui-text);
}
#title-screen {
  background: linear-gradient(
    90deg,
    var(--ui-bg),
    color-mix(in srgb, var(--ui-bg) 50%, transparent) 40%,
    transparent 72%
  );
}
#title-screen h1,
h1 {
  color: var(--ui-text);
  text-shadow: 0 3px 50px color-mix(in srgb, var(--ui-accent) 20%, transparent);
}
.eyebrow,
.subtitle,
.seed-mark {
  color: var(--ui-accent);
}
.intro,
.title-small,
.title-bottom,
.title-bottom button {
  color: var(--ui-muted);
}
#resources,
#action-bar,
#selection,
.tip,
.modal > div {
  background: var(--ui-panel);
  border-color: var(--ui-border);
  color: var(--ui-text);
}
#selection p,
.resource small,
#action-bar small,
#action-bar button kbd,
.modal p,
.modal small,
.modal dd,
#controls-line,
#controls-line button {
  color: var(--ui-muted);
}
.resource-symbol,
.sap-symbol,
.action-icon,
#action-bar .ability .action-icon,
#action-bar button.bloom-action .action-icon {
  color: var(--ui-accent);
}
.life-symbol {
  color: var(--ui-danger);
}
#time-controls button,
#action-bar button,
#action-bar .ability {
  background: var(--ui-raised);
  color: var(--ui-text);
  border-color: var(--ui-border);
}
#time-controls button:hover,
#action-bar button:hover,
#action-bar button.active {
  background: var(--ui-raised);
  border-color: var(--ui-accent);
  box-shadow: inset 0 0 0 1px var(--ui-accent);
}
#objective,
#action-hint,
#wave-preview {
  color: var(--ui-text);
  text-shadow: 0 1px 5px var(--ui-bg);
}
.objective-dot,
.bloom-action i {
  background: var(--ui-accent);
}
#next-wave,
#begin,
.title-copy > button,
.modal button,
#resume-button,
#tower-commands button {
  background: var(--ui-accent);
  color: var(--ui-on-accent);
  border-color: var(--ui-accent);
}
#next-wave span {
  border-color: currentColor;
}
#next-wave:disabled,
#tower-commands #sell-button,
.modal .secondary,
#title-screen .new-world,
#title-screen #shuffle-route,
.new-world {
  background: var(--ui-raised);
  color: var(--ui-text);
  border-color: var(--ui-border);
}
.title-copy > button:hover,
.modal button:hover {
  background: var(--ui-accent);
  color: var(--ui-on-accent);
}
#title-screen #shuffle-route {
  margin-top: 12px;
  min-width: 0;
  padding: 10px 16px;
}
#route-status {
  color: var(--ui-muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  margin-top: 12px;
}
.announcement {
  background: var(--ui-panel);
  color: var(--ui-text);
  border-color: var(--ui-border);
  text-shadow: none;
}
.announcement.danger {
  color: var(--ui-danger);
  border-color: var(--ui-danger);
}
.announcement.good {
  color: var(--ui-success);
}
.announcement.warn {
  color: var(--ui-warm);
}
#world-labels .site,
#world-labels .route {
  background: var(--ui-panel);
  color: var(--ui-text);
  border-color: var(--ui-border);
  text-shadow: none;
}
#world-labels .site:hover,
#world-labels .site.chosen {
  background: var(--ui-accent);
  color: var(--ui-on-accent);
  border-color: var(--ui-accent);
}
#world-labels .enemy {
  background: var(--ui-panel);
  color: var(--ui-danger);
}
.modal,
#pause-overlay {
  background: color-mix(in srgb, var(--ui-bg) 78%, transparent);
  color: var(--ui-text);
}
.modal dt,
#end-stats,
.seed-pair figcaption {
  color: var(--ui-text);
}
#vignette {
  background: radial-gradient(
    ellipse at 50% 45%,
    transparent 50%,
    color-mix(in srgb, var(--ui-bg) 35%, transparent) 100%
  );
}
#damage-flash {
  box-shadow: inset 0 0 110px var(--ui-danger);
}
#creator {
  background: radial-gradient(
    ellipse at 78% 42%,
    var(--ui-raised),
    var(--ui-panel) 37%,
    var(--ui-bg) 72%
  );
  color: var(--ui-text);
}
.creator-brand,
.creator-footer,
.creator-copy > p,
#generation-status,
.preview-caption p {
  color: var(--ui-muted);
}
.creator-brand span:first-child,
#creator h1,
.preview-caption h2,
#theme-form label {
  color: var(--ui-text);
}
#creator h1 em,
.creator-copy .eyebrow,
.preview-caption > span,
.quiet-button {
  color: var(--ui-accent);
}
#theme-input {
  background: var(--ui-bg);
  border-color: var(--ui-border);
  color: var(--ui-text);
}
#theme-input:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 12%, transparent);
}
.theme-suggestions button {
  background: var(--ui-raised);
  border-color: var(--ui-border);
  color: var(--ui-text);
}
.theme-suggestions button:hover {
  background: var(--ui-accent);
  color: var(--ui-on-accent);
}
#generate-world,
#generate-world:hover {
  background: var(--ui-accent);
  color: var(--ui-on-accent);
}
#generation-status.error {
  color: var(--ui-danger);
}
.creator-preview {
  border-color: var(--ui-border);
  background: radial-gradient(
    ellipse at 50% 30%,
    var(--ui-raised),
    transparent 65%
  );
}
.preview-orbit,
.creator-footer {
  border-color: var(--ui-border);
}
.world-emblem > span {
  color: var(--ui-accent);
  filter: drop-shadow(0 0 20px var(--ui-accent));
}
.emblem-tower {
  background: linear-gradient(
    90deg,
    var(--ui-raised),
    var(--ui-accent) 55%,
    var(--ui-border)
  );
}
.emblem-island {
  background: linear-gradient(150deg, var(--ui-border), var(--ui-panel));
}
#wave-info-button {
  margin-top: 9px;
  padding: 8px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 4px;
  background: var(--ui-panel);
  color: var(--ui-text);
  font-size: 11px;
}
#wave-info-button:hover {
  border-color: var(--ui-accent);
}
#wave-info .wave-info-content {
  width: min(760px, 100%);
  max-height: calc(100dvh - 50px);
  overflow: auto;
  text-align: left;
  padding: 24px;
}
.wave-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#wave-info #close-wave-info {
  min-width: 32px;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  background: var(--ui-raised);
  color: var(--ui-text);
  border-color: var(--ui-border);
}
#wave-info h2 {
  font-size: 36px;
  margin: 12px 0;
}
#wave-info-summary {
  margin: 0 0 16px;
}
.wave-picker-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ui-muted);
  font-size: 12px;
  margin: 0 0 20px;
}
#wave-picker {
  background: var(--ui-raised);
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  border-radius: 4px;
  padding: 9px 12px;
  font: inherit;
}
#wave-enemies {
  display: grid;
  gap: 12px;
}
.enemy-card {
  display: flex;
  gap: 18px;
  padding: 16px;
  background: var(--ui-raised);
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  align-items: center;
}
.enemy-card img {
  width: 144px;
  height: 108px;
  object-fit: contain;
  border-radius: 5px;
  background: var(--ui-bg);
  flex: none;
}
.enemy-card-copy {
  flex: 1;
  min-width: 0;
}
.enemy-card .eyebrow {
  font-size: 9px;
  letter-spacing: 0.12em;
}
.enemy-card h3 {
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  margin: 6px 0 12px;
}
.enemy-card dl {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 0;
}
.enemy-card dl > div {
  min-width: 58px;
}
.enemy-card dt {
  font-size: 10px;
  color: var(--ui-muted);
  margin: 0;
}
.enemy-card dd {
  font-size: 13px;
  color: var(--ui-text);
  margin: 3px 0 0;
}
#wave-info .enemy-counter {
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0 3px;
}
#wave-info .wave-info-footnote {
  font-size: 11px;
  margin: 16px 0 0;
}
@media (max-width: 600px) {
  #wave-info {
    padding: 12px;
  }
  #wave-info .wave-info-content {
    padding: 18px;
    max-height: calc(100dvh - 24px);
  }
  #wave-info h2 {
    font-size: 29px;
  }
  .enemy-card {
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
  }
  .enemy-card img {
    width: 76px;
    height: 76px;
  }
  .enemy-card dl {
    gap: 8px 12px;
  }
  .enemy-card h3 {
    font-size: 16px;
  }
  #wave-info-button {
    padding: 7px 10px;
  }
}
.wave-info-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ui-panel);
  padding-bottom: 8px;
}

.reference-picker {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-panel);
}
.reference-picker label span {
  color: var(--ui-muted);
  font-weight: normal;
}
.reference-picker input {
  display: block;
  max-width: 100%;
  margin: 10px 0;
  color: var(--ui-text);
  font: inherit;
  font-size: 12px;
}
.reference-picker input::file-selector-button {
  border: 1px solid var(--ui-border);
  border-radius: 5px;
  padding: 8px 12px;
  margin-right: 10px;
  background: var(--ui-raised);
  color: var(--ui-text);
  cursor: pointer;
}
.reference-picker small {
  display: block;
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.5;
}
#reference-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
#reference-preview.hidden {
  display: none;
}
#reference-thumbnail {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--ui-raised);
}
#reference-preview > div {
  min-width: 0;
}
#reference-name {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: var(--ui-text);
}
#remove-reference {
  margin-top: 8px;
  padding: 5px 8px;
  background: var(--ui-raised);
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  border-radius: 4px;
  font-size: 11px;
}
#reference-status {
  margin-top: 6px;
}
