:root {
  color-scheme: dark;
  --bg: #111111;
  --surface: #1b1d21;
  --surface-2: #23262c;
  --line: #333842;
  --text: #f6f7f4;
  --muted: #aeb5bf;
  --orange: #ff8a1f;
  --orange-2: #ffc247;
  --blue: #3b82f6;
  --blue-2: #8ec5ff;
  --red: #ef4444;
  --red-2: #ff9b8e;
  --mint: #31d093;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
}

.brand-lockup,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffd37c 0 12%, transparent 13%),
    radial-gradient(circle at 64% 66%, #d95f00 0 13%, transparent 14%),
    var(--orange);
  box-shadow: inset -8px -9px 0 rgba(148, 49, 0, 0.32);
  position: relative;
}

.brand-mark::before {
  content: "";
  position: absolute;
  right: -4px;
  top: -5px;
  width: 16px;
  height: 10px;
  border-radius: 16px 2px 16px 2px;
  background: #49c979;
  transform: rotate(-24deg);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--orange-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  line-height: 1;
}

h2 {
  font-size: 1.08rem;
  line-height: 1.15;
}

h3 {
  font-size: 0.9rem;
}

.source-pill,
.count-pill,
.loading-pill {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-pill {
  max-width: min(46vw, 420px);
}

.icon-button,
.ghost-button,
.primary-button,
.mini-button {
  border-radius: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 800;
}

.icon-button {
  min-height: 34px;
}

.primary-button,
.mini-button.primary {
  background: var(--orange);
  border-color: #ffad45;
  color: #1e1208;
}

.ghost-button {
  background: transparent;
}

.mini-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.step-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.step-dot span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #171717;
  background: var(--muted);
  font-size: 0.68rem;
}

.step-dot.active {
  border-color: var(--orange);
  color: var(--text);
}

.step-dot.active span,
.step-dot.complete span {
  background: var(--orange);
}

.stage {
  min-height: 0;
  overflow: hidden;
}

.flowbar {
  display: grid;
  grid-template-columns: minmax(90px, 0.4fr) minmax(140px, 1fr);
  gap: 8px;
  min-height: 46px;
}

.flowbar button {
  width: 100%;
}

.flip-stage,
.loading-stage {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  gap: 18px;
  align-content: center;
  text-align: center;
}

.orange-scene {
  width: min(44vw, 190px);
  height: min(44vw, 190px);
  display: grid;
  place-items: center;
  perspective: 800px;
}

.orange-scene.small {
  width: 118px;
  height: 118px;
}

.orange-coin {
  width: 100%;
  height: 100%;
  max-width: 174px;
  max-height: 174px;
  border-radius: 50%;
  position: relative;
  transform-style: preserve-3d;
  animation: orangeFlip 1.15s cubic-bezier(0.58, 0.02, 0.22, 0.98) infinite;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 242, 190, 0.96) 0 11%, transparent 12%),
    radial-gradient(circle at 66% 70%, rgba(188, 67, 0, 0.7) 0 14%, transparent 15%),
    radial-gradient(circle at 50% 50%, var(--orange-2), var(--orange) 58%, #d85a00 100%);
  box-shadow:
    inset -20px -24px 0 rgba(119, 43, 0, 0.3),
    0 24px 45px rgba(0, 0, 0, 0.38);
}

.orange-leaf {
  position: absolute;
  right: 10%;
  top: -2%;
  width: 30%;
  height: 16%;
  border-radius: 26px 4px 26px 4px;
  background: linear-gradient(135deg, #7ee489, #209d58);
  transform: rotate(-26deg) translateZ(8px);
}

.orange-shine {
  position: absolute;
  left: 23%;
  top: 22%;
  width: 20%;
  height: 12%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  transform: rotate(-20deg) translateZ(10px);
}

@keyframes orangeFlip {
  0% {
    transform: rotateY(0deg) rotateZ(-7deg);
  }
  48% {
    transform: rotateY(180deg) rotateZ(6deg);
  }
  100% {
    transform: rotateY(360deg) rotateZ(-7deg);
  }
}

.choice-panel {
  width: min(100%, 520px);
}

.choice-panel h2 {
  margin-bottom: 14px;
  font-size: clamp(1.55rem, 6vw, 2.4rem);
}

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

.side-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 60px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.side-choice.selected {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 138, 31, 0.25);
}

.side-orb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.side-choice.blue .side-orb,
.side-badge.blue,
.fighter.blue {
  background: rgba(59, 130, 246, 0.18);
  color: var(--blue-2);
  border-color: rgba(59, 130, 246, 0.55);
}

