/* Alpha coastal language: clear blue chrome, warm action accents, generous touch targets. */
:root {
  --ink: #f0f6fa;
  --muted: #b5c8d5;
  --gold: #f4b25b;
  --line: #b5cddd30;
  --panel: #20384c;
}
body {
  background: #152e42;
}
button {
  border-radius: 12px;
}
button,
input {
  font-size: 14px;
}
.playing header {
  background: linear-gradient(#18344bef, #203c51ec);
  border-bottom: 1px solid #7795ad50;
}
.playing .crest {
  background: #386b98;
  color: #f4f8fa;
  border: 1px solid #8cacbf;
  border-radius: 12px;
  font-size: 15px;
  box-shadow: none;
}
.playing .power strong {
  color: #ffd58b;
}
.playing .account button {
  min-height: 32px;
}
.playing .resourcebar {
  background: #25465bef;
  border-color: #7aa0bd30;
}
.resourcebar svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #bed8e8;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.resourcebar > button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  min-height: 32px;
  padding: 0 4px;
}
.playing .resourcebar {
  gap: 14px;
}
#connection {
  margin-left: auto;
  color: #d1e6dd;
  max-width: 105px;
  text-align: right;
}
.bottom-nav {
  background: linear-gradient(#294c67f5, #18354cf7);
  border-top: 1px solid #82a8c15c;
  box-shadow: 0 -3px 12px #132a3b30;
}
.bottom-nav svg {
  color: #bad6e9;
  filter: none;
}
.bottom-nav button {
  font-size: 11px;
  color: #dceaf4;
  text-shadow: none;
}
#mapToggle {
  background: #3d7396;
  border: 1px solid #92b7cf;
  color: #fff;
}
.bottom-nav button[aria-pressed="true"] {
  background: #6597b93b;
  color: #ffc574;
}
.primary {
  background: #efb261 !important;
  border-color: #ffcf8e !important;
  color: #20374a !important;
  box-shadow: 0 2px 0 #a17536;
}
.map-tools button {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  border: 1px solid #97b5c799;
  background: #294c65ed;
  color: #e6f1f8;
  box-shadow: 0 2px 7px #18334433;
  font-size: 24px;
  padding: 4px !important;
}
.map-tools button[aria-pressed="true"] {
  border-color: #efb261;
  background: #426b82;
}
.location-badge {
  filter: none;
}
.location-badge span {
  color: #eaf4f8;
  background: #2b5067e0;
  border-radius: 6px;
  padding: 3px 7px;
  width: max-content;
  letter-spacing: 0.08em;
}
.location-badge b {
  display: block;
  margin-top: 3px;
  color: #163b51;
  text-shadow: 0 1px 5px #ffffff8a;
  font-weight: 750;
}
.map-readout .coordinate-readout {
  background: #284c64e8;
  color: #dcebf5;
  border-color: #99b6c96b;
}
.map-help {
  display: none;
}
.base-stage {
  background: #94b982;
}
.base-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.base-label {
  position: absolute;
  left: 0;
  top: 0;
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid #b0c7d083;
  background: #23485beb;
  color: #f3f8fb;
  box-shadow: 0 3px 9px #18354c25;
  border-radius: 9px;
  pointer-events: auto;
  white-space: nowrap;
  line-height: 1.2;
  font-size: 12px;
}
.base-label span {
  font-weight: 700;
  display: block;
}
.base-label small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  color: #c5dbe8;
}
.base-label[aria-pressed="true"] {
  border: 2px solid #f8be70;
  background: #356582;
}
.base-hint {
  position: absolute;
  bottom: calc(91px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  white-space: nowrap;
  font-size: 10px;
  color: #f6fbff;
  background: #264c61d9;
  border-radius: 20px;
  padding: 6px 13px;
}
.base-fallback {
  display: grid;
  inset: 35% 20px 20%;
  gap: 8px;
  pointer-events: auto;
}
.on-map #panelWrap {
  border-color: #83a4bb70;
  background: #203c50;
  box-shadow: 0 8px 24px #10263655;
}
#panelWrap aside {
  background: linear-gradient(135deg, #2b4e65, #1c3549);
}
#closePanel {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  background: #42637a;
}
.metric {
  background: #18384b80;
}
.status {
  color: #d7edc9;
}
.operation-choice {
  background: #24465d;
  border-color: #7f9fb452;
}
.card {
  background: #1d3b50;
  border-color: #7f9fb42b;
}
.scene-shell {
  background: #213f54;
}
.scene-heading {
  background: #203d52;
}
.list-content {
  padding-top: 105px;
}
#toast {
  background: #f5c781;
  color: #20374a;
  max-width: calc(100vw - 32px);
}
dialog {
  background: #23445b;
  border-color: #83a9c1;
}
#game[aria-busy="true"] [data-action="assign"],
#game[aria-busy="true"] [data-action="upgrade"],
#game[aria-busy="true"] [data-action="research"] {
  opacity: 0.5;
  pointer-events: none;
}
.release-label {
  color: #a8c8dd;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.research-track {
  margin: 14px 0;
}
.research-track .row {
  border: 0;
  padding: 5px 0;
}
.research-track h3 {
  margin: 0;
}
.progress {
  accent-color: #efb261;
}
.connection-warning {
  position: fixed;
  top: calc(101px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  background: #683f20;
  color: #fff1df;
  padding: 8px 14px;
  border-radius: 0 0 10px 10px;
  font-size: 12px;
  max-width: 90vw;
  text-align: center;
}
.getting-started {
  font-size: 12px;
  padding: 12px;
  border-left: 3px solid #f0ae55;
  background: #36596d60;
}
.auth {
  max-width: 500px;
}
.auth h1 {
  color: #eaf3fa;
}
.auth small {
  color: #acc6d9;
}
.auth input {
  border-color: #769db657;
  background: #16364b;
}
#connection[data-state="offline"] {
  color: #ffbc93;
}
@media (max-width: 680px) {
  .base-label {
    font-size: 11px;
    padding: 5px 8px;
  }
  .base-label small {
    font-size: 9px;
  }
  .on-map #panelWrap {
    max-height: 50svh;
  }
  .playing .account button {
    font-size: 10px;
  }
  .playing .account {
    max-width: 88px;
  }
  .location-badge b {
    font-size: 16px;
  }
  .location-badge {
    top: calc(111px + env(safe-area-inset-top));
  }
  .map-tools {
    top: calc(151px + env(safe-area-inset-top));
  }
  .playing .power span {
    font-size: 8px;
  }
  .auth {
    margin: 20px 18px;
  }
  .resourcebar #connection {
    font-size: 8px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .location-badge,
  .base-hint,
  .map-readout {
    display: none;
  }
  .map-tools {
    top: 115px;
    display: flex;
  }
  .on-map #panelWrap {
    max-height: calc(100svh - 175px);
    width: 340px;
    left: auto;
  }
  .playing header {
    height: 58px;
  }
  .playing .resourcebar {
    top: 58px;
  }
  .bottom-nav {
    min-height: 60px;
  }
  .bottom-nav button {
    min-height: 44px;
  }
}

