:root {
  --surface: #131313;
  --surface-dim: #131313;
  --surface-bright: #393939;
  --surface-container-lowest: #0e0e0e;
  --surface-container-low: #1c1b1b;
  --surface-container: #201f1f;
  --surface-container-high: #2a2a2a;
  --surface-container-highest: #353534;
  --on-surface: #e5e2e1;
  --on-surface-variant: #c4c6d3;
  --inverse-surface: #e5e2e1;
  --inverse-on-surface: #313030;
  --outline: #8e909c;
  --outline-variant: #434651;
  --surface-tint: #b0c6ff;
  --primary: #b0c6ff;
  --on-primary: #002c70;
  --primary-container: #17408b;
  --on-primary-container: #8fafff;
  --inverse-primary: #385ca8;
  --secondary: #ffb3b0;
  --on-secondary: #680010;
  --secondary-container: #c40027;
  --on-secondary-container: #ffd2cf;
  --tertiary: #e9c400;
  --on-tertiary: #3a3000;
  --tertiary-container: #c8a900;
  --on-tertiary-container: #4b3e00;
  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;
  --background: #131313;
  --on-background: #e5e2e1;
  --surface-variant: #353534;
  --primary-fixed: #d9e2ff;
  --primary-fixed-dim: #b0c6ff;
  --secondary-fixed: #ffdad8;
  --secondary-fixed-dim: #ffb3b0;
  --tertiary-fixed: #ffe16d;
  --tertiary-fixed-dim: #e9c400;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --font-display: 'Anton', sans-serif;
  --font-headline: 'Sora', sans-serif;
  --font-body: 'Sora', sans-serif;
  --font-data: 'Hanken Grotesk', sans-serif;
  --font-label: 'Hanken Grotesk', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--on-background);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  font-size: 22px;
  line-height: 1;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-container-highest); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

::selection { background: var(--primary-container); color: var(--on-primary-container); }

.glass-panel {
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glow-bloom-primary { box-shadow: 0 0 24px -8px rgba(176, 198, 255, 0.2); }
.glow-bloom-secondary { box-shadow: 0 0 24px -8px rgba(255, 179, 176, 0.2); }
.glow-bloom-tertiary { box-shadow: 0 0 24px -8px rgba(233, 196, 0, 0.2); }

/* ========== Top Navigation ========== */
.top-nav {
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  align-items: center;
  height: 56px;
  gap: var(--spacing-md);
}

.top-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  flex-shrink: 0;
}

.top-nav-logo .material-symbols-outlined {
  font-size: 28px;
  color: var(--primary);
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.top-nav-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--spacing-lg);
}

.top-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
  border-radius: var(--radius);
  position: relative;
}

.top-nav-link .material-symbols-outlined {
  font-size: 18px;
}

.top-nav-link:hover {
  color: var(--on-surface);
  background: rgba(255, 255, 255, 0.05);
}

.top-nav-link.active {
  color: var(--primary);
  background: rgba(176, 198, 255, 0.1);
}

.top-nav-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

@media (max-width: 768px) {
  .top-nav-title { display: none; }
  .top-nav-links { margin-left: auto; gap: 0; }
  .top-nav-link { padding: 8px 10px; }
  .top-nav-link span:last-child { display: none; }
  .top-nav-link .material-symbols-outlined { font-size: 22px; }
}

@media (max-width: 480px) {
  .top-nav-link { padding: 8px 8px; }
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.header-icon-btn:hover { color: var(--primary); background: rgba(176, 198, 255, 0.08); }
.header-icon-btn:active { transform: scale(0.95); }

/* ========== Main Content ========== */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
}

/* ========== Team Badges ========== */
.team-select-area {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
  padding-bottom: 4px;
}

.team-select-area::-webkit-scrollbar { display: none; }

.team-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--outline-variant);
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.team-btn:hover, .team-btn:active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(176, 198, 255, 0.06);
}

.team-btn.filled {
  border-style: solid;
  border-color: transparent;
  color: var(--on-surface);
}

.team-btn.filled.active {
  box-shadow: 0 0 12px -2px rgba(176, 198, 255, 0.3);
}

.team-badge-count {
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: 2px;
}

.team-btn-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-surface-variant);
  margin-left: 2px;
  cursor: pointer;
  transition: all 0.15s;
}

.team-btn-remove:hover { background: var(--secondary-container); color: var(--on-secondary-container); }

.team-btn.add-team-btn { padding: 8px 12px; }
.team-btn.add-team-btn span:first-child { font-size: 18px; margin-right: 2px; }

.team-logo-dot {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}



/* ========== Team Panel Container ========== */
.team-panel-container {
  min-height: 200px;
}

.team-panel-container .team-panel {
  flex: none;
  width: 100%;
  max-width: none;
}

.team-panel-container .panels-empty {
  width: 100%;
  text-align: center;
  color: var(--outline-variant);
  padding: 60px 20px;
  font-family: var(--font-body);
  font-size: 14px;
}

/* ========== Panels Scroll (legacy) ========== */
.panels-scroll {
  display: flex;
  gap: var(--spacing-md);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--spacing-sm);
}

.panels-empty {
  width: 100%;
  text-align: center;
  color: var(--outline-variant);
  padding: 60px 20px;
  font-family: var(--font-body);
  font-size: 14px;
}

/* ========== Team Panel ========== */
.team-panel {
  flex: 0 0 320px;
  min-width: 280px;
  max-width: 400px;
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  position: relative;
}

.team-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary), transparent);
  z-index: 2;
}

.panel-letter-bg {
  position: absolute;
  top: -10px;
  right: -5px;
  font-family: var(--font-display);
  font-size: 120px;
  line-height: 1;
  color: var(--on-surface);
  opacity: 0.06;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s;
  user-select: none;
}

.team-panel:hover .panel-letter-bg {
  opacity: 0.12;
}

@media (min-width: 769px) {
  .team-panel { flex: 1; min-width: 200px; max-width: none; }
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(32, 31, 31, 0.4);
}

.panel-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 16px;
  color: var(--on-surface);
}

.panel-conf {
  margin-left: auto;
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--surface-container);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.panel-finance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  background: rgba(32, 31, 31, 0.2);
}

