/* =============================================================================================
   BLOX interface styles
   The whole look of the interface: deep charcoal panels with purple neon edges, amber primary
   buttons, magenta premium touches, blue energy elements and bold geometric white type.
   Phone first (390 x 844 portrait, safe-area insets), and it scales up to desktop sizes.

   Fonts (loaded by index.html from Google Fonts):
     Russo One  the bold geometric display face (titles, numbers, buttons). One weight only: 400.
     Barlow     the clean interface face (500, 600, 700, 800).

   Page skeleton these styles expect:
     #app
       canvas#game          the 3D view
       #labels              things pinned to map positions (JS sets left / top in pixels):
                            .floater  .site-tag  .collect-bubble  .map-tag  .press-ring
       #hud.hud             .hud-top  (.res-row of .chip, .status-row with .profile and .status-chips,
                                       .raid-banner)
                            .hud-mid  (.hud-left: .goal-card .task-list .note-list,
                                       .hud-right: .minimap .side-btns)
                            .place-bar  (placement and move mode: info, cancel, confirm)
                            .nav        (six .nav-btn)
       #sheets              .backdrop + .sheet  (slide-up panels; .sheet.dock sits above the nav
                            with no backdrop and is used for the building panel)
       #modals              .modal-wrap > .modal  (welcome, raid result, confirm, settings)
       #toasts.toasts       .toast
       #loading.loading     the loading screen

   State classes:
     .open      on .sheet, .backdrop, .modal-wrap, .raid-banner: shown
     .hidden    on anything: not displayed
     .is-off    on a .btn that cannot be used right now but still takes taps (to explain why)
     .short     on .cost-item: the player does not have enough of it (red)
     .locked    on cards: not available yet
     .active    on .nav-btn, .tab, .queue-item
     body.placing   placement or move mode (nav hides, .place-bar shows)
     body.raid      a raid is in progress (red edge glow)
     html.reduce-motion   the "reduce motion" setting

   Resource colours: put data-res="wood|metal|components|energy|food|gems" on an element and
   var(--res) is that resource's colour (cap bars, floating labels).

   The logo is written as:  <span class="logo">BL<i>O</i>X</span>
   Bars are written as:     <span class="bar hp"><i style="width:60%"></i></span>
   ============================================================================================= */

/* ---------------------------------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------------------------------- */

:root {
  --font-display: 'Russo One', 'Arial Black', 'Segoe UI', system-ui, sans-serif;
  --font-ui: 'Barlow', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif;

  /* Studio palette (the same values as PALETTE in ui/icons.js). */
  --ink: #130d21;
  --night: #0b0814;
  --panel-0: #120e1d;
  --panel-1: #1a1529;
  --panel-2: #241d38;
  --panel-3: #322a4b;
  --panel-4: #4a3f72;
  --steel: #8f96ad;
  --steel-l: #cdd3e3;
  --purple: #9a4dff;
  --purple-l: #c9a1ff;
  --purple-d: #5b21c4;
  --magenta: #ff3ea5;
  --magenta-l: #ff9fd2;
  --magenta-d: #b3146f;
  --blue: #2f7dff;
  --blue-l: #8fd0ff;
  --blue-d: #1746b8;
  --amber: #ffb21f;
  --amber-l: #ffdc73;
  --amber-d: #d67a00;
  --orange: #ff7a1a;
  --green: #35d46a;
  --green-l: #9df27c;
  --green-d: #16904a;
  --red: #ff4d5e;
  --red-l: #ff9aa4;
  --red-d: #b81e3a;

  --text: #ffffff;
  --text-2: #d4cdea;
  --text-3: #9b92b8;

  /* Panel edges and glows. */
  --edge: rgba(154, 77, 255, 0.6);
  --edge-soft: rgba(154, 77, 255, 0.24);
  --glow: 0 0 14px rgba(154, 77, 255, 0.45);
  --outline: -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink), 1px 1px 0 var(--ink),
    0 2px 0 var(--ink);

  /* Safe areas (notches, home indicator). */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);

  /* Height of the bottom navigation without the safe area (the docked panel sits on top of it). */
  --nav-h: 78px;
  --nav-btn-h: 60px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-res='wood'] { --res: #eaae63; }
[data-res='metal'] { --res: #cdd3e3; }
[data-res='components'] { --res: #8fd0ff; }
[data-res='energy'] { --res: #2f7dff; }
[data-res='food'] { --res: #ff4d5e; }
[data-res='gems'] { --res: #ff3ea5; }

/* ---------------------------------------------------------------------------------------------
   2. Base
   --------------------------------------------------------------------------------------------- */

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  overscroll-behavior: none;
  touch-action: none; /* the game handles pan and pinch itself; scrolling panels opt back in */
}

body {
  position: fixed;
  inset: 0;
  font: 600 14px/1.3 var(--font-ui);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--amber-l);
  outline-offset: 2px;
}

img {
  -webkit-user-drag: none;
}

p {
  margin: 0;
}

b,
strong {
  font-weight: 800;
}

.hidden {
  display: none !important;
}

/* Icons from ui/icons.js. */
.ico {
  display: inline-block;
  flex: none;
  vertical-align: middle;
  overflow: visible;
}

/* The display face on any element. */
.dsp {
  font-family: var(--font-display);
  font-weight: 400;
}

/* A number that pops when it changes (hud.js adds .up or .down for a moment). */
.num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.num.up {
  animation: num-up 0.45s var(--ease-out);
}

.num.down {
  animation: num-down 0.45s var(--ease-out);
}

/* ---------------------------------------------------------------------------------------------
   3. Layers
   --------------------------------------------------------------------------------------------- */

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 30%, #2a1d52 0%, #130d21 60%, #0b0814 100%);
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  cursor: grab;
}

#game.dragging {
  cursor: grabbing;
}

body.placing #game {
  cursor: crosshair;
}

#labels {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#sheets,
#modals {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#sheets {
  z-index: 20;
}

#modals {
  z-index: 40;
}

#sheets > *,
#modals > * {
  pointer-events: auto;
}

/* ---------------------------------------------------------------------------------------------
   4. Shared pieces: logo, buttons, bars, pills, badges, tiles, rows
   --------------------------------------------------------------------------------------------- */

/* ----- Logo: <span class="logo">BL<i>O</i>X</span> ----- */

.logo {
  position: relative;
  display: inline-block;
  padding: 0 2px;
  font: 400 22px/1 var(--font-display);
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: var(--outline), 0 4px 0 rgba(91, 33, 196, 0.9), 0 0 16px rgba(154, 77, 255, 0.7);
  white-space: nowrap;
}

.logo i {
  position: relative;
  font-style: normal;
}

/* The small amber roof over the O. */
.logo i::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 86%;
  width: 0.62em;
  height: 0.3em;
  margin-left: -0.33em;
  background: linear-gradient(180deg, var(--amber-l), var(--amber));
  clip-path: polygon(50% 0, 100% 100%, 78% 100%, 50% 45%, 22% 100%, 0 100%);
  filter: drop-shadow(0 1px 0 var(--ink));
}

.logo.lg {
  font-size: 40px;
}

.logo.xl {
  font-size: 64px;
}

/* Slanted amber dashes used as a small title ornament. */
.stripes {
  display: inline-block;
  flex: none;
  width: 30px;
  height: 8px;
  background: repeating-linear-gradient(-60deg, var(--amber) 0 5px, transparent 5px 9px);
  opacity: 0.9;
}

/* ----- Buttons ----- */

.btn {
  --b1: #4b4070;
  --b2: #2f2749;
  --b-edge: #1b152e;
  --b-text: #ffffff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 16px 3px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), inset 0 -4px 0 var(--b-edge), 0 3px 0 rgba(0, 0, 0, 0.45);
  color: var(--b-text);
  font: 400 15px/1 var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  transition: transform 0.08s ease-out, filter 0.15s ease-out, box-shadow 0.08s ease-out;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -2px 0 var(--b-edge), 0 1px 0 rgba(0, 0, 0, 0.45);
}

.btn .ico {
  width: 20px;
  height: 20px;
}

