/* Token Tycoon interface. Mobile first; the scene canvas sits behind everything. */

:root {
  --bg: #0b1020;
  --panel: rgba(14, 19, 34, 0.86);
  --panel-solid: #121a2e;
  --card: #1a2440;
  --card-2: #212d4f;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f6ff;
  --muted: #9aa6c7;
  --dim: #6b7699;
  --green: #22c55e;
  --green-dark: #15803d;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --gold: #fbbf24;
  --gold-dark: #b45309;
  --pink: #ec4899;
  --purple: #8b5cf6;
  --purple-dark: #6d28d9;
  --red: #ef4444;
  --orange: #f97316;
  --cyan: #22d3ee;
  --grey-btn: #475569;
  --grey-btn-dark: #334155;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --font: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --tab-h: 64px;
  --radius: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

body {
  position: fixed;
  inset: 0;
}

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

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

input {
  -webkit-user-select: text;
  user-select: text;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

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

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Boot screen ---------- */

#boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0b1020;
  z-index: 100;
  transition: opacity 0.5s ease;
}

#boot.hide {
  opacity: 0;
  pointer-events: none;
}

/* The icon sits dead centre, where the iPhone launch screen (tools/splash.mjs) put it. */
.boot-logo {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  animation: float 2s ease-in-out 0.4s infinite;
}

.boot-text {
  position: absolute;
  top: calc(50% + 76px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: boot-in 0.5s ease both;
}

@keyframes boot-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.boot-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.boot-sub {
  color: var(--muted);
  font-weight: 600;
}

@keyframes float {
  50% {
    transform: translateY(-8px);
  }
}

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

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(var(--safe-top) + 6px) calc(var(--safe-right) + 10px) 8px calc(var(--safe-left) + 10px);
  background: linear-gradient(180deg, rgba(8, 11, 22, 0.94), rgba(10, 14, 28, 0.82));
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-row + .hud-row {
  margin-top: 6px;
}

.cash-block {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.coin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  color: #7a4b00;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #fbbf24 55%, #d97706);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 2px 8px rgba(251, 191, 36, 0.35);
  flex: none;
}

.cash-text {
  min-width: 0;
}

.cash {
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.cash.bump {
  animation: bump 0.25s ease;
}

@keyframes bump {
  40% {
    transform: scale(1.06);
  }
}

.income {
  font-size: 12.5px;
  font-weight: 800;
  color: #4ade80;
  margin-top: 2px;
  white-space: nowrap;
}

.income .boosted {
  color: var(--gold);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}

.pill.gems {
  color: #e9d5ff;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.35), rgba(109, 40, 217, 0.25));
  border-color: rgba(167, 139, 250, 0.35);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  font-size: 18px;
  flex: none;
  transition: transform 0.12s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

.model-badge {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 6px;
  border-radius: 12px;
  background: rgba(124, 245, 208, 0.08);
  border: 1px solid rgba(124, 245, 208, 0.18);
}

.model-icon {
  font-size: 18px;
}

.model-info {
  flex: 1;
  min-width: 0;
}

.model-name {
  font-size: 12.5px;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  white-space: nowrap;
}

.model-name .eta {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 3px;
}

.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #34d399, #7cf5d0);
  transition: width 0.3s ease;
}

.bar.gold > i {
  background: linear-gradient(90deg, #f59e0b, #fde68a);
}

.bar.blue > i {
  background: linear-gradient(90deg, #3b82f6, #93c5fd);
}

.bar.purple > i {
  background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
}

.bar.shine > i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shine 2.2s ease-in-out infinite;
}

@keyframes shine {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(200%);
  }
}

.subs-pill {
  color: #bae6fd;
}

.boost-pill {
  color: #1c1400;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  border-color: rgba(255, 255, 255, 0.3);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.05);
  }
}

/* ---------- News ticker ---------- */

#ticker {
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  overflow: hidden;
  background: rgba(8, 10, 20, 0.55);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5f5;
  z-index: 9;
  pointer-events: none;
}

.ticker-track {
  position: absolute;
  white-space: nowrap;
  top: 3px;
  will-change: transform;
}

.ticker-track b {
  color: #fca5a5;
  margin-right: 6px;
}

.ticker-track span {
  margin-right: 42px;
}

/* ---------- Mission chip and floating buttons ---------- */

#mission-chip {
  position: absolute;
  left: calc(var(--safe-left) + 10px);
  max-width: min(72vw, 330px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 8px;
  border-radius: 16px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  z-index: 8;
  transition: transform 0.15s ease;
}

#mission-chip:active {
  transform: scale(0.97);
}

#mission-chip.ready {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25), 0 6px 18px rgba(0, 0, 0, 0.35);
  animation: chip-glow 1.4s ease-in-out infinite;
}

@keyframes chip-glow {
  50% {
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.12), 0 6px 18px rgba(0, 0, 0, 0.35);
  }
}

#mission-chip:empty {
  display: none;
}

.chip-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 17px;
  flex: none;
}

.chip-body {
  min-width: 0;
  flex: 1;
}

.chip-title {
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.chip-claim {
  font-size: 11px;
  font-weight: 900;
  color: #1c1400;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  border-radius: 9px;
  padding: 5px 8px;
}

#fab {
  position: absolute;
  right: calc(var(--safe-right) + 10px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 8;
}

.fab-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
}

.fab-btn:active {
  transform: scale(0.9);
}

.fab-btn.hot {
  animation: wiggle 1.2s ease-in-out infinite;
  border-color: rgba(251, 191, 36, 0.6);
}

@keyframes wiggle {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }
  70% {
    transform: rotate(-10deg);
  }
  80% {
    transform: rotate(10deg);
  }
  90% {
    transform: rotate(-6deg);
  }
}