.panel-finance .fin-label {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.panel-finance .fin-val {
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.panel-finance .fin-val.danger { color: var(--secondary); }
.panel-finance .fin-val.success { color: #4ade80; }

.player-list { overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

.player-list-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  background: var(--surface-container);
  z-index: 2;
}

.player-list-header .plh-name { flex: 1; }
.player-list-header .plh-salary { width: 68px; text-align: right; }
.player-list-header .plh-per { width: 36px; text-align: right; }
.player-list-header .plh-action { width: 24px; text-align: center; }

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.player-row:hover { background: rgba(176, 198, 255, 0.06); }
.player-row.selected {
  background: rgba(176, 198, 255, 0.1);
  border-left: 3px solid var(--primary);
  padding-left: 11px;
}
.player-row.selected:hover { background: rgba(255, 179, 176, 0.1); }
.player-row.restricted { opacity: 0.35; cursor: not-allowed; }
.player-row.restricted:hover { background: transparent; }

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-container-high);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-variant);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.player-name {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.6;
}

.player-name[data-player-id] {
  cursor: pointer;
}

.player-name[data-player-id]:hover {
  color: var(--primary);
}

.player-position {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 1px;
}

.player-name .lock-icon { font-size: 9px; flex-shrink: 0; }

.player-salary {
  width: 72px;
  text-align: right;
  font-family: var(--font-data);
  font-size: 14px;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}

.player-per {
  width: 38px;
  text-align: right;
  font-family: var(--font-data);
  font-size: 14px;
  color: var(--outline-variant);
  font-variant-numeric: tabular-nums;
}

.player-action {
  width: 24px;
  text-align: center;
  font-size: 14px;
}

.player-action .arrow { color: var(--outline-variant); }
.player-action .checked { color: var(--primary); font-weight: 700; }

.draft-pick-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 6px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.draft-pick-list {
  overflow-y: auto;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.draft-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.draft-pick-row:hover { background: rgba(176, 198, 255, 0.06); }
.draft-pick-row.selected {
  background: rgba(176, 198, 255, 0.1);
  border-left: 3px solid var(--primary);
  padding-left: 11px;
}
.draft-pick-row.selected:hover { background: rgba(255, 179, 176, 0.1); }
.draft-pick-row.restricted { opacity: 0.35; cursor: not-allowed; }
.draft-pick-row.restricted:hover { background: transparent; }

.pick-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pick-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.pick-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5;
}

.pick-protection {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--tertiary);
  background: rgba(255, 179, 176, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.pick-origin {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.05em;
  line-height: 1;
  margin-top: 1px;
}

.pick-action {
  width: 24px;
  text-align: center;
  font-size: 14px;
}

.pick-action .arrow { color: var(--outline-variant); }
.pick-action .checked { color: var(--primary); font-weight: 700; }

/* ========== Trade Package ========== */
.trade-package-section {
  max-width: 1100px;
  margin: 0 auto;
}

.trade-package {
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.trade-pkg-body {
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.trade-pkg-col {
  flex: 1;
  min-width: 200px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.trade-pkg-col:last-child { border-right: none; }

.trade-pkg-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.trade-pkg-col-head::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  padding: 16px;
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 1;
  opacity: 0.03;
  pointer-events: none;
}

.trade-pkg-col-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 800;
}

.trade-pkg-sub-col { padding: 10px 14px; }
.trade-pkg-sub-col + .trade-pkg-sub-col { border-top: 1px solid rgba(255, 255, 255, 0.05); }

.trade-pkg-sub-label {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trade-pkg-sub-label.out-label { color: var(--secondary); }
.trade-pkg-sub-label.in-label { color: var(--primary); }

.trade-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface-container-lowest);
  border-radius: var(--radius);
  margin-bottom: 4px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.trade-item .ti-type {
  font-family: var(--font-label);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.trade-item .ti-type.out-tag {
  background: rgba(255, 179, 176, 0.15);
  color: var(--secondary);
}

.trade-item .ti-type.in-tag {
  background: rgba(176, 198, 255, 0.15);
  color: var(--primary);
}

.trade-item .ti-name {
  flex: 1;
  font-family: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--on-surface);
}

.trade-item .ti-to {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--outline-variant);
  flex-shrink: 0;
}

.trade-item .ti-salary {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
}

.trade-item .ti-remove {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.trade-item .ti-remove:hover, .trade-item .ti-remove:active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.trade-pkg-col-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--on-surface-variant);
}

.trade-pkg-col-footer b.out-amt { color: var(--secondary); }
.trade-pkg-col-footer b.in-amt { color: var(--primary); }

.trade-pkg-empty {
  color: var(--outline-variant);
  font-family: var(--font-data);
  font-size: 12px;
  padding: 2px 0;
}

.trade-pkg-empty-full {
  color: var(--outline-variant);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 40px 20px;
  text-align: center;
  width: 100%;
}

.trade-pkg-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  gap: 8px;
  flex-wrap: wrap;
}

.salary-summary {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--on-surface-variant);
}

.salary-summary b { color: var(--on-surface); }

.check-trade-btn {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(to right, var(--primary-container), var(--primary-fixed-dim));
  color: var(--on-primary);
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-shadow: 0 4px 24px -4px rgba(23, 64, 139, 0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.check-trade-btn:hover { filter: brightness(1.1); }
.check-trade-btn:active { transform: scale(0.98); }
.check-trade-btn:disabled {
  background: var(--surface-container-high);
  color: var(--outline-variant);
  box-shadow: none;
  cursor: not-allowed;
}

/* ========== Result ========== */
.result-area { display: none; }
.result-area.visible { display: block; }

.result-card {
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
}

.result-title {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--on-surface);
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.rule-item:last-child { border-bottom: none; }

.rule-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 14px;
}

.rule-icon.pass { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.rule-icon.fail { color: var(--secondary); background: rgba(255, 179, 176, 0.1); }
.rule-icon.warn { color: var(--tertiary); background: rgba(233, 196, 0, 0.1); }

.rule-detail { flex: 1; }
.rule-name { font-family: var(--font-headline); font-weight: 700; font-size: 13px; }
.rule-desc { font-family: var(--font-body); font-size: 11px; color: var(--on-surface-variant); margin-top: 2px; }

/* ========== Action Bar ========== */
.action-bar {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  padding: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.action-btn:hover { background: var(--surface-container); color: var(--on-surface); }
.action-btn:active { transform: scale(0.95); }

.action-btn .material-symbols-outlined { font-size: 18px; }

.action-btn.ai-btn {
  border-color: rgba(176, 198, 255, 0.3);
  color: var(--primary);
  background: rgba(176, 198, 255, 0.06);
}

.action-btn.ai-btn:hover {
  background: rgba(176, 198, 255, 0.12);
  border-color: var(--primary);
  box-shadow: 0 0 16px -4px rgba(176, 198, 255, 0.2);
}

.action-btn.gm-btn {
  border-color: rgba(233, 196, 0, 0.3);
  color: var(--tertiary);
  background: rgba(233, 196, 0, 0.06);
}

.action-btn.gm-btn:hover {
  background: rgba(233, 196, 0, 0.12);
  border-color: var(--tertiary);
  box-shadow: 0 0 16px -4px rgba(233, 196, 0, 0.2);
}

.action-btn.danger-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background: rgba(255, 179, 176, 0.06);
}

.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s;
}

.modal-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

.modal-card {
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  background: var(--surface-container-low);
  z-index: 2;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-head h3 {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--on-surface);
}

.modal-head h3 .material-symbols-outlined { font-size: 20px; color: var(--on-surface-variant); }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover, .modal-close:active { background: var(--surface-container-high); color: var(--on-surface); }

.modal-close .material-symbols-outlined { font-size: 18px; }

.modal-body { padding: 12px 16px 16px; }

.modal-team-intro {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--on-surface-variant);
  margin-bottom: 16px;
}