.retry-command {
  position: fixed;
  z-index: 31;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  background: #efb261;
  color: #20374a;
}

.base-label small {
  font-size: 11px;
}
.playing .power span {
  font-size: 10px;
}
.playing .account button {
  min-height: 44px;
}
.playing .resourcebar {
  height: 44px;
}
.playing .resourcebar > button {
  min-height: 44px;
}
.playing .account {
  font-size: 11px;
}
.location-badge {
  top: calc(119px + env(safe-area-inset-top));
}
.location-badge span {
  font-size: 10px;
}
.base-hint {
  font-size: 11px;
}
.bottom-nav button {
  font-size: 11px;
}
.base-label {
  max-width: 146px;
}
.base-label small {
  white-space: normal;
}
.base-label span {
  white-space: nowrap;
}
.playing .resourcebar b {
  font-size: 14px;
}
#panelWrap .eyebrow {
  font-size: 11px;
}
#connection {
  font-size: 10px !important;
}
.playing .resourcebar {
  gap: 10px;
}
.playing .account {
  max-width: 94px;
}

.base-stage .map-tools {
  top: auto;
  bottom: calc(125px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(2, 44px);
}

/* Keep dismissal separate from scrolling details and feedback clear of actions. */
.panel-toolbar {
  display: none;
}
.on-map .panel-toolbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 3;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 4px 18px;
  background: #24475f;
  border-bottom: 1px solid #83a4bb40;
  min-height: 52px;
}
.panel-toolbar span {
  font-size: 12px;
  color: #c8dce9;
}
.on-map #closePanel {
  position: static;
  float: none;
  margin: 0;
}
.on-map #panelWrap h2,
.on-map #panelWrap .eyebrow {
  padding-right: 0;
}
#toast {
  top: calc(118px + env(safe-area-inset-top));
  bottom: auto;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
  padding: 12px 16px;
}
.on-map #panelWrap aside {
  border-radius: 0;
  padding-top: 14px;
}