.fab-btn .fab-label {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 7px;
  background: #0b1020;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.fab-btn svg.ring {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  transform: rotate(-90deg);
}

.dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px #0b1020;
}

/* ---------- Tabs ---------- */

#tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  padding: 6px calc(var(--safe-right) + 6px) calc(var(--safe-bottom) + 6px) calc(var(--safe-left) + 6px);
  background: linear-gradient(0deg, rgba(8, 11, 22, 0.97), rgba(10, 14, 28, 0.9));
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-top: 1px solid var(--line);
  z-index: 30;
}

.tab {
  position: relative;
  flex: 1;
  height: 54px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 800;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.tab:active {
  transform: scale(0.94);
}

.tab .tab-icon {
  font-size: 22px;
  line-height: 1;
  filter: grayscale(0.7) opacity(0.75);
  transition: filter 0.15s ease, transform 0.2s ease;
}

.tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.tab.active .tab-icon {
  filter: none;
  transform: translateY(-1px) scale(1.08);
}

.tab .dot {
  top: 2px;
  right: calc(50% - 22px);
}

/* ---------- Sheets ---------- */

#sheet-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: auto;
}

.sheet-backdrop.show {
  opacity: 1;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100% - var(--safe-top) - 96px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #16203a, #0f1628);
  border-radius: 26px 26px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(105%);
  transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.25, 1.05);
  pointer-events: auto;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 6px);
}

.sheet.show {
  transform: translateY(0);
}

.sheet.dragging {
  transition: none;
}

.sheet-handle {
  flex: none;
  padding: 8px 0 2px;
  display: flex;
  justify-content: center;
  touch-action: none;
}

.sheet-handle i {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 10px;
  touch-action: none;
}

.sheet-head .title-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.07);
  flex: none;
}

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

.sheet-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-title p {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 14px 14px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}

.segmented button {
  flex: 1;
  height: 32px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented button.on {
  background: #fff;
  color: #0b1020;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 2px 8px;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.section-title:first-child {
  margin-top: 4px;
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card + .card {
  margin-top: 10px;
}

.card.flat {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.card.locked {
  opacity: 0.6;
}

.card.glow {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.18), 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.grow {
  flex: 1;
  min-width: 0;
}

.item-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.07);
  flex: none;
}

.item-title {
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 1px;
}

.item-sub b {
  color: var(--text);
}

.tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  vertical-align: 2px;
}