.modal-conf-section { margin-bottom: 16px; }
.modal-conf-section:last-child { margin-bottom: 0; }

.modal-conf-title {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding-bottom: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-conf-title.conf-east { color: var(--secondary); }
.modal-conf-title.conf-west { color: var(--tertiary); }

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

.modal-team-card {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.modal-team-card:hover { background: rgba(255, 255, 255, 0.12); }
.modal-team-card:active { transform: scale(0.98); }

.modal-team-card.selected {
  opacity: 0.4;
  cursor: not-allowed;
}

.modal-team-card.selected:hover { background: rgba(255, 255, 255, 0.06); transform: none; }

.modal-team-card.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.modal-team-card.disabled:hover { background: rgba(255, 255, 255, 0.06); transform: none; }

.modal-card-letter-bg {
  display: none;
}

.modal-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1;
}

.modal-card-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: none;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
}

.modal-card-logo span {
  font-family: var(--font-data);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.modal-card-info { display: flex; flex-direction: column; gap: 2px; }

.modal-card-city {
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.4;
}

.modal-card-name {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
  line-height: 1;
}

.modal-card-trade-btn {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: none;
}

.modal-card-trade-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.25); }
.modal-card-trade-btn:active { transform: scale(0.95); }

.modal-card-trade-btn.is-selected {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
  box-shadow: none;
  cursor: default;
}

.modal-team-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
}

.dest-player-info {
  padding: 12px 14px;
  background: var(--surface-container-lowest);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.modal-section-title {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  color: var(--outline-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.modal-team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.modal-team-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

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

.modal-team-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* ========== Toast ========== */
.toast-container {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.warn { background: rgba(233, 196, 0, 0.9); color: #000; }
.toast.success { background: rgba(74, 222, 128, 0.9); color: #000; }
.toast.error { background: rgba(255, 179, 176, 0.9); color: var(--on-secondary); }
.toast.info { background: rgba(176, 198, 255, 0.9); color: var(--on-primary); }

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

/* ========== AI Panel ========== */
.ai-panel { display: none; }
.ai-panel.visible { display: block; }

.ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ai-panel-title {
  font-family: var(--font-headline);
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-panel-title .material-symbols-outlined { color: var(--primary); font-size: 20px; }

.panel-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.panel-close-btn:hover { background: var(--surface-container-high); color: var(--on-surface); }
.panel-close-btn .material-symbols-outlined { font-size: 18px; }

.ai-panel-body {
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: var(--spacing-md);
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: break-word;
  color: var(--on-surface);
}

.ai-panel-body hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.ai-panel-body code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--font-data);
}

.ai-panel-body strong {
  font-weight: 700;
  color: var(--on-surface);
}

.ai-panel-placeholder {
  color: var(--outline-variant);
  text-align: center;
  padding: 40px 0;
}

.ai-panel-loading { color: var(--on-surface-variant); }
.ai-panel-loading .dot { animation: blink 1.4s infinite both; }
.ai-panel-loading .dot:nth-child(2) { animation-delay: 0.2s; }
.ai-panel-loading .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }

.ai-panel-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px;
  background: rgba(28, 27, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.ai-usage {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--on-surface-variant);
}

/* ========== AI Settings Modal ========== */
.ai-settings-section { margin-bottom: var(--spacing-md); }

.ai-settings-label {
  display: block;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--on-surface);
  letter-spacing: 0.05em;
}

.ai-settings-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: var(--font-data);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.ai-settings-input:focus { border-color: var(--primary); }

.ai-settings-hint {
  font-size: 11px;
  color: var(--on-surface-variant);
  margin-top: 6px;
}

.ai-settings-save {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(to right, var(--primary-container), var(--primary-fixed-dim));
  color: var(--on-primary);
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px -4px rgba(23, 64, 139, 0.4);
}

.ai-settings-save:hover { filter: brightness(1.1); }
.ai-settings-save:active { transform: scale(0.98); }

/* ========== GM Chat Panel ========== */
.gm-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: none;
  background: linear-gradient(135deg, var(--tertiary-container), var(--tertiary));
  color: var(--on-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(233, 196, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  z-index: 100;
}

.gm-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(233, 196, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.4);
}

.gm-fab:active {
  transform: scale(0.95);
}

.gm-fab .material-symbols-outlined {
  font-size: 26px;
  font-variation-settings: 'FILL' 1;
}

.modal-overlay.active ~ .gm-fab,
.gm-fab.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.8);
}

.gm-chat-modal-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: calc(100vh - 8vh);
  max-height: none;
  background: var(--surface-container-low);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  animation: gmModalIn 0.25s ease-out;
}

@keyframes gmModalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gm-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.gm-chat-title {
  font-family: var(--font-headline);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--on-surface);
}

.gm-chat-title .material-symbols-outlined { color: var(--tertiary); font-size: 20px; }

