/* ============================ HOME ============================ */
.home-top { text-align: center; margin-top: 8px; }
.brand-badge {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: 0.18em;
}
.brand-title {
  margin: 10px 0 4px; font-size: 34px; font-weight: 900; letter-spacing: 0.14em;
  color: var(--amber);
}
.brand-title span { color: var(--orange); }
.brand-sub { margin: 0; font-size: 12px; color: var(--muted); }

.profile-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.profile-row { display: flex; align-items: center; gap: 14px; }
.profile-level {
  width: 60px; height: 60px; flex-shrink: 0; border-radius: 14px;
  background: linear-gradient(135deg, #1e3a5f, #0f1724);
  border: 1px solid rgba(34, 211, 238, 0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em; color: var(--cyan);
}
.profile-level span { font-size: 24px; color: #fff; line-height: 1; }
.profile-xp { flex: 1; min-width: 0; }
.xp-head { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.home-title { margin-top: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }

.settings-sub { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 4px; }
.title-row { display: flex; flex-wrap: wrap; gap: 6px; }
.title-chip { font-family: inherit; font-size: 11px; font-weight: 800; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.title-chip.is-active { background: rgba(34, 211, 238, 0.16); border-color: rgba(34, 211, 238, 0.5); color: var(--cyan); }
.title-chip.is-locked { opacity: 0.5; cursor: not-allowed; }
.skin-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.skin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.skin-name { font-size: 12px; font-weight: 800; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, 0.15); background: var(--sw); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.swatch.is-active { border-color: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.swatch.is-locked { opacity: 0.55; }
.stat { background: var(--panel-3); border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 4px; text-align: center; }
.stat-val { display: block; font-size: 16px; font-weight: 900; color: #fff; }
.stat-label { font-size: 9px; color: var(--muted-2); font-weight: 700; }

.home-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.daily-banner {
  padding: 10px 14px; border-radius: 12px; text-align: center;
  background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--amber); font-weight: 800; font-size: 12px;
}
.daily-banner.granted { background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.5); color: var(--green); }

.mission-section { display: flex; flex-direction: column; gap: 8px; }
.mission-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.mission-head .streak { color: var(--amber); }
.mission-list { display: flex; flex-direction: column; gap: 8px; }
.mission-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mission-row.is-unlocked { border-color: rgba(52, 211, 153, 0.5); }
.mission-row.is-done { opacity: 0.6; }
.mission-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mission-name { font-size: 12px; font-weight: 800; color: #fff; }
.mission-desc { font-size: 10px; color: var(--muted-2); }
.mission-prog { font-size: 9px; color: var(--muted); font-family: ui-monospace, monospace; }
.mission-claim { font-family: inherit; font-size: 11px; font-weight: 800; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: #0f1620; color: var(--muted); cursor: pointer; white-space: nowrap; }
.mission-claim.ready { background: rgba(52, 211, 153, 0.16); border-color: rgba(52, 211, 153, 0.55); color: var(--green); }
.mission-claim:disabled { opacity: 0.55; cursor: not-allowed; }
.stats-content { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.stats-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.home-foot { margin-top: auto; text-align: center; font-size: 10px; color: var(--muted-2); padding-top: 8px; }

/* ============================ MODE ============================ */
.mode-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.mode-card {
  background: var(--panel-2); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: transform 0.12s ease;
}
.mode-card:active { transform: scale(0.98); }
.mode-card.is-locked { opacity: 0.6; cursor: not-allowed; }
.mode-head { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 900; letter-spacing: 0.06em; }
.mode-icon { font-size: 22px; }
.mode-lock { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 700; }
.mode-tagline { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.mode-desc { font-size: 11px; color: var(--muted-2); margin-top: 6px; line-height: 1.5; }
.mode-cta {
  margin-top: 12px; display: inline-block; padding: 7px 14px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.06); font-size: 11px; font-weight: 800;
}

/* ============================ SQUAD ============================ */
.pill-tray {
  min-height: 46px; padding: 8px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex-shrink: 0;
}
.pill {
  padding: 5px 10px; border-radius: 9px; border: 1px solid; font-size: 11px; font-weight: 800;
  background: transparent; color: inherit; cursor: pointer; font-family: inherit;
}
.champ-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
  overflow-y: auto; flex: 1; padding-right: 2px; align-content: start;
}
.champ-card {
  border-radius: var(--radius); padding: 12px 6px; text-align: center;
  cursor: pointer; transition: transform 0.1s ease; position: relative;
}
.champ-card.is-picked { transform: translateY(-2px); }
.champ-avatar {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px;
}
.champ-name { font-size: 12px; font-weight: 800; color: #fff; line-height: 1.1; }
.champ-role { font-size: 10px; font-weight: 700; margin-top: 2px; }
.champ-stats { font-size: 9px; color: var(--muted-2); margin-top: 6px; font-family: ui-monospace, monospace; }
.champ-locked {
  position: absolute; top: 6px; right: 6px; font-size: 9px; font-weight: 800;
  background: rgba(0, 0, 0, 0.6); color: var(--amber); padding: 2px 6px; border-radius: 7px;
}

/* ============================ ROSTER ============================ */
.roster-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; }
.roster-row {
  display: flex; align-items: center; gap: 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px;
}
.roster-avatar {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px;
}
.roster-info { flex: 1; min-width: 0; }
.roster-name { font-size: 13px; font-weight: 800; color: #fff; }
.roster-tip { font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.roster-meta { font-size: 9px; color: var(--cyan); margin-top: 4px; font-weight: 700; }
.roster-owned { font-size: 11px; font-weight: 800; color: var(--green); white-space: nowrap; }
.roster-buy {
  font-family: inherit; font-size: 12px; font-weight: 800; padding: 9px 12px;
  border-radius: 9px; background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--amber); cursor: pointer; white-space: nowrap;
}
.roster-buy:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================ SETTINGS ============================ */
.settings-list { display: flex; flex-direction: column; gap: 10px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px;
}
.settings-row.col { flex-direction: column; align-items: stretch; gap: 10px; }
.settings-row strong { display: block; font-size: 13px; }
.settings-row em { display: block; font-size: 10px; color: var(--muted-2); font-style: normal; margin-top: 3px; }
.version-tag { font-size: 12px; font-weight: 800; color: var(--cyan); font-family: ui-monospace, monospace; }
.switch { width: 46px; height: 26px; appearance: none; background: #1e293b; border-radius: 99px; position: relative; cursor: pointer; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #64748b; transition: 0.15s; }
.switch:checked { background: rgba(34, 211, 238, 0.35); }
.switch:checked::after { left: 23px; background: var(--cyan); }

/* ============================ GAME SCREEN ============================ */
.game-screen { padding: 0; overflow: hidden; gap: 0; }
#viewport-container {
  position: absolute; inset: 0; background: radial-gradient(circle at center, #16222f 0%, #0b1017 100%);
  overflow: hidden; touch-action: none; z-index: 1;
}
#three-canvas { width: 100%; height: 100%; display: block; }
#labels-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }

.hud-top {
  position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px;
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  gap: 6px; z-index: 20; pointer-events: none;
}
.hud-score {
  pointer-events: auto; display: flex; align-items: center; gap: 6px;
  background: rgba(13, 17, 23, 0.85); backdrop-filter: blur(8px);
  padding: 7px 11px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 11px; font-weight: 800; box-shadow: var(--shadow);
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-blue { background: var(--cyan); }
.dot-red { background: #fb7185; }
.hud-score .blue { color: var(--cyan); font-weight: 900; }
.hud-score .red { color: #fb7185; font-weight: 900; }
.vs { color: var(--muted-2); font-size: 9px; }
.sep { color: #334155; }
.timer { color: var(--amber); font-family: ui-monospace, monospace; }
.nexus { font-size: 10px; }
.nexus.blue { color: #7dd3fc; }
.nexus.red { color: #fda4af; }

.hud-actions { display: flex; gap: 5px; pointer-events: auto; }

.macro-popover {
  position: absolute; top: calc(52px + var(--safe-t)); left: 10px; z-index: 21;
  display: flex; align-items: center; gap: 5px; padding: 6px;
  background: rgba(15, 23, 36, 0.96); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); pointer-events: auto;
}
.macro-label { font-size: 9px; font-weight: 800; color: var(--muted-2); padding: 0 4px; }
.team-farm { color: var(--green); border-color: rgba(52, 211, 153, 0.5); }
.team-push { color: #fdba74; border-color: rgba(251, 146, 60, 0.5); }
.team-defend { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.5); }
.team-retreat { color: var(--muted); }

.cam-controls {
  position: absolute; top: calc(58px + var(--safe-t)); right: 10px; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: auto;
}
.cam-presets, .zoom-box {
  display: flex; flex-direction: column; gap: 4px; padding: 4px;
  background: rgba(13, 17, 23, 0.85); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.cam-btn { border-color: transparent; }
.cam-btn.is-active { color: var(--cyan); background: rgba(34, 211, 238, 0.14); border-color: rgba(34, 211, 238, 0.45); }
.zoom-box { align-items: center; padding: 8px 6px; }
.zoom-step { width: 26px; height: 26px; padding: 0; font-size: 16px; color: var(--cyan); }
.zoom-slider { writing-mode: vertical-lr; direction: rtl; width: 24px; height: 92px; accent-color: var(--cyan); background: transparent; margin: 4px 0; }
.zoom-label { font-size: 8px; font-family: ui-monospace, monospace; color: var(--muted); }

/* ---- Bottom stack ---- */
.bottom-stack {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-direction: column; pointer-events: none;
}
.command-sheet {
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  margin: 0 8px 6px; padding: 12px; pointer-events: auto;
  background: rgba(15, 22, 35, 0.96); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.sheet-hidden { transform: translateY(118%); opacity: 0; pointer-events: none; }
.sheet-visible { transform: translateY(0%); opacity: 1; }

.sheet-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; gap: 8px; }
.sheet-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sel-name { font-size: 14px; font-weight: 900; color: #fff; }
.sel-role { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 7px; background: rgba(251, 191, 36, 0.2); color: var(--amber); }
.sel-level { font-size: 11px; font-weight: 800; color: var(--muted); font-family: ui-monospace, monospace; }
.sheet-head-right { display: flex; align-items: center; gap: 8px; }
.sel-gold { font-size: 12px; font-weight: 800; color: var(--amber); background: rgba(251, 191, 36, 0.1); padding: 3px 8px; border-radius: 8px; border: 1px solid rgba(251, 191, 36, 0.2); white-space: nowrap; }

.sheet-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; background: #090d14; padding: 4px; border-radius: 12px; border: 1px solid var(--line-soft); }
.sheet-tab { padding: 7px 4px; border-radius: 9px; font-size: 10px; font-weight: 800; background: transparent; border: 1px solid transparent; color: var(--muted); font-family: inherit; cursor: pointer; }
.sheet-tab.is-active { background: rgba(34, 211, 238, 0.16); color: var(--cyan); border-color: rgba(34, 211, 238, 0.4); }

.sheet-panel { display: flex; flex-direction: column; gap: 8px; }
.order-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.order { padding: 9px 2px; border-radius: 11px; font-size: 9px; font-weight: 800; font-family: inherit; cursor: pointer; border: 1px solid; background: #0f1620; transition: box-shadow 0.15s ease, transform 0.1s ease; }
.order:active { transform: scale(0.95); }
.order-farm { color: var(--green); border-color: rgba(52, 211, 153, 0.55); }
.order-push { color: #fb923c; border-color: rgba(249, 115, 22, 0.55); }
.order-defend { color: #38bdf8; border-color: rgba(56, 189, 248, 0.55); }
.order-retreat { color: var(--muted); border-color: rgba(100, 116, 139, 0.55); }
.order.is-active { box-shadow: 0 0 12px currentColor; transform: translateY(-1px); }

.priority-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: #090d14; padding: 6px 10px; border-radius: 11px; border: 1px solid var(--line-soft); }
.priority-label { font-size: 10px; font-weight: 700; color: var(--muted); }
.prio-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.prio { font-family: inherit; padding: 4px 8px; border-radius: 7px; font-size: 9px; font-weight: 700; background: #1e293b; color: var(--muted); border: 1px solid transparent; cursor: pointer; }
.prio.is-active { background: rgba(251, 191, 36, 0.18); color: var(--amber); border-color: rgba(251, 191, 36, 0.4); }

.ultimate {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 12px;
  font-family: inherit; cursor: pointer; border: 1px solid; font-weight: 800; width: 100%;
}
.ultimate.is-ready { background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(234, 88, 12, 0.18)); border-color: rgba(251, 191, 36, 0.55); color: #fff; box-shadow: 0 0 16px rgba(251, 191, 36, 0.25); }
.ultimate.is-cooling { background: #10161f; border-color: var(--line); color: var(--muted-2); }
.ult-tag { font-size: 9px; letter-spacing: 0.16em; color: var(--amber); font-weight: 900; }
.ult-name { flex: 1; text-align: left; font-size: 13px; }
.ult-cd { font-size: 11px; font-family: ui-monospace, monospace; }
.ultimate.is-cooling .ult-cd { color: var(--muted); }

.ability-row { display: grid; grid-template-columns: 3fr 2fr; gap: 6px; }
.ability2 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; border-radius: 12px; font-family: inherit; font-weight: 800; cursor: pointer; border: 1px solid; }
.ability2.is-ready { background: rgba(34, 211, 238, 0.14); border-color: rgba(34, 211, 238, 0.5); color: #fff; }
.ability2.is-cooling { background: #10161f; border-color: var(--line); color: var(--muted-2); }
.ab2-name { font-size: 11px; }
.ab2-cd { font-size: 9px; font-family: ui-monospace, monospace; }
.perk-btn { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 11px; border: 1px solid rgba(52, 211, 153, 0.55); background: rgba(52, 211, 153, 0.14); color: #fff; font-weight: 900; font-size: 11px; cursor: pointer; font-family: inherit; }
.perk-count { background: #34d399; color: #052e1a; border-radius: 99px; padding: 0 8px; font-weight: 900; }

.support-section { display: flex; flex-direction: column; gap: 6px; background: #090d14; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line-soft); }
.support-hint { font-size: 10px; color: var(--muted); line-height: 1.5; }
.support-hint strong { color: var(--green); }
.support-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.support-btn { padding: 9px 3px; border-radius: 11px; font-size: 9px; font-weight: 800; font-family: inherit; cursor: pointer; border: 1px solid var(--line); background: #0f1620; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-btn.is-active { background: rgba(16, 185, 129, 0.16); border-color: rgba(52, 211, 153, 0.6); color: var(--green); }

.stats-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #090d14; padding: 7px 10px; border-radius: 11px; border: 1px solid var(--line-soft); font-size: 10px; font-family: ui-monospace, monospace; font-weight: 700; }
.stat-inline.hp { color: var(--green); }
.stat-inline.ad { color: #fb923c; }
.stat-inline.ap { color: var(--violet); }
.stat-inline.arm { color: #38bdf8; }
.stat-inline.as { color: var(--amber); }
.stat-inline.ls { color: #fb7185; }
.sel-items { display: flex; gap: 4px; margin-left: auto; }
.item-slot { width: 16px; height: 16px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 900; color: #fff; }
.item-slot.empty { background: #090d14; border: 1px solid var(--line); }

.shop-head { display: flex; align-items: center; justify-content: space-between; }
.shop-hint { font-size: 9px; font-weight: 800; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }
.shop-feedback { font-size: 10px; font-weight: 800; opacity: 0; transition: opacity 0.2s; }
.shop-feedback.ok { opacity: 1; color: var(--green); }
.shop-feedback.err { opacity: 1; color: var(--rose); }
.shop-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.shop-item { min-width: 92px; border-radius: 11px; background: #090d14; border: 1px solid var(--line); padding: 6px; text-align: center; cursor: pointer; flex-shrink: 0; }
.shop-item-top { display: flex; align-items: center; justify-content: center; gap: 5px; }
.shop-item-badge { width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 900; color: #fff; }
.shop-item-cost { font-size: 10px; font-weight: 800; color: var(--amber); }
.shop-item-name { font-size: 9px; font-weight: 800; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-item-desc { font-size: 8px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.squad-dock { pointer-events: auto; background: rgba(11, 16, 24, 0.96); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + var(--safe-b)); }
.squad-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.squad-card { border-radius: 12px; background: #131b28; border: 1px solid var(--line-soft); padding: 6px; display: flex; flex-direction: column; cursor: pointer; transition: transform 0.1s ease, box-shadow 0.15s ease; }
.squad-card:active { transform: scale(0.96); }
.squad-card.is-selected { border-color: var(--cyan); box-shadow: 0 0 14px rgba(34, 211, 238, 0.45), inset 0 0 8px rgba(34, 211, 238, 0.2); background: #162436; transform: translateY(-2px); }
.squad-card-top { display: flex; align-items: center; justify-content: space-between; }
.role-letter { font-size: 9px; font-weight: 900; }
.squad-gold { font-size: 8px; font-family: ui-monospace, monospace; color: var(--amber); font-weight: 700; }
.squad-name { font-size: 10px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; text-align: center; }
.squad-card .bar { margin: 4px 0; height: 4px; }
.squad-card-bottom { display: flex; align-items: center; justify-content: space-between; }
.squad-order { font-size: 7px; font-weight: 800; color: var(--cyan); text-transform: uppercase; }
.squad-kda { font-size: 8px; color: var(--muted); font-family: ui-monospace, monospace; }

/* ============================ UNIT LABELS ============================ */
.unit-label { position: absolute; transform: translate(-50%, -100%); pointer-events: none; display: flex; flex-direction: column; align-items: center; transition: opacity 0.12s ease; }
.detail-tag { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; background: rgba(2, 6, 12, 0.95); padding: 2px 7px; border-radius: 7px; font-size: 10px; font-weight: 800; border: 1px solid rgba(34, 211, 238, 0.8); white-space: nowrap; }
.detail-tag.hidden { display: none; }
.lvl-badge { color: var(--amber); }
.unit-name { color: #fff; }
.stance-badge { font-size: 9px; padding: 0 4px; border-radius: 4px; background: rgba(34, 211, 238, 0.2); color: #67e8f9; }
.escort-tag { margin-bottom: 2px; background: rgba(6, 78, 59, 0.9); border: 1px solid rgba(52, 211, 153, 0.7); padding: 0 6px; border-radius: 5px; font-size: 8px; font-weight: 800; color: var(--green); white-space: nowrap; }
.escort-tag.hidden { display: none; }
.micro-bar { width: 28px; height: 4px; background: rgba(2, 6, 12, 0.75); border-radius: 99px; overflow: hidden; }
.structure-bar { width: 40px; height: 4px; background: rgba(2, 6, 12, 0.8); border-radius: 99px; overflow: hidden; border: 1px solid rgba(51, 65, 85, 0.6); }
.hp-fill { height: 100%; }
.bar-blue { background: var(--cyan); }
.bar-red { background: #fb7185; }

.float-text { position: absolute; transform: translate(-50%, -50%); font-size: 13px; font-weight: 900; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9); pointer-events: none; animation: floatUp 0.9s ease-out forwards; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  25% { opacity: 1; transform: translate(-50%, -70%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1); }
}

/* ============================ GAMEOVER MODAL ============================ */
.modal {
  position: absolute; inset: 0; z-index: 60; padding: 24px;
  background: rgba(0, 0, 0, 0.86); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.go-badge { width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 30px; margin-bottom: 12px; border: 2px solid; }
.go-badge.win { border-color: var(--amber); background: rgba(251, 191, 36, 0.16); }
.go-badge.lose { border-color: #f43f5e; background: rgba(244, 63, 94, 0.16); }
.go-title { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.go-title.win { color: var(--amber); }
.go-title.lose { color: #f43f5e; }
.go-desc { font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
.go-rewards { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px; }
.go-rewards-title { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.go-rewards-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.reward-chip { font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 9px; }
.reward-chip.gold { background: rgba(251, 191, 36, 0.16); color: var(--amber); }
.reward-chip.xp { background: rgba(34, 211, 238, 0.16); color: var(--cyan); }
.reward-chip.mvp { background: rgba(168, 85, 247, 0.16); color: var(--violet); }
.go-levelup { margin-top: 10px; font-size: 12px; font-weight: 800; color: var(--green); }
.go-stats { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; text-align: left; }
.go-stat-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(30, 41, 59, 0.7); padding: 6px 0; }
.go-stat-row:last-child { border-bottom: none; }
.go-stat-name { font-size: 12px; font-weight: 800; color: #fff; }
.go-stat-val { font-size: 11px; font-family: ui-monospace, monospace; color: var(--amber); }
.go-actions { display: flex; gap: 8px; width: 100%; }

/* ============================ DESKTOP / LARGE SCREENS ============================ */
@media (min-width: 820px) {
  #app-shell {
    max-width: 1024px;
  }
  /* Center and cap the content of menu screens so it doesn't stretch edge-to-edge. */
  .screen:not(.game-screen) > * {
    width: 100%;
    max-width: 780px;
    align-self: center;
  }
  .champ-grid { grid-template-columns: repeat(4, 1fr); }
  .command-sheet { max-width: 720px; margin-left: auto; margin-right: auto; }
  .home-actions { flex-direction: row; flex-wrap: wrap; }
  .home-actions .btn { flex: 1; min-width: 220px; }
}

@media (min-width: 1200px) {
  #app-shell { max-width: 1120px; }
  .screen:not(.game-screen) > * { max-width: 860px; }
  .champ-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ============================ FEEDBACK / JUICE ============================ */
.screen-flash { position: absolute; inset: 0; z-index: 45; pointer-events: none; opacity: 0; background: transparent; }

.kill-feed {
  position: absolute; top: calc(46px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 18; pointer-events: none;
  max-width: 92%;
}
.kill-row {
  display: flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px;
  background: rgba(2, 6, 12, 0.8); border: 1px solid var(--line);
  font-size: 10px; font-weight: 800; white-space: nowrap;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.kill-row.fade { opacity: 0; transform: translateY(-6px); }
.kf-name.blue { color: var(--cyan); }
.kf-name.red { color: #fb7185; }
.kf-icon { color: var(--amber); }

.tutorial-banner {
  pointer-events: auto; margin: 0 8px 6px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: rgba(15, 22, 35, 0.97); border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 14px; box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}
.tut-body { display: flex; flex-direction: column; gap: 2px; }
.tut-step { font-size: 9px; font-weight: 900; letter-spacing: 0.12em; color: var(--amber); text-transform: uppercase; }
.tut-text { font-size: 12px; color: #fff; font-weight: 600; }

.help-btn { margin-left: 4px; }
.help-card {
  width: 100%; max-width: 420px; max-height: 82%; overflow-y: auto; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.help-title { margin: 0; font-size: 16px; font-weight: 900; color: var(--amber); text-transform: uppercase; letter-spacing: 0.08em; }
.help-sub { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.help-list { display: flex; flex-direction: column; gap: 8px; }
.help-item { display: flex; gap: 10px; align-items: baseline; }
.help-item strong { min-width: 78px; font-size: 12px; font-weight: 900; color: #fff; }
.help-item span { font-size: 11px; color: var(--muted); line-height: 1.45; }

.vol-slider { width: 130px; accent-color: var(--cyan); }
.transfer-hint { font-size: 12px; color: var(--muted); }
.transfer-text {
  width: 100%; min-height: 96px; resize: vertical;
  background: #0f1620; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 10px; font-family: ui-monospace, monospace; font-size: 11px;
}
.transfer-status { min-height: 16px; font-size: 11px; font-weight: 800; text-align: center; color: var(--muted); }
.transfer-status.ok { color: var(--green); }
.transfer-status.err { color: var(--rose); }
.lang-select {
  background: #0f1620; color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px; font-family: inherit; font-weight: 700; font-size: 12px;
}
.hud-score .wave { color: var(--muted); font-size: 10px; white-space: nowrap; }

/* Larger tap targets for accessibility */
.order { padding: 11px 2px; }
.prio { padding: 6px 10px; min-height: 26px; }

/* Reduced motion */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* Landscape phones */
@media (orientation: landscape) and (max-height: 560px) {
  .command-sheet { max-height: 60vh; overflow-y: auto; }
  .cam-controls { top: calc(42px + var(--safe-t)); }
  .tutorial-banner { padding: 6px 10px; }
  .squad-dock { padding-top: 6px; }
}