.tag.green {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.tag.gold {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}

.tag.red {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.tag.purple {
  background: rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.stat {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 8px 10px;
}

.stat .k {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat .v {
  font-size: 15px;
  font-weight: 900;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.4;
}

.hint.warn {
  color: #fdba74;
}

.hint.good {
  color: #86efac;
}

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

.btn {
  --c1: var(--green);
  --c2: var(--green-dark);
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 6px 14px;
  border-radius: 14px;
  background-color: var(--c1);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 70%);
  box-shadow: 0 4px 0 var(--c2), 0 6px 14px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--c2), 0 3px 8px rgba(0, 0, 0, 0.25);
}

.btn:disabled,
.btn.off {
  --c1: var(--grey-btn);
  --c2: var(--grey-btn-dark);
  filter: saturate(0.4);
  color: rgba(255, 255, 255, 0.75);
}

.btn small {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.92;
  margin-top: 2px;
}

.btn.blue {
  --c1: var(--blue);
  --c2: var(--blue-dark);
}

.btn.gold {
  --c1: #f59e0b;
  --c2: var(--gold-dark);
  color: #231400;
  text-shadow: none;
}

.btn.purple {
  --c1: var(--purple);
  --c2: var(--purple-dark);
}

.btn.red {
  --c1: var(--red);
  --c2: #991b1b;
}

.btn.ghost {
  --c1: rgba(255, 255, 255, 0.12);
  --c2: rgba(0, 0, 0, 0.3);
}

.btn.wide {
  width: 100%;
}

.btn.small {
  min-height: 38px;
  padding: 4px 11px;
  font-size: 13px;
  border-radius: 12px;
}

.btn.big {
  min-height: 58px;
  font-size: 17px;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-row > .btn {
  flex: 1;
}

.gain {
  color: #bbf7d0;
}

.btn.off .gain {
  color: inherit;
}

/* ---------- Floor detail parts ---------- */

.hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero .big-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: rgba(0, 0, 0, 0.25);
  flex: none;
}

.hero .lvl {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
}

.hero .lvl small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
  margin-left: 4px;
}

.milestone {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #fcd34d;
}

.racks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.rack-slot {
  aspect-ratio: 0.8;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  color: var(--muted);
  transition: transform 0.1s ease;
}

.rack-slot:active {
  transform: scale(0.95);
}

.rack-slot.full {
  border-style: solid;
  border-color: rgba(57, 255, 136, 0.35);
  background: linear-gradient(180deg, #2a303c, #1c2029);
  color: #86efac;
}

.rack-slot.off {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.rack-slot.buy {
  border-color: rgba(34, 197, 94, 0.7);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
}

.rack-slot .e {
  font-size: 22px;
}

.upgrade-list .card {
  padding: 10px;
}

.upgrade-list .item-icon {
  width: 40px;
  height: 40px;
  font-size: 21px;
}

.owned-check {
  font-size: 13px;
  font-weight: 900;
  color: #86efac;
  padding: 0 6px;
}

/* ---------- Build list ---------- */

.floor-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.floor-card .item-icon {
  position: relative;
}

.floor-card .mini-lvl {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 900;
  background: #0b1020;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  white-space: nowrap;
}

.floor-card .btn {
  min-width: 96px;
}

/* ---------- Lab: training and research tree ---------- */

.train-card {
  background: radial-gradient(circle at 20% 0%, rgba(124, 245, 208, 0.2), transparent 60%), linear-gradient(180deg, var(--card-2), var(--card));
}

.version-big {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.reserve {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.reserve button {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 900;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid transparent;
}

.reserve button.on {
  background: rgba(124, 245, 208, 0.18);
  color: #7cf5d0;
  border-color: rgba(124, 245, 208, 0.45);
}

.tech-tier {
  margin-bottom: 12px;
}

.tech-tier-label {
  font-size: 11px;
  font-weight: 900;
  color: var(--dim);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 0 2px 6px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.tech {
  position: relative;
  min-width: 0;
  border-radius: 14px;
  padding: 10px 8px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.1s ease;
}

.tech:active {
  transform: scale(0.96);
}

.tech .t-icon {
  font-size: 24px;
}

.tech .t-name {
  font-size: 11.5px;
  font-weight: 900;
  margin-top: 4px;
  line-height: 1.15;
  /* Long single words (Backpropagation) break with a hyphen rather than spill out. */
  overflow-wrap: anywhere;
  hyphens: auto;
}

.tech .t-eff {
  font-size: 10.5px;
  font-weight: 800;
  color: #86efac;
  margin-top: 3px;
}

.tech .t-cost {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 900;
  color: #c4b5fd;
}

.tech.owned {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.22), rgba(34, 197, 94, 0.08));
  border-color: rgba(34, 197, 94, 0.5);
}

.tech.ready {
  border-color: rgba(167, 139, 250, 0.85);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
  animation: chip-glow 1.6s ease-in-out infinite;
}

.tech.locked {
  opacity: 0.45;
}

.rp-pill {
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(167, 139, 250, 0.35);
}

/* Leaderboard */

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
}

.lb-row + .lb-row {
  margin-top: 4px;
}

.lb-row.you {
  background: linear-gradient(90deg, rgba(124, 245, 208, 0.2), rgba(124, 245, 208, 0.05));
  border: 1px solid rgba(124, 245, 208, 0.35);
}

.lb-rank {
  width: 26px;
  font-weight: 900;
  font-size: 15px;
  text-align: center;
  color: var(--muted);
}

.lb-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  flex: none;
}

.lb-score {
  font-weight: 900;
  font-size: 14px;
}

/* ---------- Missions, contracts and achievements ---------- */

.mission .item-icon {
  width: 42px;
  height: 42px;
  font-size: 21px;
}

.mission .bar {
  height: 7px;
  margin-top: 6px;
}

.reward {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.ach {
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ach .a-icon {
  font-size: 26px;
  filter: grayscale(1) opacity(0.4);
}

.ach.got {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.06));
  border-color: rgba(251, 191, 36, 0.4);
}

.ach.got .a-icon {
  filter: none;
}

.ach .a-name {
  font-size: 11px;
  font-weight: 900;
  margin-top: 4px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.ach .a-text {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.2;
}

.timer {
  font-weight: 900;
  color: #fcd34d;
}

/* ---------- Empire: sites and talent ---------- */

.site-card {
  overflow: hidden;
}

.site-card .site-art {
  height: 74px;
  margin: -12px -12px 10px;
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  font-size: 34px;
  position: relative;
}

.site-card .site-art .site-name {
  font-size: 18px;
  font-weight: 900;
  margin-left: 8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.site-card.current {
  border-color: rgba(124, 245, 208, 0.5);
}

.talent-card .portrait {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  flex: none;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.rarity-common {
  color: #cbd5e1;
}

.rarity-rare {
  color: #7dd3fc;
}

.rarity-epic {
  color: #d8b4fe;
}

.rarity-legendary {
  color: #fcd34d;
}

.talent-card.legendary {
  border-color: rgba(251, 191, 36, 0.55);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.14), var(--card));
}

.talent-card.epic {
  border-color: rgba(168, 85, 247, 0.5);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.14), var(--card));
}

.talent-card.rare {
  border-color: rgba(56, 189, 248, 0.45);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.team-grid .portrait {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.team-grid .portrait.empty {
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 20px;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
}

/* ---------- Shop ---------- */

.daily-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin: 8px 0 10px;
}

.daily-day {
  border-radius: 10px;
  padding: 6px 2px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.daily-day .d-gem {
  font-size: 12px;
  font-weight: 900;
  color: #e9d5ff;
  margin-top: 2px;
}

.daily-day.done {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.daily-day.today {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.35), rgba(251, 191, 36, 0.15));
  color: #fff;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.5);
}

.perk-dots {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}

.perk-dots i {
  width: 14px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.perk-dots i.on {
  background: linear-gradient(90deg, #a78bfa, #f0abfc);
}

.no-ads {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--dim);
  margin: 16px 0 4px;
}

/* ---------- Modals ---------- */

#modal-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
}

.modal-backdrop.show {
  opacity: 1;
}

.modal {
  width: min(100%, 400px);
  max-height: 100%;
  overflow-y: auto;
  border-radius: 28px;
  padding: 22px 18px 18px;
  text-align: center;
  background: linear-gradient(180deg, #1c2a4d, #121a31);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 1.2, 0.3, 1), opacity 0.2s ease;
}

.modal-backdrop.show .modal {
  transform: none;
  opacity: 1;
}

.modal .m-icon {
  font-size: 58px;
  line-height: 1;
  margin-bottom: 8px;
  display: inline-block;
  animation: pop-in 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

@keyframes pop-in {
  from {
    transform: scale(0.2) rotate(-20deg);
    opacity: 0;
  }
}

.modal h2 {
  margin: 4px 0 6px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.4px;
}

.modal p {
  margin: 0 0 12px;
  color: #c7d0ee;
  font-weight: 650;
  font-size: 14.5px;
  line-height: 1.45;
}

.modal .big-num {
  font-size: 34px;
  font-weight: 900;
  color: #fde68a;
  letter-spacing: -0.5px;
  margin: 6px 0 2px;
}

.modal .rewards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.modal .reward-chip {
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
  font-size: 14px;
}

.modal .unlock-list {
  text-align: left;
  margin: 8px 0 14px;
}

.modal .unlock-list div {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  font-size: 13.5px;
}

.modal .unlock-list div + div {
  margin-top: 6px;
}

.modal .choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.modal input[type='text'],
.modal textarea {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  padding: 0 14px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.modal textarea {
  height: 110px;
  font-size: 11px;
  text-align: left;
  padding: 10px;
  resize: none;
  font-family: ui-monospace, Menlo, monospace;
  -webkit-user-select: text;
  user-select: text;
}

.modal input[type='text']:focus {
  border-color: #7cf5d0;
}

.name-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 16px;
}

.name-suggestions button {
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
  font-size: 13px;
}

.glow-ring {
  position: absolute;
  inset: -40px;
  background: conic-gradient(from 0deg, transparent, rgba(124, 245, 208, 0.25), transparent 30%, rgba(251, 191, 36, 0.25), transparent 60%);
  animation: spin 6s linear infinite;
  border-radius: 50%;
  z-index: -1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal.celebrate {
  position: relative;
  overflow: hidden;
}

.modal.celebrate::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(124, 245, 208, 0.12), transparent 25%, rgba(251, 191, 36, 0.12), transparent 50%, rgba(236, 72, 153, 0.12), transparent 75%);
  animation: spin 8s linear infinite;
  pointer-events: none;
}

.modal.celebrate > * {
  position: relative;
}

.event-timer {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: -4px 0 12px;
}

.event-timer i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  transform-origin: left;
}

.settings-list .card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.toggle {
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  flex: none;
  transition: background 0.2s ease;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.toggle.on {
  background: var(--green);
}

.toggle.on::after {
  transform: translateX(20px);
}

/* ---------- Toasts ---------- */

#toasts {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--safe-top) + 54px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 45;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 28px);
  padding: 7px 13px;
  border-radius: 14px;
  background: rgba(12, 16, 30, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-weight: 800;
  font-size: 12.5px;
  line-height: 1.25;
  animation: toast-in 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.toast.out {
  animation: toast-out 0.3s ease both;
}

.toast .t-icon {
  font-size: 17px;
  flex: none;
}

.toast.gold {
  border-color: rgba(251, 191, 36, 0.5);
}

.toast.green {
  border-color: rgba(34, 197, 94, 0.5);
}

.toast.purple {
  border-color: rgba(167, 139, 250, 0.55);
}

.toast.red {
  border-color: rgba(239, 68, 68, 0.55);
}

@keyframes toast-in {
  from {
    transform: translateY(-16px) scale(0.9);
    opacity: 0;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}

/* ---------- Misc ---------- */

.fly-coin {
  position: fixed;
  z-index: 70;
  font-size: 18px;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.5, -0.3, 0.7, 1), opacity 0.7s ease;
}

.empty-state {
  text-align: center;
  padding: 20px 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13.5px;
}

.center {
  text-align: center;
}

.mt {
  margin-top: 10px;
}

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

@media (min-width: 700px) {
  .sheet {
    left: 50%;
    right: auto;
    width: 560px;
    margin-left: -280px;
  }
  #tabs {
    justify-content: center;
  }
  .tab {
    max-width: 110px;
  }
}

/* Checklist for buying the next building. */
.next-card {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.check-row.done {
  color: var(--text);
  background: rgba(34, 197, 94, 0.12);
}

.check-row .check-mark {
  width: 20px;
  text-align: center;
}

.check-row .check-count {
  font-size: 12px;
  color: var(--dim);
}

.check-row.done .check-count {
  color: #86efac;
}

/* Map zoom and overview buttons. */
#map-ctrl {
  position: absolute;
  right: calc(var(--safe-right) + 10px);
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 18px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 7;
}

.map-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.map-btn:active {
  transform: scale(0.94);
}

.floor-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 14px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.floor-box .map-btn {
  border: 0;
  box-shadow: none;
  background: transparent;
  height: 38px;
  font-size: 15px;
}

.floor-box .map-btn:disabled {
  opacity: 0.3;
}

.floor-label {
  font-size: 13px;
  font-weight: 900;
  color: var(--gold);
  padding: 2px 0;
}

/* ---------- Room items (stars) ---------- */

.item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.item-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  min-width: 0;
}

.item-tile.maxed {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.14), var(--card));
}

