/* Sports Stat Tracker V1.5.1 — mobile rebuild, palettes and language controls.
   Presentation only. Model, collection, grading and storage mechanics are untouched. */

body.v151-theme-stadium-dark {
  color-scheme: dark;
  --bg: #070807;
  --surface: #101210;
  --surface-2: #161916;
  --surface-3: #1d211c;
  --text: #f6f5ee;
  --muted: #999d96;
  --line: rgba(246,245,238,.10);
  --brand: #dfff43;
  --brand-rgb: 223,255,67;
  --accent: var(--brand);
  --accent-2: #efffaf;
  --surface-glass: rgba(16,18,16,.94);
}

body.v151-theme-midnight-dark {
  color-scheme: dark;
  --bg: #06101d;
  --surface: #0c1929;
  --surface-2: #112238;
  --surface-3: #182d46;
  --text: #edf7ff;
  --muted: #91a9bd;
  --line: rgba(214,235,255,.11);
  --brand: #5eead4;
  --brand-rgb: 94,234,212;
  --accent: var(--brand);
  --accent-2: #b9fff4;
  --good: #65e6a1;
  --warn: #ffd37a;
  --bad: #ff7d8f;
  --surface-glass: rgba(12,25,41,.94);
  --shadow: 0 18px 52px rgba(0,4,12,.36);
  --soft-shadow: 0 10px 30px rgba(0,4,12,.25);
}

body.light.v151-theme-field-light {
  color-scheme: light;
  --bg: #e7ebe7;
  --surface: #f5f7f3;
  --surface-2: #edf0eb;
  --surface-3: #e2e7e1;
  --text: #26312a;
  --muted: #69736c;
  --line: rgba(38,49,42,.105);
  --brand: #62752c;
  --brand-rgb: 98,117,44;
  --accent: var(--brand);
  --accent-2: #71813f;
  --surface-glass: rgba(245,247,243,.95);
}

body.light.v151-theme-sand-light {
  color-scheme: light;
  --bg: #eee6da;
  --surface: #fffaf2;
  --surface-2: #f6eee2;
  --surface-3: #eadfce;
  --text: #30271f;
  --muted: #75685c;
  --line: rgba(62,48,36,.12);
  --brand: #9a6429;
  --brand-rgb: 154,100,41;
  --accent: var(--brand);
  --accent-2: #80511f;
  --good: #39765a;
  --warn: #9b6d20;
  --bad: #a44e58;
  --surface-glass: rgba(255,250,242,.95);
  --shadow: 0 14px 38px rgba(78,55,34,.10);
  --soft-shadow: 0 8px 24px rgba(78,55,34,.08);
}

body.v151-theme-midnight-dark,
body.light.v151-theme-sand-light {
  background:
    radial-gradient(circle at 50% -16%, rgba(var(--league-rgb),.09), transparent 34rem),
    var(--bg);
  background-attachment: fixed;
}

