:root {
  /* Strict 60 / 30 / 10 Tropical Dieter Rams Palette */
  --sand: #F4EFE6;       /* 60% Dominant */
  --sand-deep: #E7DFD1;
  --lagoon: #0E5A6D;     /* 30% Secondary */
  --ink: #0B2A33;
  --accent: #FF5A1F;     /* 10% Accent */

  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

.coast-3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.coast-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* World Labels (Clean 1px Technical Tags) */
.labels-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}

.station-tag {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--sand);
  border: 1px solid rgba(11, 42, 51, 0.22);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  transition: border-color 0.2s;
}

.station-tag.is-top {
  border-color: var(--accent);
}

.station-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--lagoon);
}

.station-tag.is-top .station-rank {
  color: var(--accent);
}

.station-tag.is-open {
  opacity: 0.55;
  font-weight: 500;
}

/* Sticky solid ocean header for scrollable subpages (prevents text overlap) */
.sub-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(10, 70, 86, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(244, 239, 230, 0.16);
  padding: 8px 24px;
}

.sub-header .ocean-nav {
  border-bottom: none;
  max-width: 880px;
  margin: 0 auto;
  padding: 6px 0;
}

/* Top-Left Ocean Navigation Header */
.hud-top {
  position: fixed;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.ocean-nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.28);
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sand);
  text-decoration: none;
}

h1, .modal-title {
  font-family: var(--font-sans);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-left: 20px;
  border-left: 1px solid rgba(244, 239, 230, 0.24);
}

.nav-link {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(244, 239, 230, 0.85);
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--accent);
}

.btn-circle {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(11, 42, 51, 0.18);
  background: rgba(244, 239, 230, 0.9);
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.hud-bottom {
  position: fixed;
  bottom: 28px;
  left: 24px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hud-top { left: 14px; right: 14px; top: 14px; }
  .hud-bottom { left: 14px; bottom: 18px; }
  .hud-telemetry { right: 14px; bottom: 72px; }
}

.hud-telemetry {
  position: fixed;
  right: 36px;
  bottom: 32px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(244, 239, 230, 0.35);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--sand);
  min-width: 260px;
}

.tele-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(244, 239, 230, 0.72);
  margin-bottom: 4px;
}

.tele-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.tele-k {
  color: rgba(244, 239, 230, 0.72);
}

.tele-v {
  font-weight: 700;
  color: var(--sand);
}

.tele-v.is-accent {
  color: var(--accent);
}

.btn {
  padding: 12px 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

.btn-lagoon {
  background: var(--lagoon);
  color: var(--sand);
}

.btn-accent {
  background: var(--accent);
  color: var(--sand);
}

.btn-secondary {
  background: var(--sand-deep);
  color: var(--ink);
  border-color: rgba(11, 42, 51, 0.2);
}

.btn-primary {
  background: var(--lagoon);
  color: var(--sand);
}

.btn-gold {
  background: var(--accent);
  color: var(--sand);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 42, 51, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--sand);
  border: 1px solid rgba(11, 42, 51, 0.22);
  border-radius: 6px;
  padding: 24px;
  color: var(--ink);
}

.modal-close {
  float: right;
  background: transparent;
  border: 1px solid rgba(11, 42, 51, 0.2);
  color: var(--ink);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-right: 32px;
}

.modal-desc {
  font-size: 14px;
  color: rgba(11, 42, 51, 0.72);
  line-height: 1.5;
  margin-bottom: 14px;
}

.badge-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--sand-deep);
  color: var(--lagoon);
}

.badge-gold {
  background: rgba(255, 90, 31, 0.14);
  color: var(--accent);
}

.deal-box {
  border: 1px dashed var(--lagoon);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.deal-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

.btn-mini {
  background: var(--ink);
  color: var(--sand);
  border: none;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
}

.quest-progress {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 8px;
}

.choice-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.choice-btn {
  text-align: left;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(11, 42, 51, 0.16);
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.choice-btn:hover {
  border-color: var(--accent);
}

.loot-canvas {
  width: 100%;
  border-radius: 4px;
  border: 1px solid rgba(11, 42, 51, 0.2);
  margin: 10px 0;
}

.result-card {
  background: #fff;
  border: 1px solid rgba(11, 42, 51, 0.14);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(11, 42, 51, 0.7);
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(11, 42, 51, 0.22);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
}

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