.item-tile.locked {
  opacity: 0.7;
}

.item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-emoji {
  font-size: 26px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  flex: none;
}

.item-name {
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.15;
}

.stars {
  color: #fbbf24;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1.1;
}

.item-gain {
  font-size: 11.5px;
  font-weight: 800;
  color: #86efac;
}

.item-tile.maxed .item-gain {
  color: #fcd34d;
}

.item-blurb {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
  flex: 1;
}

.item-tile .btn {
  min-height: 38px;
  padding: 4px 8px;
  font-size: 13px;
}

/* ---------- Managers ---------- */

.manager-card .row {
  align-items: center;
}

.mgr-face .portrait,
.mgr-empty {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  flex: none;
  overflow: hidden;
}

.mgr-empty {
  display: grid;
  place-items: center;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
}

.mgr-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mgr-btns .btn {
  min-height: 34px;
  padding: 3px 10px;
}

.portrait.rarity-border-common {
  box-shadow: 0 0 0 2px #94a3b8;
}

.portrait.rarity-border-rare {
  box-shadow: 0 0 0 2px #38bdf8;
}

.portrait.rarity-border-epic {
  box-shadow: 0 0 0 2px #a855f7, 0 0 12px rgba(168, 85, 247, 0.5);
}

.portrait.rarity-border-legendary {
  box-shadow: 0 0 0 2px #fbbf24, 0 0 16px rgba(251, 191, 36, 0.6);
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  margin: 10px 0;
  text-align: left;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
}