.gm-chat-team-select {
  flex: 1;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.gm-chat-team-select:focus { border-color: var(--tertiary); }

.gm-chat-body {
  flex: 1;
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: var(--spacing-md);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gm-chat-placeholder {
  color: var(--outline-variant);
  text-align: center;
  padding: 60px 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.8;
}

.gm-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: msgIn 0.3s ease-out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.gm-chat-msg-label {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gm-chat-msg.gm .gm-chat-msg-label { color: var(--primary); }
.gm-chat-msg.owner .gm-chat-msg-label { color: var(--tertiary); text-align: right; }

.gm-chat-msg-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.gm-chat-msg.owner .gm-chat-msg-bubble {
  white-space: pre-wrap;
}

.gm-chat-msg.gm .gm-chat-msg-bubble {
  background: var(--surface-container);
  border: 1px solid rgba(176, 198, 255, 0.1);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
  color: var(--on-surface);
}

.gm-chat-msg.owner .gm-chat-msg-bubble {
  background: rgba(233, 196, 0, 0.08);
  border: 1px solid rgba(233, 196, 0, 0.15);
  border-radius: var(--radius-md) 4px var(--radius-md) var(--radius-md);
  align-self: flex-end;
  color: var(--on-surface);
}

.gm-chat-msg-loading .gm-chat-msg-bubble { color: var(--on-surface-variant); min-width: 80px; }

.gm-chat-msg-bubble hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.gm-chat-msg-bubble code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--font-data);
}

.gm-chat-msg-bubble strong {
  font-weight: 700;
  color: var(--on-surface);
}

.gm-chat-input-area {
  display: flex;
  gap: var(--spacing-sm);
  padding: 10px 16px;
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gm-chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.gm-chat-input:focus { border-color: var(--tertiary); }
.gm-chat-input:disabled { opacity: 0.5; }

.gm-chat-send {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--tertiary-container), var(--tertiary));
  color: var(--on-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.gm-chat-send:hover { filter: brightness(1.1); }
.gm-chat-send:active { transform: scale(0.95); }
.gm-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.gm-chat-send .material-symbols-outlined { font-size: 20px; }

.gm-chat-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(28, 27, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.gm-chat-usage {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--on-surface-variant);
}

.gm-chat-clear {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface-variant);
  background: transparent;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.gm-chat-clear:hover { color: var(--secondary); border-color: var(--secondary); }

/* ========== Trade Bar ========== */
.trade-bar {
  position: relative;
  z-index: 90;
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 12px;
  transition: all 0.3s ease;
}

.trade-bar-teams {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.trade-bar-teams::-webkit-scrollbar { display: none; }

.trade-bar-placeholder {
  text-align: center;
  color: var(--outline-variant);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 20px 0;
}

.trade-bar-placeholder .material-symbols-outlined {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
  opacity: 0.5;
}

.trade-bar-team-card {
  flex-shrink: 0;
  min-width: 130px;
  height: 88px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow: hidden;
}

.trade-bar-team-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.trade-bar-team-card.active {
  background: rgba(176, 198, 255, 0.08);
  border-width: 2px;
}

.trade-bar-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.trade-bar-card-logo {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.trade-bar-card-name {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-bar-card-remove {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.trade-bar-card-remove:hover { color: var(--secondary); }
.trade-bar-card-remove .material-symbols-outlined { font-size: 14px; }

.trade-bar-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trade-bar-card-empty {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--outline-variant);
  padding: 2px 0;
}

.trade-bar-row {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}

.trade-bar-row .material-symbols-outlined { font-size: 13px; }

.trade-bar-out { color: var(--secondary); }
.trade-bar-in { color: var(--primary); }

.trade-bar-team-card.add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-style: dashed;
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  min-width: 90px;
}

.trade-bar-team-card.add-card:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(176, 198, 255, 0.06);
}

/* ========== Check Trade FAB ========== */
.check-trade-fab {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  border: none;
  background: linear-gradient(to right, var(--primary-container), var(--primary-fixed-dim));
  color: var(--on-primary);
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-shadow: 0 4px 24px -4px rgba(23, 64, 139, 0.5);
  white-space: nowrap;
}

.check-trade-fab:hover { filter: brightness(1.1); }
.check-trade-fab:active { transform: translateX(-50%) scale(0.97); }
.check-trade-fab:disabled {
  background: var(--surface-container-high);
  color: var(--outline-variant);
  box-shadow: none;
  cursor: not-allowed;
}

.check-trade-fab .material-symbols-outlined { font-size: 20px; }

/* ========== Trade Result Modal ========== */
#modal-trade-result.modal-overlay {
  padding: 6vh 0 0 0;
  align-items: flex-start;
}

#gm-chat-modal.modal-overlay {
  padding: 0;
  align-items: flex-end;
}

.trade-result-modal-card {
  background: var(--surface-container-low);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 6vh);
  height: calc(100dvh - 6vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.trade-result-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--surface-container-low);
  flex-shrink: 0;
}

.trade-result-modal-head h3 {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--on-surface);
}

.trade-result-modal-head h3 .material-symbols-outlined {
  font-size: 20px;
  color: var(--primary);
}

.trade-result-modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.trade-result-modal-footer {
  display: flex;
  gap: var(--spacing-sm);
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--surface-container-low);
  flex-shrink: 0;
}

/* ========== AI Result Modal ========== */
.ai-result-modal-card {
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.25s ease-out;
}

.ai-result-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--surface-container-low);
  flex-shrink: 0;
}

.ai-result-modal-head .ai-panel-title {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--on-surface);
}

.ai-result-modal-head .ai-panel-title .material-symbols-outlined {
  color: var(--primary);
  font-size: 20px;
}

.ai-result-modal-card .ai-panel-body {
  border: none;
  border-radius: 0;
  flex: 1;
  overflow-y: auto;
  max-height: none;
}

.ai-result-modal-card .ai-panel-footer {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .panels-scroll { flex-direction: column; overflow-x: hidden; gap: 10px; }
  .team-panel { flex: none; width: 100%; max-width: none; }
  .trade-pkg-body { flex-direction: column; }
  .trade-pkg-col { border-right: none; border-top: 1px solid rgba(255, 255, 255, 0.05); }
  .trade-pkg-col:first-child { border-top: none; }
  .trade-pkg-footer { flex-direction: column; align-items: stretch; }
  .check-trade-btn { width: 100%; justify-content: center; }
  .action-bar { flex-wrap: wrap; }
  .action-btn { flex: 1; justify-content: center; min-width: 100px; }
}

