
/* === Local shell UI (not on prod) === */

/* Scroll stays functional, scrollbars are never drawn */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.game-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 8% 0%, rgba(56, 102, 168, 0.22), transparent 58%),
    radial-gradient(ellipse 55% 40% at 92% 100%, rgba(88, 48, 128, 0.16), transparent 52%);
  opacity: 1;
}

.game > *:not(.game-bg):not(.shell-overlay):not(.drawer):not(.planet-picker) {
  position: relative;
  z-index: 1;
}

.game > .shell-overlay {
  position: fixed;
  z-index: 40;
}

.game > .drawer,
.game > .planet-picker {
  position: fixed;
  z-index: 50;
}

.drawer[hidden],
.planet-picker[hidden],
.shell-overlay[hidden] {
  display: none !important;
}

.mobile-only { display: none; }

.shell-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

body.shell-open {
  overflow: hidden;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  width: min(280px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
  background: rgba(8, 12, 20, 0.97);
  border-right: 1px solid var(--panel-edge);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  animation: drawer-in 0.22s var(--ease);
}

@keyframes drawer-in {
  from { transform: translateX(-100%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer__head {
  padding: 8px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drawer__head strong {
  display: block;
  color: var(--gold);
  font-size: 0.95rem;
}

.drawer__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}

.drawer__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font: 600 0.92rem var(--font);
  padding: 11px 16px;
  cursor: pointer;
  position: relative;
}

.drawer__item--sub {
  padding-left: 28px;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
}

.drawer__item.is-active {
  color: var(--gold);
  background: linear-gradient(90deg, rgba(94, 179, 255, 0.18), transparent);
}

.drawer__item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: #5eb3ff;
  border-radius: 0 2px 2px 0;
}

.drawer__item.has-alert::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  transform: translateY(-50%);
}
  padding: 10px 16px 4px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.drawer__logout { margin: 0 12px; }

.planet-picker {
  position: fixed;
  top: max(58px, calc(env(safe-area-inset-top) + 48px));
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 50;
  width: min(400px, calc(100vw - 24px));
  max-height: min(72vh, 520px);
  margin: 0;
  display: flex;
  flex-direction: column;
  background: rgba(8, 12, 20, 0.97);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
  animation: picker-in 0.18s var(--ease);
}

@keyframes picker-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateX(-50%); }
}

.planet-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.planet-picker__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}

.planet-picker__item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
}

.planet-picker__item.is-active {
  background: rgba(232, 184, 109, 0.1);
  color: var(--gold);
}

.planet-picker__thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at 30% 30%, #4a90c0, #1a3050);
}

.planet-picker__thumb--moon {
  background: radial-gradient(circle at 30% 30%, #888, #333);
}

.corner-dock {
  display: none;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.corner-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(120, 140, 170, 0.35);
  background: rgba(8, 14, 24, 0.85);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  backdrop-filter: blur(8px);
  padding: 0;
}

.corner-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

#btn-planets svg {
  width: 22px;
  height: 22px;
}

.corner-btn:active {
  transform: scale(0.96);
  background: rgba(232, 184, 109, 0.15);
}

.corner-btn--plain {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
}

.corner-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.content-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pull-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  pointer-events: none;
}

.pull-indicator.is-ready { color: var(--gold); }

.pull-indicator.is-loading .pull-indicator__icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.overview-server-time {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
}

.overview-planet-card {
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
  margin-bottom: 12px;
}