.picker-row .portrait {
  border-radius: 12px;
  flex: none;
}

.picker-row:active {
  transform: scale(0.98);
}

.item-sub.dim {
  color: var(--dim);
}

.floor-card.managed .item-icon {
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.8);
}

/* Headhunter boxes. */
.box-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.box-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 10px 8px;
}

.box-card .item-sub {
  font-size: 10.5px;
  line-height: 1.2;
  flex: 1;
}

.box-card .btn {
  width: 100%;
  min-height: 40px;
  padding: 4px 6px;
  font-size: 13px;
}

.box-icon {
  position: relative;
  font-size: 34px;
  line-height: 1;
}

.box-card.ready .box-icon {
  animation: box-bounce 1.2s ease-in-out infinite;
}

.box-stock {
  position: absolute;
  right: -14px;
  top: -6px;
  font-size: 11px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
}

.box-name {
  font-size: 12.5px;
  font-weight: 900;
}

.box-premium {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.12), var(--card));
}

@keyframes box-bounce {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-4px) rotate(-4deg);
  }
}

/* The manager collection. */
.manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.mgr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px 6px;
  border-radius: 16px;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--text);
  min-width: 0;
}

.mgr-card.rarity-rare {
  border-color: rgba(56, 189, 248, 0.45);
}

.mgr-card.rarity-epic {
  border-color: rgba(168, 85, 247, 0.55);
}

.mgr-card.rarity-legendary {
  border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.12), var(--card));
}

.mgr-card.unknown {
  opacity: 0.45;
}

.mgr-card.promote {
  animation: promote-glow 1.4s ease-in-out infinite;
}

@keyframes promote-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.55);
  }
}

.mgr-pic {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.mgr-pic .portrait {
  width: 60px;
  height: 60px;
  border-radius: 16px;
}

.mgr-lvl {
  position: absolute;
  left: -4px;
  bottom: -4px;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 8px;
  background: #111827;
  border: 1px solid var(--line);
}

.mgr-role {
  position: absolute;
  right: -5px;
  top: -5px;
  font-size: 14px;
}

.mgr-name {
  font-size: 12px;
  font-weight: 900;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mgr-where {
  font-size: 10px;
  color: var(--dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mgr-card.working .mgr-where {
  color: #c4b5fd;
}

.mgr-card .bar {
  width: 100%;
  height: 5px;
}

.mgr-cards {
  font-size: 10px;
  color: var(--muted);
}

.manager-modal .portrait.big {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  margin: 0 auto 6px;
  display: block;
}

/* Opening a box. */
.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
  max-height: 46vh;
  overflow-y: auto;
}

.reveal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 14px;
  background: var(--card);
  border: 1.5px solid var(--line);
  opacity: 0;
  animation: reveal-in 0.5s ease-out forwards;
}

.reveal-card .portrait {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.reveal-card.rarity-rare {
  border-color: #38bdf8;
}

.reveal-card.rarity-epic {
  border-color: #a855f7;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}

.reveal-card.rarity-legendary {
  border-color: #fbbf24;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.6);
}

.reveal-name {
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
}

.reveal-tag {
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
}

.reveal-tag.new {
  color: #fcd34d;
}

@keyframes reveal-in {
  0% {
    opacity: 0;
    transform: rotateY(90deg) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: rotateY(0) scale(1);
  }
}

/* Campaigns. */
.campaign.live {
  border-color: rgba(244, 114, 182, 0.6);
  background: linear-gradient(180deg, rgba(244, 114, 182, 0.14), var(--card));
}

.campaign.locked {
  opacity: 0.65;
}

@media (max-width: 360px) {
  .box-row {
    grid-template-columns: 1fr;
  }
  .tab {
    font-size: 9.5px;
  }
}

/* ---------- Accounts ---------- */

.account-card {
  margin-bottom: 10px;
  text-align: left;
}

.signin-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: -apple-system, system-ui, sans-serif;
}

.signin-btn.apple {
  background: #000;
  color: #fff;
  border: 1px solid #333;
}

.signin-btn.google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
}

.signin-btn:disabled {
  opacity: 0.6;
}

.account-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
}

.account-avatar.letter {
  display: grid;
  place-items: center;
  background: var(--purple);
  font-weight: 900;
  font-size: 20px;
}

.welcome-signin {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.welcome-signin .signin-buttons {
  margin-top: 8px;
}

.save-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 14px;
}

.save-choice {
  text-align: left;
}

.save-choice .big-num {
  font-size: 20px;
  margin: 4px 0;
}

/* ---------- Training runs ---------- */

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

.focus-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 62px;
  padding: 7px 4px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid transparent;
  color: var(--text);
  transition: transform 0.1s ease, opacity 0.2s ease;
}

.focus-chip:active {
  transform: scale(0.96);
}

.focus-chip.on {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(196, 181, 253, 0.7);
}

.focus-chip.locked {
  opacity: 0.4;
}

.focus-chip .fc-icon {
  font-size: 20px;
  line-height: 1.1;
}

.focus-chip .fc-name {
  font-size: 11.5px;
  font-weight: 900;
}

.focus-chip .fc-tag {
  font-size: 9.5px;
  font-weight: 900;
  color: var(--dim);
  min-height: 12px;
}