.rank {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 8px;
  background: #3f6379;
  color: #ffd18b;
  margin-right: 6px;
}
@media (max-width: 680px) {
  #game[data-view="clan"] .workspace {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
  }
  #game[data-view="clan"] #panelWrap {
    order: -1;
  }
  #game[data-view="clan"] .scene-shell {
    min-height: 0;
  }
  #game[data-view="clan"] .list-content {
    padding-top: 86px;
  }
}

.support-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.support-option.card {
  margin: 0;
  padding: 11px;
  min-width: 0;
}
.support-option h3 {
  font-size: 14px;
  margin: 0 0 5px;
}
.support-option small {
  font-size: 11px;
  line-height: 1.45;
}
.support-option .full {
  font-size: 12px;
  padding: 8px 5px;
  margin: 8px 0;
}
.support-fit {
  display: block;
  color: #ffd18b;
  font-size: 10px;
  min-height: 28px;
}
.operation-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.operation-progress .progress {
  margin: 0;
  flex: 1;
}
.operation-progress b {
  font-size: 12px;
}

.support-fit {
  min-height: 0;
  font-size: 11px;
}
.support-option small {
  margin-top: 3px;
}
.support-option h3 {
  white-space: nowrap;
}

/* Avoid automatic form zoom on iPhone. */
input,
select,
textarea {
  font-size: 16px;
}

button.base-hint {
  pointer-events: auto;
  min-height: 44px;
  border: 1px solid #ffd18b;
  background: #efb261;
  color: #20374a;
  font-size: 13px;
  font-weight: 700;
}

/* Base overview communicates activity, not a permanent statistics overlay. */
.base-label {
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
}
.base-label small {
  display: none;
}
.base-label:focus-visible {
  opacity: 1;
  outline: 2px solid #ffd18b;
  outline-offset: 3px;
}
.base-stage .location-badge,
.base-hint:not(button) {
  display: none;
}
.base-stage .map-tools {
  bottom: calc(95px + env(safe-area-inset-bottom));
}
.base-stage .map-tools button {
  box-shadow: none;
  background: #24455dbb;
}

.production-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}
.production-summary strong {
  display: block;
  font-size: 32px;
  line-height: 1.2;
  color: #ffe0a4;
}
.production-summary span {
  font-size: 12px;
}
.building-upgrade {
  border-top: 1px solid #ffffff20;
  margin-top: 16px;
  padding-top: 8px;
}
.production-breakdown {
  margin-top: 18px;
  font-size: 13px;
}
.production-breakdown summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: #b6cfdb;
}
.production-breakdown summary::before {
  content: "＋";
  margin-right: 8px;
}
.production-breakdown[open] summary::before {
  content: "−";
}