.overview-planet-card__title {
  font-size: 1rem;
  color: var(--gold);
  margin: 0 0 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.overview-planet-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.overview-planet-card__row span:last-child {
  text-align: right;
  overflow-wrap: anywhere;
}

.overview-planet-card__row:last-of-type { border-bottom: none; }

.overview-queues {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.overview-queue-tile {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
  cursor: pointer;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.overview-queue-tile:active {
  background: rgba(232, 184, 109, 0.12);
}

.overview-queue-tile__label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.overview-queue-tile__text {
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--text);
}

.overview-queue-tile__timer {
  font-size: 0.72rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.fleet-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fleet-feed__item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 3px solid var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
}

.fleet-feed__item--attack { border-left-color: #ef4444; color: #fca5a5; }
.fleet-feed__item--own { border-left-color: #22c55e; color: #86efac; }
.fleet-feed__item--spy { border-left-color: #c084fc; color: #e9d5ff; }
.fleet-feed__item--neutral { border-left-color: #60a5fa; }

.fleet-feed__timer {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.msg-cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px !important;
}

.msg-cat {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font: 600 0.85rem var(--font);
}

.msg-cat__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.msg-cat--spy .msg-cat__dot { background: #c084fc; }
.msg-cat--combat .msg-cat__dot { background: #f87171; }
.msg-cat--transport .msg-cat__dot { background: #4ade80; }
.msg-cat--expedition .msg-cat__dot { background: #38bdf8; }
.msg-cat--colony .msg-cat__dot { background: #fbbf24; }
.msg-cat--ally .msg-cat__dot { background: #60a5fa; }
.msg-cat--pm .msg-cat__dot { background: var(--gold); }
.msg-cat--other .msg-cat__dot { background: #94a3b8; }

.msg-cat__count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 500;
}

.msg-cat__count strong {
  color: #f87171;
}

/* Resource bar: icon on top, label, current, storage cap */
.game .resources {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-height: none !important;
  align-items: stretch;
  overflow: hidden;
  min-width: 0;
}

.game .res-chip {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  height: auto;
  min-width: 0;
  flex: none;
  padding: 6px 4px 10px !important;
  overflow: hidden;
  text-align: center;
  container-type: inline-size;
}

.game .res-chip img.res-chip__icon {
  width: 24px !important;
  height: 24px !important;
  margin: 0 0 1px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  border: none;
  padding: 0;
  background: transparent;
}

.game .res-chip__label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.game .res-chip--metal .res-chip__label { color: var(--metal); }
.game .res-chip--crystal .res-chip__label { color: var(--crystal); }
.game .res-chip--deut .res-chip__label { color: var(--deut); }
.game .res-chip--energy .res-chip__label { color: #b57cf0; }
.game .res-chip--dm .res-chip__label { color: #c4a0ff; }

.game .res-chip__val {
  display: block;
  width: 100%;
  font-size: clamp(7px, 11cqi, 12px) !important;
  font-weight: 700;
  color: var(--text) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.game .res-chip--energy .res-chip__val { color: #6cff00 !important; }
.game .res-chip--dm .res-chip__val { color: #e0c8ff !important; }
.game .res-chip--dm .res-chip__cap { color: #a78bfa; }

.game .res-chip__cap {
  display: block;
  width: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6cff00;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  padding-bottom: 2px;
}

.game .res-chip.is-over-cap .res-chip__val,
.game .res-chip__cap.is-over,
.game .res-chip.is-over-cap .res-chip__cap:not(.res-chip__clock) {
  color: var(--bad) !important;
  text-shadow: 0 0 8px rgba(255, 77, 77, 0.35);
}

/* У энергии вторая строка — серверные часы, а не склад: при дефиците
   краснеет само значение, часы остаются нейтральными. */
.game .res-chip--energy.is-over-cap .res-chip__val { color: var(--bad) !important; }
.game .res-chip--energy.is-over-cap .res-chip__clock { color: var(--muted); }

.game .res-chip__clock {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  font-size: clamp(8px, 10cqi, 11px);
  letter-spacing: -0.03em;
}

/* Development tabs (buildings / research / shipyard / defense) */
.dev-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.dev-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.75rem;
}

.fields-line {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-align: center;
  color: var(--text);
}

.fields-line strong { color: #6cff00; }
.fields-line__max { color: var(--bad); }
.fields-line--full strong,
.fields-line--full .fields-line__max { color: var(--bad); }
.fields-line__hint {
  display: block;
  margin-top: 4px;
  color: var(--gold);
}

/* Tech card body: production, stacked cost, time, requirements — never overlapping */
.tech-card {
  overflow: hidden;
}

.tech-card__body {
  min-width: 0;
}

.tech-stats {
  margin: 0 0 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tech-stat {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

.tech-stat--warn {
  color: #fbbf24;
}

.tech-stat__val { color: var(--text); font-variant-numeric: tabular-nums; }
.tech-stat__val--metal { color: var(--metal); }
.tech-stat__val--crystal { color: var(--crystal); }
.tech-stat__val--deut { color: var(--deut); }
.tech-stat__val--energy { color: var(--energy); }

.stat-gain { color: #6cff00; font-size: 0.72rem; }
.stat-gain--cost { color: #fbbf24; }

.cost-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cost-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cost-block:last-of-type { border-bottom: none; padding-bottom: 0; }

.cost-block__label {
  font-size: 0.78rem;
  font-weight: 700;
}

.cost-block__label--metal { color: var(--metal); }
.cost-block__label--crystal { color: var(--crystal); }
.cost-block__label--deut { color: var(--deut); }

.cost-block__need,
.cost-block__rest {
  display: block;
  width: 100%;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  line-height: 1.3;
}

.cost-block__need {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.cost-block__rest {
  font-size: 0.78rem;
  color: #6cff00;
  line-height: 1.4;
}

.cost-block__need.is-lack,
.cost-block__rest.is-lack { color: var(--bad); }

.cost-time {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.cost-time strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.tech-card__body > .tech-reqs {
  margin: 0;
}

.tech-card__body > .tech-reqs + .tech-reqs { margin-top: 0; }

/* Galaxy table */
.gx-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding: 4px 8px 0;
}

.gx-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  table-layout: fixed;
}

.gx-col-pos { width: 24px; }
.gx-col-planet { width: 38%; }
.gx-col-moon { width: 34px; }
.gx-col-player { width: 34%; }
.gx-col-ally { width: 52px; }

.gx-th-short { display: none; }

.gx-table th {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 6px 6px 4px;
  border-bottom: 1px solid var(--panel-edge);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gx-table th.gx-pos,
.gx-table th.gx-moon {
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
}

.gx-row td {
  padding: 5px 6px 5px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  overflow: hidden;
}

.gx-row--void td { height: 28px; }
.gx-row.is-mine { background: rgba(108, 255, 0, 0.06); }
.gx-row.is-ally { background: rgba(96, 165, 250, 0.07); }
.gx-row.is-war { background: rgba(239, 68, 68, 0.08); }
.gx-row.is-tappable { cursor: pointer; }
.gx-row.is-tappable:active { background: rgba(255, 255, 255, 0.05); }
.gx-row.is-open { background: rgba(232, 184, 109, 0.1); }

.gx-pos {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
}

.gx-moon {
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
}

.gx-planet,
.gx-owner-cell,
.gx-ally {
  min-width: 0;
}

.gx-planet__in {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.gx-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: radial-gradient(circle at 32% 30%, #4a90c0, #14283f 70%);
}

.gx-thumb--p1 { background: radial-gradient(circle at 32% 30%, #6bb0d8, #16304c 70%); }
.gx-thumb--p2 { background: radial-gradient(circle at 32% 30%, #d8a86b, #3a2716 70%); }
.gx-thumb--p3 { background: radial-gradient(circle at 32% 30%, #8fd86b, #1c3a16 70%); }
.gx-thumb--p4 { background: radial-gradient(circle at 32% 30%, #c58fe0, #2e1a3a 70%); }
.gx-thumb--p5 { background: radial-gradient(circle at 32% 30%, #e08f8f, #3a1a1a 70%); }
.gx-thumb--mine { border-color: #6cff00; box-shadow: 0 0 6px rgba(108, 255, 0, 0.4); }
.gx-thumb--moon {
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 32% 30%, #cfcfcf, #3a3a3a 70%);
}
.gx-thumb--empty { background: none; border-style: dashed; border-color: rgba(255, 255, 255, 0.08); }
.gx-thumb--debris { background: radial-gradient(circle at 50% 50%, #8a7030, transparent 65%); border-style: dotted; }
.gx-thumb--void { background: none; border: none; }

.gx-name {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f87171;
}

.gx-name--mine { color: #6cff00; }
.gx-name--empty { color: var(--muted); font-weight: 400; }

.gx-owner {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
}

.gx-owner--mine { color: #6cff00; }
.gx-owner--ally { color: #60a5fa; }
.gx-owner--war { color: #f87171; }
.gx-owner--inactive { color: var(--muted); }
.gx-owner--admin { color: var(--gold); }
.gx-owner--empty,
.gx-tag--empty { color: var(--muted); font-weight: 400; }

.gx-tag {
  display: block;
  color: #6cff00;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gx-acts-row td {
  padding: 8px 6px 10px;
  background: rgba(8, 12, 20, 0.72);
  border-bottom: 1px solid rgba(232, 184, 109, 0.22);
  vertical-align: top;
}

.gx-act__in {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  align-items: stretch;
}

.gx-btn {
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(120, 140, 170, 0.45);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 600 0.74rem var(--font);
  cursor: pointer;
  flex: 1 1 calc(50% - 6px);
}

.gx-btn:active { background: rgba(232, 184, 109, 0.2); }
.gx-btn--danger { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }

.gx-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 8px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 6px;
  font-size: 0.75rem;
}

.gx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0 8px 10px;
}

.gx-legend span { display: inline-flex; align-items: center; gap: 4px; }
.gx-legend__hint { width: 100%; color: var(--muted); }

.gx-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.gx-dot--mine { background: #6cff00; }
.gx-dot--ally { background: #60a5fa; }
.gx-dot--war { background: #f87171; }
.gx-dot--inactive { background: #8b95a8; }
.gx-dot--admin { background: var(--gold); }

/* Fleet table */
.fl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.fl-table th {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 4px 3px;
  border-bottom: 1px solid var(--panel-edge);
}

.fl-row td {
  padding: 6px 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.fl-row--attack { background: rgba(239, 68, 68, 0.07); }
.fl-row--own { background: rgba(34, 197, 94, 0.06); }
.fl-row--spy { background: rgba(192, 132, 252, 0.06); }

.fl-mission { display: flex; flex-direction: column; gap: 1px; }
.fl-mission strong { font-size: 0.76rem; }
.fl-mission .muted { font-size: 0.65rem; }
.fl-count { font-size: 0.65rem; color: var(--gold); }

.fl-route {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.fl-coords { white-space: nowrap; }
.fl-arrow { color: var(--muted); }

.fl-time { display: flex; flex-direction: column; gap: 1px; }
.fl-timer { color: var(--gold); font-variant-numeric: tabular-nums; }
.fl-time .muted { font-size: 0.62rem; }

.fl-cmd { text-align: right; }
.fl-cmd .btn { white-space: nowrap; }

@media (max-width: 900px) {
  .mobile-only { display: flex !important; }
  .desktop-only { display: none !important; }

  .topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: stretch;
    gap: 6px;
    padding: 6px 8px;
    padding-top: max(6px, env(safe-area-inset-top));
  }

  .topbar__desktop { display: none !important; }
  .corner-dock { display: flex; }

  .game .resources {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-height: none !important;
    align-self: stretch;
    min-width: 0;
    overflow: hidden;
  }

  .game .res-chip {
    min-height: 0;
    height: auto;
    padding: 7px 4px 11px !important;
  }

  .game .resources { gap: 3px; }

  .game .res-chip img.res-chip__icon {
    width: 21px !important;
    height: 21px !important;
  }

  .game .res-chip__label { font-size: clamp(0.52rem, 2.2vw, 0.64rem); }

  .layout {
    grid-template-columns: 1fr;
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }

  .sidebar { display: none !important; }

  .content-shell {
    min-height: 0;
    overflow: hidden;
  }

  .content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .page-head {
    display: block;
    padding: 10px 12px;
    margin-bottom: 10px;
  }

  .page-head h2 { font-size: 1.08rem; margin: 0; line-height: 1.3; }
  .page-head p { display: none; }

  .overview-queues { gap: 6px; }
  .overview-queue-tile { min-height: 68px; padding: 10px 8px; gap: 6px; }

  .overview-planet-card { padding: 12px; }
  .overview-planet-card__row { padding: 6px 0; gap: 10px; }

  .gx-table { font-size: 0.68rem; }
  .gx-col-pos { width: 22px; }
  .gx-col-planet { width: 36%; }
  .gx-col-moon { width: 26px; }
  .gx-col-player { width: 32%; }
  .gx-col-ally { width: 40px; }
  .gx-th-full { display: none; }
  .gx-th-short { display: inline; }
  .gx-thumb { width: 18px; height: 18px; }
  .gx-thumb--moon { width: 14px; height: 14px; }
  .gx-row td { padding: 5px 4px 5px 2px; }
  .gx-wrap { padding: 2px 6px 0; }
  .gx-btn { min-height: 40px; font-size: 0.78rem; }

  .fl-table { font-size: 0.7rem; }
  .fl-cmd .btn { padding: 4px 6px; font-size: 0.65rem; }

  .cost-table { font-size: 0.72rem; }
}

@media (min-width: 901px) {
  .drawer,
  .planet-picker,
  .shell-overlay,
  .corner-dock {
    display: none !important;
  }

  .game .resources {
    max-height: none !important;
  }

  .gx-col-moon { width: 42px; }
  .gx-col-ally { width: 72px; }
  .gx-btn {
    flex: 0 1 auto;
    min-width: 120px;
    min-height: 34px;
  }
}

.arena-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0 2px 0 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  vertical-align: -2px;
}

.gx-row--arena td {
  background: rgba(232, 184, 109, 0.08);
}

.gx-name--arena {
  color: var(--gold, #e8b86d);
  font-weight: 600;
}

.galaxy-arena {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.arena-title-pop {
  position: fixed;
  z-index: 80;
  min-width: 180px;
  max-width: min(240px, calc(100vw - 16px));
  padding: 8px 10px;
  background: rgba(8, 12, 20, 0.96);
  border: 1px solid var(--gold, #e8b86d);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.arena-title-pop[hidden] {
  display: none;
}

.arena-title-pop__name {
  color: var(--gold, #e8b86d);
  font-size: 0.85rem;
}

.arena-title-pop__bonus {
  color: var(--text, #e8eef8);
  font-size: 0.78rem;
}
