/* Semilla shell. Superficies sólidas, mundo dominante, sin fuentes externas. */

:root {
  --surface: #FFFBF3;
  --surface-2: #F3EBDC;
  --surface-3: #EAE0CD;
  --border: #E3D9C6;
  --ink: #2B3038;
  --ink-2: #5F6672;
  --ink-3: #8A8F99;
  --accent: #E8863A;
  --accent-dark: #C96C25;
  --ok: #4F9A5C;
  --warn: #C98A1E;
  --err: #B9463F;
  --focus: #2F6FB3;
  --sky: #DCEAF2;
  --shadow: 0 2px 8px rgba(43, 48, 56, .14);
  --shadow-up: 0 -2px 10px rgba(43, 48, 56, .12);
  --r: 12px;
  --r-btn: 10px;
  --gutter: 16px;
  --bar-h: 44px;
  --side-w: 300px;
  --dur: 180ms;
  --dur-slow: 300ms;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- mundo ---------------------------------------------------------------- */

#stage { position: fixed; inset: 0; background: var(--sky); }

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

#game.is-veiled { visibility: hidden; }

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

/* --- botones -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: transform var(--dur) ease, background-color var(--dur) ease;
}

.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #2B3038;
}
.btn-primary:hover:not(:disabled) { background: #F09A55; }

.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn-slim { height: 30px; padding: 0 10px; }
.btn-block { width: 100%; }
.btn-ic { width: 16px; height: 16px; }

.link-btn {
  background: none;
  border: 0;
  padding: 4px 2px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--ink); }

.icon-btn {
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  color: var(--ink-2);
  cursor: pointer;
}

.brand-mark { width: 20px; height: 20px; color: var(--ok); flex: none; }

/* --- portada y carga ------------------------------------------------------ */

.intro {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 40;
  overflow: auto;
  opacity: 1;
  transition: opacity var(--dur-slow) ease;
}

.intro.is-leaving { opacity: 0; pointer-events: none; }

.intro-grid {
  min-height: 100%;
  display: grid;
  grid-template-columns: 55fr 45fr;
  align-items: center;
  gap: 48px;
  padding: 56px 64px;
  max-width: 1280px;
  margin: 0 auto;
}

.intro-main { max-width: 560px; }

.intro-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.intro-title {
  margin: 0 0 8px;
  font-size: 52px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.02em;
}

.intro-sub {
  margin: 0 0 24px;
  font-size: 18px;
  color: var(--ink-2);
  max-width: 46ch;
}

.lesson {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 14px 16px;
  margin-bottom: 24px;
}

.lesson-tag {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.lesson-title { margin: 0 0 8px; font-size: 17px; font-weight: 700; }

.lesson-steps {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--ink-2);
}
.lesson-steps li { margin-bottom: 3px; }

.intro-status { min-height: 148px; }

.load-line { margin-bottom: 8px; }

.load-track {
  height: 6px;
  width: 100%;
  max-width: 420px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.load-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transform-origin: left center;
  transition: none;
}

.load-track.is-indeterminate .load-fill {
  width: 34%;
  animation: slide 1.4s ease-in-out infinite;
}

.load-track.is-ready .load-fill { background: var(--ok); width: 100%; }
.load-track.is-error .load-fill { background: var(--err); width: 100%; }

@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.load-text { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.load-note { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); min-height: 18px; }

.intro-status.is-error .load-text { color: var(--err); }

.intro-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.error-details {
  margin: 12px 0 0;
  padding: 10px 12px;
  max-width: 460px;
  max-height: 120px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.intro-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}
.intro-foot-sep { color: var(--border); }

.intro-art { display: flex; justify-content: center; }

.art {
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--sky);
}