@media (max-width: 480px) {
  .team-btn { font-size: 12px; padding: 6px 10px; }
  .header-title { font-size: 24px; }
}

/* ========== PC Adaptation (>=1024px) ========== */
@media (min-width: 1024px) {
  /* Wider main content */
  .main-content {
    max-width: 1400px;
    padding: var(--spacing-lg) var(--spacing-xl);
  }

  /* Multi-panel layout: show all team panels side by side */
  .panels-scroll.multi-panel {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--spacing-sm);
    flex-direction: row;
  }

  .panels-scroll.multi-panel .team-panel {
    flex: 0 0 380px;
    min-width: 320px;
    max-width: 420px;
  }

  /* Trade bar - more spacious */
  .trade-bar {
    padding: 14px 16px;
  }

  .trade-bar-team-card {
    min-width: 150px;
    height: 96px;
    padding: 12px 14px;
  }

  .trade-bar-card-name {
    font-size: 14px;
  }

  .trade-bar-card-info {
    font-size: 11px;
  }

  .trade-bar-team-card.add-card {
    min-width: 100px;
    font-size: 13px;
  }

  /* Player table - more compact columns */
  .player-list-header {
    padding: 8px 16px;
    font-size: 11px;
  }

  .player-row {
    padding: 10px 16px;
  }

  .player-name {
    font-size: 15px;
  }

  .player-salary {
    width: 80px;
    font-size: 13px;
  }

  .player-per {
    width: 42px;
    font-size: 13px;
  }

  /* FAB: reposition check trade button to right side */
  .check-trade-fab {
    bottom: 24px;
    right: 24px;
    left: auto;
    transform: none;
    padding: 14px 28px;
    font-size: 15px;
    box-shadow: 0 6px 32px -4px rgba(23, 64, 139, 0.6);
  }

  .check-trade-fab:active {
    transform: scale(0.97);
  }

  .check-trade-fab:disabled {
    background: var(--surface-container-high);
    color: var(--outline-variant);
    box-shadow: none;
    cursor: not-allowed;
  }

  /* GM FAB - slightly higher */
  .gm-fab {
    bottom: 96px;
    width: 52px;
    height: 52px;
  }

  /* Trade result modal: centered dialog on PC */
  #modal-trade-result.modal-overlay {
    padding: 16px;
    align-items: center;
    justify-content: center;
  }

  #modal-trade-result .trade-result-modal-card {
    width: 100%;
    max-width: 700px;
    height: auto;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.25s ease-out;
  }

  @keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* GM chat modal: centered on PC */
  #gm-chat-modal.modal-overlay {
    padding: 16px;
    align-items: center;
    justify-content: center;
  }

  #gm-chat-modal .gm-chat-modal-card {
    max-width: 560px;
    height: 80vh;
    border-radius: var(--radius-lg);
  }

  #gm-chat-modal .gm-chat-head {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  /* Team select modal: bigger grid on PC */
  .modal-team-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-card {
    max-width: 700px;
  }

  /* Destination modal */
  #modal-dest .modal-card {
    max-width: 480px;
  }

  /* Panel finance - more spacing */
  .panel-finance {
    padding: 12px 16px;
    font-size: 12px;
  }

  .panel-finance .fin-val {
    font-size: 16px;
  }

  .panel-head {
    padding: 14px 16px;
  }

  .panel-name {
    font-size: 18px;
  }

  .panel-logo {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  /* Action bar inline */
  .action-bar {
    flex-direction: row;
    padding: 0;
  }

  .action-btn {
    padding: 10px 24px;
  }
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.teams-section {
  margin-bottom: var(--spacing-lg);
}

.teams-section-title {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-sm);
  border-left: 3px solid var(--primary);
  line-height: 1.2;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

@media (max-width: 768px) {
  .teams-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.team-card {
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.team-card:hover {
  background: rgba(40, 39, 39, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.4);
}

.team-card:active {
  transform: translateY(0);
}

.team-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.team-card-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team-card-name {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.3;
}

.team-card-fullname {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 10px 14px;
  font-size: 11px;
}

.team-card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.team-card-stat-label {
  font-family: var(--font-label);
  font-size: 9px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.team-card-stat-value {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  font-variant-numeric: tabular-nums;
}

.team-card-stat-value.danger { color: var(--secondary); }
.team-card-stat-value.success { color: #4ade80; }

.game-results-wrapper {
  padding: var(--spacing-md);
}

.game-results-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.game-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.game-results-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 700;
  color: var(--on-surface);
  margin: 0;
}

.game-results-title .material-symbols-outlined {
  font-size: 22px;
  color: var(--primary);
}

.game-results-date {
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--on-surface-variant);
}

.game-results-summary {
  display: flex;
  gap: var(--spacing-md);
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--on-surface-variant);
}

.game-count.live {
  color: var(--secondary);
  font-weight: 600;
}

.game-results-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.game-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: none;
  transition: background-color 0.2s;
}

.game-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.game-card.playoff {
  border-left: 3px solid rgba(233, 196, 0, 0.5);
}

.game-card.playoff:hover {
  border-left-color: rgba(233, 196, 0, 0.7);
}

.game-card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-label);
  font-size: 12px;
}

.game-state {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.game-state.final {
  color: var(--on-surface-variant);
}

.game-state.live {
  color: var(--secondary);
}

.game-state.scheduled {
  color: var(--primary);
}

.game-series {
  color: var(--tertiary);
  font-weight: 600;
}

.game-playoff-badge {
  margin-left: auto;
  background: rgba(233, 196, 0, 0.15);
  color: var(--tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.game-card-body {
  padding: 12px 14px;
}

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

.game-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.game-team-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-team-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.game-team-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
}

.game-team-record {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--on-surface-variant);
}

.game-team-score {
  font-family: var(--font-data);
  font-size: 22px;
  font-weight: 600;
  color: var(--on-surface-variant);
  min-width: 36px;
  text-align: right;
}

.game-team-score.winner {
  color: var(--on-surface);
  font-weight: 700;
}

.game-team.winner .game-team-name {
  color: var(--primary);
}

.game-live-info {
  text-align: center;
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--secondary);
  font-weight: 600;
  padding-top: 4px;
}