.focus-chip .fc-tag.hot {
  color: var(--gold);
}

.focus-chip .fc-tag.tired {
  color: #93a3c8;
}

.focus-effect {
  margin-top: 8px;
  color: #c4b5fd;
}

.quality-meter .qm-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 900;
}

.quality-meter .bar {
  height: 8px;
  border-radius: 4px;
}

.incident-btn {
  margin-top: 10px;
  animation: incident-pulse 1.6s ease-in-out infinite;
}

@keyframes incident-pulse {
  50% {
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.25);
  }
}

.modal .quality-meter {
  text-align: left;
  margin: 4px 0 6px;
}

.scorecard {
  text-align: left;
  margin: 6px 0 4px;
}

.scorecard .review {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.scorecard .review-score {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1px;
  color: #fde68a;
  flex: none;
}

.scorecard .review-score small {
  font-size: 14px;
  color: var(--muted);
  margin-left: 1px;
}

.scorecard.tier-great .review {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(236, 72, 153, 0.14));
  box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.35);
}

.scorecard.tier-bad .review-score {
  color: #fca5a5;
}

.scorecard .review-by {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.scorecard .review-quote {
  font-size: 13.5px;
  font-weight: 750;
  font-style: italic;
  line-height: 1.35;
  color: #e5e9fb;
}

.scorecard .bench {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.bench-row {
  display: grid;
  grid-template-columns: 118px 1fr 26px;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 850;
}

.bench-row .bar {
  height: 8px;
  margin: 0;
  border-radius: 4px;
}

.bench-row .bar > i {
  transition: width 0.7s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.bench-row .bench-score {
  text-align: right;
  font-weight: 900;
}

.modal .reward-chip.hot {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
}

.modal .reward-chip.tired {
  color: #b8c3e3;
}

.scorecard .rewards {
  margin-bottom: 6px;
}

.scorecard .reward-chip {
  font-size: 12.5px;
}

.next-focus {
  text-align: left;
  margin: 4px 0 14px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.1);
}

.quality-meter .qm-title {
  white-space: nowrap;
}

.quality-meter .item-sub {
  text-align: right;
}

.incident-choice + .incident-choice {
  margin-top: 8px;
}

.incident-choice .hint {
  margin: 4px 4px 0;
  text-align: center;
}

/* ---------- Lab sections and deployments ---------- */

.segmented button {
  position: relative;
}

.seg-dot {
  position: absolute;
  top: -5px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 16px;
}

.deploy-pane .section-title:first-child {
  margin-top: 4px;
}

.trip-slot .bar {
  margin-top: 10px;
}

.trip-slot.done {
  box-shadow: inset 0 0 0 1.5px rgba(251, 191, 36, 0.55);
  animation: incident-pulse 1.8s ease-in-out infinite;
}

.item-icon.big {
  width: 64px;
  height: 64px;
  font-size: 34px;
  margin: 0 auto 10px;
}

.wide-modal {
  text-align: left;
}

.wide-modal h2,
.wide-modal .m-icon,
.wide-modal > p {
  text-align: center;
  display: block;
}

.trip-list .card {
  margin-bottom: 8px;
}

.trip-row.locked {
  opacity: 0.55;
}

.trip-row .hint {
  margin-top: 8px;
}

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

.ds-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.ds-tile .ds-icon {
  font-size: 24px;
}

.ds-tile .ds-name {
  font-size: 11.5px;
  font-weight: 900;
}

.ds-tile .ds-count {
  font-size: 17px;
  font-weight: 900;
}

.ds-tile .item-sub {
  font-size: 10.5px;
  min-height: 14px;
}

.ds-tile .btn {
  margin-top: 4px;
  width: 100%;
}

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

.chip-btn {
  display: block;
  padding: 0;
  text-align: inherit;
  color: inherit;
}

.chip-btn:active {
  transform: scale(0.96);
}

.chip-tile {
  --tier: #9aa6c7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px 8px;
  border-radius: 14px;
  /* Plain fallbacks first, for iOS before 16.2 (no color-mix). */
  background: rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier) 22%, transparent), rgba(255, 255, 255, 0.04));
  border: 1.5px solid var(--tier);
  border: 1.5px solid color-mix(in srgb, var(--tier) 65%, transparent);
  text-align: center;
  height: 100%;
}

.chip-tile.empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
}

.chip-tile .chip-icon {
  font-size: 26px;
  line-height: 1.1;
}

.chip-tile .chip-name {
  font-size: 11.5px;
  font-weight: 900;
  line-height: 1.15;
}

.chip-tile .chip-bonus {
  font-size: 10.5px;
  font-weight: 850;
  color: var(--tier);
}

.chip-tile .chip-count {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
}

.chip-btn.can-fuse .chip-tile {
  box-shadow: 0 0 0 2px rgba(196, 181, 253, 0.45);
}

.chip-btn.can-fuse .chip-count {
  color: #c4b5fd;
}

.chip-hero {
  width: 132px;
  margin: 0 auto 6px;
}

.chip-grid.reveal .chip-tile {
  animation: pop-in 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.chip-grid.reveal {
  margin-bottom: 14px;
}

.chip-tile .chip-tier {
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tier);
}

.trip-row .btn {
  margin-top: 10px;
}

/* ---------- Manager abilities ---------- */

.manager-card .skill-row {
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.skill-line {
  color: #fde68a;
}

.skill-card {
  text-align: left;
}

.skill-row-card {
  margin-bottom: 8px;
}

.skill-row-card .portrait {
  border-radius: 12px;
  flex: none;
}

/* ---------- Season track ---------- */

.season-card {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(139, 92, 246, 0.1)), var(--card);
}