/* Amber: the primary action. */
.btn-amber {
  --b1: #ffd75a;
  --b2: #ffa514;
  --b-edge: #c96f00;
  --b-text: #2a1500;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Green: confirm, collect, repair. */
.btn-green {
  --b1: #7df59a;
  --b2: #22b955;
  --b-edge: #0f7a36;
  --b-text: #052a12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Magenta: anything that spends gems. */
.btn-magenta {
  --b1: #ff7cc4;
  --b2: #e02a8d;
  --b-edge: #96105c;
}

/* Blue: energy and the power network. */
.btn-blue {
  --b1: #6aa8ff;
  --b2: #2468e6;
  --b-edge: #12409c;
}

/* Purple: neutral strong actions. */
.btn-purple {
  --b1: #b47bff;
  --b2: #6f2fe0;
  --b-edge: #46189c;
}

/* Red: destructive. */
.btn-danger {
  --b1: #ff7a87;
  --b2: #d92b45;
  --b-edge: #8f1229;
}

/* Quiet secondary button. */
.btn-ghost {
  --b1: rgba(255, 255, 255, 0.1);
  --b2: rgba(255, 255, 255, 0.05);
  --b-edge: rgba(0, 0, 0, 0.25);
  border-color: rgba(201, 161, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 0 var(--b-edge);
  color: var(--text-2);
}

.btn-sm {
  min-height: 36px;
  padding: 0 11px 2px;
  border-radius: 10px;
  font-size: 12.5px;
  gap: 5px;
}

.btn-sm .ico {
  width: 16px;
  height: 16px;
}

.btn-lg {
  min-height: 56px;
  padding: 0 24px 4px;
  border-radius: 15px;
  font-size: 19px;
}

.btn-lg .ico {
  width: 26px;
  height: 26px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Square icon-only button. */
.btn-icon {
  width: 46px;
  min-width: 46px;
  padding: 0 0 3px;
}

.btn-icon.btn-sm {
  width: 36px;
  min-width: 36px;
}

/* Two lines inside a button: the action and a small note under it. */
.btn-stack {
  flex-direction: column;
  gap: 2px;
  padding-top: 5px;
  padding-bottom: 7px;
}

.btn-stack small {
  font: 700 10.5px/1 var(--font-ui);
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.85;
}

/* A price capsule inside a button (the gem cost of a speed-up). */
.btn-cost {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  padding: 3px 7px 3px 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 0.9em;
  text-shadow: none;
}

.btn-cost .ico {
  width: 15px;
  height: 15px;
}

/* Unusable: really disabled, or still tappable (.is-off) so the game can say why. */
.btn[disabled],
.btn.is-off {
  filter: grayscale(0.85) brightness(0.72);
}

.btn[disabled] {
  cursor: default;
  pointer-events: none;
}

/* Round buttons of the placement bar. */
.round-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(180deg, #4b4070, #2f2749);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), inset 0 -4px 0 rgba(0, 0, 0, 0.3), 0 3px 0 rgba(0, 0, 0, 0.45);
  color: #fff;
  transition: transform 0.08s ease-out, filter 0.15s ease-out;
}

.round-btn:active {
  transform: translateY(2px) scale(0.96);
}

.round-btn .ico {
  width: 24px;
  height: 24px;
}

.round-btn.confirm {
  background: linear-gradient(180deg, #7df59a, #22b955);
}

.round-btn.cancel {
  background: linear-gradient(180deg, #ff7a87, #d92b45);
}

.round-btn.is-off {
  filter: grayscale(0.85) brightness(0.7);
}

/* ----- Stepper: [-] 1/2 [+] ----- */

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.step-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: linear-gradient(180deg, #54487c, #322a4f);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -3px 0 #1c1630;
  color: #fff;
  transition: transform 0.08s ease-out, filter 0.15s ease-out;
}

.step-btn:active {
  transform: translateY(2px);
}

.step-btn .ico {
  width: 14px;
  height: 14px;
}

.step-btn.plus {
  background: linear-gradient(180deg, #ffd75a, #ffa514);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 #c96f00;
  color: #2a1500;
}

.step-btn[disabled],
.step-btn.is-off {
  filter: grayscale(0.9) brightness(0.65);
}

.step-btn[disabled] {
  pointer-events: none;
}

.step-val {
  min-width: 42px;
  text-align: center;
  font: 400 15px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.step-val small {
  color: var(--text-3);
  font-size: 0.85em;
}

/* ----- Bars ----- */

.bar {
  position: relative;
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--purple-l), var(--purple));
  transition: width 0.3s linear;
}

.bar.hp > i {
  background: linear-gradient(180deg, var(--green-l), var(--green));
}

.bar.hp.low > i,
.bar.bad > i {
  background: linear-gradient(180deg, var(--red-l), var(--red));
}

.bar.xp > i {
  background: linear-gradient(180deg, var(--amber-l), var(--amber));
}

.bar.energy > i {
  background: linear-gradient(180deg, var(--blue-l), var(--blue));
  box-shadow: 0 0 8px var(--blue);
}

.bar.magenta > i {
  background: linear-gradient(180deg, var(--magenta-l), var(--magenta));
}

/* Construction progress: moving amber stripes. */
.bar.build > i {
  background: repeating-linear-gradient(-45deg, #ffb21f 0 8px, #ffcf5c 8px 16px);
  background-size: 22.63px 100%;
  animation: stripes-move 0.8s linear infinite;
}

.bar.build.paused > i {
  animation-play-state: paused;
  filter: saturate(0.4);
}

/* ----- Pills, badges, dots ----- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  font: 700 11px/1 var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill .ico {
  width: 12px;
  height: 12px;
}

.pill.ok {
  background: rgba(53, 212, 106, 0.18);
  color: var(--green-l);
}

.pill.warn {
  background: rgba(255, 178, 31, 0.18);
  color: var(--amber-l);
}

.pill.bad {
  background: rgba(255, 77, 94, 0.2);
  color: var(--red-l);
}

.pill.energy {
  background: rgba(47, 125, 255, 0.22);
  color: var(--blue-l);
}

.pill.premium {
  background: rgba(255, 62, 165, 0.2);
  color: var(--magenta-l);
}

/* Level badge: "Lv.3" or just "3". */
.lv-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 28px;
  height: 20px;
  padding: 0 6px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: linear-gradient(180deg, #8450f0, #4a1fa8);
  color: #fff;
  font: 400 11px/1 var(--font-display);
  white-space: nowrap;
}

/* Red attention badge on nav and side buttons. Empty = a plain dot. */
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(180deg, #ff7a87, #e0263f);
  color: #fff;
  font: 400 10px/1 var(--font-display);
  animation: badge-pop 0.35s var(--ease-pop);
}

.badge:empty {
  min-width: 13px;
  height: 13px;
  padding: 0;
}

.dot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5b5475;
  box-shadow: 0 0 0 2px var(--ink);
}

.dot.on {
  background: var(--blue-l);
  box-shadow: 0 0 0 2px var(--ink), 0 0 8px var(--blue);
}

.dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 2px var(--ink), 0 0 8px rgba(53, 212, 106, 0.7);
}

.dot.off {
  background: var(--red);
  box-shadow: 0 0 0 2px var(--ink), 0 0 8px rgba(255, 77, 94, 0.7);
}

/* ----- Icon tiles: the framed square an icon sits in ----- */

.ico-tile {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border: 1.5px solid rgba(201, 161, 255, 0.5);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, #6344be 0%, #2a1f52 72%);
  box-shadow: inset 0 0 10px rgba(154, 77, 255, 0.5), 0 0 0 1.5px var(--ink);
}

.ico-tile > .ico {
  width: 72%;
  height: 72%;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

.ico-tile.sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.ico-tile.lg {
  width: 72px;
  height: 72px;
  border-radius: 15px;
}

.ico-tile.xl {
  width: 92px;
  height: 92px;
  border-radius: 18px;
}

.ico-tile.dark {
  border-color: rgba(255, 255, 255, 0.14);
  background: radial-gradient(circle at 50% 30%, #3b3456 0%, #1c1630 75%);
  box-shadow: 0 0 0 1.5px var(--ink);
}

.ico-tile.blue {
  border-color: rgba(143, 208, 255, 0.6);
  background: radial-gradient(circle at 50% 30%, #2f6fe0 0%, #14285e 75%);
  box-shadow: inset 0 0 10px rgba(47, 125, 255, 0.6), 0 0 0 1.5px var(--ink);
}

.ico-tile.amber {
  border-color: rgba(255, 220, 115, 0.65);
  background: radial-gradient(circle at 50% 30%, #b06a10 0%, #3d2408 78%);
  box-shadow: inset 0 0 10px rgba(255, 178, 31, 0.45), 0 0 0 1.5px var(--ink);
}

.ico-tile.magenta {
  border-color: rgba(255, 159, 210, 0.65);
  background: radial-gradient(circle at 50% 30%, #c42a84 0%, #45102f 78%);
  box-shadow: inset 0 0 10px rgba(255, 62, 165, 0.5), 0 0 0 1.5px var(--ink);
}

.ico-tile.red {
  border-color: rgba(255, 154, 164, 0.6);
  background: radial-gradient(circle at 50% 30%, #b32a3d 0%, #401019 78%);
  box-shadow: inset 0 0 10px rgba(255, 77, 94, 0.5), 0 0 0 1.5px var(--ink);
}

.ico-tile .lv-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
}

/* ----- Costs and times ----- */

.cost {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.cost-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fff;
  font: 400 13px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cost-item .ico {
  width: 18px;
  height: 18px;
}

.cost-item.short {
  color: var(--red);
}

.cost-free {
  color: var(--green-l);
  font: 400 13px/1 var(--font-display);
}

.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font: 400 13px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time-chip .ico {
  width: 16px;
  height: 16px;
}

/* ----- Sections, rows, tiles, lists, alerts ----- */

.section {
  margin-top: 14px;
}

.section:first-child {
  margin-top: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--purple-l);
  font: 400 11.5px/1 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--edge-soft), transparent);
}

.section-title .ico {
  width: 15px;
  height: 15px;
}

.hint {
  color: var(--text-3);
  font: 500 12px/1.35 var(--font-ui);
}

/* A label / value row (stats, benefits, staff). */
.rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.row > .ico {
  width: 20px;
  height: 20px;
}

.row-label {
  flex: 1;
  min-width: 0;
  font: 600 13px/1.2 var(--font-ui);
  color: var(--text);
}

.row-label small {
  display: block;
  color: var(--text-3);
  font: 500 11px/1.2 var(--font-ui);
}

.row-val {
  flex: none;
  font: 400 13.5px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.row-val.up,
.row-to {
  color: var(--green);
}

.row-val.bad {
  color: var(--red-l);
}

.row-val.energy {
  color: var(--blue-l);
}

.row-from {
  color: var(--text-2);
}

.row-val .ico {
  width: 10px;
  height: 10px;
  margin: 0 4px;
  color: var(--text-3);
}

/* A next-level benefit: green and marked with the upgrade arrow. */
.row.gain {
  background: rgba(53, 212, 106, 0.09);
  box-shadow: inset 0 0 0 1px rgba(53, 212, 106, 0.22);
}

.row.gain .row-label {
  color: #d9ffe4;
}

/* Big-number tiles. */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tiles.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tiles.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tile {
  padding: 9px 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.tile-label {
  color: var(--text-3);
  font: 700 10.5px/1.1 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tile-val {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  font: 400 20px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.tile-val .ico {
  width: 18px;
  height: 18px;
}

.tile.blue .tile-val { color: var(--blue-l); }
.tile.amber .tile-val { color: var(--amber-l); }
.tile.green .tile-val { color: var(--green-l); }
.tile.red .tile-val { color: var(--red-l); }
.tile.magenta .tile-val { color: var(--magenta-l); }

/* Lists of things (units, powered buildings, workers). */
.list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}

button.list-row:active {
  background: rgba(154, 77, 255, 0.22);
  border-color: var(--edge);
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-name {
  overflow: hidden;
  font: 400 13.5px/1.2 var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-sub {
  overflow: hidden;
  color: var(--text-2);
  font: 500 11.5px/1.25 var(--font-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-main .bar {
  height: 5px;
  margin-top: 4px;
}

.list-end {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font: 400 13px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 2px 6px;
  color: var(--purple-l);
  font: 400 12px/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.group-head:first-child {
  margin-top: 0;
}

.group-head small {
  color: var(--text-3);
  font: 700 11px/1 var(--font-ui);
  letter-spacing: 0;
  text-transform: none;
}

.empty {
  padding: 22px 12px;
  color: var(--text-3);
  font: 600 13px/1.35 var(--font-ui);
  text-align: center;
}

.empty .ico {
  display: block;
  margin: 0 auto 8px;
  opacity: 0.75;
}

/* Message boxes. Default is blue (information). */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(47, 125, 255, 0.55);
  border-radius: 12px;
  background: rgba(47, 125, 255, 0.13);
  color: #d9eaff;
  font: 600 13px/1.3 var(--font-ui);
}

.alert > .ico {
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.alert b {
  display: block;
  margin-bottom: 1px;
  color: #fff;
  font: 400 13px/1.2 var(--font-display);
  letter-spacing: 0.03em;
}

.alert.ok {
  border-color: rgba(53, 212, 106, 0.55);
  background: rgba(53, 212, 106, 0.12);
  color: #dcffe6;
}

.alert.warn {
  border-color: rgba(255, 178, 31, 0.6);
  background: rgba(255, 178, 31, 0.12);
  color: #fff0cc;
}

.alert.bad {
  border-color: rgba(255, 77, 94, 0.65);
  background: rgba(255, 77, 94, 0.14);
  color: #ffe0e3;
}

/* Tabs (shop categories and the like). */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 2px;
  overflow-x: auto;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 38px;
  padding: 0 12px 2px;
  border: 1.5px solid var(--panel-4);
  border-radius: 10px;
  background: linear-gradient(180deg, #2c2543, #1d172d);
  color: var(--text-2);
  font: 400 12px/1 var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tab .ico {
  width: 16px;
  height: 16px;
}

.tab.active {
  border-color: var(--ink);
  background: linear-gradient(180deg, #ffd75a, #ffa514);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 #c96f00;
  color: #2a1500;
}

/* On / off switch (settings). */
.switch {
  position: relative;
  flex: none;
  width: 54px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  background: #3b3456;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: background 0.2s ease-out;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #cdd3e3);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease-pop);
}

.switch.on {
  background: linear-gradient(180deg, #4be07c, #1fae50);
}

.switch.on::after {
  transform: translateX(24px);
}

/* ---------------------------------------------------------------------------------------------
   5. HUD
   --------------------------------------------------------------------------------------------- */

/* A soft dark scrim behind the top rows so white text reads over a bright map. */
.hud::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: -1;
  height: calc(var(--sat) + 120px);
  background: linear-gradient(180deg, rgba(11, 8, 20, 0.72), rgba(11, 8, 20, 0));
  pointer-events: none;
}

/* Red glow round the screen edge while a raid is on. */
.hud::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  box-shadow: inset 0 0 70px rgba(255, 62, 94, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-out;
}

body.raid .hud::after {
  opacity: 1;
  animation: glow-breathe 1.6s ease-in-out infinite;
}

.hud-top {
  flex: none;
  padding: calc(var(--sat) + 6px) calc(var(--sar) + 8px) 0 calc(var(--sal) + 8px);
}

/* ----- Row 1: resources ----- */

.res-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.res-row > .logo {
  display: none;
  margin-right: 8px;
}

.chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  height: 28px;
  padding: 0 6px 0 3px;
  border: 1.5px solid var(--edge);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(46, 38, 72, 0.95), rgba(20, 15, 34, 0.95));
  box-shadow: 0 0 0 1px var(--ink), 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #fff;
  font: 400 clamp(11.5px, 3.1vw, 14px) / 1 var(--font-display);
  white-space: nowrap;
  pointer-events: auto;
}

.res-row .chip {
  flex: 1 1 0;
  max-width: 150px;
}

.chip > .ico {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5));
}

.chip .num {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 2px;
  text-align: right;
}

/* How full the storage is: a thin bar along the bottom of the chip. */
.chip-cap {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 2px;
  height: 2.5px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.13);
}

.chip-cap > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--res, var(--purple-l));
  transition: width 0.4s ease-out;
}

.chip.full .num {
  color: var(--amber-l);
}

.chip.full .chip-cap > i {
  background: var(--amber);
}

.chip.empty .num {
  color: var(--red-l);
}

.chip.energy {
  border-color: rgba(47, 125, 255, 0.85);
}

.chip.gems {
  border-color: rgba(255, 62, 165, 0.85);
}

/* The small amber plus on the gems chip (opens the Shop preview). */
.chip-plus {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0 -2px 0 2px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: linear-gradient(180deg, var(--amber-l), var(--amber));
  color: #2a1500;
}

.chip-plus .ico {
  width: 9px;
  height: 9px;
}

/* ----- Row 2: profile, builders, gems, clock ----- */

.status-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}

.status-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.chip.tall {
  height: 34px;
  padding: 0 7px 0 4px;
  border-radius: 11px;
  font-size: 13px;
}

.chip.tall > .ico {
  width: 22px;
  height: 22px;
}

.chip.tall .num {
  padding-bottom: 0;
}

.profile {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 3px 10px 3px 3px;
  border: 1.5px solid var(--edge);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(46, 38, 72, 0.95), rgba(20, 15, 34, 0.95));
  box-shadow: 0 0 0 1px var(--ink), 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: left;
  pointer-events: auto;
}

.profile-pic {
  position: relative;
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 2px solid var(--purple);
  border-radius: 11px;
  background: linear-gradient(160deg, #7a45e6, #2a1662);
  box-shadow: 0 0 10px rgba(154, 77, 255, 0.6);
}

.profile-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 54px;
}

.profile-name {
  color: var(--purple-l);
  font: 400 9.5px/1 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-lv {
  font: 400 15px/1 var(--font-display);
  text-shadow: 0 1px 0 var(--ink);
}

.profile .bar {
  height: 6px;
}

/* Builders free / total. Amber edge when every builder is busy. */
.chip.builders.busy {
  border-color: var(--amber);
}

.chip.builders.busy .num {
  color: var(--amber-l);
}

/* Day / night clock: two lines and a thin bar for the progress of the day. */
.chip.clock {
  gap: 5px;
}

.clock-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 3px;
}

.clock-day {
  color: var(--text-2);
  font: 700 9.5px/1 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clock-time {
  font: 400 12px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.chip.clock .chip-cap > i {
  background: var(--amber-l);
  transition: none;
}

.chip.clock.night {
  border-color: rgba(110, 140, 255, 0.9);
  background: linear-gradient(180deg, rgba(30, 36, 86, 0.95), rgba(13, 14, 40, 0.95));
}

.chip.clock.night .chip-cap > i {
  background: #9fb4ff;
}

/* ----- Raid banner (under the top rows) ----- */

.raid-banner {
  display: none;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  padding: 7px 12px 7px 8px;
  border: 1.5px solid var(--red);
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(128, 16, 46, 0.96), rgba(78, 16, 74, 0.96));
  box-shadow: 0 0 0 1.5px var(--ink), 0 0 18px rgba(255, 77, 94, 0.55);
  pointer-events: auto;
}

.raid-banner.open {
  display: flex;
  animation: drop-in 0.35s var(--ease-pop), raid-pulse 1.1s ease-in-out 0.35s infinite;
}

.raid-banner > .ico {
  width: 30px;
  height: 30px;
}

.raid-main {
  flex: 1;
  min-width: 0;
}

.raid-title {
  font: 400 13.5px/1.1 var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.raid-text {
  overflow: hidden;
  color: #ffd9de;
  font: 600 12px/1.25 var(--font-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raid-time {
  flex: none;
  color: var(--amber-l);
  font: 400 20px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 var(--ink);
}

/* ----- Middle: left column (goal, tasks, notifications) and right column (minimap, buttons) ----- */

.hud-mid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px calc(var(--sar) + 8px) 0 calc(var(--sal) + 8px);
}

.hud-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: min(60vw, 240px);
  transition: opacity 0.2s ease-out;
}

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Main Goal card. */
.goal-card {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 6px 7px 7px;
  border: 1.5px solid var(--purple);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(60, 38, 112, 0.96), rgba(24, 18, 40, 0.96));
  box-shadow: 0 0 0 1.5px var(--ink), var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-align: left;
  pointer-events: auto;
}

.goal-card > .ico-tile {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.goal-main {
  flex: 1;
  min-width: 0;
}

.goal-title {
  color: var(--amber);
  font: 400 12px/1 var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.goal-text {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  font: 700 12.5px/1.2 var(--font-ui);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.goal-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.goal-meta .bar {
  flex: 1;
  height: 5px;
}

.goal-count {
  flex: none;
  color: var(--text-2);
  font: 400 10.5px/1 var(--font-display);
}

.goal-reward {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 7px;
  margin-top: 4px;
  color: var(--text-2);
  font: 700 11px/1 var(--font-ui);
}

.goal-reward span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.goal-reward .ico {
  width: 13px;
  height: 13px;
}

.goal-card > .ico-chevron {
  width: 12px;
  height: 12px;
  color: var(--purple-l);
}

/* Played once when a goal is completed. */
.goal-card.flash {
  animation: goal-flash 0.9s var(--ease-out);
}

/* Active tasks: construction and training timers. */
.task-list,
.note-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.task {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 9px 5px 5px;
  overflow: hidden;
  border: 1px solid var(--edge-soft);
  border-radius: 10px;
  background: rgba(20, 15, 34, 0.9);
  box-shadow: 0 0 0 1px var(--ink);
  font: 700 11.5px/1.1 var(--font-ui);
  text-align: left;
  pointer-events: auto;
}

.task > .ico {
  width: 18px;
  height: 18px;
}

.task-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-time {
  flex: none;
  color: var(--amber-l);
  font: 400 11px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.task-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2.5px;
  background: var(--amber);
  transition: width 0.3s linear;
}

.task.waiting .task-time {
  color: var(--text-3);
}

/* Notifications: short lines that fade away. */
.note {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 9px 4px 7px;
  border-left: 3px solid var(--purple);
  border-radius: 8px;
  background: rgba(13, 10, 23, 0.78);
  color: var(--text-2);
  font: 600 11.5px/1.2 var(--font-ui);
  animation: note-in 0.25s var(--ease-out);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.note .ico {
  width: 14px;
  height: 14px;
}

.note.good { border-left-color: var(--green); }
.note.bad { border-left-color: var(--red); }
.note.energy { border-left-color: var(--blue); }
.note.warn { border-left-color: var(--amber); }

.note.out {
  opacity: 0;
  transform: translateX(-12px);
}

/* Minimap: a round frame; hud.js draws the grid turned 45 degrees (like the camera) so it fits. */
.minimap {
  position: relative;
  display: block;
  flex: none;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 2px solid var(--purple);
  border-radius: 50%;
  background: radial-gradient(circle, #1b3324 0%, #0e1712 100%);
  box-shadow: 0 0 0 2px var(--ink), var(--glow);
  pointer-events: auto;
}

.minimap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.minimap-n {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  font: 400 9px/1 var(--font-display);
  text-shadow: var(--outline);
  pointer-events: none;
}

/* Square buttons under the minimap (power network, notifications, settings). */
.side-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--edge);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(46, 38, 72, 0.95), rgba(20, 15, 34, 0.95));
  box-shadow: 0 0 0 1px var(--ink), 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  transition: transform 0.08s ease-out;
}

.side-btn:active {
  transform: translateY(2px);
}

.side-btn .ico {
  width: 26px;
  height: 26px;
}

.side-btn.energy {
  border-color: rgba(47, 125, 255, 0.85);
}

/* Power shortage: the power button pulses red. */
.side-btn.warn {
  border-color: var(--red);
  animation: raid-pulse 1.1s ease-in-out infinite;
}
.side-btn.helper.glow { border-color: #ffba00; animation: helper-glow 1.4s ease-in-out infinite; }
@keyframes helper-glow { 0%, 100% { box-shadow: 0 0 0 0 #ffba0000; } 50% { box-shadow: 0 0 0 4px #ffba0066, 0 0 18px #ffba00aa; } }
.modal.helper { max-width: 420px; }
.helper-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.helper-head img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #b026ff; background: #241a3a; }
.helper-head b { display: block; font-size: 19px; }
.helper-head small { color: #b9b0d8; font-size: 13px; }
.helper-need { margin: 4px 0 10px; padding: 8px 10px; border-radius: 10px; background: #ffba0018; border: 1px solid #ffba0055; color: #ffe2a0; font-weight: 700; font-size: 14px; }
.helper-step { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #ffffff14; }
.helper-step p { flex: 1; margin: 0; font-size: 14.5px; line-height: 1.4; }
.helper-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #8a2be2; font-weight: 800; font-size: 13px; }
.helper-step .btn { flex: none; }

/* ----- Placement bar (placement and move modes) ----- */

.place-bar {
  display: none;
  align-items: center;
  gap: 10px;
  flex: none;
  width: min(calc(100% - 16px - var(--sal) - var(--sar)), 430px);
  margin: 0 auto calc(var(--sab) + 12px);
  padding: 8px 10px;
  border: 2px solid var(--purple);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(40, 31, 66, 0.97), rgba(21, 16, 34, 0.97));
  box-shadow: 0 0 0 2px var(--ink), var(--glow);
  pointer-events: auto;
}

body.placing .place-bar {
  display: flex;
  animation: rise-in 0.3s var(--ease-pop);
}

body.placing .nav {
  display: none;
}

body.placing .hud-left,
body.placing .side-btns {
  visibility: hidden;
  opacity: 0;
}

.place-main {
  flex: 1;
  min-width: 0;
}

.place-name {
  overflow: hidden;
  font: 400 15px/1.15 var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-hint {
  color: var(--green-l);
  font: 600 12px/1.25 var(--font-ui);
}

.place-hint.bad {
  color: var(--red-l);
}

/* ----- Bottom navigation ----- */

.nav {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 5px;
  flex: none;
  padding: 10px calc(var(--sar) + 8px) calc(var(--sab) + 8px) calc(var(--sal) + 8px);
  background: linear-gradient(180deg, rgba(11, 8, 20, 0) 0%, rgba(11, 8, 20, 0.82) 38%, rgba(11, 8, 20, 0.96) 100%);
  pointer-events: auto;
}

.nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 96px;
  height: var(--nav-btn-h);
  padding-bottom: 2px;
  border: 2px solid #473d6e;
  border-radius: 14px;
  background: linear-gradient(180deg, #2f2748, #191427);
  box-shadow: 0 0 0 1.5px var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.1), inset 0 -4px 0 rgba(0, 0, 0, 0.3);
  color: #fff;
  font: 400 clamp(9.5px, 2.6vw, 12px) / 1 var(--font-display);
  letter-spacing: 0.01em;
  text-align: center;
  text-shadow: 0 1px 0 var(--ink);
  transition: transform 0.12s var(--ease-out), border-color 0.15s ease-out, background 0.15s ease-out;
}

.nav-btn .ico {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4));
}

.nav-btn:active {
  transform: translateY(2px);
}

.nav-btn.active {
  border-color: var(--purple-l);
  background: linear-gradient(180deg, #6a38d6, #2f176e);
  box-shadow: 0 0 0 1.5px var(--ink), 0 0 16px rgba(154, 77, 255, 0.75), inset 0 2px 0 rgba(255, 255, 255, 0.22),
    inset 0 -4px 0 rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

/* The Shop tab carries the magenta premium edge. */
.nav-btn.premium {
  border-color: rgba(255, 62, 165, 0.8);
  background: linear-gradient(180deg, #4a2251, #1f1229);
}

.nav-btn.premium.active {
  border-color: var(--magenta-l);
  background: linear-gradient(180deg, #d02c8a, #5e1244);
  box-shadow: 0 0 0 1.5px var(--ink), 0 0 16px rgba(255, 62, 165, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.22),
    inset 0 -4px 0 rgba(0, 0, 0, 0.3);
}

/* ---------------------------------------------------------------------------------------------
   6. Labels pinned to the map (JS sets left and top in pixels; CSS does the centring)
   --------------------------------------------------------------------------------------------- */

/* Floating "+120" labels. Removed by JS on animationend. */
.floater {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--res, #fff);
  font: 400 17px/1 var(--font-display);
  text-shadow: var(--outline), 0 3px 5px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: float-up 1.25s var(--ease-out) forwards;
  will-change: transform, opacity;
}

.floater .ico {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 0 var(--ink));
}

.floater.small {
  font-size: 13px;
}

.floater.small .ico {
  width: 14px;
  height: 14px;
}

.floater.big {
  font-size: 22px;
}

.floater.dmg {
  color: var(--red-l);
  font-size: 13px;
  animation-duration: 0.8s;
}

.floater.good {
  color: var(--green-l);
}

/* Countdown bubble over the selected construction site. */
.site-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 124px;
  margin-top: -14px;
  padding: 6px 9px 8px;
  border: 1.5px solid var(--purple);
  border-radius: 13px;
  background: rgba(22, 17, 37, 0.96);
  box-shadow: 0 0 0 1.5px var(--ink), var(--glow);
  transform: translate(-50%, -100%);
  pointer-events: auto;
}

/* The pointer under the bubble. */
.site-tag::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-right: 1.5px solid var(--purple);
  border-bottom: 1.5px solid var(--purple);
  background: rgb(22, 17, 37);
  transform: rotate(45deg);
}

.site-title {
  color: var(--purple-l);
  font: 400 10.5px/1 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font: 400 16px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.site-time .ico {
  width: 16px;
  height: 16px;
}

.site-tag .bar {
  width: 100%;
  height: 6px;
}

.site-tag .btn {
  min-height: 32px;
  margin-top: 2px;
  padding: 0 10px 2px;
  font-size: 12px;
}

/* The builder is still walking to the site. */
.site-tag.waiting .site-time {
  color: var(--amber-l);
  font-size: 12.5px;
}

/* A bobbing bubble over a building with stock to collect. */
.collect-bubble {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -44px 0 0 -20px;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 50% 50% / 46% 46% 54% 54%;
  background: linear-gradient(180deg, #ffffff, #dcd4f5);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(154, 77, 255, 0.55);
  animation: bob 1.4s ease-in-out infinite;
  pointer-events: auto;
}

.collect-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: #dcd4f5;
  transform: rotate(45deg);
}

.collect-bubble .ico {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
}

/* Storage inside the building is full: amber ring. */
.collect-bubble.full {
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), 0 0 0 3px var(--amber), 0 0 14px rgba(255, 178, 31, 0.8);
}

/* A small name tag over a building. */
.map-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px 2px 3px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: rgba(20, 15, 34, 0.86);
  box-shadow: 0 0 0 1px var(--ink);
  font: 400 9px/1.05 var(--font-display);
  opacity: 0.94;
  white-space: nowrap;
  transform: translate(-50%, -100%);
}

.map-tag .ico {
  width: 13px;
  height: 13px;
}

.map-tag small {
  display: block;
  color: var(--purple-l);
  font: 700 8px/1.05 var(--font-ui);
}

.map-tag.off {
  border-color: var(--red);
}

/* A ring that grows under the finger during a long-press (duration from --dur). */
.press-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border: 4px solid var(--amber-l);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 178, 31, 0.8), inset 0 0 12px rgba(255, 178, 31, 0.5);
  animation: press-grow var(--dur, 0.45s) linear forwards;
}

/* ---------------------------------------------------------------------------------------------
   7. Sheets (slide-up panels)
   --------------------------------------------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(8, 5, 16, 0.62);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease-out, visibility 0s linear 0.25s;
}

.backdrop.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease-out, visibility 0s;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  max-height: min(82dvh, 760px);
  margin: 0 auto;
  padding-bottom: var(--sab);
  border: 2px solid var(--purple);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, #251d3b 0%, #171226 38%, #120e1d 100%);
  box-shadow: 0 0 0 2px var(--ink), 0 -6px 30px rgba(154, 77, 255, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(calc(100% + 40px));
  visibility: hidden;
  transition: transform 0.34s var(--ease-out), visibility 0s linear 0.34s;
}

.sheet.open {
  transform: none;
  visibility: visible;
  transition: transform 0.34s var(--ease-out), visibility 0s;
}

/* A bright streak in the top edge: the neon highlight. */
.sheet::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ecd9ff, transparent);
  pointer-events: none;
}

/* The docked sheet: sits above the bottom navigation, no backdrop, the map stays in view.
   Used for the building panel and for the small unit / worker cards. */
.sheet.dock {
  left: calc(var(--sal) + 6px);
  right: calc(var(--sar) + 6px);
  bottom: calc(var(--nav-h) + var(--sab) + 2px);
  z-index: 20;
  width: auto;
  max-height: 54vh;
  max-height: min(54dvh, 500px);
  padding-bottom: 0;
  border-bottom: 2px solid var(--purple);
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--ink), 0 0 22px rgba(154, 77, 255, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(26px);
  transition: transform 0.26s var(--ease-out), opacity 0.2s ease-out, visibility 0s linear 0.26s;
}

.sheet.dock.open {
  opacity: 1;
  transform: none;
  transition: transform 0.26s var(--ease-out), opacity 0.2s ease-out, visibility 0s;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 12px 12px 10px 14px;
  border-bottom: 1px solid var(--edge-soft);
}

.sheet-head > .ico {
  width: 28px;
  height: 28px;
}

.sheet-titles {
  flex: 1;
  min-width: 0;
}

.sheet-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 400 20px/1.1 var(--font-display);
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sheet-sub {
  margin-top: 2px;
  color: var(--text-2);
  font: 500 12px/1.25 var(--font-ui);
}

/* The square close button (also used on modals). */
.sheet-close,
.modal-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(201, 161, 255, 0.55);
  border-radius: 11px;
  background: linear-gradient(180deg, #3a3158, #221b36);
  box-shadow: 0 0 0 1.5px var(--ink), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #fff;
  transition: transform 0.08s ease-out;
}

.sheet-close:active,
.modal-close:active {
  transform: scale(0.92);
}

.sheet-close .ico,
.modal-close .ico {
  width: 15px;
  height: 15px;
}

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 14px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(154, 77, 255, 0.6) transparent;
}

.sheet-body::-webkit-scrollbar {
  width: 4px;
}

.sheet-body::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background: rgba(154, 77, 255, 0.6);
}

.sheet-foot {
  flex: none;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--edge-soft);
  background: rgba(11, 8, 20, 0.55);
}

.sheet.dock .sheet-foot {
  border-radius: 0 0 16px 16px;
}

/* ---------------------------------------------------------------------------------------------
   8. Build menu
   --------------------------------------------------------------------------------------------- */

.build-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.build-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1.5px solid var(--panel-4);
  border-radius: 14px;
  background: linear-gradient(180deg, #2d2545, #1b1529);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 0 rgba(0, 0, 0, 0.4);
  text-align: left;
  transition: transform 0.08s ease-out, border-color 0.15s ease-out;
}

.build-card:active {
  border-color: var(--purple-l);
  transform: translateY(2px);
}

.build-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.build-titles {
  flex: 1;
  min-width: 0;
}

.build-name {
  font: 400 14px/1.1 var(--font-display);
}

.build-count {
  margin-top: 3px;
  color: var(--text-3);
  font: 700 11px/1 var(--font-ui);
}

.build-desc {
  display: -webkit-box;
  min-height: 2.5em;
  overflow: hidden;
  color: var(--text-2);
  font: 500 12px/1.25 var(--font-ui);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.build-foot {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Not available yet: greyed, with the reason in amber. */
.build-card.locked {
  border-color: #3a3355;
  background: linear-gradient(180deg, #231e33, #17131f);
}

.build-card.locked .ico-tile,
.build-card.locked .build-name,
.build-card.locked .build-desc {
  filter: grayscale(0.8);
  opacity: 0.6;
}

.build-lock {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: var(--amber-l);
  font: 700 11.5px/1.25 var(--font-ui);
}

.build-lock .ico {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

/* ---------------------------------------------------------------------------------------------
   9. Building panel (the docked sheet)
   --------------------------------------------------------------------------------------------- */

.bp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 10px 10px 10px 12px;
  border-bottom: 1px solid var(--edge-soft);
}

.bp-head > .ico-tile {
  width: 62px;
  height: 62px;
  border-radius: 14px;
}

.bp-titles {
  flex: 1;
  min-width: 0;
}

.bp-name {
  overflow: hidden;
  font: 400 19px/1.1 var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Lv. 6 > Lv. 7" */
.lv-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font: 400 14px/1 var(--font-display);
}

.lv-now {
  color: var(--text-2);
}

.lv-next {
  color: var(--amber-l);
}

.lv-line .ico {
  width: 11px;
  height: 11px;
  color: var(--text-3);
}

.bp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.bp-head .sheet-close {
  align-self: flex-start;
}

.bp-desc {
  margin-bottom: 10px;
  color: var(--text-2);
  font: 500 12.5px/1.35 var(--font-ui);
}

/* Health line: a heart, a bar and the numbers. */
.hp-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 400 12px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.hp-line .ico {
  width: 16px;
  height: 16px;
}

.hp-line .bar {
  flex: 1;
}

/* Construction / upgrade in progress. */
.progress-block {
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 178, 31, 0.4);
  border-radius: 12px;
  background: rgba(255, 178, 31, 0.08);
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font: 400 13px/1.1 var(--font-display);
}

.progress-top .time-chip {
  color: var(--amber-l);
  font-size: 15px;
}

.progress-block .bar {
  height: 10px;
}

.progress-block .hint {
  margin-top: 6px;
}

/* Footer: cost on the left, time on the right, then the action buttons. */
.bp-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 9px;
}

.foot-label {
  margin-bottom: 4px;
  color: var(--text-3);
  font: 700 10.5px/1 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.foot-cell {
  min-width: 0;
}

.foot-cell.end {
  flex: none;
  text-align: right;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions .btn {
  flex: 1 1 auto;
}

.actions .btn-icon {
  flex: none;
}

/* Why the main action is unavailable. */
.reason {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: var(--amber-l);
  font: 700 12px/1.25 var(--font-ui);
}

.reason .ico {
  width: 14px;
  height: 14px;
}

/* ---------------------------------------------------------------------------------------------
   10. Barracks training
   --------------------------------------------------------------------------------------------- */

.train-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.train-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  padding: 10px;
  border: 1.5px solid var(--panel-4);
  border-radius: 14px;
  background: linear-gradient(180deg, #2d2545, #1b1529);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.train-name {
  font: 400 15px/1.1 var(--font-display);
}

.train-desc {
  margin-top: 2px;
  color: var(--text-2);
  font: 500 12px/1.25 var(--font-ui);
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 5px;
}

.mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-2);
  font: 700 12px/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
}

.mini-stat .ico {
  width: 14px;
  height: 14px;
}

/* The bottom strip of a training card: cost and time on the left, the buttons on the right. */
.train-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.train-price {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.train-btns {
  display: flex;
  gap: 6px;
  flex: none;
}

.train-card.locked {
  border-color: #3a3355;
}

.train-card.locked .ico-tile,
.train-card.locked .train-name,
.train-card.locked .train-desc,
.train-card.locked .mini-stats {
  filter: grayscale(0.8);
  opacity: 0.6;
}

/* The queue: a strip of small tiles, the first one in training. */
.queue {
  display: flex;
  gap: 9px;
  padding: 8px 4px 6px;
  overflow-x: auto;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.queue::-webkit-scrollbar {
  display: none;
}

.queue-item {
  position: relative;
  flex: none;
  width: 60px;
  padding: 6px 5px 6px;
  border: 1.5px solid var(--panel-4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.queue-item > .ico {
  width: 34px;
  height: 34px;
}

.queue-item.active {
  border-color: var(--amber);
  background: rgba(255, 178, 31, 0.1);
}

.queue-item .bar {
  height: 5px;
  margin-top: 4px;
}

.queue-time {
  margin-top: 4px;
  color: var(--amber-l);
  font: 400 10.5px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.queue-item:not(.active) .queue-time {
  color: var(--text-3);
}

.queue-x {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(180deg, #ff7a87, #d92b45);
  color: #fff;
}

/* A bigger invisible touch area round the small cancel button. */
.queue-x::after {
  content: '';
  position: absolute;
  inset: -10px;
}

.queue-x .ico {
  width: 9px;
  height: 9px;
}

.queue-empty {
  padding: 12px 4px;
  color: var(--text-3);
  font: 600 12.5px/1.3 var(--font-ui);
}

/* ---------------------------------------------------------------------------------------------
   11. Power Network panel
   --------------------------------------------------------------------------------------------- */

.power-gauge {
  position: relative;
  height: 28px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #0d0a17;
  box-shadow: 0 0 0 1.5px rgba(47, 125, 255, 0.6), inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.power-gauge > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%)
      0 0 / 80px 100% repeat-x,
    linear-gradient(90deg, #1746b8, #2f7dff 60%, #8fd0ff);
  box-shadow: 0 0 12px var(--blue);
  transition: width 0.5s var(--ease-out);
  animation: flow 1.6s linear infinite;
}

.power-gauge.over > i {
  background: linear-gradient(90deg, #b81e3a, #ff4d5e 60%, #ff9aa4);
  box-shadow: 0 0 12px var(--red);
  animation: none;
}

.power-gauge-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 400 12.5px/1 var(--font-display);
  letter-spacing: 0.04em;
  text-shadow: var(--outline);
}

.power-gauge + .tiles,
.tiles + .alert,
.alert + .tiles,
.power-gauge + .alert {
  margin-top: 10px;
}

/* ---------------------------------------------------------------------------------------------
   12. Coming-soon panels: Craft, Research, Alliance, Shop
   --------------------------------------------------------------------------------------------- */

.soon-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 4px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6dbb, #c2187a);
  color: #fff;
  font: 400 10.5px/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.soon-tag .ico {
  width: 11px;
  height: 11px;
}

/* The banner at the top of a preview panel. */
.soon-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 12px;
  overflow: hidden;
  border: 1.5px solid var(--purple);
  border-radius: 16px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(154, 77, 255, 0.55), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, rgba(255, 62, 165, 0.38), transparent 60%), #1b1430;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.soon-hero-main {
  flex: 1;
  min-width: 0;
}

.soon-hero-title {
  font: 400 18px/1.1 var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.soon-hero-text {
  margin-top: 4px;
  color: var(--text-2);
  font: 500 12.5px/1.35 var(--font-ui);
}

.soon-hero .soon-tag {
  margin-top: 8px;
}

/* ----- Research preview: one card per branch with a chain of technologies ----- */

.branch {
  margin-bottom: 10px;
  padding: 10px 10px 6px;
  border: 1.5px solid var(--panel-4);
  border-radius: 14px;
  background: linear-gradient(180deg, #2a2240, #1b1529);
}

.branch:last-child {
  margin-bottom: 0;
}

.branch-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.branch-titles {
  flex: 1;
  min-width: 0;
}

.branch-name {
  font: 400 15px/1.1 var(--font-display);
}

.branch-desc {
  margin-top: 2px;
  color: var(--text-2);
  font: 500 12px/1.25 var(--font-ui);
}

.tech-tree {
  display: flex;
  align-items: stretch;
  padding: 4px 2px 8px;
  overflow-x: auto;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.tech-tree::-webkit-scrollbar {
  display: none;
}

.tech {
  position: relative;
  flex: none;
  width: 116px;
  margin-right: 22px;
  padding: 8px;
  border: 1.5px solid var(--panel-4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.tech:last-child {
  margin-right: 0;
}

/* The glowing link to the next technology. */
.tech:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: calc(100% + 1.5px);
  width: 22px;
  height: 3px;
  margin-top: -1.5px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  box-shadow: 0 0 6px rgba(154, 77, 255, 0.8);
}

.tech-tier {
  color: var(--purple-l);
  font: 700 10px/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tech-name {
  margin-top: 4px;
  font: 400 12px/1.15 var(--font-display);
}

.tech-desc {
  margin-top: 3px;
  color: var(--text-2);
  font: 500 11px/1.25 var(--font-ui);
}

.tech-cost {
  margin-top: 6px;
}

.tech-cost .cost-item {
  font-size: 11px;
}

.tech-cost .cost-item .ico {
  width: 14px;
  height: 14px;
}

/* ----- Shop preview: fixed bundles and prices, nothing can be bought ----- */

.offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.offer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1.5px solid var(--purple);
  border-radius: 16px;
  background: radial-gradient(130% 100% at 0% 0%, rgba(154, 77, 255, 0.4), transparent 62%), #1d1631;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.offer.wide {
  grid-column: 1 / -1;
}

/* Card products get the magenta premium edge. */
.offer.premium {
  border-color: var(--magenta);
  background: radial-gradient(130% 100% at 0% 0%, rgba(255, 62, 165, 0.34), transparent 62%), #1d1631;
}

.offer-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.offer-titles {
  flex: 1;
  min-width: 0;
}

.offer-title {
  font: 400 15px/1.08 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.offer-text {
  margin-top: 3px;
  color: var(--text-2);
  font: 500 12px/1.3 var(--font-ui);
}

.offer-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.offer-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  font: 700 12px/1.2 var(--font-ui);
}

.offer-line .ico {
  width: 16px;
  height: 16px;
}

.offer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
}

/* A price plate. In the prototype every plate is .soon: shown, toned down, not a button. */
.price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 34px;
  padding: 0 12px 2px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffd75a, #ffa514);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 #c96f00;
  color: #2a1500;
  font: 400 15px/1 var(--font-display);
  white-space: nowrap;
}

.price.soon {
  filter: saturate(0.5) brightness(0.88);
}

.gem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gem-pack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 6px 9px;
  border: 1.5px solid var(--panel-4);
  border-radius: 14px;
  background: linear-gradient(180deg, #2f2649, #1b1529);
  text-align: center;
}

.gem-amount {
  font: 400 17px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.gem-word {
  color: var(--text-2);
  font: 700 10.5px/1 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* A little heap of gem icons: bigger packs show more of them. */
.gem-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 44px;
  margin: 2px 0;
}

.gem-art .ico {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 6px rgba(255, 62, 165, 0.6));
}

.gem-art .ico + .ico {
  margin-left: -13px;
}

.gem-art .ico:nth-child(2) {
  width: 36px;
  height: 36px;
}

.gem-pack .price {
  min-width: 0;
  width: 100%;
  height: 30px;
  font-size: 13px;
}

.cos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cos-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font: 700 11.5px/1.2 var(--font-ui);
  text-align: center;
}

.shop-note {
  margin-top: 14px;
  color: var(--text-3);
  font: 500 11.5px/1.4 var(--font-ui);
  text-align: center;
}

/* ---------------------------------------------------------------------------------------------
   13. Modals: welcome, raid result, confirm, settings
   --------------------------------------------------------------------------------------------- */

.modal-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sat) + 16px) calc(var(--sar) + 16px) calc(var(--sab) + 16px) calc(var(--sal) + 16px);
  background: rgba(8, 5, 16, 0.74);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease-out, visibility 0s linear 0.25s;
}

.modal-wrap.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease-out, visibility 0s;
}

.modal {
  position: relative;
  width: min(100%, 384px);
  max-height: 100%;
  padding: 20px 16px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border: 2px solid var(--purple);
  border-radius: 20px;
  background: linear-gradient(180deg, #281f40 0%, #171226 45%, #120e1d 100%);
  box-shadow: 0 0 0 2px var(--ink), 0 0 36px rgba(154, 77, 255, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  transform: translateY(18px) scale(0.94);
  transition: transform 0.34s var(--ease-pop);
  scrollbar-width: none;
}

.modal::-webkit-scrollbar {
  display: none;
}

.modal-wrap.open .modal {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.modal-title {
  font: 400 22px/1.1 var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal-text {
  margin: 8px 0 0;
  color: var(--text-2);
  font: 500 14px/1.4 var(--font-ui);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .btn {
  flex: 1 1 0;
  min-width: 0;
}

.modal > .ico-tile {
  margin: 0 auto 10px;
}

/* ----- Welcome card: logo, three lines, one button ----- */

.welcome .logo {
  margin: 4px 0 2px;
}

.welcome-tag {
  color: var(--purple-l);
  font: 400 10.5px/1.3 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.welcome-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 16px 0 0;
  text-align: left;
}

.welcome-line {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-2);
  font: 600 13px/1.3 var(--font-ui);
}

.welcome-line > .ico {
  width: 32px;
  height: 32px;
}

.welcome-line b {
  display: block;
  color: var(--amber-l);
  font: 400 13.5px/1.2 var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ----- Raid result ----- */

.result-crest {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto 10px;
  border: 3px solid var(--amber);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #7a45e6, #2a1662 75%);
  box-shadow: 0 0 0 2px var(--ink), 0 0 26px rgba(255, 178, 31, 0.6);
  animation: crest-pop 0.6s var(--ease-pop) 0.1s both;
}

.result-crest .ico {
  width: 52px;
  height: 52px;
}

.result-title {
  font: 400 28px/1.05 var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 3px 0 var(--ink);
}

.result.won .result-title {
  color: var(--amber-l);
}

.result.lost {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--ink), 0 0 36px rgba(255, 77, 94, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.08);
}

.result.lost .result-crest {
  border-color: var(--red);
  background: radial-gradient(circle at 50% 35%, #b32a3d, #401019 75%);
  box-shadow: 0 0 0 2px var(--ink), 0 0 26px rgba(255, 77, 94, 0.6);
}

.result.lost .result-title {
  color: var(--red-l);
}

.result-sub {
  margin-top: 6px;
  color: var(--text-2);
  font: 500 13.5px/1.35 var(--font-ui);
}

.result .section {
  text-align: left;
}

.loot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
}

.loot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  font: 400 15px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.loot-item .ico {
  width: 26px;
  height: 26px;
}

.loot-item.gain {
  color: var(--green-l);
}

.loot-item.loss {
  color: var(--red-l);
}

.loot-label {
  color: var(--text-3);
  font: 700 10.5px/1 var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result .btn-lg {
  margin-top: 18px;
}

/* ----- Settings ----- */

.set-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  text-align: left;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.set-row > .ico {
  width: 24px;
  height: 24px;
}

.set-main {
  flex: 1;
  min-width: 0;
}

.set-label {
  font: 700 14px/1.2 var(--font-ui);
}

.set-sub {
  margin-top: 1px;
  color: var(--text-3);
  font: 500 11.5px/1.25 var(--font-ui);
}

.version {
  margin-top: 14px;
  color: var(--text-3);
  font: 600 11px/1.3 var(--font-ui);
  text-align: center;
}

/* ---------------------------------------------------------------------------------------------
   14. Toasts
   --------------------------------------------------------------------------------------------- */

.toasts {
  position: fixed;
  top: calc(var(--sat) + 168px);
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 360px);
  padding: 9px 14px 9px 10px;
  border: 1.5px solid var(--purple);
  border-radius: 12px;
  background: rgba(19, 13, 33, 0.97);
  box-shadow: 0 0 0 1.5px var(--ink), 0 6px 18px rgba(0, 0, 0, 0.5);
  font: 700 13.5px/1.25 var(--font-ui);
  animation: toast-in 0.28s var(--ease-pop) both;
}

.toast .ico {
  width: 20px;
  height: 20px;
}

.toast.bad {
  border-color: var(--red);
}

.toast.good {
  border-color: var(--green);
}

.toast.energy {
  border-color: var(--blue);
}

.toast.warn {
  border-color: var(--amber);
}

.toast.out {
  animation: toast-out 0.25s ease-in forwards;
}

/* ---------------------------------------------------------------------------------------------
   15. Loading screen
   --------------------------------------------------------------------------------------------- */

.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: calc(var(--sat) + 24px) 28px calc(var(--sab) + 52px);
  background: url('/assets/blox/loading.webp') center / cover no-repeat,
    radial-gradient(120% 90% at 50% 30%, #3a2378 0%, #170f2c 60%, #0b0814 100%);
  transition: opacity 0.5s ease-out, visibility 0s linear 0.5s;
}

/* Darkens the lower part of the artwork so the logo and the bar read clearly. */
.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 8, 20, 0) 35%, rgba(11, 8, 20, 0.78) 72%, rgba(11, 8, 20, 0.96) 100%);
}

.loading > * {
  position: relative;
}

.loading.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.load-tag {
  margin-top: 10px;
  color: var(--text-2);
  font: 400 11px/1.4 var(--font-display);
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.load-bar {
  width: min(100%, 320px);
  height: 16px;
  margin-top: 22px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: #0d0a17;
  box-shadow: 0 0 0 1.5px var(--purple), var(--glow);
}

.load-bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple-d), var(--purple) 55%, var(--magenta));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: width 0.3s ease-out;
}

.load-text {
  min-height: 1.3em;
  margin-top: 9px;
  color: var(--text-2);
  font: 600 12px/1.3 var(--font-ui);
  text-align: center;
}

.load-text.bad {
  color: var(--red-l);
}

/* ---------------------------------------------------------------------------------------------
   16. Animations
   --------------------------------------------------------------------------------------------- */

@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  14% { opacity: 1; transform: translate(-50%, -85%) scale(1.18); }
  28% { opacity: 1; transform: translate(-50%, -110%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -270%) scale(1); }
}

/* Used instead of float-up when motion is reduced: the label just shows and fades. */
@keyframes fade-hold {
  0% { opacity: 0; }
  12% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes press-grow {
  0% { opacity: 0.2; transform: scale(0.35); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes raid-pulse {
  0%, 100% { box-shadow: 0 0 0 1.5px var(--ink), 0 0 10px rgba(255, 77, 94, 0.4); }
  50% { box-shadow: 0 0 0 1.5px var(--ink), 0 0 24px rgba(255, 77, 94, 0.9); }
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes drop-in {
  0% { opacity: 0; transform: translateY(-14px) scale(0.96); }
  100% { opacity: 1; transform: none; }
}

@keyframes rise-in {
  0% { opacity: 0; transform: translateY(22px); }
  100% { opacity: 1; transform: none; }
}

@keyframes toast-in {
  0% { opacity: 0; transform: translateY(-10px) scale(0.9); }
  100% { opacity: 1; transform: none; }
}

@keyframes toast-out {
  0% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

@keyframes note-in {
  0% { opacity: 0; transform: translateX(-14px); }
  100% { opacity: 1; transform: none; }
}

@keyframes num-up {
  0% { transform: scale(1); }
  35% { transform: scale(1.2); color: var(--green-l); }
  100% { transform: scale(1); }
}

@keyframes num-down {
  0% { transform: scale(1); }
  35% { transform: scale(0.9); color: var(--red-l); }
  100% { transform: scale(1); }
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes goal-flash {
  0% { transform: scale(1); filter: brightness(1); }
  25% { transform: scale(1.05); filter: brightness(1.7); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes crest-pop {
  0% { opacity: 0; transform: scale(0.3) rotate(-18deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes stripes-move {
  0% { background-position: 0 0; }
  100% { background-position: 22.63px 0; }
}

@keyframes flow {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 80px 0, 0 0; }
}

/* ---------------------------------------------------------------------------------------------
   17. Sizes: small phones, tablets and desktop, short landscape screens
   --------------------------------------------------------------------------------------------- */

/* Narrow phones. */
@media (max-width: 359px) {
  :root {
    --nav-h: 72px;
    --nav-btn-h: 54px;
  }

  .chip {
    padding: 0 4px 0 2px;
  }

  .chip > .ico {
    width: 15px;
    height: 15px;
  }

  .chip-plus {
    display: none;
  }

  .profile-info {
    min-width: 44px;
  }

  .nav-btn .ico {
    width: 26px;
    height: 26px;
  }

  .minimap {
    width: 78px;
    height: 78px;
  }

  .gem-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Large phones, tablets, desktop. */
@media (min-width: 600px) {
  :root {
    --nav-h: 88px;
    --nav-btn-h: 68px;
  }

  .res-row > .logo {
    display: inline-block;
  }

  .res-row {
    gap: 6px;
  }

  .chip {
    height: 32px;
    padding: 0 9px 0 5px;
    border-radius: 10px;
    font-size: 14px;
  }

  .chip > .ico {
    width: 21px;
    height: 21px;
  }

  .chip.tall {
    height: 38px;
    font-size: 14px;
  }

  .clock-time {
    font-size: 13px;
  }

  .profile-pic {
    width: 52px;
    height: 52px;
  }

  .profile-info {
    min-width: 84px;
  }

  .profile-lv {
    font-size: 17px;
  }

  .hud-left {
    width: 270px;
  }

  .goal-text {
    font-size: 13.5px;
  }

  .minimap {
    width: 124px;
    height: 124px;
  }

  .side-btn {
    width: 48px;
    height: 48px;
  }

  .nav {
    gap: 8px;
  }

  .nav-btn {
    font-size: 12.5px;
  }

  .nav-btn .ico {
    width: 34px;
    height: 34px;
  }

  .sheet.dock {
    left: 0;
    right: 0;
  }

  .build-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toasts {
    top: calc(var(--sat) + 150px);
  }
}

@media (min-width: 900px) {
  .sheet {
    max-width: 620px;
  }

  .minimap {
    width: 148px;
    height: 148px;
  }

  .floater {
    font-size: 19px;
  }
}

/* Short screens (a phone held sideways): keep the map visible. */
@media (max-height: 520px) {
  :root {
    --nav-h: 62px;
    --nav-btn-h: 46px;
  }

  .nav {
    padding-top: 8px;
  }

  .nav-btn {
    flex-direction: row;
    gap: 6px;
    max-width: 130px;
  }

  .nav-btn .ico {
    width: 24px;
    height: 24px;
  }

  .nav-btn.active {
    transform: translateY(-2px);
  }

  .task-list,
  .note-list,
  .goal-reward {
    display: none;
  }

  .minimap {
    width: 72px;
    height: 72px;
  }

  .side-btns {
    flex-direction: row;
  }

  .sheet {
    max-height: 94vh;
    max-height: 94dvh;
  }

  .sheet.dock {
    max-height: 68vh;
    max-height: 68dvh;
  }

  .toasts {
    top: calc(var(--sat) + 52px);
  }
}

/* Hover feedback where there is a real pointer. */
@media (hover: hover) {
  .btn:hover,
  .round-btn:hover,
  .step-btn:hover {
    filter: brightness(1.1);
  }

  .btn[disabled]:hover,
  .btn.is-off:hover {
    filter: grayscale(0.85) brightness(0.72);
  }

  .nav-btn:hover,
  .side-btn:hover,
  .build-card:hover,
  .sheet-close:hover,
  .modal-close:hover {
    border-color: var(--purple-l);
  }

  button.list-row:hover,
  .tab:hover {
    border-color: var(--edge);
  }
}

/* ---------------------------------------------------------------------------------------------
   18. Reduced motion (the system setting, or the game's own setting on <html>)
   --------------------------------------------------------------------------------------------- */

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

  /* Floating labels still need to be seen: they show and fade without moving. */
  .floater {
    animation-name: fade-hold !important;
    animation-duration: 1.2s !important;
    transform: translate(-50%, -150%);
  }
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0s !important;
}

html.reduce-motion .floater {
  animation-name: fade-hold !important;
  animation-duration: 1.2s !important;
  transform: translate(-50%, -150%);
}

/* Celebrations sized to the win: a banner that pops in the middle of the screen. */
.celebrate { position: fixed; left: 50%; top: 40%; z-index: 60; pointer-events: none; text-align: center;
  transform: translate(-50%, -50%); animation: celebrate-pop 1.9s cubic-bezier(.2,1.4,.4,1) forwards; }
.celebrate.lg { animation-duration: 2.6s; }
.celebrate b { display: block; font: 400 30px/1 var(--font-display); color: #ffd23e; letter-spacing: .02em; white-space: nowrap;
  text-shadow: 0 3px 0 #7a3b00, 0 0 18px rgba(255, 190, 60, .75), 0 0 2px #000; -webkit-text-stroke: 1px #5a2a00; }
.celebrate.lg b { font-size: 40px; color: #fff3b0; text-shadow: 0 4px 0 #6b2fe0, 0 0 26px rgba(180, 107, 255, .95), 0 0 50px rgba(255, 210, 62, .7); }
.celebrate span { display: block; margin-top: 8px; font: 700 14px/1.2 var(--font-ui); color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.celebrate.lg span { font-size: 16px; }
@keyframes celebrate-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; transform: translate(-50%, -54%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -62%) scale(.96); } }
.celebrate-flash { position: fixed; inset: 0; z-index: 59; pointer-events: none; background: radial-gradient(circle at 50% 42%, rgba(255, 236, 170, .55), rgba(180, 107, 255, .2) 45%, transparent 75%);
  animation: celebrate-flash .7s ease-out forwards; }
@keyframes celebrate-flash { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .celebrate { animation-duration: 1.2s; } .celebrate-flash { display: none; } }

/* Smaller call-outs for a hero's special move. */
.celebrate.sm { top: 52%; animation-duration: 1.3s; }
.celebrate.sm b { font-size: 24px; padding: 8px 18px 6px; border-radius: 16px; color: #ffe27a; background: rgba(22, 12, 44, .82);
  border: 2px solid rgba(180, 107, 255, .75); box-shadow: 0 0 24px rgba(180, 107, 255, .55);
  text-shadow: 0 2px 0 #6b2fe0, 0 0 12px rgba(255, 190, 60, .6); -webkit-text-stroke: 0; }

/* The hero bar: one round button per hero, just above the menu. */
.hero-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--sab) + 16px); z-index: 12; display: none;
  justify-content: center; gap: 14px; pointer-events: none; }
.hero-bar.show { display: flex; }
.hero-btn { position: relative; width: 66px; height: 82px; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; -webkit-tap-highlight-color: transparent; transition: transform .15s; }
.hero-btn:active { transform: scale(.92); }
.hero-face { width: 58px; height: 58px; border-radius: 50%; background: #261a42 center/cover no-repeat; border: 3px solid #5b4a8a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(0, 0, 0, .4); }
.hero-sweep { position: absolute; top: 0; left: 4px; width: 58px; height: 58px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(rgba(12, 8, 26, .78) calc(var(--cd, 0) * 360deg), transparent 0); }
.hero-name { position: absolute; top: -18px; white-space: nowrap; font: 700 10px/1 var(--font-ui); color: #fff; opacity: 0; transition: opacity .2s;
  text-shadow: 0 1px 3px #000; }
.hero-note { margin-top: 3px; padding: 2px 7px; border-radius: 8px; background: rgba(18, 12, 34, .9); border: 1px solid #4b3a78;
  font: 700 10px/1.2 var(--font-ui); color: #d8ccff; white-space: nowrap; }
.hero-hp { position: absolute; top: 52px; width: 44px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .6); overflow: hidden; }
.hero-hp i { display: block; height: 100%; background: linear-gradient(90deg, #3ddc84, #b6f36a); }
.hero-bar:not(.raid) .hero-btn { opacity: .82; }
.hero-bar.raid .hero-name { opacity: 1; }
.hero-btn.ready .hero-face { border-color: #ffd23e; box-shadow: 0 0 0 3px rgba(255, 210, 62, .35), 0 0 22px rgba(255, 190, 60, .85); animation: hero-pulse 1s ease-in-out infinite; }
.hero-btn.ready .hero-note { background: linear-gradient(180deg, #ffd23e, #ff9a1f); color: #2a1400; border-color: #ffd23e; }
.hero-btn.armed .hero-face { border-color: #c9a640; }
body.placing .hero-bar { display: none; }
.hero-btn.locked .hero-face, .hero-btn.down .hero-face { filter: grayscale(1) brightness(.55); }
.hero-btn.locked .hero-hp, .hero-btn.down .hero-hp { visibility: hidden; }
.hero-btn.fired .hero-face { animation: hero-fire .45s ease-out; }
@keyframes hero-pulse { 50% { transform: scale(1.07); } }
@keyframes hero-fire { 0% { transform: scale(1.25); box-shadow: 0 0 40px #fff; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hero-btn.ready .hero-face { animation: none; } }

/* ---------- casino pass 2: the climbing raid bounty, "so close", almost-affordable, daily gifts ---------- */

/* the bounty for winning this raid, under the raid banner's text */
.raid-bounty { display: flex !important; align-items: center; gap: 8px; margin-top: 3px; white-space: nowrap; overflow: hidden;
  font: 800 12px/1 var(--font-ui); color: var(--amber-l); }
.raid-bounty .rb-label { color: #ffd9de; font-weight: 700; }
.raid-bounty .rb-item { display: inline-flex; align-items: center; gap: 3px; }
.raid-bounty .rb-item svg, .raid-bounty .rb-item img { width: 15px; height: 15px; }
.raid-bounty .rb-streak { padding: 2px 6px; border-radius: 7px; background: linear-gradient(180deg, var(--amber-l), var(--amber)); color: #2a1400; }

/* a building or upgrade the player can nearly afford: gold edge and the true gap */
.build-card.almost { border-color: #c99b2a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 0 rgba(0, 0, 0, 0.4), 0 0 14px rgba(255, 178, 31, 0.28); }
.build-almost, .almost-line { color: var(--amber-l); font: 800 11.5px/1.2 var(--font-ui); }
.almost-line { margin: 2px 0 8px; text-align: center; }

/* raid result: the defence streak */
.streak-box { margin: 12px 0 4px; padding: 11px 12px; border-radius: 14px; border: 1.5px solid #c99b2a;
  background: linear-gradient(180deg, rgba(255, 178, 31, 0.16), rgba(255, 178, 31, 0.05)); }
.streak-head { display: flex; align-items: center; gap: 8px; font: 400 15px/1 var(--font-display); color: var(--amber-l); }
.streak-head svg { width: 20px; height: 20px; }
.streak-mult { margin-left: auto; padding: 4px 9px; border-radius: 9px; font: 400 15px/1 var(--font-display); color: #2a1400;
  background: linear-gradient(180deg, var(--amber-l), var(--amber)); box-shadow: 0 0 14px rgba(255, 178, 31, 0.6); }
.streak-pips { display: flex; gap: 5px; margin: 10px 0 8px; }
.streak-pips i { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.streak-pips i.on { background: linear-gradient(90deg, var(--amber), var(--amber-l)); box-shadow: 0 0 8px rgba(255, 178, 31, 0.6); }
.streak-pips i.new { animation: pip-in 0.7s var(--ease-pop) 0.35s both; }
@keyframes pip-in { 0% { transform: scaleY(0.2); opacity: 0; } 100% { transform: none; opacity: 1; } }
.streak-note { color: var(--text-2); font: 600 12.5px/1.3 var(--font-ui); }

/* raid result on a loss: the true gap */
.gap-box { margin: 12px 0 4px; padding: 11px 12px; border-radius: 14px; border: 1.5px solid var(--panel-4); background: rgba(255, 255, 255, 0.04); }
.gap-box.close { border-color: var(--amber); background: linear-gradient(180deg, rgba(255, 178, 31, 0.14), rgba(255, 178, 31, 0.03)); }
.gap-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gap-head b { font: 400 17px/1 var(--font-display); color: var(--text); }
.gap-box.close .gap-head b { color: var(--amber-l); font-size: 20px; }
.gap-head span { color: var(--text-3); font: 700 12px/1 var(--font-ui); }
.gap-bar { height: 10px; margin: 9px 0 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.gap-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--green-d), var(--green)); animation: gap-fill 0.9s var(--ease-out) 0.25s both; }
.gap-box.close .gap-bar i { background: linear-gradient(90deg, var(--amber-d), var(--amber-l)); }
@keyframes gap-fill { from { width: 0; } }
.gap-note { color: var(--text-2); font: 600 12.5px/1.3 var(--font-ui); }
.gap-streak { margin-top: 7px; color: var(--red-l); font: 700 12px/1.3 var(--font-ui); }

/* the daily gift calendar */
.modal.daily { text-align: center; }
.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 12px; }
.daily-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px 7px;
  border-radius: 12px; border: 1.5px solid var(--panel-4); background: linear-gradient(180deg, #2d2545, #1b1529); }
.daily-tile.big { grid-column: span 2; border-color: #c99b2a; background: linear-gradient(180deg, rgba(255, 178, 31, 0.22), rgba(120, 60, 0, 0.18)); }
.daily-day { color: var(--text-3); font: 800 10.5px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; }
.daily-tile.big .daily-day { color: var(--amber-l); }
.daily-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; }
.daily-res { display: inline-flex; align-items: center; gap: 2px; font: 800 12px/1 var(--font-ui); color: var(--text); }
.daily-res svg, .daily-res img { width: 18px; height: 18px; }
.daily-tile.big .daily-res svg, .daily-tile.big .daily-res img { width: 24px; height: 24px; }
.daily-tile.big .daily-res { font-size: 14px; }
.daily-check { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; border-radius: 11px; background: rgba(12, 8, 24, 0.62); }
.daily-check svg { width: 26px; height: 26px; }
.daily-tile.taken .daily-check { display: flex; }
.daily-tile.just .daily-check { animation: daily-stamp 0.5s var(--ease-pop); }
@keyframes daily-stamp { 0% { transform: scale(1.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
.daily-tile.today { border-color: var(--amber-l); box-shadow: 0 0 0 2px rgba(255, 220, 115, 0.35), 0 0 18px rgba(255, 178, 31, 0.7); animation: daily-glow 1.2s ease-in-out infinite; }
@keyframes daily-glow { 50% { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .daily-tile.today, .streak-pips i.new, .gap-bar i { animation: none; } }
.daily-got { display: flex; justify-content: center; gap: 12px; animation: daily-pop 0.55s var(--ease-pop); }
.daily-got .daily-res { font: 400 24px/1 var(--font-display); color: var(--amber-l); text-shadow: 0 0 14px rgba(255, 178, 31, 0.7); }
.daily-got .daily-res svg, .daily-got .daily-res img { width: 30px; height: 30px; }
.daily-sub { display: block; margin-top: 6px; color: var(--text-2); font: 600 12.5px/1.3 var(--font-ui); }
@keyframes daily-pop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- the joystick (drive the Commander during a raid) ---------- */
.joy { position: fixed; left: calc(var(--sal) + 12px); bottom: calc(var(--nav-h) + var(--sab) + 8px); z-index: 12; display: none;
  width: 112px; height: 112px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.joy.show { display: block; animation: joy-in 0.35s var(--ease-pop); }
@keyframes joy-in { from { transform: scale(0.6); opacity: 0; } }
.joy-base { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(60, 40, 110, 0.72), rgba(18, 12, 34, 0.82) 70%);
  border: 2px solid rgba(201, 161, 255, 0.55); box-shadow: 0 0 0 2px rgba(11, 8, 20, 0.7), 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 0 18px rgba(154, 77, 255, 0.35); }
.joy-arrow { position: absolute; width: 0; height: 0; border: 7px solid transparent; opacity: 0.75; }
.joy-arrow.n { top: 7px; border-bottom: 9px solid var(--purple-l); border-top-width: 0; }
.joy-arrow.s { bottom: 7px; border-top: 9px solid var(--purple-l); border-bottom-width: 0; }
.joy-arrow.w { left: 7px; border-right: 9px solid var(--purple-l); border-left-width: 0; }
.joy-arrow.e { right: 7px; border-left: 9px solid var(--purple-l); border-right-width: 0; }
.joy-knob { width: 56px; height: 56px; border-radius: 50%; background: #261a42 center/cover no-repeat; border: 3px solid #b46bff;
  box-shadow: 0 0 0 2px rgba(11, 8, 20, 0.8), 0 0 16px rgba(180, 107, 255, 0.8); transition: transform 0.12s var(--ease-out); pointer-events: none; }
.joy.held .joy-knob { transition: none; border-color: var(--amber-l); box-shadow: 0 0 0 2px rgba(11, 8, 20, 0.8), 0 0 22px rgba(255, 190, 60, 0.9); }
.joy.held .joy-base { border-color: rgba(255, 220, 115, 0.7); }
.joy.down { opacity: 0.45; filter: grayscale(1); }
/* One thumb: during a raid the stick and the three hero buttons sit together in one group at the bottom
   centre (stick 96 + 10 gap + three 62 px buttons with 8 px gaps = 308 px), never split left and right. */
.joy { left: calc(50% - 154px); bottom: calc(var(--nav-h) + var(--sab) + 21px); width: 96px; height: 96px; }
.joy-knob { width: 48px; height: 48px; }
.hero-bar.has-joy { justify-content: flex-start; gap: 8px; padding-left: calc(50% - 48px); }
.hero-bar.has-joy .hero-btn { width: 62px; }
.hero-bar.has-joy .hero-sweep { left: 2px; }
.hero-bar.has-joy .hero-name { font-size: 9px; }

/* wide windows (desktop browsers): the raid banner keeps a sensible width instead of spanning the screen */
@media (min-width: 900px) {
  .raid-banner { max-width: 600px; }
}

/* ---------- Research ---------- */
.research-now { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; padding: 11px 12px; border-radius: 14px;
  border: 1.5px solid var(--purple); background: linear-gradient(180deg, rgba(154, 77, 255, 0.22), rgba(154, 77, 255, 0.06));
  box-shadow: 0 0 16px rgba(154, 77, 255, 0.35); }
.research-now-main { flex: 1; min-width: 0; }
.research-now-label { color: var(--purple-l); font: 800 10.5px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.research-now-name { margin: 3px 0 6px; font: 400 15px/1.1 var(--font-display); }
.research-bar { height: 8px; }
.research-bar > i { background: linear-gradient(90deg, var(--purple), var(--magenta)); }
.research-now-time { display: flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--text-2); font: 700 12px/1 var(--font-ui); }
.research-now-time svg { width: 14px; height: 14px; }
.branch-count { padding: 4px 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); color: var(--text-2); font: 800 12px/1 var(--font-ui); }
.tech { width: 148px; display: flex; flex-direction: column; gap: 0; }
.tech .btn { margin-top: 8px; }
.tech .build-lock { margin-top: 6px; font-size: 11px; }
.tech .build-almost { margin-top: 5px; font-size: 11px; }
.tech.done { border-color: var(--green-d); background: linear-gradient(180deg, rgba(53, 212, 106, 0.16), rgba(53, 212, 106, 0.04)); }
.tech.active { border-color: var(--purple-l); box-shadow: 0 0 12px rgba(154, 77, 255, 0.55); }
.tech.ready { border-color: #7a5bc4; }
.tech.locked { opacity: 0.72; }
.tech.locked .tech-name, .tech.locked .tech-desc { filter: grayscale(0.6); }
.tech-done { display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 8px; color: var(--green-l); font: 800 12px/1 var(--font-ui); }
.tech-done.active { color: var(--purple-l); }
.tech-done svg { width: 14px; height: 14px; }

/* celebration banners fit any phone: long titles wrap and shrink instead of running off the edges */
.celebrate { width: min(94vw, 560px); }
.celebrate b { white-space: normal; line-height: 1.08; font-size: clamp(22px, 7.2vw, 30px); }
.celebrate.lg b { font-size: clamp(26px, 9vw, 40px); }
.celebrate.sm { width: auto; }
.celebrate.sm b { white-space: nowrap; font-size: 24px; }

/* ---------- Missions ---------- */
.side-btn.missions.ready { animation: side-pulse 1.4s ease-in-out infinite; }
@keyframes side-pulse { 50% { box-shadow: 0 0 0 2px rgba(255, 220, 115, 0.5), 0 0 18px rgba(255, 178, 31, 0.8); } }
.points-box { margin: 10px 0 10px; padding: 12px; border-radius: 14px; border: 1.5px solid #c99b2a;
  background: linear-gradient(180deg, rgba(255, 178, 31, 0.14), rgba(255, 178, 31, 0.03)); }
.points-head { display: flex; align-items: baseline; gap: 6px; }
.points-head b { font: 400 22px/1 var(--font-display); color: var(--amber-l); }
.points-head span { color: var(--text-2); font: 700 12px/1 var(--font-ui); }
.points-bar { position: relative; height: 10px; margin: 10px 0 12px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); }
.points-bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--amber-d), var(--amber-l)); }
.points-mark { position: absolute; top: -3px; width: 3px; height: 16px; margin-left: -1.5px; border-radius: 2px; background: #fff; opacity: 0.7; }
.chests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.chest-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px;
  border: 1.5px solid var(--panel-4); background: linear-gradient(180deg, #2d2545, #1b1529); color: var(--text); }
.chest-btn .chest-ico svg { width: 30px; height: 30px; }
.chest-at { color: var(--text-3); font: 800 10.5px/1 var(--font-ui); }
.chest-rew { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; }
.chest-rew .chip-res { display: inline-flex; align-items: center; gap: 2px; font: 800 11px/1 var(--font-ui); }
.chest-rew .chip-res svg, .chest-rew .chip-res img { width: 14px; height: 14px; }
.chest-btn.ready { border-color: var(--amber-l); box-shadow: 0 0 16px rgba(255, 178, 31, 0.7); animation: daily-glow 1.2s ease-in-out infinite; }
.chest-btn.ready .chest-at { color: var(--amber-l); }
.chest-btn.claimed { opacity: 0.55; }
.mission { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; padding: 10px 11px; border-radius: 13px;
  border: 1.5px solid var(--panel-4); background: linear-gradient(180deg, #2a2240, #1b1529); }
.mission-main { flex: 1; min-width: 0; }
.mission-text { font: 700 13.5px/1.25 var(--font-ui); }
.mission-sub { margin-top: 2px; color: var(--text-2); font: 600 12px/1.25 var(--font-ui); }
.mission-bar { height: 7px; margin-top: 7px; }
.mission-bar > i { background: linear-gradient(90deg, var(--green-d), var(--green)); }
.mission-n { margin-top: 4px; color: var(--text-3); font: 700 11px/1 var(--font-ui); }
.mission-pts { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); font: 800 13px/1 var(--font-ui); }
.mission-pts svg, .mission-pts img { width: 16px; height: 16px; }
.mission-pts.got { color: var(--green-l); }
.mission.done { border-color: var(--amber); box-shadow: 0 0 12px rgba(255, 178, 31, 0.35); }
.mission.claimed { opacity: 0.6; }
.mission .btn svg, .mission .btn img { width: 16px; height: 16px; }
.ach-stars { color: var(--amber-l); letter-spacing: 1px; font-size: 13px; }

/* ---------- Workshop ---------- */
.craft-list { display: grid; gap: 8px; margin-top: 10px; }
.craft-card { padding: 10px 11px; border-radius: 14px; border: 1.5px solid var(--panel-4); background: linear-gradient(180deg, #2d2545, #1b1529); }
.craft-top { display: flex; align-items: flex-start; gap: 10px; }
.craft-titles { flex: 1; min-width: 0; }
.craft-name { font: 400 14px/1.15 var(--font-display); }
.craft-desc { margin-top: 3px; color: var(--text-2); font: 600 12px/1.3 var(--font-ui); }
.craft-owned { padding: 4px 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); color: var(--text-3); font: 800 12px/1 var(--font-ui); }
.craft-owned.has { background: linear-gradient(180deg, var(--green-l), var(--green)); color: #052a12; }
.craft-foot { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.craft-cost { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.craft-btns { display: flex; gap: 8px; margin-top: 8px; }
.craft-btns .btn { flex: 1; }
.craft-card .build-almost { margin-top: 5px; }

/* ---------- Shop ---------- */
.gem-pack { position: relative; }
.gem-pack .btn, .gem-pack .price { margin-top: 8px; }
.gem-bonus { position: absolute; top: -7px; right: -5px; padding: 3px 7px; border-radius: 8px; transform: rotate(6deg);
  background: linear-gradient(180deg, var(--green-l), var(--green)); color: #052a12; font: 800 11px/1 var(--font-ui); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.offer-once { color: var(--amber-l); font: 800 11.5px/1 var(--font-ui); }
.offer-foot .buy-btn { min-width: 96px; }
.supply-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.supply { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 6px; border-radius: 13px; text-align: center;
  border: 1.5px solid var(--panel-4); background: linear-gradient(180deg, #2d2545, #1b1529); }
.supply-name { font: 400 12px/1.1 var(--font-display); }
.supply-what { min-height: 2.4em; color: var(--text-2); font: 600 11px/1.2 var(--font-ui); }
.supply .btn svg, .supply .btn img { width: 15px; height: 15px; }

/* ---------- attack mode: the camp list, the battle screen and its result ---------- */

.btn-red { --b1: #ff7a5a; --b2: #e0352a; --b-edge: #8f1a12; }
.nav-btn.attack { border-color: rgba(255, 90, 70, 0.85); background: linear-gradient(180deg, #5a2120, #24110f); }
.nav-btn.attack.active { border-color: #ffb3a6; background: linear-gradient(180deg, #e0452f, #6b1a12);
  box-shadow: 0 0 0 1.5px var(--ink), 0 0 16px rgba(255, 80, 60, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.22), inset 0 -4px 0 rgba(0, 0, 0, 0.3); }

.army-box { margin: 2px 0 12px; padding: 12px; border-radius: 14px; background: linear-gradient(180deg, #2a1f44, #1a1430); border: 1px solid var(--edge-soft); }
.army-head { display: flex; justify-content: space-between; align-items: center; font: 400 14px/1 var(--font-display); letter-spacing: .03em; color: #fff; }
.army-stars { display: inline-flex; align-items: center; gap: 4px; font: 700 13px/1 var(--font-ui); color: var(--text-2); }
.army-stars .ico, .army-stars svg { width: 18px; height: 18px; }
.army-stars b { color: var(--amber-l); font-size: 15px; }
.army-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.army-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 4px; border-radius: 10px; background: rgba(0, 0, 0, .35);
  border: 1px solid #3d3163; font: 800 13px/1 var(--font-ui); color: #fff; }
.army-chip svg, .army-chip .ico { width: 24px; height: 24px; }
.army-chip.hero { border-color: rgba(255, 210, 62, .5); }
.army-chip.hero svg { width: 16px; height: 16px; }
.army-none { font: 600 13px/1.2 var(--font-ui); color: var(--text-3); }
.army-note { margin-top: 9px; font: 600 12px/1.3 var(--font-ui); color: var(--text-3); }

.camp { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px 12px;
  border-radius: 14px; background: linear-gradient(180deg, #2b1c2a, #1a1220); border: 1px solid rgba(255, 90, 70, .35); }
.camp.done { border-color: rgba(255, 210, 62, .45); }
.camp.locked { opacity: .62; border-color: #33284d; background: #17122a; }
.camp-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #3a1d1d; border: 2px solid var(--ink);
  font: 400 16px/1 var(--font-display); color: #ffd0c8; }
.camp.locked .camp-num { background: #251d3a; color: var(--text-3); }
.camp-main { min-width: 0; }
.camp-name { font: 400 15px/1.1 var(--font-display); color: #fff; letter-spacing: .02em; }
.camp-stars { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.camp-star svg, .camp-star .ico { width: 18px; height: 18px; display: block; }
.camp-star:not(.on) svg { filter: grayscale(1) brightness(.45); }
.camp-gems { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font: 800 12px/1 var(--font-ui); color: var(--magenta-l); }
.camp-gems svg { width: 15px; height: 15px; }
.camp-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 5px; font: 600 12px/1.2 var(--font-ui); color: var(--text-2); }
.camp-meta svg { width: 16px; height: 16px; }
.camp-loot { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.camp-looted { font: 700 12px/1 var(--font-ui); color: var(--text-3); }
.camp .btn { min-height: 40px; padding: 0 12px 3px; font-size: 13px; }
.camp .build-lock { max-width: 110px; font-size: 11px; }

body.in-battle #hud, body.in-battle #labels, body.in-battle .hero-bar, body.in-battle .joy { display: none !important; }

.battle-ui { position: fixed; inset: 0; z-index: 14; pointer-events: none; font-family: var(--font-ui); }
.bt-top { position: absolute; top: calc(var(--sat) + 8px); left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 16px));
  padding: 8px 10px 9px; border-radius: 16px; background: rgba(16, 10, 26, .84); border: 1px solid rgba(255, 90, 70, .45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45); pointer-events: auto; }
.bt-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.bt-name { font: 700 12px/1.15 var(--font-ui); color: #ffc9bf; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-clock { text-align: center; }
.bt-clock b { display: block; font: 400 26px/1 var(--font-display); color: #fff; letter-spacing: .03em; text-shadow: var(--outline); }
.bt-clock-label { display: block; font: 700 10px/1.1 var(--font-ui); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.bt-clock.low b { color: #ff6b5e; animation: bt-tick 1s steps(2) infinite; }
@keyframes bt-tick { 50% { opacity: .55; } }
.bt-end { justify-self: end; min-width: 64px; height: 34px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--ink); cursor: pointer;
  background: linear-gradient(180deg, #5a4a80, #2f2749); color: #fff; font: 400 13px/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.bt-end.armed { background: linear-gradient(180deg, #ff7a5a, #c22a1f); }
.bt-score { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.bt-stars { display: flex; gap: 1px; }
.bt-star svg, .bt-star .ico { width: 24px; height: 24px; display: block; }
.bt-star:not(.on) svg { filter: grayscale(1) brightness(.4); }
.bt-pct { display: flex; align-items: baseline; gap: 4px; }
.bt-pct b { font: 400 20px/1 var(--font-display); color: #fff; }
.bt-pct span { font: 700 11px/1 var(--font-ui); color: var(--text-3); }
.bt-loot { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bt-res { display: inline-flex; align-items: center; gap: 3px; font: 800 13px/1 var(--font-ui); color: #fff; }
.bt-res svg, .bt-res .ico { width: 18px; height: 18px; }

.bt-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 120px); width: max-content; max-width: calc(100% - 32px);
  padding: 8px 14px; border-radius: 12px; background: rgba(16, 10, 26, .85); border: 1px solid #4b3a78; color: #fff; text-align: center;
  font: 600 13px/1.3 var(--font-ui); transition: opacity .4s; }
.bt-hint b { color: #ff7a6e; }
.bt-hint.gone { opacity: 0; }

.bt-cards { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 12px); display: flex; justify-content: center; gap: 8px;
  padding: 0 10px; overflow-x: auto; pointer-events: auto; scrollbar-width: none; }
.bt-cards::-webkit-scrollbar { display: none; }
.bt-card { position: relative; flex: 0 0 auto; width: 66px; height: 96px; padding: 6px 0 0; border-radius: 14px; border: 2px solid #3d3163; cursor: pointer;
  background: linear-gradient(180deg, #2a2142, #17122a); display: flex; flex-direction: column; align-items: center; gap: 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .5); transition: transform .12s, border-color .12s; -webkit-tap-highlight-color: transparent; }
.bt-card.sel { border-color: var(--amber-l); transform: translateY(-6px); box-shadow: 0 0 0 2px var(--ink), 0 0 18px rgba(255, 210, 62, .55); }
.bt-card.empty { filter: grayscale(1) brightness(.6); }
.bt-face { width: 48px; height: 48px; border-radius: 12px; background: #1d1631 center/cover no-repeat; display: grid; place-items: center; }
.bt-face.unit svg { width: 42px; height: 42px; }
.bt-card.hero .bt-face { border-radius: 50%; border: 2px solid #5b4a8a; }
.bt-sweep { position: absolute; top: 6px; left: 50%; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(rgba(12, 8, 26, .8) calc(var(--cd, 0) * 360deg), transparent 0); }
.bt-count { font: 400 14px/1 var(--font-display); color: #fff; text-shadow: var(--outline); }
.bt-card.hero .bt-count { font: 800 10px/1.05 var(--font-ui); text-align: center; padding: 0 3px; }
.bt-label { font: 700 9px/1.1 var(--font-ui); color: var(--text-3); text-align: center; padding: 0 2px; }
.bt-card.out { border-color: var(--magenta); background: linear-gradient(180deg, #4a1d45, #1f1229); }
.bt-card.out .bt-face { border-color: var(--magenta-l); }
.bt-card.ready .bt-face { animation: hero-pulse .9s ease-in-out infinite; box-shadow: 0 0 16px #ff7cc4; }
.bt-card.down .bt-face { filter: grayscale(1) brightness(.5); }
.bt-card.fired .bt-face { animation: hero-fire .45s ease-out; }

.bt-star-pop { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 61; pointer-events: none; display: flex; gap: 4px;
  animation: bt-pop 1.4s var(--ease-out) forwards; }
.bt-star-pop svg { width: 64px; height: 64px; }
.bt-star-pop .bt-star:not(.on) { display: none; }
@keyframes bt-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(.9); } }

.bt-result { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 14, .72);
  animation: bt-fade .35s ease-out; }
@keyframes bt-fade { from { opacity: 0; } }
.bt-result-card { width: min(380px, 100%); padding: 20px 18px 18px; border-radius: 20px; text-align: center;
  background: linear-gradient(180deg, #2b2044, #15102a); border: 2px solid #4b3a78; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.bt-result.won .bt-result-card { border-color: rgba(255, 210, 62, .7); box-shadow: 0 12px 40px rgba(0, 0, 0, .6), 0 0 40px rgba(255, 190, 40, .25); }
.bt-result-title { font: 400 30px/1 var(--font-display); color: #fff; letter-spacing: .03em; text-shadow: var(--outline); }
.bt-result.won .bt-result-title { color: #ffd23e; }
.bt-result-stars { display: flex; justify-content: center; gap: 6px; margin: 14px 0 8px; }
.bt-result-stars svg { width: 58px; height: 58px; }
.bt-result-stars .bt-star.on { animation: bt-land .5s var(--ease-pop) both; }
@keyframes bt-land { from { opacity: 0; transform: scale(2.2) rotate(-25deg); } }
.bt-result-pct { font: 600 14px/1.3 var(--font-ui); color: var(--text-2); }
.bt-result-pct b { color: #fff; font-size: 16px; }
.bt-result-loot { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 14px 0 6px; }
.bt-result-loot .bt-res { font-size: 16px; }
.bt-result-loot .bt-res svg { width: 24px; height: 24px; }
.bt-none { font: 600 13px/1 var(--font-ui); color: var(--text-3); }
.bt-result-note { margin: 8px 0 14px; font: 600 13px/1.45 var(--font-ui); color: var(--text-2); }
.bt-result-note svg { width: 15px; height: 15px; vertical-align: -2px; }
@media (min-width: 900px) {
  .bt-cards { bottom: 18px; gap: 10px; }
  .bt-card { width: 74px; height: 104px; }
  .bt-face { width: 54px; height: 54px; }
  .bt-sweep { width: 54px; height: 54px; margin-left: -27px; }
}
@media (prefers-reduced-motion: reduce) { .bt-card.ready .bt-face, .bt-result-stars .bt-star.on, .bt-star-pop { animation: none; } }

.practice-box { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 12px;
  border-radius: 14px; background: linear-gradient(180deg, #241d3d, #17122a); border: 1px solid var(--edge-soft); }
.practice-name { font: 400 14px/1.1 var(--font-display); color: #fff; letter-spacing: .02em; }
.practice-desc { margin-top: 3px; font: 600 12px/1.3 var(--font-ui); color: var(--text-3); }
.practice-box .btn { min-height: 40px; padding: 0 14px 3px; font-size: 13px; }

.army-board { margin-top: 10px; min-height: 38px; font-size: 13px; }

/* rivals (online) on the Attack sheet, and the "while you were away" card */
.rival-box { margin-bottom: 10px; padding: 12px; border-radius: 14px; background: linear-gradient(180deg, #3a1a1a, #1d1118); border: 1px solid rgba(255, 90, 70, .5); }
.rival-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.rival-name { font: 400 16px/1.1 var(--font-display); color: #fff; letter-spacing: .02em; }
.rival-desc { margin-top: 4px; font: 600 12px/1.3 var(--font-ui); color: var(--text-2); }
.rival-trophies { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .35); white-space: nowrap; }
.rival-trophies svg { width: 20px; height: 20px; }
.rival-trophies b { font: 400 17px/1 var(--font-display); color: var(--amber-l); }
.rival-shield { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font: 700 12px/1.3 var(--font-ui); color: var(--blue-l); }
.rival-shield svg { width: 16px; height: 16px; }
.def-list { list-style: none; margin: 14px 0 6px; padding: 0; text-align: left; }
.def-list li { padding: 9px 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); font: 600 14px/1.35 var(--font-ui); color: var(--text-2); }
.def-list li b { color: #fff; }

/* "Barracks built!": rises from the building and fades */
.float-label{position:fixed;z-index:30;transform:translate(-50%,0);padding:5px 12px;border-radius:999px;background:linear-gradient(180deg,#ffe06a,#ffb22e);color:#3a1d00;font:900 14px/1 system-ui,sans-serif;letter-spacing:.02em;box-shadow:0 3px 0 #b86a00,0 8px 18px rgba(0,0,0,.35);pointer-events:none;white-space:nowrap;animation:qxRise 1.6s cubic-bezier(.2,.8,.3,1) forwards}
@keyframes qxRise{0%{opacity:0;transform:translate(-50%,10px) scale(.6)}15%{opacity:1;transform:translate(-50%,0) scale(1.08)}25%{transform:translate(-50%,-6px) scale(1)}100%{opacity:0;transform:translate(-50%,-70px) scale(1)}}

/* ---------- squad orders (ui/squads.js): pick a squad, then tap the map ---------- */
.squad-bar { position: fixed; left: 0; right: 0; z-index: 12; display: none; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; bottom: calc(var(--nav-h) + var(--sab) + 134px); }
.squad-bar.squad-battle { position: absolute; bottom: calc(var(--sab) + 118px); }
.squad-bar.show { display: flex; animation: joy-in 0.3s var(--ease-pop); }
.squad-hint { padding: 5px 12px; border-radius: 10px; background: rgba(16, 10, 26, .82); border: 1px solid #3d3163; color: #d9d0f2;
  font: 600 12px/1.25 var(--font-ui); max-width: calc(100% - 32px); text-align: center; }
.squad-bar.picking .squad-hint { border-color: #5ee0ff; color: #fff; box-shadow: 0 0 14px rgba(94, 224, 255, .35); }
.squad-hint b { color: #8fe9ff; }
.squad-chips { display: flex; gap: 6px; padding: 0 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; pointer-events: auto; }
.squad-chips::-webkit-scrollbar { display: none; }
.squad-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; height: 40px; padding: 0 10px 0 5px; border-radius: 20px; cursor: pointer;
  border: 2px solid #3d3163; background: linear-gradient(180deg, #2a2142, #17122a); color: #fff; font: 700 12px/1 var(--font-ui);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45); -webkit-tap-highlight-color: transparent; transition: transform .12s, border-color .12s, box-shadow .12s; }
.squad-chip:active { transform: scale(.94); }
.squad-chip b { min-width: 18px; padding: 2px 5px; border-radius: 9px; background: #0d0918; color: #ffd23e; font-size: 11px; text-align: center; }
.squad-face { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #120d22; font-size: 16px; }
.squad-face svg { width: 24px; height: 24px; }
.squad-all { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #8fe9ff; box-shadow: 0 0 0 3px #120d22, 0 0 0 5px #8fe9ff; transform: scale(.7); }
.squad-chip.sel { border-color: #5ee0ff; background: linear-gradient(180deg, #1d4a5c, #12283a); box-shadow: 0 0 0 2px rgba(11, 8, 20, .8), 0 0 18px rgba(94, 224, 255, .7); }
.squad-hero { width: 28px; height: 28px; border-radius: 50%; background: center/cover no-repeat; }
.squad-bar.picking .squad-hint { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; pointer-events: auto; }
.squad-auto { border: 1px solid #6b5a9a; border-radius: 8px; padding: 5px 9px; background: #241a3d; color: #ffd23e; font: 700 12px/1 var(--font-ui); cursor: pointer; white-space: nowrap; }
body.placing .squad-bar, body.in-battle .squad-bar.squad-home { display: none !important; }
@media (max-width: 520px) { .squad-chip:not(.sel):not([data-squad="all"]) .squad-label { display: none; } }

/* sim v4: more land and the Trade Dock */
.land-card{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;margin-bottom:10px;border-radius:14px;border:2px solid #3d6b4f;background:linear-gradient(180deg,#1d3a2a,#13261c);color:#fff;text-align:left;cursor:pointer}
.land-card .land-txt{flex:1;display:flex;flex-direction:column;gap:2px}
.land-card b{font:800 15px/1.2 var(--font-ui)}
.land-card .land-txt span{font-size:12px;color:#cfe8d6}
.land-card .land-go{opacity:.7}
.trade-list{display:flex;flex-direction:column;gap:6px}
.trade-row{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1)}
.trade-row.gone{opacity:.5}
.trade-row .tr-give,.trade-row .tr-get{display:flex;gap:6px;flex:1}
.trade-row .tr-get{justify-content:flex-start}
.tr-res{display:inline-flex;align-items:center;gap:3px;font-weight:800}
.tr-res svg{width:18px;height:18px}
.tr-arrow{opacity:.7}
.land-bar{position:fixed;left:50%;top:calc(var(--sat,0px) + 70px);transform:translateX(-50%);z-index:30;display:flex;align-items:center;gap:10px;padding:8px 10px 8px 14px;border-radius:14px;background:rgba(16,10,26,.9);border:1px solid #3d6b4f;color:#fff;font:700 13px/1.3 var(--font-ui);max-width:calc(100% - 24px)}
.land-bar button{flex:0 0 auto}
.wave-btn{position:fixed;left:calc(var(--sal,0px) + 10px);bottom:calc(var(--nav-h) + var(--sab) + 128px);z-index:12;display:none;flex-direction:column;align-items:flex-start;gap:1px;padding:8px 12px;border-radius:14px;border:2px solid #ff6a5a;background:linear-gradient(180deg,#5a1d24,#36101a);color:#fff;font:800 13px/1.15 var(--font-ui);box-shadow:0 4px 12px rgba(0,0,0,.5);cursor:pointer}
.wave-btn.show{display:flex}
.wave-btn small{font-size:10px;font-weight:700;color:#ffc8c0}
.wave-btn .wv-tag{display:inline-block;margin-left:6px;padding:1px 5px;border-radius:6px;font-size:10px;background:#ffd23e;color:#2a1800}
.wave-btn .wv-tag.free{background:#3ddc84;color:#06240f}
body.in-battle .wave-btn,body.raid .wave-btn,body.placing .wave-btn{display:none !important}
body.land-mode .hero-bar,body.land-mode .joy,body.land-mode .goal-card,body.land-mode .main-goal,body.land-mode .squad-bar{display:none !important}

/* ---------- Heroes tab: portraits, rank stars, training (sim v5) ---------- */
.hero-cards { display: flex; flex-direction: column; gap: 9px; }
.hero-card { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 14px;
  border: 1.5px solid #4b3a78; background: linear-gradient(180deg, rgba(120, 80, 220, .2), rgba(120, 80, 220, .05)); }
.hero-card.training { border-color: var(--purple); box-shadow: 0 0 14px rgba(154, 77, 255, .35); }
.hero-card.locked { opacity: .6; }
.hero-card-face { flex: none; width: 58px; height: 58px; border-radius: 14px; border: 2px solid #ffd23e; background: #1c1430 center/cover no-repeat; }
.hero-card.locked .hero-card-face { filter: grayscale(1) brightness(.6); border-color: #555; }
.hero-card.training .hero-card-face { filter: saturate(.6) brightness(.8); }
.hero-card-main { flex: 1; min-width: 0; }
.hero-card-name { font: 400 15px/1.1 var(--font-display); }
.hero-card-name small { margin-left: 4px; color: var(--text-2); font: 800 12px/1 var(--font-ui); }
.hero-stars { display: flex; gap: 2px; margin: 4px 0 3px; }
.hero-stars i { display: inline-flex; width: 17px; height: 17px; }
.hero-stars i svg { width: 17px; height: 17px; }
.hero-stars i.open svg { filter: grayscale(1) brightness(.75); opacity: .75; }
.hero-stars i.shut svg { filter: grayscale(1) brightness(.4); opacity: .4; }
.hero-card-sub { color: var(--text-2); font: 700 11.5px/1.25 var(--font-ui); }
.hero-card-cost { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.hero-card-why { margin-top: 4px; color: #ffb36b; font: 700 11.5px/1.25 var(--font-ui); }
.hero-card-bar { height: 7px; margin-top: 6px; }
.hero-card-bar > i { background: linear-gradient(90deg, var(--purple), var(--magenta)); }
.hero-card-time { display: flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--text-2); font: 700 11.5px/1.2 var(--font-ui); }
.hero-card-time svg { width: 13px; height: 13px; flex: none; }
.hero-card-act { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.hero-card-lock { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font: 800 12px/1 var(--font-ui); }
.hero-card-lock svg { width: 14px; height: 14px; }
.hero-btn.training .hero-face { filter: saturate(.5) brightness(.7); }
.hero-btn.training .hero-hp { visibility: hidden; }

/* ---------- What's new card (shown once per build to returning players) ---------- */
.news .news-lines { gap: 12px; }
.news-line { align-items: flex-start; }
.news-ico { flex: none; display: inline-flex; width: 40px; height: 40px; border-radius: 12px; background: rgba(139, 61, 255, .22); align-items: center; justify-content: center; }
.news-ico svg { width: 30px; height: 30px; }
.news-line > span:last-child { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.news-go { align-self: flex-start; margin-top: 6px; }
.qx-kid .chip-plus{display:none}