.game-quarters {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.game-quarter-row {
  display: grid;
  grid-template-columns: 60px repeat(var(--quarter-count, 4), 1fr) 40px;
  gap: 4px;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--on-surface-variant);
  padding: 3px 0;
}

.game-quarter-row.game-quarter-header {
  color: var(--outline);
  font-weight: 600;
  font-size: 11px;
}

.game-quarter-team {
  font-weight: 600;
  color: var(--on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-leaders {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  display: flex;
  gap: var(--spacing-md);
}

.game-leader-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.game-leader-name {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-leader-stat {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--on-surface-variant);
}

.game-results-loading,
.game-results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xl);
  color: var(--on-surface-variant);
  font-family: var(--font-body);
  font-size: 14px;
}

.game-results-loading .material-symbols-outlined,
.game-results-empty .material-symbols-outlined {
  font-size: 36px;
  color: var(--outline);
}

.game-results-hint {
  font-size: 12px;
  color: var(--outline);
}

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

.spinning {
  animation: spin 1s linear infinite;
}

@media (max-width: 480px) {
  .game-results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .game-team-score {
    font-size: 18px;
  }

  .game-quarter-row {
    font-size: 11px;
  }

  .game-leaders {
    flex-direction: column;
    gap: 6px;
  }
}

.home-section {
  margin-bottom: var(--spacing-xl);
}

.home-section-title {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-sm);
  border-left: 3px solid var(--primary);
  line-height: 1.2;
}

.home-empty {
  text-align: center;
  color: var(--outline-variant);
  padding: 24px 16px;
  font-family: var(--font-body);
  font-size: 13px;
}

.home-teams-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

@media (max-width: 768px) {
  .home-teams-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.home-team-card {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.home-team-card:hover { background: rgba(255, 255, 255, 0.12); }
.home-team-card:active { transform: scale(0.98); }

.home-team-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
}

.home-team-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-team-name {
  font-family: var(--font-headline);
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
}

.home-team-sub {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--on-surface-variant);
}

.home-team-sub .danger { color: var(--secondary); }
.home-team-sub .success { color: #4ade80; }

.home-more-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: var(--spacing-md);
  border: 1px dashed var(--outline-variant);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.home-more-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(176, 198, 255, 0.05);
}

.content-section {
  margin-bottom: var(--spacing-lg);
}

.content-section-title {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-sm);
  border-left: 3px solid var(--tertiary);
  line-height: 1.2;
}

.insight-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

@media (max-width: 600px) {
  .insight-cards { grid-template-columns: 1fr; }
}

.insight-card {
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.insight-card:hover {
  background: rgba(40, 39, 39, 0.7);
}

.insight-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-card-icon .material-symbols-outlined {
  font-size: 22px;
  color: #fff;
}

.insight-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.insight-card-label {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-card-value {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-card-sub {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--on-surface-variant);
}

.news-loading, .news-empty {
  text-align: center;
  color: var(--outline-variant);
  padding: 40px 20px;
  font-family: var(--font-body);
  font-size: 14px;
}

.news-item {
  display: block;
  padding: 14px;
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  text-decoration: none;
  color: var(--on-surface);
  transition: all 0.15s;
}

.news-item:hover {
  background: rgba(40, 39, 39, 0.7);
}

.news-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.news-level-badge {
  font-family: var(--font-label);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.news-level-s .news-level-badge {
  background: rgba(233, 196, 0, 0.2);
  color: var(--tertiary);
}

.news-level-a .news-level-badge {
  background: rgba(176, 198, 255, 0.15);
  color: var(--primary);
}

.news-level-b .news-level-badge {
  background: rgba(255, 255, 255, 0.06);
  color: var(--on-surface-variant);
}

.news-source {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--on-surface-variant);
}

.news-date {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--outline-variant);
  margin-left: auto;
}

.news-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--on-surface);
}

.news-excerpt {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.5;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.team-detail-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  color: var(--primary);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  width: fit-content;
}

.team-detail-back:hover {
  opacity: 0.8;
}

.team-detail-back .material-symbols-outlined {
  font-size: 20px;
}