.side-choice.blue .side-orb {
  background: var(--blue);
}

.side-choice.red .side-orb,
.side-badge.red,
.fighter.red {
  background: rgba(239, 68, 68, 0.18);
  color: var(--red-2);
  border-color: rgba(239, 68, 68, 0.55);
}

.side-choice.red .side-orb {
  background: var(--red);
}

.map-stage,
.draft-stage,
.summary-stage {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.stage-head,
.panel-head,
.pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 0 0 auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

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

.mode-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-weight: 800;
  font-size: 0.8rem;
}

.mode-tabs button.active {
  border-color: var(--orange);
  color: var(--text);
  background: rgba(255, 138, 31, 0.13);
}

.search-input {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f1012;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  flex: 0 0 auto;
}

.search-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 138, 31, 0.2);
}

.map-grid {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding-right: 2px;
}

.map-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 88px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.map-card.selected {
  border-color: var(--orange);
}

.map-card img {
  width: 72px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
}

.map-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.map-name,
.rec-card strong,
.pool-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-name {
  font-weight: 900;
  font-size: 0.9rem;
}

.map-mode,
.map-top,
.pool-card span,
.rec-card span,
.map-strip p,
.odds-copy span {
  color: var(--muted);
  font-size: 0.74rem;
}

.map-top {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.map-top span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-strip {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 76px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.map-strip img {
  width: 92px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
}

.map-strip div {
  min-width: 0;
}

.map-strip h2,
.map-strip p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-grid {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 8px;
  overflow: hidden;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  overflow: hidden;
}

.rec-rail {
  display: grid;
  gap: 7px;
  flex: 0 0 auto;
}

.rec-card {
  min-height: 62px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 7px;
  touch-action: pan-y;
  transition:
    transform 140ms ease,
    border-color 140ms ease;
}

.rec-card.dragging {
  border-color: var(--orange);
  transition: none;
}

.rec-card img,
.pool-card img,
.chip img,
.slot-brawler img,
.fighter img,
.team-card img {
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.rec-card img {
  width: 46px;
  height: 46px;
}

.rec-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rec-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  z-index: 2;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip,
.empty-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 7px 3px 4px;
  font-size: 0.78rem;
  font-weight: 800;
}

.chip img {
  width: 24px;
  height: 24px;
}

.icon-chip {
  gap: 3px;
  padding: 3px 4px;
}

.icon-chip img {
  width: 30px;
  height: 30px;
}

.chip button {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 0.72rem;
  padding: 0;
}

.empty-chip {
  color: var(--muted);
  padding: 0 10px;
}

.pool-panel {
  overflow: hidden;
}

.pool-list {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.pool-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 6px;
}

.pool-card img {
  width: 42px;
  height: 42px;
}

.pool-card div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pick-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  flex: 0 0 auto;
}

.pick-slot {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px auto minmax(0, 1fr) 22px;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  padding: 4px;
}

.pick-slot.current {
  border-color: var(--orange);
}

.slot-order {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.side-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 0.7rem;
  font-weight: 900;
}

.slot-brawler {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 800;
}

.slot-brawler img {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.slot-empty {
  color: var(--muted);
  font-size: 0.75rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick-slot button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
  color: var(--text);
  padding: 0;
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex: 0 0 auto;
}

.position-card {
  min-width: 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 4px 6px;
}

.position-card.current {
  border-color: var(--orange);
}

.position-card span {
  color: var(--orange-2);
  font-size: 0.7rem;
  font-weight: 900;
}

.position-card select {
  min-width: 0;
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 6px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
}

.input-only {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(239, 68, 68, 0.08);
  padding: 12px;
}

.summary-stage {
  overflow: auto;
}

.summary-stage > .panel {
  flex: 0 0 auto;
  overflow: visible;
}

.matchup-list {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.matchup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px;
}

.fighters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.fighter {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid;
  border-radius: 8px;
  padding: 5px;
  font-size: 0.8rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fighter img {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.fight-copy {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.odds-bar {
  display: flex;
  height: 12px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #090a0c;
}

.odds-blue {
  background: linear-gradient(90deg, var(--blue), var(--mint));
}

.odds-red {
  background: linear-gradient(90deg, var(--red), #ffbe72);
}

.odds-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 5px;
}

.odds-copy strong {
  font-size: 1rem;
}

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

.build-panel {
  flex: 0 0 auto;
  padding: 0;
  gap: 0;
}

.build-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.loadout-toggle {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.loadout-toggle div {
  min-width: 0;
}

.loadout-toggle h2,
.loadout-toggle span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loadout-toggle span {
  color: var(--muted);
  font-size: 0.74rem;
}

.loadout-toggle strong {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 138, 31, 0.16);
  color: var(--orange-2);
  padding: 6px 10px;
  font-size: 0.75rem;
}

.build-card {
  display: grid;
  grid-template-columns: minmax(108px, 0.72fr) minmax(0, 1.28fr);
  gap: 8px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px;
}

.build-brawler {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.build-brawler img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  object-fit: contain;
}

.build-brawler strong {
  min-width: 0;
  flex: 1 1 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-brawler span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.build-items {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 6px;
}

.build-item {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: center;
  min-height: 74px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 7px;
}

.build-item span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}

.loadout-icons {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.loadout-icon {
  min-width: 0;
  flex: 1 1 46px;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.loadout-icon img,
.loadout-fallback {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  object-fit: contain;
}

.loadout-fallback {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--orange-2);
  font-size: 0.78rem;
  font-weight: 900;
}

.loadout-icon strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
}

.team-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
}

.team-card h3 {
  margin-bottom: 7px;
}

.team-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-card span {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px 3px 3px;
  font-size: 0.75rem;
  font-weight: 800;
}

.team-card img {
  width: 24px;
  height: 24px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 12px;
}

.empty-state.compact {
  min-height: 56px;
}

.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.58);
}

.profile-sheet {
  width: min(100%, 540px);
  max-height: min(92vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.profile-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.profile-clear {
  width: 100%;
}

.profile-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.profile-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

.rank-mode-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.rank-mode-group button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  padding: 0 8px;
  font-weight: 900;
  font-size: 0.74rem;
}

.rank-mode-group button.active {
  border-color: var(--orange);
  background: rgba(255, 138, 31, 0.14);
  color: var(--text);
}

.profile-note {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  padding: 9px;
  font-size: 0.82rem;
  font-weight: 800;
}

.teammate-list {
  display: grid;
  gap: 8px;
}

.teammate-row {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
}

.teammate-row > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.loading-stage p {
  color: var(--muted);
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px;
    gap: 7px;
  }

  .topbar {
    min-height: 50px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .source-pill {
    max-width: 37vw;
    padding-inline: 8px;
  }

  .icon-button {
    padding-inline: 9px;
  }

  .top-actions {
    gap: 6px;
  }

  .step-dot {
    gap: 0;
    font-size: 0;
  }

  .step-dot span {
    width: 21px;
    height: 21px;
    font-size: 0.72rem;
  }

  .compact-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(230px, 0.9fr) minmax(0, 1fr);
  }

  .map-strip {
    grid-template-columns: 80px minmax(0, 1fr);
    min-height: 68px;
    padding: 6px;
  }

  .map-strip img {
    width: 80px;
    height: 52px;
  }

  .panel {
    padding: 8px;
    gap: 7px;
  }

  .rec-card {
    min-height: 56px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 6px;
  }

  .rec-card img {
    width: 40px;
    height: 40px;
  }

  .rec-actions {
    gap: 4px;
  }

  .mini-button {
    min-height: 28px;
    padding: 0 7px;
  }

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

  .map-card {
    grid-template-columns: 1fr;
    align-content: start;
    min-height: 132px;
  }

  .map-card img {
    width: 100%;
    height: 62px;
  }

  .map-top {
    display: none;
  }

  .pick-slots {
    grid-template-columns: 1fr;
    max-height: 146px;
    overflow: auto;
    padding-right: 2px;
  }

  .pool-card {
    min-height: 52px;
  }

  .profile-form {
    grid-template-columns: 1fr;
  }

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

  .build-card {
    grid-template-columns: 1fr;
  }

  .fighters {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 5px;
  }

  .fighter {
    gap: 4px;
    padding: 4px;
    font-size: 0.72rem;
  }

  .fighter img {
    width: 24px;
    height: 24px;
  }

  .fight-copy {
    font-size: 0.68rem;
  }
}

@media (max-width: 420px) {
  .top-actions {
    gap: 6px;
  }

  .source-pill {
    max-width: 32vw;
  }

  h1 {
    font-size: 1.08rem;
  }

  .side-choice-row {
    grid-template-columns: 1fr;
  }

  .map-grid {
    grid-template-columns: 1fr;
  }

  .compact-grid {
    grid-template-rows: minmax(222px, 0.85fr) minmax(0, 1fr);
  }

  .pool-head {
    align-items: flex-start;
  }

  .rec-actions {
    flex-direction: column;
  }
}