/* Animación propia, solo transform/opacity, únicamente en la portada. */
.art-robot { animation: bob 5.4s ease-in-out infinite; transform-origin: 228px 316px; }
.art-arm { animation: wave 4.2s ease-in-out infinite; transform-origin: 260px 236px; }
.art-antenna { animation: tilt 6s ease-in-out infinite; transform-origin: 229px 176px; }
.art-dome, .art-tent, .art-crates { animation: rise var(--dur-slow) ease both; }
.art-tent { animation-delay: 80ms; }
.art-crates { animation-delay: 160ms; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-9deg); }
}
@keyframes tilt {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* --- HUD ------------------------------------------------------------------ */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

#hud > * { pointer-events: auto; }

#hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.hud-sep { width: 1px; height: 22px; background: var(--border); }

.strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.strip-item { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.strip-label { font-size: 12px; color: var(--ink-2); }
.strip-value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.strip-milestone .strip-value {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.strip-flag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
}

#controls { display: flex; align-items: center; gap: 8px; }

.chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  max-width: 250px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.chip-text {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-bar { display: block; height: 3px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.chip-bar-fill { display: block; height: 100%; width: 0%; background: var(--ok); transition: none; }
.chip.is-low .chip-bar-fill { background: var(--warn); }
.chip.is-empty .chip-bar-fill { background: var(--err); }

.menu {
  position: absolute;
  top: calc(var(--bar-h) + 6px);
  right: 12px;
  width: 216px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
  animation: pop var(--dur) ease both;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.menu-item {
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item[aria-pressed="true"]::after { content: " ✓"; color: var(--ok); }
.menu-item.is-danger { color: var(--err); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* --- columna lateral ------------------------------------------------------ */

#side {
  position: absolute;
  top: calc(var(--bar-h) + var(--gutter));
  right: var(--gutter);
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - var(--bar-h) - 190px);
  overflow-y: auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  animation: rise var(--dur) ease both;
}

.card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.guide { position: relative;  }
.guide-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.guide-step { font-size: 12px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.guide-body { margin: 6px 0 10px; font-size: 14px; }

.guide-progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.guide-progress-fill { display: block; height: 100%; width: 0%; background: var(--accent); transition: none; }

.guide-done {
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 2px 8px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 700;
  color: var(--ok);
  animation: rise var(--dur) ease both;
}
.done-ic { width: 22px; height: 22px; }

.bubble {  }
.bubble-who { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.bubble-tag { font-weight: 400; color: var(--ink-2); }
.bubble-text { margin: 0 0 10px; font-size: 14px; }
.bubble-choices { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.bubble-choices .btn { width: 100%; height: auto; min-height: 36px; padding: 7px 12px; text-align: left; justify-content: flex-start; }

.freetext { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
textarea, input[type="email"], input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  resize: vertical;
}
.hint { margin: 0; font-size: 12px; color: var(--ink-2); }
.reply { margin: 6px 0 0; font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }

.routines { padding: 0; overflow: hidden; }
.routines-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.routines-count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.routines-chevron { width: 16px; height: 16px; color: var(--ink-2); transition: transform var(--dur) ease; }
.routines-toggle[aria-expanded="true"] .routines-chevron { transform: rotate(180deg); }
.routines-body { padding: 0 14px 12px; }

.learning-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.learning-row { border-top: 1px solid var(--border); padding-top: 8px; }
.learning-row:first-child { border-top: 0; padding-top: 0; }
.learning-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.role-dot.is-auto { background: var(--ok); }
.learning-name { font-size: 14px; font-weight: 700; }
.learning-task { margin-left: auto; font-size: 12px; color: var(--ink-2); }
.skill-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-3);
}
.skill-chip.is-known { background: #E6F2E6; border-color: #BFDCC0; color: #35673E; }
.skill-ic { width: 12px; height: 12px; }
.autonomy-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.autonomy-track { flex: 1; height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.autonomy-fill { display: block; height: 100%; width: 0%; background: var(--ok); transition: none; }

/* --- avisos --------------------------------------------------------------- */

.events {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) + 96px);
  width: 288px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event {
  margin: 0;
  padding: 8px 10px;
  min-height: 40px;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);

  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: rise var(--dur) ease both;
}
.event.is-ok { border-color: var(--ok); }
.event.is-warn { border-color: var(--warn); }
.event.is-error { border-color: var(--err); }

/* --- barra de construcción ------------------------------------------------ */

.buildbar {
  position: absolute;
  left: 50%;
  bottom: var(--gutter);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.buildbar-hint {
  margin: 0;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: rise var(--dur) ease both;
}

.buildbar-row {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-up);
}

.build-btn {
  position: relative;
  width: 84px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px 8px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--dur) ease, transform var(--dur) ease;
}
.build-btn:hover:not(:disabled) { background: var(--surface-2); }
.build-btn:active:not(:disabled) { transform: translateY(1px); }

.build-ic { flex-shrink: 0; width: 28px; height: 28px; color: var(--ink); }
.build-name { font-size: 13px; font-weight: 700; }
.build-cost { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: center; }
.build-key {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
}
.build-lock { position: absolute; top: 6px; right: 6px; width: 13px; height: 13px; color: var(--ink-3); }

.build-btn[aria-pressed="true"] { background: var(--surface-2); }
.build-btn[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.build-btn:disabled { cursor: not-allowed; }
.build-btn:disabled .build-ic { color: #B7B3AA; }
.build-btn:disabled .build-name { color: var(--ink-3); }
.build-btn.is-short .build-cost { color: var(--warn); }

/* --- paneles y diálogos --------------------------------------------------- */

.panel {
  position: fixed;
  top: calc(var(--bar-h) + var(--gutter));
  right: var(--gutter);
  width: 344px;
  max-height: calc(100vh - var(--bar-h) - 32px);
  overflow-y: auto;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  z-index: 30;
  animation: rise var(--dur) ease both;
}

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-title { margin: 0; font-size: 20px; font-weight: 700; }
.panel-subtitle { margin: 12px 0 6px; font-size: 14px; font-weight: 700; }

.notice {
  margin: 0 0 12px;
  padding: 9px 11px;
  background: var(--surface-2);

  border-radius: 8px;
  font-size: 13px;
}

.feedback { margin: 0 0 8px; font-size: 13px; min-height: 18px; }
.feedback.is-error { color: var(--err); }
.feedback.is-ok { color: var(--ok); }

.saves-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.saves-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 48, 56, .45);
  z-index: 45;
  animation: fade var(--dur) ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  z-index: 50;
  animation: modal-in var(--dur-slow) ease both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.modal-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.modal-close { position: absolute; top: 10px; right: 10px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }

/* --- viewports ------------------------------------------------------------ */

@media (max-width: 1200px) {
  .intro-grid { grid-template-columns: 1fr; gap: 28px; padding: 40px; }
  .intro-art { order: -1; }
  .art { max-width: 300px; }
  .intro-title { font-size: 40px; }
}

@media (max-width: 1080px) {
  :root { --side-w: 260px; }
  .build-btn { width: 74px; height: 72px; }
  .strip-bots { display: none; }
}

@media (max-width: 900px) {
  #side { top: auto; bottom: calc(var(--gutter) + 104px); max-height: 200px; }
  .events { bottom: calc(var(--gutter) + 96px); width: 240px; }
  .hud-brand span { display: none; }
  .chip { max-width: 130px; }
  .events { display: none; }
}

@media (max-height: 780px) {
  .intro-grid { padding: 32px 48px; align-items: start; }
  #side { max-height: calc(100vh - var(--bar-h) - 170px); }
}

/* --- movimiento reducido -------------------------------------------------- */

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

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0ms !important;
}

/* The title belongs to the living colony, with one compact game menu. */
.intro.is-ready { background: transparent; }
.intro-grid { min-height: 100dvh; max-width: none; grid-template-columns: 416px 1fr; gap: 64px; padding: 48px 5vw; }
.intro-main { position: relative; padding: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 5px 0 #c8c0aa; }
.intro-emblem { width: 38px; height: 38px; color: #487858; margin-bottom: 10px; }
.intro-title { font-size: 64px; font-weight: 900; letter-spacing: .025em; color: #344c3b; line-height: 1; }
.intro-sub { margin: 12px 0 30px; font-size: 18px; color: var(--ink); }
.intro.is-ready .intro-art { display: none; }
.lesson { padding: 0; border: 0; border-radius: 0; background: none; margin-bottom: 28px; }
.lesson-copy { font-size: 15px; color: var(--ink-2); margin: 8px 0 0; line-height: 1.55; }
.intro-status { min-height: 120px; }
.intro-foot { margin: 20px 0 0; }
#side { width: 282px; }
@media (max-width: 1050px) { .intro-grid { grid-template-columns: 384px 1fr; padding: 32px; gap: 24px; } .intro-title { font-size: 58px; } }
@media (max-width: 700px) { .intro-grid { display: flex; justify-content: center; min-height: 100dvh; padding: 20px; } .intro-main { width: min(100%,416px); padding: 26px; } .intro-title { font-size: clamp(40px,12vw,64px); } .intro-art { display: none; } #side { width: min(282px,calc(100vw - 24px)); } }

.build-ic { width: 38px; height: 38px; }
.build-cost { min-height: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.cost-unit { display: inline-flex; align-items: center; gap: 2px; }
.cost-unit svg { width: 13px; height: 13px; flex: none; }
.build-btn { width: 92px; min-height: 106px; gap: 5px; }
.build-name { line-height: 1.1; }
@media(max-width:700px) { .build-btn { width: 64px; padding-inline: 2px; } .build-ic { width: 30px; height: 30px; } .build-name { font-size: 11px; } .build-cost { gap: 3px; font-size: 10px; } .cost-unit svg { width: 10px; height: 10px; } }

.panel { max-width: calc(100vw - 32px); }
@media(max-width:700px) {
  .buildbar { max-width: calc(100vw - 16px); }
  .buildbar-row { overflow-x: auto; }
  .build-btn { flex-shrink: 0; }
  #side { bottom: 144px; max-height: min(45vh,340px); }
}
@media(max-width:700px) {
  :root { --bar-h: 76px; }
  #hud-top { height: var(--bar-h); display: grid; grid-template-columns: 1fr auto; grid-template-rows: 32px 28px; padding: 6px 12px; gap: 4px 12px; }
  .hud-brand { grid-column: 1; grid-row: 1; }
  .hud-brand span { display: inline; }
  .hud-sep, #quota-chip, .strip-milestone, .strip-flag { display: none; }
  #controls { grid-column: 2; grid-row: 1; }
  #resources { grid-column: 1 / -1; grid-row: 2; gap: 18px; overflow: visible; }
}
.buildbar-row { max-width: 100%; }