.team-detail-header {
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.team-detail-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.team-detail-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-detail-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--on-surface);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.team-detail-conf {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--surface-container);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.team-detail-finance {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.td-fin-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.td-fin-label {
  font-family: var(--font-label);
  font-size: 9px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.td-fin-value {
  font-family: var(--font-data);
  font-size: 16px;
  font-weight: 600;
  color: var(--on-surface);
  font-variant-numeric: tabular-nums;
}

.td-fin-value.danger { color: var(--secondary); }
.td-fin-value.success { color: #4ade80; }

.team-detail-section {
  background: rgba(28, 27, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
}

.team-detail-section-title {
  font-family: var(--font-headline);
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.team-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
}

@media (max-width: 480px) {
  .team-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.ts-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px;
  background: var(--surface-container-low);
  border-radius: var(--radius);
}

.ts-label {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ts-value {
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface);
  font-variant-numeric: tabular-nums;
}

.team-detail-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.team-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.team-detail-table th {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.team-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--on-surface-variant);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.team-detail-table tr:hover td {
  background: rgba(176, 198, 255, 0.04);
}

.td-player-name {
  font-family: var(--font-body) !important;
  font-weight: 500;
  color: var(--on-surface) !important;
}

.td-player-name[data-player-id]:hover {
  color: var(--primary) !important;
}

.td-salary {
  color: var(--on-surface) !important;
}

.tpe-loading, .tpe-empty {
  text-align: center;
  color: var(--outline-variant);
  padding: 20px;
  font-family: var(--font-body);
  font-size: 13px;
}

.tpe-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tpe-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-container-low);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.tpe-amount {
  font-family: var(--font-data);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.tpe-source {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tpe-expires {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--on-surface-variant);
}

.tpe-restricted {
  font-family: var(--font-label);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 179, 176, 0.15);
  color: var(--secondary);
  margin-left: auto;
  white-space: nowrap;
}

.team-detail-action {
  display: flex;
  justify-content: center;
  padding: var(--spacing-md) 0;
}

.team-detail-action .action-btn {
  padding: 14px 32px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .team-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .team-detail-finance {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .team-detail-name {
    font-size: 22px;
  }
}

.rankings-section {
  padding: 0 var(--spacing-md);
}

.rankings-main-tabs {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
  background: var(--surface-container-low);
  border-radius: var(--radius-md);
  padding: var(--spacing-xs);
}

.rankings-main-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.rankings-main-tab .material-symbols-outlined {
  font-size: 18px;
}

.rankings-main-tab.active {
  background: var(--surface-container-high);
  color: var(--on-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.rankings-main-tab:hover:not(.active) {
  background: var(--surface-container);
}

.rankings-dim-tabs {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.rankings-dim-tabs::-webkit-scrollbar {
  display: none;
}

.rankings-dim-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  flex-shrink: 0;
}

.rankings-dim-tab .material-symbols-outlined {
  font-size: 14px;
}

.rankings-dim-tab.active {
  background: rgba(176, 198, 255, 0.15);
  border-color: rgba(176, 198, 255, 0.4);
  color: var(--primary);
}

.rankings-dim-tab:hover:not(.active) {
  background: var(--surface-container);
  border-color: var(--outline);
}

.rankings-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 13px;
}

.rankings-table thead th {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--background);
  z-index: 1;
}

.rankings-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.1s;
}

.rankings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.rankings-table tbody tr:active {
  background: rgba(255, 255, 255, 0.06);
}

.rankings-table td {
  padding: 10px 10px;
  vertical-align: middle;
}

.rank-col {
  width: 36px;
  text-align: center;
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 700;
}

.rank-top-1 { color: #fbbf24; }
.rank-top-2 { color: #94a3b8; }
.rank-top-3 { color: #d97706; }

.player-col {
  min-width: 100px;
}

.rankings-player-name {
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  display: block;
  line-height: 1.3;
}

.rankings-player-pos {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--on-surface-variant);
  background: var(--surface-container);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  margin-left: 4px;
}

.team-col {
  min-width: 60px;
}

.rankings-team-badge {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.conf-col {
  width: 40px;
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--on-surface-variant);
}

.value-col {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  min-width: 60px;
  white-space: nowrap;
}

.salary-col {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--on-surface-variant);
  text-align: right;
  min-width: 60px;
  white-space: nowrap;
}

.extra-col {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--on-surface-variant);
  text-align: center;
  min-width: 40px;
}

.rankings-show-more {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: var(--spacing-sm);
  border: 1px dashed var(--outline-variant);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.rankings-show-more:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(176, 198, 255, 0.06);
}

.rankings-empty {
  text-align: center;
  color: var(--outline-variant);
  padding: 40px 20px;
  font-family: var(--font-body);
  font-size: 14px;
}

@media (max-width: 600px) {
  .rankings-section {
    padding: 0 var(--spacing-sm);
  }

  .rankings-main-tab {
    padding: 8px 6px;
    font-size: 11px;
  }

  .rankings-main-tab .material-symbols-outlined {
    font-size: 16px;
  }

  .rankings-dim-tab {
    padding: 5px 8px;
    font-size: 10px;
  }

  .rankings-table td {
    padding: 8px 6px;
  }

  .rankings-player-name {
    font-size: 12px;
  }

  .value-col {
    font-size: 13px;
  }

  .salary-col {
    font-size: 11px;
  }
}

.player-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.player-detail-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.player-detail-panel {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: #1a1a1a;
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  padding: 20px;
  position: relative;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.player-detail-overlay.active .player-detail-panel {
  transform: translateY(0);
}

.player-detail-back {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  border: none;
  color: var(--on-surface-variant);
}

.player-detail-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

.player-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.player-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.player-detail-info {
  min-width: 0;
}

.player-detail-name {
  font-family: var(--font-headline);
  font-size: 22px;
  font-weight: 700;
  color: var(--on-surface);
  margin: 0;
  line-height: 1.2;
}

.player-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.player-detail-team {
  font-family: var(--font-data);
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}

.player-detail-team:hover {
  text-decoration: underline;
}

.player-detail-pos {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--on-surface-variant);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

.player-detail-physical {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--on-surface-variant);
}

.player-detail-contract {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.pdc-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdc-label {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--on-surface-variant);
}

.pdc-value {
  font-family: var(--font-data);
  font-size: 16px;
  font-weight: 700;
  color: var(--on-surface);
}

.player-detail-section {
  margin-bottom: 16px;
}

.player-detail-section-title {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}

.player-stats-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pso-item {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pso-item.pso-highlight {
  background: rgba(255, 255, 255, 0.1);
}

.pso-value {
  font-family: var(--font-data);
  font-size: 20px;
  font-weight: 700;
  color: var(--on-surface);
}

.pso-highlight .pso-value {
  color: var(--primary);
}

.pso-label {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--on-surface-variant);
}

.player-stats-detail {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 4px 0;
}

.psd-row {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  gap: 8px;
}

.psd-row + .psd-row {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.psd-label {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--on-surface-variant);
  width: 40px;
  flex-shrink: 0;
}

.psd-value {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
}

.psd-sub {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-left: auto;
}

.player-detail-action {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ========== GM Grade Structured UI ========== */
.gm-grade-overview {
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gm-grade-teams-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.gm-grade-team-card {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 16px 12px;
  background: var(--surface-container);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: gmGradeFadeIn 0.4s ease-out both;
}

.gm-grade-team-card:nth-child(3) { animation-delay: 0.1s; }

.gm-grade-team-name {
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 8px;
}

.gm-grade-letter {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  text-shadow: 0 0 24px currentColor;
}

.gm-grade-score {
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 6px;
}

.gm-grade-score span {
  font-size: 12px;
  color: var(--on-surface-variant);
  font-weight: 400;
}

.gm-grade-label {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.gm-grade-vs {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--outline-variant);
  flex-shrink: 0;
}

.gm-grade-verdict {
  text-align: center;
  font-family: var(--font-headline);
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
  padding: 6px 0;
  letter-spacing: 0.04em;
}

.gm-grade-summary {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  color: var(--on-surface-variant);
  margin-top: 8px;
  padding: 0;
}

.gm-grade-summary b {
  font-weight: 600;
}

.gm-grade-trade-moves {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-grade-moves-team-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.gm-grade-moves-team-name {
  font-weight: 700;
  flex-shrink: 0;
  font-size: 12px;
}

.gm-grade-moves-compact {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.gm-grade-moves-compact .gm-grade-moves-label {
  flex-shrink: 0;
}

.gm-grade-moves-compact .gm-grade-moves-names {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-grade-moves-arrow {
  color: #8e909c;
  font-size: 11px;
  flex-shrink: 0;
}

.gm-grade-moves {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gm-grade-moves-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.gm-grade-moves-label {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.gm-grade-moves-out .gm-grade-moves-label { color: #ffb3b0; }
.gm-grade-moves-in .gm-grade-moves-label { color: #b0c6ff; }

.gm-grade-moves-names {
  color: var(--on-surface-variant);
}

.gm-grade-moves-compact .gm-grade-moves-names {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-grade-team-badge {
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 700;
  border-bottom: 2px solid;
  padding-bottom: 1px;
}

.gm-grade-team-badge-grade {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  margin-left: 6px;
}

/* Dimensions Bar Chart */
.gm-grade-dimensions {
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gm-grade-dim-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.gm-grade-dim-row + .gm-grade-dim-row {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.gm-grade-dim-label {
  width: 68px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gm-grade-dim-name {
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
}

.gm-grade-dim-desc {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--outline-variant);
}

.gm-grade-dim-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-grade-dim-bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gm-grade-dim-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-container-highest);
  border-radius: 4px;
  overflow: hidden;
}

.gm-grade-dim-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  animation: gmBarGrow 0.6s ease-out both;
}

.gm-grade-dim-bar-group:nth-child(2) .gm-grade-dim-bar-fill {
  animation-delay: 0.1s;
}

.gm-grade-dim-grade {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* Detail Expandable */
.gm-grade-collapsible {
  background: var(--surface-container-low);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.gm-grade-collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  list-style: none;
}

.gm-grade-collapsible-header::-webkit-details-marker { display: none; }

.gm-grade-collapsible-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.gm-grade-collapsible-title {
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
}

.gm-grade-collapsible-arrow {
  font-size: 14px;
  color: var(--outline-variant);
  transition: transform 0.2s;
}

.gm-grade-collapsible[open] .gm-grade-collapsible-arrow {
  transform: rotate(90deg);
}

.gm-grade-collapsible-body {
  padding: 0 14px 14px;
}

.gm-grade-loading {
  text-align: center;
  color: var(--outline-variant);
  font-size: 13px;
  padding: 12px 0;
  animation: pulse 1.5s infinite;
}

.gm-grade-team-detail {
  margin-bottom: 12px;
}

.gm-grade-team-detail:last-child { margin-bottom: 0; }

.gm-grade-team-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.gm-grade-team-detail-name {
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 700;
}

.gm-grade-team-detail-grade {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 700;
}

.gm-grade-detail-dim {
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.gm-grade-detail-dim:first-child { border-top: none; }

.gm-grade-detail-dim-name {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
  display: block;
  margin-bottom: 2px;
}

.gm-grade-detail-dim-name b {
  font-weight: 700;
}

.gm-grade-detail-dim-comment {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--on-surface);
  line-height: 1.6;
}

/* Share Button in AI Panel */
.gm-grade-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0 0;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gm-grade-stream-analysis {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  line-height: 1.7;
  color: var(--on-surface);
}

.gm-grade-stream-analysis:empty { display: none; }

.gm-grade-share-row {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 0;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gm-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface-variant);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.gm-share-btn:hover {
  background: rgba(176, 198, 255, 0.08);
  color: var(--primary);
  border-color: var(--primary);
}

.gm-share-btn .material-symbols-outlined {
  font-size: 16px;
}

/* Share Card (for capture) */
.gm-share-card {
  width: 540px;
  padding: 36px 32px;
  background: #131313;
  color: #e5e2e1;
  font-family: 'Sora', -apple-system, sans-serif;
}

.gm-share-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gm-share-logo { font-size: 32px; }

.gm-share-title {
  font-family: 'Anton', sans-serif;
  font-size: 24px;
  color: #b0c6ff;
  letter-spacing: 0.02em;
}

.gm-share-grades {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 16px 0;
}

.gm-share-grade-item {
  display: flex;
  align-items: center;
}

.gm-share-grade-team-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 14px 22px;
}

.gm-share-grade-team {
  font-weight: 700;
  font-size: 16px;
}

.gm-share-grade-letter {
  font-family: 'Anton', sans-serif;
  font-size: 42px;
}

.gm-share-grade-score {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #c4c6d3;
}

.gm-share-grade-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
}

.gm-share-grade-vs {
  font-size: 20px;
  color: #8e909c;
}

.gm-share-verdict {
  text-align: center;
  font-family: 'Anton', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.gm-share-moves {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gm-share-moves-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  line-height: 1.8;
}

.gm-share-moves-team {
  font-weight: 700;
  flex-shrink: 0;
  font-size: 15px;
}

.gm-share-moves-label {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.gm-share-moves-out { color: #ffb3b0; }
.gm-share-moves-in { color: #b0c6ff; }

.gm-share-moves-names {
  color: #c4c6d3;
}

.gm-share-moves-arrow {
  color: #8e909c;
  font-size: 14px;
  flex-shrink: 0;
}

.gm-share-summary {
  font-size: 15px;
  line-height: 1.8;
  color: #c4c6d3;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.gm-share-summary b {
  font-weight: 600;
}

.gm-share-footer {
  text-align: center;
  font-size: 11px;
  color: #8e909c;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  letter-spacing: 0.05em;
}

/* Animations */
@keyframes gmGradeFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gmBarGrow {
  from { width: 0 !important; }
}

@media (max-width: 480px) {
  .gm-grade-teams-row { flex-direction: row; gap: 4px; flex-wrap: nowrap; }
  .gm-grade-team-card { max-width: none; padding: 8px 4px; min-width: 0; }
  .gm-grade-team-name { font-size: 11px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gm-grade-letter { font-size: 28px; margin-bottom: 0; }
  .gm-grade-score { font-size: 13px; margin-bottom: 2px; }
  .gm-grade-score span { font-size: 9px; }
  .gm-grade-label { font-size: 9px; padding: 1px 5px; }
  .gm-grade-vs { font-size: 12px; }
  .gm-grade-dim-name { font-size: 11px; }
  .gm-grade-dim-desc { font-size: 9px; }
  .gm-grade-dim-grade { font-size: 11px; }
  .gm-grade-trade-moves { gap: 2px; }
  .gm-grade-moves-team-row { font-size: 11px; gap: 4px; }
  .gm-grade-moves-compact .gm-grade-moves-names { white-space: normal; }
  .gm-grade-summary { font-size: 12px; }
}
