:root {
  --bg-0: #090d1f;
  --bg-1: #111734;
  --bg-2: #182047;
  --surface: rgba(21, 28, 62, 0.86);
  --surface-strong: #171f46;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --gold: #ffc928;
  --gold-soft: rgba(255, 201, 40, 0.16);
  --blue: #22b8ff;
  --blue-deep: #0b4f8c;
  --blue-soft: rgba(34, 184, 255, 0.18);
  --red: #ff3b6b;
  --red-deep: #7f1232;
  --red-soft: rgba(255, 59, 107, 0.18);
  --green: #2ee59d;
  --text: #f5f7ff;
  --muted: #98a6d6;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

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

html, body {
  min-height: 100%;
  background-color: var(--bg-0);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(34, 184, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at 85% -10%, rgba(255, 59, 107, 0.16), transparent 60%),
    linear-gradient(180deg, #0e1431 0%, var(--bg-0) 100%);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

button, .snake-step, .ban-slot, .pick-slot, .brawler-tile, .mini-slot {
  touch-action: manipulation;
  user-select: none;
}

.hidden {
  display: none !important;
}

.brawl-title {
  font-family: 'Lilita One', cursive;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.65);
}

.app-shell {
  max-width: 1580px;
  margin: 0 auto;
  padding: 14px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==================== SITE NAVIGATION BAR ==================== */
.site-nav {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  background: rgba(12, 17, 41, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.nav-star {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #ffd43b, #ff7b00);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #fff;
}

.nav-logo {
  font-size: 16px;
  letter-spacing: 0.7px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: #1c1200;
  background: linear-gradient(180deg, #ffd84d 0%, #f59f00 100%);
  border-color: #ffe380;
  box-shadow: 0 3px 12px rgba(255, 201, 40, 0.28);
}

/* ==================== HOME PAGE ==================== */
.home-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

.home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.home-title {
  font-size: clamp(28px, 5vw, 46px);
  color: var(--text);
}

.home-subtitle {
  max-width: 560px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.home-actions {
  margin-top: 6px;
}

.home-cta {
  display: inline-block;
  text-decoration: none;
  padding: 12px 22px;
  font-size: 14px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.home-card {
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.14s, border-color 0.15s;
}

.home-card-featured:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.home-card-muted {
  opacity: 0.72;
}

.home-card-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(46, 229, 157, 0.16);
  color: var(--green);
}

.home-card-tag.tag-soon {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.home-card-title {
  font-size: 20px;
}

.home-card-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  flex: 1;
}

.home-card-link {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
}

/* ==================== TOP BAR ==================== */
.top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 280px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ranked-emblem {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd43b, #ff7b00);
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  box-shadow: 0 4px 14px rgba(255, 166, 0, 0.35);
}

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

.brand-text h1 {
  font-size: 21px;
  line-height: 1.1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  max-width: 100%;
}

.status-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.dot.warn {
  background: #ff5c39;
  box-shadow: 0 0 8px #ff5c39;
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-group label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--gold);
}

.select-input, .search-input {
  background: #0c1129;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.select-input:focus, .search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 201, 40, 0.18);
}

.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-blue {
  background: linear-gradient(180deg, #1ea7ff 0%, #006be6 100%);
  box-shadow: 0 4px 12px rgba(0, 128, 255, 0.32);
}

.btn-red {
  background: linear-gradient(180deg, #ff4774 0%, #c91240 100%);
  box-shadow: 0 4px 12px rgba(255, 59, 107, 0.32);
}

.btn-danger {
  background: rgba(255, 59, 107, 0.15);
  border-color: rgba(255, 59, 107, 0.45);
  color: #ff8aa6;
}

.btn-danger:hover {
  background: rgba(255, 59, 107, 0.28);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(180deg, #ffd84d 0%, #f59f00 100%);
  border-color: #ffe380;
  color: #1c1200;
  font-weight: 800;
}

/* ==================== SNAKE TIMELINE & BANS ==================== */
.draft-strip {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 14px;
}

.strip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.strip-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--muted);
}

.strip-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
}

.turn-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}

.turn-pill.blue-pill {
  background: var(--blue-soft);
  color: #79d8ff;
  border: 1px solid rgba(34, 184, 255, 0.4);
}

.turn-pill.red-pill {
  background: var(--red-soft);
  color: #ff8aa6;
  border: 1px solid rgba(255, 59, 107, 0.4);
}

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

.snake-step {
  padding: 7px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  min-width: 0;
}

.snake-step.blue-step {
  background: rgba(16, 86, 158, 0.45);
  border-color: rgba(34, 184, 255, 0.25);
}

.snake-step.red-step {
  background: rgba(145, 22, 58, 0.45);
  border-color: rgba(255, 59, 107, 0.25);
}

.snake-step.filled-step {
  opacity: 0.95;
}

.snake-step.active-step {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 201, 40, 0.35);
  transform: translateY(-1px);
}

.snake-step-num {
  font-family: 'Lilita One', cursive;
  font-size: 13px;
  line-height: 1.1;
}

.snake-step-val {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.ban-slot {
  height: 46px;
  background: #0d132e;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.15s;
}

.ban-slot:hover {
  border-color: var(--red);
}

.ban-slot.filled {
  border-style: solid;
  border-color: rgba(255, 59, 107, 0.6);
}

.ban-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(75%) brightness(0.75);
}

.ban-slot.filled::after {
  content: "✕";
  position: absolute;
  inset: 0;
  background: rgba(200, 14, 48, 0.45);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  display: grid;
  place-items: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.ban-placeholder {
  font-size: 10px;
  font-weight: 800;
  color: #5e6c9e;
}

/* ==================== MOBILE COMPACT TEAMS & TABS ==================== */
.mobile-teams-bar {
  display: none;
}

.mobile-view-tabs {
  display: none;
}

/* ==================== MAIN 3-COLUMN ARENA ==================== */
.draft-arena {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 400px;
  gap: 14px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

/* Left Column: Teams */
.teams-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.team-box {
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid var(--border);
}

.team-box.blue-team {
  background: linear-gradient(180deg, rgba(14, 72, 138, 0.65) 0%, rgba(12, 26, 62, 0.9) 100%);
  border-color: rgba(34, 184, 255, 0.35);
}

.team-box.red-team {
  background: linear-gradient(180deg, rgba(132, 20, 56, 0.62) 0%, rgba(44, 12, 32, 0.9) 100%);
  border-color: rgba(255, 59, 107, 0.35);
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Lilita One', cursive;
  font-size: 15px;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

.pick-order-tag {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold);
}

.team-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pick-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(8, 12, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.pick-slot:hover {
  background: rgba(8, 12, 30, 0.8);
}

.pick-slot.active-target {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 201, 40, 0.25);
}

.pick-slot img,
.slot-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: #0d132e;
}

.slot-empty-icon {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  color: var(--muted);
  font-weight: 800;
  font-size: 16px;
}

.slot-meta {
  min-width: 0;
  flex: 1;
}

.slot-number {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.slot-brawler-name {
  display: block;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-clear {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 6px;
}

.vs-divider {
  text-align: center;
  font-family: 'Lilita One', cursive;
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 2px;
  opacity: 0.85;
}

/* Center Column: Roster */
.roster-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roster-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.assign-mode-tabs {
  display: inline-flex;
  background: #0c1129;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  gap: 4px;
}

.mode-tab {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  padding: 7px 11px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mode-tab.active {
  background: var(--gold);
  color: #1c1200;
}

.mode-tab.tab-ban.active {
  background: var(--red);
  color: #fff;
}

.mode-tab.tab-blue.active {
  background: var(--blue);
  color: #03192b;
}

.mode-tab.tab-red.active {
  background: var(--red);
  color: #fff;
}

.search-wrap {
  position: relative;
  flex: 1 1 180px;
  max-width: 280px;
}

.search-input {
  width: 100%;
  padding-right: 32px;
}

.clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: var(--text);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.assign-hint {
  font-size: 12px;
  color: var(--muted);
  background: rgba(12, 17, 41, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
}

.assign-hint strong {
  color: var(--gold);
}

.brawler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

.brawler-tile {
  background: #12193b;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 6px 5px 7px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}

.brawler-tile:hover:not(.unavailable) {
  border-color: var(--gold);
  background: #1a2454;
  transform: translateY(-2px);
}

.brawler-tile img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: #0a0f26;
  display: block;
  margin: 0 auto;
}

.brawler-tile-name {
  font-size: 10.5px;
  font-weight: 800;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.brawler-tile.unavailable {
  opacity: 0.38;
  cursor: not-allowed;
}

.brawler-tile.unavailable img {
  filter: grayscale(90%);
}

.tile-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 8.5px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 5px;
  color: #fff;
  letter-spacing: 0.3px;
}

.tile-badge.badge-ban { background: #d61f45; }
.tile-badge.badge-ally { background: #0077e6; }
.tile-badge.badge-enemy { background: #d61f45; }

/* Right Column: Top 10 Recommendations */
.recommendations-column {
  border-color: rgba(255, 201, 40, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.rec-title {
  font-size: 19px;
  color: var(--gold);
}

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

.rec-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 201, 40, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 670px;
  overflow-y: auto;
  padding-right: 4px;
}

.rec-card {
  display: grid;
  grid-template-columns: 28px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  background: rgba(11, 16, 39, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s;
}

.rec-card.rank-1 {
  border-color: rgba(255, 201, 40, 0.65);
  background: linear-gradient(90deg, rgba(255, 201, 40, 0.14), rgba(11, 16, 39, 0.92));
}

.rec-card.rank-2 {
  border-color: rgba(192, 208, 255, 0.35);
}

.rec-card.rank-3 {
  border-color: rgba(232, 149, 85, 0.35);
}

.rec-rank {
  font-family: 'Lilita One', cursive;
  font-size: 18px;
  text-align: center;
  color: var(--muted);
}

.rec-card.rank-1 .rec-rank { color: var(--gold); }
.rec-card.rank-2 .rec-rank { color: #d8e2ff; }
.rec-card.rank-3 .rec-rank { color: #f0a160; }

.rec-card img {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  object-fit: cover;
  background: #0a0f26;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.rec-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rec-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.rec-brawler-name {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-winrate {
  font-weight: 800;
  font-size: 13px;
  color: var(--green);
  flex-shrink: 0;
}

.rec-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.rec-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.rec-reason {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 1px;
}

.stat-chip {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #c2cdf0;
}

.stat-chip.chip-pick {
  background: rgba(255, 201, 40, 0.16);
  color: var(--gold);
}

.low-data-notice {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffd875;
  background: rgba(255, 201, 40, 0.12);
  border: 1px solid rgba(255, 201, 40, 0.35);
  border-radius: 10px;
  padding: 7px 10px;
}

.rec-pick-btn {
  padding: 8px 11px;
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: 28px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* Custom subtle scrollbars */
.brawler-grid::-webkit-scrollbar,
.rec-list::-webkit-scrollbar {
  width: 6px;
}
.brawler-grid::-webkit-scrollbar-thumb,
.rec-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

/* ==================== TABLET & PHONE RESPONSIVE ==================== */
@media (max-width: 1080px) {
  .draft-arena {
    grid-template-columns: 240px minmax(0, 1fr) 350px;
  }
}

@media (max-width: 920px) {
  .app-shell {
    padding: 10px 10px 24px;
    gap: 10px;
  }

  .top-bar {
    padding: 10px 12px;
    border-radius: 14px;
    gap: 10px;
  }

  .brand-row {
    width: 100%;
    flex: 1 1 100%;
  }

  .brand-text h1 {
    font-size: 18px;
  }

  .ranked-emblem {
    width: 36px;
    height: 36px;
    font-size: 18px;
    border-radius: 10px;
  }

  .controls-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
  }

  .select-input, .search-input {
    font-size: 16px; /* Prevents iOS Safari zoom on tap */
    padding: 8px 10px;
    min-width: 0;
    width: 100%;
  }

  .btn {
    padding: 9px 11px;
    font-size: 12.5px;
  }

  .draft-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .strip-card {
    padding: 9px 10px;
  }

  .snake-steps {
    gap: 5px;
  }

  .snake-step {
    padding: 6px 3px;
  }

  .snake-step-num {
    font-size: 12px;
  }

  .snake-step-val {
    font-size: 9px;
  }

  .ban-slot {
    height: 40px;
  }

  /* Show compact Blue vs Red bar on mobile, hide tall left column */
  .teams-column {
    display: none;
  }

  .mobile-teams-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 9px 10px;
  }

  .mini-team-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    font-weight: 800;
    margin-bottom: 6px;
  }

  .mini-blue .mini-team-head { color: #79d8ff; }
  .mini-red .mini-team-head { color: #ff8aa6; }

  .mini-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 201, 40, 0.16);
    color: var(--gold);
  }

  .mini-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .mini-slot {
    aspect-ratio: 1 / 1;
    border-radius: 9px;
    background: #0c1129;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    overflow: hidden;
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
  }

  .mini-slot.filled {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.25);
  }

  .mini-slot.active-target {
    border-style: solid;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(255, 201, 40, 0.35);
  }

  .mini-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mini-vs {
    font-family: 'Lilita One', cursive;
    font-size: 15px;
    color: var(--gold);
    padding-top: 14px;
  }

  /* Sticky mobile view switcher */
  .mobile-view-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #0c1129;
    padding: 5px;
    border-radius: 13px;
    border: 1px solid var(--border);
    position: sticky;
    top: 6px;
    z-index: 20;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  }

  .mobile-tab {
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 10px 8px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
  }

  .mobile-tab.active {
    background: linear-gradient(180deg, #ffd84d 0%, #f59f00 100%);
    color: #1c1200;
  }

  /* Tabbed single-column view on mobile */
  .draft-arena {
    display: block;
  }

  .draft-arena[data-mobile-view="recs"] [data-panel="roster"] {
    display: none;
  }

  .draft-arena[data-mobile-view="roster"] [data-panel="recs"] {
    display: none;
  }

  .panel {
    padding: 12px;
    border-radius: 14px;
  }

  .roster-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .assign-mode-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
  }

  .search-wrap {
    max-width: none;
  }

  .brawler-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .rec-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .rec-card {
    grid-template-columns: 24px 44px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }

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

@media (max-width: 420px) {
  .controls-bar {
    grid-template-columns: 1fr 1fr;
  }

  .control-fp {
    grid-column: 1 / -1;
  }

  .control-fp .btn {
    width: 100%;
  }
}


/* ==================== BRAWLVAULT EXPANSION STYLES ==================== */

/* Mobile-friendly scrollable 5-tab top nav */
.nav-links {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link { white-space: nowrap; flex-shrink: 0; }

/* Extra button variants */
.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }
.btn-sm { padding: 7px 12px; font-size: 12px; }

.btn-toggle {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
  color: var(--muted);
  font-size: 12px;
  padding: 7px 12px;
}
.btn-toggle.active {
  background: rgba(255, 201, 40, 0.2);
  border-color: var(--gold);
  color: var(--gold);
}

/* Home Page Phone-First Enhancements */
.home-tag-box {
  width: 100%;
  max-width: 560px;
  background: rgba(9, 13, 31, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.home-tag-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--gold);
}

.tag-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.tag-field {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
}

.connected-player-pill {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(46, 229, 157, 0.12);
  border: 1px solid rgba(46, 229, 157, 0.35);
  color: #dcfff0;
}

.connected-player-pill.pill-error {
  background: rgba(255, 59, 107, 0.14);
  border-color: rgba(255, 59, 107, 0.4);
  color: #ffb3c4;
}

.lv11-badge, .rating-mini {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.lv11-badge { background: rgba(255, 201, 40, 0.22); color: var(--gold); }
.rating-mini { background: rgba(34, 184, 255, 0.22); color: #8be0ff; }

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.home-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.home-card-tag.tag-gold { background: rgba(255, 201, 40, 0.16); color: var(--gold); }
.home-card-tag.tag-blue { background: rgba(34, 184, 255, 0.18); color: #79d8ff; }
.home-card-tag.tag-purple { background: rgba(157, 123, 255, 0.2); color: #c7b4ff; }

/* Drafting Player Level 11 Filter Strip */
.player-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid rgba(255, 201, 40, 0.25);
  border-radius: var(--radius-md);
}

.player-filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--gold);
}

.tag-compact {
  width: 150px;
  padding: 7px 10px;
  font-size: 13px;
  text-transform: uppercase;
}

.player-filter-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.player-status-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.lv11-inline {
  color: var(--gold);
  font-weight: 800;
}

.tile-lv11 {
  border-color: rgba(255, 201, 40, 0.55) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 201, 40, 0.25);
}

.tile-badge.badge-lv11 {
  background: linear-gradient(180deg, #ffd84d, #f59f00);
  color: #1c1200;
}

.lv11-chip {
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 201, 40, 0.22);
  color: var(--gold);
  vertical-align: middle;
}

/* Shared Subpage Headers, Summary Strips, Empty Cards */
.page-header-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.page-title { font-size: clamp(20px, 3vw, 28px); }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 4px; max-width: 620px; line-height: 1.45; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.summary-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-label { font-size: 10px; font-weight: 800; letter-spacing: 0.8px; color: var(--muted); }
.summary-val { font-size: 16px; font-weight: 800; }
.gold-text { color: var(--gold); }
.green-text { color: var(--green); }
.muted-tag { color: var(--muted); font-size: 12px; font-weight: 700; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(12, 17, 41, 0.75);
  color: var(--muted);
  cursor: pointer;
}
.filter-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c1200;
}

.filter-search { max-width: 240px; width: 100%; }

.empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.empty-card.error-card {
  border-color: rgba(255, 59, 107, 0.45);
  color: #ff9cb0;
}

/* ==================== UPGRADE GUIDE CARDS ==================== */
.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

.upgrade-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.upgrade-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.upgrade-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.upgrade-rank {
  font-family: 'Lilita One', cursive;
  font-size: 18px;
  color: var(--gold);
  min-width: 28px;
}

.upgrade-identity img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: #0a0f26;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.upgrade-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.upgrade-name { font-size: 15px; font-weight: 800; }

.upgrade-level-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.level-tag {
  font-size: 11px;
  font-weight: 800;
  color: #c8d4fa;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 5px;
}

.prio-tag {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.4px;
}
.prio-s { background: rgba(255, 71, 105, 0.22); color: #ff8aa6; }
.prio-a { background: rgba(255, 201, 40, 0.2); color: var(--gold); }
.prio-b { background: rgba(34, 184, 255, 0.2); color: #79d8ff; }
.prio-c { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

.upgrade-meta-nums {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.meta-num { display: flex; flex-direction: column; align-items: flex-end; }
.meta-num span { font-size: 10px; color: var(--muted); font-weight: 700; }
.meta-num strong { font-size: 14px; color: var(--green); }

.upgrade-cost-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cost-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(12, 17, 41, 0.8);
  border: 1px solid var(--border);
}
.cost-coins { color: var(--gold); }
.cost-pp { color: #d896ff; }
.cost-score { color: #79d8ff; }

.build-box {
  background: rgba(9, 13, 31, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.build-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.build-sample { color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; }

.build-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.build-key { color: var(--muted); font-weight: 700; flex-shrink: 0; }
.build-val { font-weight: 800; text-align: right; color: var(--text); }
.owned-badge {
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(46, 229, 157, 0.18);
  color: var(--green);
}

.upgrade-maps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.maps-lbl { color: var(--muted); font-weight: 700; }
.mini-map-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #d6e0ff;
}

/* ==================== AI TIER LIST ==================== */
.tier-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.tier-lv11-note {
  padding: 8px 13px;
  border-radius: 10px;
  background: rgba(255, 201, 40, 0.12);
  border: 1px solid rgba(255, 201, 40, 0.35);
  color: #ffe380;
  font-size: 12.5px;
  font-weight: 700;
}

.tier-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tier-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tier-row-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 6px;
}

.tier-letter { font-size: 32px; line-height: 1; }
.tier-count { font-size: 10.5px; font-weight: 800; opacity: 0.85; }

.tier-pill {
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 5px;
}

.tier-s { background: linear-gradient(180deg, #ff4b6e, #c8133d); color: #fff; }
.tier-a { background: linear-gradient(180deg, #ffb833, #d97706); color: #1b0f00; }
.tier-b { background: linear-gradient(180deg, #2bb5ff, #0066cc); color: #fff; }
.tier-c { background: linear-gradient(180deg, #4fd1a5, #1f8a66); color: #052218; }
.tier-d { background: linear-gradient(180deg, #64748b, #334155); color: #fff; }

.tier-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  padding: 10px;
}

.tier-tile {
  background: #101736;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  padding: 6px 5px;
  text-align: center;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s, border-color 0.12s;
}
.tier-tile:hover { transform: translateY(-2px); border-color: var(--gold); }
.tier-tile img { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; display: block; margin: 0 auto; }
.tier-tile-name { font-size: 10.5px; font-weight: 800; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tier-tile-stats { font-size: 9.5px; color: var(--muted); font-weight: 700; margin-top: 1px; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 18, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #12193b;
  border: 1px solid rgba(255, 201, 40, 0.4);
  border-radius: 18px;
  padding: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.modal-head { display: flex; align-items: center; gap: 12px; padding-right: 34px; }
.modal-head img { width: 62px; height: 62px; border-radius: 14px; object-fit: cover; border: 1px solid var(--border-strong); }
.modal-title { font-size: 22px; }
.modal-rank-line { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-top: 3px; }

.modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modal-stat-box {
  background: rgba(9, 13, 31, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
  text-align: center;
}
.modal-stat-box span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.modal-stat-box strong { font-size: 17px; color: var(--green); }

.modal-section { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.modal-sec-lbl { font-size: 10.5px; font-weight: 800; letter-spacing: 0.7px; color: var(--gold); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==================== PLAYER & CLUB LOOKUP ==================== */
.lookup-search-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 280px;
  flex: 1 1 320px;
  max-width: 460px;
}

.lookup-type-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: #0c1129;
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--border);
  gap: 4px;
}

.lookup-type-btn {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.lookup-type-btn.active { background: var(--gold); color: #1c1200; }

.lookup-result { display: flex; flex-direction: column; gap: 14px; }

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.95fr);
  gap: 14px;
}

.profile-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-top-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.profile-name { font-size: clamp(22px, 3vw, 30px); }
.profile-tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.profile-tag { font-size: 13px; font-weight: 800; color: var(--gold); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.club-link-pill {
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 184, 255, 0.4);
  background: rgba(34, 184, 255, 0.14);
  color: #8be0ff;
  cursor: pointer;
}
.club-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 9px;
}

.stat-tile {
  background: rgba(9, 13, 31, 0.72);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-tile span { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.stat-tile strong { font-size: 15px; font-weight: 800; }

.api-note { font-size: 11px; color: var(--muted); opacity: 0.85; }

/* Rating Card out of 10 */
.rating-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.rating-card.score-elite { border-color: rgba(255, 201, 40, 0.6); background: linear-gradient(180deg, rgba(255, 201, 40, 0.14), rgba(15, 21, 48, 0.92)); }
.rating-card.score-good { border-color: rgba(46, 229, 157, 0.5); }
.rating-card.score-mid { border-color: rgba(34, 184, 255, 0.45); }

.rating-label { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.rating-score-big { display: flex; align-items: baseline; gap: 4px; }
.rating-score-big span { font-size: 52px; line-height: 1; color: var(--gold); }
.rating-score-big small { font-size: 18px; font-weight: 800; color: var(--muted); }
.rating-grade {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.9px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 201, 40, 0.18);
  color: var(--gold);
}

.rating-breakdown { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rb-head { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; margin-bottom: 3px; }
.rb-head span { color: var(--muted); }
.rb-track { width: 100%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.rb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--green), var(--gold)); }

.sub-tabs-bar {
  display: inline-flex;
  gap: 6px;
  background: #0c1129;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border);
  align-self: flex-start;
}
.sub-tab {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.sub-tab.active { background: var(--gold); color: #1c1200; }

.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 12px;
}
.match-row.res-win { border-left-color: var(--green); }
.match-row.res-loss { border-left-color: var(--red); }

.match-row img, .match-img-empty {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #0a0f26;
}
.match-img-empty { display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.match-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; }
.match-mode-tag { font-size: 11px; color: var(--muted); font-weight: 700; }
.sp-badge { font-size: 9.5px; font-weight: 900; padding: 2px 6px; border-radius: 4px; background: rgba(255, 201, 40, 0.22); color: var(--gold); }
.match-map { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.match-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.match-res-badge { font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 5px; }
.match-res-badge.res-win { background: rgba(46, 229, 157, 0.18); color: var(--green); }
.match-res-badge.res-loss { background: rgba(255, 59, 107, 0.18); color: #ff8aa6; }
.match-res-badge.res-draw { background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.match-trophy { font-size: 11px; font-weight: 800; }
.match-trophy.pos { color: var(--green); }
.match-trophy.neg { color: #ff8aa6; }

.player-brawler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.pb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  position: relative;
}
.pb-card img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; display: block; margin: 0 auto; }
.pb-power {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.7);
  color: #d6e0ff;
}
.pb-power.lv11 { background: var(--gold); color: #1c1200; }
.pb-name { font-size: 11px; font-weight: 800; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-trophies { font-size: 10.5px; font-weight: 700; color: var(--gold); margin-top: 2px; }

.section-bar-title { font-size: 11px; font-weight: 800; letter-spacing: 0.8px; color: var(--gold); margin-bottom: 10px; }
.club-member-list { display: flex; flex-direction: column; gap: 6px; }
.club-member-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(9, 13, 31, 0.7);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.club-member-row:hover { border-color: var(--gold); }
.member-rank { font-family: 'Lilita One', cursive; font-size: 15px; color: var(--gold); }
.member-info { display: flex; flex-direction: column; min-width: 0; }
.member-info strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-meta { font-size: 11px; color: var(--muted); }
.member-trophies { font-size: 13px; font-weight: 800; color: var(--gold); }

/* ==================== PHONE RESPONSIVE OVERRIDES ==================== */
@media (max-width: 920px) {
  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 9px 10px;
  }

  .nav-links {
    width: 100%;
    padding-bottom: 2px;
  }

  .nav-link {
    font-size: 12.5px;
    padding: 7px 11px;
  }

  .home-hero {
    padding: 22px 14px;
  }

  .home-subtitle {
    font-size: 13.5px;
  }

  .tag-input-row {
    flex-wrap: wrap;
  }

  .tag-input-row .btn {
    flex: 1 1 auto;
  }

  .home-actions {
    width: 100%;
  }

  .home-cta {
    width: 100%;
    text-align: center;
  }

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

  .player-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .player-filter-left {
    width: 100%;
  }

  .tag-compact {
    flex: 1;
    font-size: 16px;
  }

  .page-header-card {
    padding: 13px;
  }

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

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

  .tier-row-label {
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 14px;
  }

  .tier-row-grid {
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  }

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

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


/* ==================== DEEP SCORE COACHING SUGGESTIONS ==================== */
.coaching-panel {
  border-color: rgba(255, 201, 40, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coaching-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.coaching-heading {
  font-size: 19px;
  color: var(--gold);
}

.coaching-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.coaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 12px;
}

.coach-card {
  background: rgba(9, 13, 31, 0.78);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coach-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.coach-cat {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--blue);
}

.coach-tag {
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 201, 40, 0.16);
  color: var(--gold);
  letter-spacing: 0.4px;
}

.coach-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.coach-summary {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}

.coach-steps {
  margin: 2px 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #cfd8f6;
}

.coach-cta {
  margin-top: auto;
  padding-top: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}

@media (max-width: 920px) {
  .coaching-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================== EXPANDABLE MATCH LOBBY DETAILS ==================== */
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.match-card.res-win { border-left-color: var(--green); }
.match-card.res-loss { border-left-color: var(--red); }
.match-card.open { border-color: rgba(255, 201, 40, 0.45); }

.match-row-toggle {
  width: 100%;
  border: none;
  border-left: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.match-row-toggle:hover { background: rgba(255, 255, 255, 0.03); }

.match-chevron {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.15s;
}
.match-card.open .match-chevron {
  transform: rotate(180deg);
  color: var(--gold);
}

.match-details {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  background: rgba(8, 12, 30, 0.72);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-detail-meta {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.match-teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.match-team-col {
  background: rgba(15, 22, 48, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.match-team-col.md-blue { border-color: rgba(34, 184, 255, 0.35); }
.match-team-col.md-red { border-color: rgba(255, 59, 107, 0.35); }

.match-team-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: var(--muted);
}
.md-blue .match-team-lbl { color: #79d8ff; }
.md-red .match-team-lbl { color: #ff8aa6; }

.match-team-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-player-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(9, 13, 31, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.match-player-btn:hover {
  border-color: var(--gold);
  background: rgba(255, 201, 40, 0.08);
}
.match-player-btn.mp-self {
  border-color: rgba(46, 229, 157, 0.45);
  background: rgba(46, 229, 157, 0.08);
}

.match-player-btn img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #0a0f26;
}

.mp-info { min-width: 0; }
.mp-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
}
.mp-name-line strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-sub-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

.mp-lv {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #d6e0ff;
  font-size: 9.5px;
  font-weight: 800;
}
.mp-lv.lv11 { background: rgba(255, 201, 40, 0.22); color: var(--gold); }
.mp-trophies { color: var(--gold); }
.mp-arrow { color: var(--muted); font-size: 12px; font-weight: 800; }

@media (max-width: 920px) {
  .match-teams-grid {
    grid-template-columns: 1fr;
  }
}


/* Coaching Metric Chips */
.coach-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
  margin: 2px 0;
}

.coach-metric {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coach-metric span {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
}

.coach-metric strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ==================== FAN CONTENT POLICY FOOTER ==================== */
.site-footer {
  margin-top: 12px;
  padding: 14px 12px 6px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: underline;
}


/* ==================== COMMUNITY MATCH GUIDES ==================== */
.guides-auth-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1f2430;
  border-color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}
.btn-google:hover { filter: brightness(0.95); }

.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}
.auth-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

.guides-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.guides-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 320px;
  justify-content: flex-end;
}
.guides-selects .select-input,
.guides-selects .search-input {
  min-width: 135px;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}
.guide-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 201, 40, 0.45);
}

.guide-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.guide-card-brawler {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.guide-card-brawler img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  object-fit: cover;
  background: #0a0f26;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.guide-card-titles { min-width: 0; }
.guide-pills-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.guide-card-title { font-size: 15.5px; font-weight: 800; line-height: 1.3; }

.upvote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(9, 13, 31, 0.78);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.upvote-btn strong { font-size: 13px; color: var(--text); }
.upvote-btn.voted {
  border-color: var(--gold);
  background: rgba(255, 201, 40, 0.18);
  color: var(--gold);
}
.upvote-btn.voted strong { color: var(--gold); }

.guide-mini-build {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #cdd8fa;
  background: rgba(9, 13, 31, 0.65);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 9px;
}

.guide-card-preview {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  flex: 1;
}

.guide-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.guide-author-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.mini-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }

.read-guide-link {
  border: none;
  background: transparent;
  color: var(--gold);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* Guide Write & Read Modals */
.modal-wide { max-width: 640px; }
.guide-modal-title { font-size: 20px; font-weight: 800; line-height: 1.25; margin-bottom: 4px; }

.guide-matchup-chips { display: flex; flex-direction: column; gap: 6px; }
.gm-chip {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}
.gm-syn strong { color: var(--green); }
.gm-cnt strong { color: var(--gold); }

.guide-full-body {
  font-size: 14px;
  line-height: 1.65;
  color: #e4ebff;
  white-space: pre-wrap;
  background: rgba(9, 13, 31, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
}

.guide-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.guide-form { display: flex; flex-direction: column; gap: 11px; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 10px; font-weight: 800; letter-spacing: 0.8px; color: var(--gold); }
.form-label-row { display: flex; justify-content: space-between; align-items: center; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.form-row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.guide-textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

@media (max-width: 920px) {
  .guides-grid { grid-template-columns: 1fr; }
  .guides-selects { width: 100%; justify-content: stretch; }
  .guides-selects .select-input,
  .guides-selects .search-input { flex: 1 1 45%; }
  .form-row-3, .form-row-2 { grid-template-columns: 1fr; }
}