.season-track {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

.season-track::-webkit-scrollbar {
  display: none;
}

.season-tile {
  flex: none;
  width: 44px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid transparent;
  position: relative;
}

.season-tile.big {
  background: rgba(251, 191, 36, 0.12);
}

.season-tile .st-num {
  font-size: 9.5px;
  font-weight: 900;
  color: var(--dim);
}

.season-tile .st-icon {
  font-size: 19px;
  line-height: 1.1;
}

.season-tile.claimed {
  opacity: 0.4;
}

.season-tile.claimed::after {
  content: '✓';
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 10px;
  font-weight: 900;
  color: #86efac;
}

.season-tile.ready {
  border-color: rgba(251, 191, 36, 0.8);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
}

.season-tile.next {
  border-color: rgba(255, 255, 255, 0.35);
  border-style: dashed;
}

.season-list {
  display: grid;
  gap: 4px;
}

.season-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
  font-size: 13.5px;
}

.season-row.big {
  background: rgba(251, 191, 36, 0.1);
}

.season-row .st-num {
  width: 22px;
  text-align: center;
  font-weight: 900;
  color: var(--muted);
}

.season-row .st-state {
  font-size: 12px;
  color: var(--muted);
}

.season-row.claimed {
  opacity: 0.5;
}

.season-row.ready .st-state {
  color: #fde68a;
}

.modal .rewards .reward-chip {
  font-size: 12.5px;
}

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

.ways .way {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 800;
  color: #c7d0ee;
}

.ways .way b {
  color: #fde68a;
}

/* ---------- Ops agents ---------- */

.agent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.agent-row + .agent-row {
  border-top: 1px solid var(--line);
}

.agent-row.locked {
  opacity: 0.45;
}

.agent-row .item-sub {
  font-size: 12px;
}

.agent-budget-row {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.agent-budget {
  margin: 6px 0 0;
}

.agent-budget button {
  font-size: 11px;
}

.ticker-track .breaking b {
  color: #fde68a;
}

/* ---------- Challenges ---------- */

.challenge-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 14px;
}

.challenge-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid transparent;
  color: var(--text);
}

.challenge-chip.on {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(252, 165, 165, 0.7);
}

.challenge-chip .cc-icon {
  font-size: 22px;
  flex: none;
}

.challenge-chip .cc-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.challenge-chip b {
  font-size: 13.5px;
  font-weight: 900;
}

.challenge-chip small {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.challenge-chip .cc-reward {
  color: #fde68a;
}

.challenge-badges {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.challenge-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 18px;
  opacity: 0.45;
}

.challenge-badge b {
  font-size: 11px;
  font-weight: 900;
}

.challenge-badge.won {
  opacity: 1;
  background: rgba(251, 191, 36, 0.14);
}

.challenge-won,
.challenge-on {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: 13.5px;
}

.challenge-won {
  color: #fde68a;
}

.challenge-on {
  color: #fca5a5;
}

.modal.intro .intro-kicker,
.modal .intro-kicker {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* ---------- Weekly events ---------- */

.event-head {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(236, 72, 153, 0.12)), var(--card);
}

.event-head .big-num {
  font-size: 24px;
  font-weight: 900;
  color: #fde68a;
}

.event-stars {
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--gold);
  white-space: nowrap;
}

.event-modes {
  margin: 0;
  width: 150px;
}

.event-modes button {
  height: 26px;
  font-size: 11.5px;
}

.event-project {
  margin-bottom: 8px;
}

.event-project .btn {
  min-width: 92px;
}

.event-link {
  cursor: pointer;
}

.season-row .portrait {
  border-radius: 8px;
  flex: none;
}

.whats-new .wn-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 16px;
  /* A long list scrolls inside the card, so the button below stays in view. */
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  -webkit-mask-image: linear-gradient(180deg, #000 85%, transparent);
  mask-image: linear-gradient(180deg, #000 85%, transparent);
}

.whats-new .wn-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
}

.whats-new .wn-icon {
  font-size: 20px;
  flex: none;
}

/* ---------- Product mastery ---------- */

.mastery-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}

.mastery-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 0 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.45;
}

.mastery-tile.has {
  opacity: 1;
  background: rgba(139, 92, 246, 0.14);
}

.mastery-tile.max {
  background: rgba(251, 191, 36, 0.18);
}

.mastery-tile .mt-icon {
  font-size: 17px;
}

.mastery-tile .mt-lvl {
  font-size: 11px;
  font-weight: 900;
  color: #c4b5fd;
}