.v151-preference-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 8px;
  width: min(470px, 100%);
  margin: 8px 0 0 auto;
  padding-bottom: 2px;
}
.v151-preference-control {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 6px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.v151-preference-control > span {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.v151-preference-control select {
  min-width: 0;
  min-height: 34px;
  padding: 5px 26px 5px 8px;
  border: 0;
  border-radius: 8px;
  background-color: var(--surface-2);
  font-size: .72rem;
  font-weight: 800;
  box-shadow: none;
}
.v151-preference-control select:focus-visible {
  outline: 2px solid rgba(var(--brand-rgb),.72);
  outline-offset: 1px;
}
.v150-aesthetic #themeToggle { display: none; }

@media (max-width: 760px) {
  html,
  body.v150-aesthetic {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  body.v150-aesthetic {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    background-attachment: scroll;
  }
  .v150-aesthetic .app-shell {
    width: 100%;
    max-width: 100%;
    padding: 0 10px 30px;
  }
  .v150-aesthetic .floating-command-shell {
    position: relative;
    top: auto;
    z-index: 30;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 0 10px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .v150-aesthetic .topbar {
    min-height: 58px;
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) 0 8px;
  }
  .v150-aesthetic .brand-lockup {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }
  .v150-aesthetic .brand-lockup > div:last-child { min-width: 0; }
  .v150-aesthetic .brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }
  .v150-aesthetic .eyebrow { display: none; }
  .v150-aesthetic .brand-lockup h1 {
    overflow: hidden;
    margin: 0;
    font-size: 1.13rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .v150-aesthetic .topbar-actions {
    flex: 0 0 auto;
    gap: 5px;
  }
  .v150-aesthetic .top-data-button {
    min-width: 0;
    min-height: 36px;
    padding: 7px 10px;
    font-size: .66rem;
  }
  .v150-aesthetic .league-switcher {
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    margin: 0;
    padding: 4px;
  }
  .v150-aesthetic .league-button {
    min-width: 0;
    min-height: 40px;
    padding: 6px 2px;
  }
  .v150-aesthetic .league-short {
    overflow: hidden;
    font-size: .66rem;
    text-overflow: ellipsis;
  }
  .v151-preference-bar {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 7px 0 0;
  }
  .v151-preference-control {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 7px;
  }
  .v151-preference-control > span {
    padding-left: 3px;
    font-size: .57rem;
  }
  .v151-preference-control select {
    min-height: 38px;
    font-size: .7rem;
  }

  .v150-aesthetic .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 200;
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    margin: 0;
    padding: 6px 7px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 17px 17px 0 0;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 -10px 34px rgba(0,0,0,.28);
    overflow: visible;
    transform: none;
  }
  .v150-aesthetic .tab {
    min-width: 0;
    min-height: 50px;
    gap: 2px;
    padding: 5px 1px;
    border-radius: 10px;
    flex-direction: column;
    overflow: hidden;
    font-size: .56rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .v150-aesthetic .tab > span { font-size: .95rem; }

  .v150-aesthetic main,
  .v150-aesthetic .panel,
  .v150-aesthetic .controls-card,
  .v150-aesthetic .home-hero,
  .v150-aesthetic .home-grid,
  .v150-aesthetic .home-panel-card,
  .v150-aesthetic .v136-home-zone,
  .v150-aesthetic .v136-zone-content,
  .v150-aesthetic .v1431-projection-cleanup,
  .v150-aesthetic .v1431-builder-controls,
  .v150-aesthetic .v1431-primary-scope,
  .v150-aesthetic .v1431-tune-details,
  .v150-aesthetic .v1431-pick-readout,
  .v150-aesthetic .v1431-pick-list,
  .v150-aesthetic .projection-card,
  .v150-aesthetic .v1431-pick-main,
  .v150-aesthetic .v1431-pick-topline,
  .v150-aesthetic .v1431-pick-player,
  .v150-aesthetic .status-info,
  .v150-aesthetic .status-row,
  .v150-aesthetic details,
  .v150-aesthetic summary {
    min-width: 0;
    max-width: 100%;
  }
  .v150-aesthetic .panel { padding-top: 14px; }
  .v150-aesthetic .v136-panel-masthead {
    padding: 19px 17px;
    border-radius: 17px;
  }
  .v150-aesthetic .home-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 21px 18px;
  }
  .v150-aesthetic .home-scorecard {
    min-width: 0;
    min-height: 74px;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    text-align: left;
  }
  .v150-aesthetic .home-scorecard strong { margin-left: auto; }
  .v150-aesthetic .home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .v150-aesthetic .home-actions .ghost-button { grid-column: 1 / -1; }
  .v150-aesthetic .home-grid,
  .v150-aesthetic .v12-command-grid,
  .v150-aesthetic .news-summary,
  .v150-aesthetic .news-controls,
  .v150-aesthetic .filter-grid,
  .v150-aesthetic .v140-cloud-grid,
  .v150-aesthetic .v1412-consumer-grid,
  .v150-aesthetic .v143-auto-grid {
    grid-template-columns: 1fr;
  }
  .v150-aesthetic .section-heading,
  .v150-aesthetic .news-header-card,
  .v150-aesthetic .v143-auto-head,
  .v150-aesthetic .v143-auto-foot {
    align-items: flex-start;
    flex-direction: column;
  }
  .v150-aesthetic .date-grid,
  .v150-aesthetic .controls-card.compact { grid-template-columns: 1fr; }
  .v150-aesthetic .button-row > button,
  .v150-aesthetic .news-refresh { flex: 1 1 auto; }

  .v150-aesthetic .v1431-compact-intro {
    min-height: 0;
    padding: 62px 19px 22px;
    border-radius: 19px;
  }
  .v150-aesthetic .v1431-compact-intro h3 {
    font-size: clamp(1.72rem, 8.5vw, 2.45rem);
    line-height: 1;
  }
  .v150-aesthetic .v1431-compact-intro p { font-size: .78rem; }
  .v150-aesthetic .v1431-primary-scope { padding: 17px; }
  .v150-aesthetic .v1431-primary-scope .v136-control-grid { grid-template-columns: 1fr; }
  .v150-aesthetic .v1431-tune-details[open] { display: block; }
  .v150-aesthetic .v1431-pick-readout { grid-template-columns: 1fr; }
  .v150-aesthetic .v1431-pick-readout > span,
  .v150-aesthetic .v1431-pick-readout small { grid-column: auto; }
}

@media (max-width: 520px) {
  body.v150-aesthetic {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }
  .v150-aesthetic .app-shell { padding-inline: 8px; }
  .v150-aesthetic .tabbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, 43px);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .v150-aesthetic .tab {
    min-height: 43px;
    flex-direction: row;
    gap: 6px;
    padding: 5px 8px;
    font-size: .64rem;
  }
  .v150-aesthetic .tab > span { font-size: .88rem; }
  .v150-aesthetic .v1431-summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v150-aesthetic .projection-card.v1431-pick-card,
  .v150-aesthetic .projection-card.v13-builder-leg {
    display: block;
    border-radius: 17px;
  }
  .v150-aesthetic .v1431-pick-rank {
    width: 100%;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 14px !important;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .v150-aesthetic .v1431-pick-rank span {
    flex: 0 0 auto;
    font-size: 1.05rem;
    line-height: 1;
  }
  .v150-aesthetic .v1431-pick-rank small {
    display: inline-block;
    writing-mode: horizontal-tb !important;
    transform: none !important;
    font-size: .64rem;
    line-height: 1;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
  .v150-aesthetic .v1431-pick-main { padding: 15px 14px; }
  .v150-aesthetic .v1431-pick-topline { flex-wrap: wrap; }
  .v150-aesthetic .v1431-pick-player { flex: 1 1 190px; }
  .v150-aesthetic .v1431-pick-range { padding: 14px; }
  .v150-aesthetic .v1431-pick-mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v150-aesthetic .v1431-pick-mini span { padding: 8px 6px; }
}

@media (max-width: 350px) {
  .v150-aesthetic .brand-lockup h1 span { display: none; }
  .v150-aesthetic .top-data-button { padding-inline: 8px; }
  .v151-preference-control { padding-inline: 5px; }
  .v151-preference-control select { padding-inline: 6px 20px; font-size: .65rem; }
  .v150-aesthetic .v1431-summary-strip,
  .v150-aesthetic .v1431-pick-mini { grid-template-columns: 1fr; }
}