.speed-up {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.speed-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.charter-text {
  margin: 6px 2px 10px;
  min-height: 32px;
}

.charter-line {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.charter-on {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: 13.5px;
  color: #c4b5fd;
}

/* Company profile: growth graph and share picture. */
.growth-canvas {
  display: block;
  max-width: 100%;
}
.growth-legend {
  margin-top: 6px;
}
.share-modal .share-preview {
  display: block;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 5;
  margin: 10px auto 14px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.share-modal .share-row {
  justify-content: center;
  gap: 10px;
}
.share-modal a.btn {
  text-decoration: none;
}

/* Game guide. */
.guide-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.guide-item summary::-webkit-details-marker {
  display: none;
}
.guide-item summary::after {
  content: '›';
  color: var(--muted);
  font-size: 22px;
  transition: transform 0.2s ease;
}
.guide-item[open] summary::after {
  transform: rotate(90deg);
}
.guide-item p {
  margin: 10px 0 0;
  line-height: 1.45;
}
.guide-item {
  display: block;
}

/* World leaderboard. */
.world-list {
  margin-top: 10px;
}
.world-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-top: 1px solid var(--line);
}
.world-row:first-child {
  border-top: 0;
}
.world-row.you {
  background: rgba(34, 197, 94, 0.12);
  border-radius: 12px;
}
.world-row .wr-rank {
  width: 36px;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
}
.world-row .wr-main {
  min-width: 0;
}
.world-row .wr-name {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.world-row .wr-score {
  font-weight: 800;
  color: var(--green);
}
.world-gap {
  text-align: center;
  color: var(--dim);
}
.world-join .welcome-signin,
.world-join .btn {
  margin-top: 8px;
}

/* Selling the company. */
.sell-lists {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  text-align: left;
}
.legacy-card .item-icon {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.35), rgba(139, 92, 246, 0.35));
}

/* Daily deals. */
.deal-card.bought {
  opacity: 0.55;
}

.stat .v.wrap {
  white-space: normal;
  line-height: 1.15;
}

/* The AI Awards. */
.award-list {
  display: grid;
  gap: 8px;
  text-align: left;
}
.award-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.award-row.done {
  background: rgba(251, 191, 36, 0.14);
}
.award-row.missed {
  opacity: 0.5;
}
.award-row .aw-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}
.award-row .aw-name {
  font-weight: 800;
}
.award-row .bar {
  margin-top: 6px;
}
.award-row .aw-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-weight: 800;
  min-width: 48px;
}
.award-row .aw-count {
  color: var(--muted);
  font-size: 13px;
}
.awards-modal .award-list {
  margin: 12px 0 14px;
}

/* A charter suggested by how the last building ran. */
.focus-chip.suggested {
  position: relative;
}
.focus-chip.suggested::after {
  content: '★';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  color: var(--gold);
}
.charter-tip {
  color: #fcd34d;
  margin: 6px 0 10px;
}

.manager-modal .event-only {
  color: #fcd34d;
  margin: 4px 0 8px;
}

/* Company logo. */
.logo-badge {
  --logo: #8b5cf6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--logo);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  font-size: 17px;
  line-height: 1;
}
.logo-badge.big {
  width: 76px;
  height: 76px;
  font-size: 44px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.8), 0 10px 24px rgba(0, 0, 0, 0.4);
}
.brand-modal .brand-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
}
.brand-icons {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.brand-icon {
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  font-size: 20px;
}
.brand-icon.on {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.15);
}
.brand-colours {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.brand-colour {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid transparent;
}
.brand-colour.on {
  border-color: #fff;
}

/* Progress towards an achievement not yet earned. */
.ach .a-bar {
  margin-top: 6px;
}
.ach .a-bar .bar {
  height: 4px;
}
.ach.got .a-bar {
  display: none;
}

/* Past eras on the Legacy card. */
.era-history {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.era-history:empty {
  display: none;
}
.era-row {
  display: flex;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.era-row b {
  color: var(--text);
}

.welcome-logos {
  margin-bottom: 12px;
}

/* ---------- Label data ---------- */

.label-game h2 {
  margin-bottom: 10px;
}

.bar.label-timer {
  height: 10px;
  border-radius: 5px;
}

.bar.label-timer > i {
  border-radius: 5px;
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
  transition: none;
}

.bar.label-timer.low > i {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.label-score {
  min-height: 22px;
  margin: 8px 0 2px;
  font-weight: 850;
  color: var(--muted);
}

.label-score.hot {
  color: var(--gold);
}

.label-stage {
  position: relative;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.label-card {
  width: 132px;
  height: 132px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 74px;
  line-height: 1;
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  user-select: none;
  -webkit-user-select: none;
}

.label-card.text {
  font-size: 58px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.label-card.pop {
  animation: label-pop 0.16s ease-out;
}

.label-card.wrong {
  animation: label-shake 0.3s ease;
  border-color: var(--red);
}

@keyframes label-pop {
  from {
    transform: scale(0.6);
    opacity: 0.2;
  }
}

@keyframes label-shake {
  25% {
    transform: translateX(-9px);
  }
  75% {
    transform: translateX(9px);
  }
}

.label-float {
  position: absolute;
  top: 8px;
  right: 16%;
  font-size: 22px;
  font-weight: 900;
  color: #86efac;
  opacity: 0;
  pointer-events: none;
}

.label-float.bad {
  color: #fca5a5;
}

.label-float.go {
  animation: label-float 0.6s ease-out;
}

@keyframes label-float {
  from {
    opacity: 1;
    transform: translateY(10px);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.label-bins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.label-bin {
  appearance: none;
  border: 0;
  border-radius: 22px;
  min-height: 104px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  box-shadow: 0 5px 0 #1e3a8a;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.label-bin + .label-bin {
  background: linear-gradient(180deg, var(--purple), var(--purple-dark));
  box-shadow: 0 5px 0 #4c1d95;
}

.label-bin:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.label-bin .lb-icon {
  font-size: 36px;
  line-height: 1;
}

.label-result {
  margin: 4px 0 6px;
  font-size: 26px;
  font-weight: 900;
  color: var(--cyan);
}

/* ---------- The dog's wardrobe ---------- */

.wardrobe {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.wardrobe-item {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font: inherit;
  color: var(--text);
  background: var(--card);
}

.wardrobe-item .wd-icon {
  font-size: 26px;
  line-height: 1.2;
}

.wardrobe-item .wd-name {
  font-size: 12px;
  font-weight: 800;
}

.wardrobe-item .wd-state {
  font-size: 12px;
  font-weight: 850;
  color: #c4b5fd;
}

.wardrobe-item.owned .wd-state {
  color: var(--muted);
}

.wardrobe-item.on {
  border-color: var(--purple);
  box-shadow: inset 0 0 0 2px rgba(139, 92, 246, 0.45);
}

.wardrobe-item.on .wd-state {
  color: #86efac;
}

.wardrobe-item.off {
  opacity: 0.55;
}
