:root {
  color-scheme: dark;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f1f3ef;
  background: #101820;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #9da9a8;
  --line: rgba(225, 239, 232, .12);
  --panel: #17232a;
  --mint: #b6f16c;
  --mint-dark: #1d321c;
  --coral: #ffac8c;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 80% 4%, rgba(55, 104, 83, .22), transparent 39%), #101820;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.topbar { min-height: 82px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #eaf0e9; text-decoration: none; font: 700 15px Manrope, sans-serif; letter-spacing: -.3px; }
.brand strong { color: var(--mint); }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px 10px 10px 3px; color: #182218; background: var(--mint); font: 800 17px Manrope, sans-serif; }
.account-area { color: var(--muted); display: flex; align-items: center; gap: 16px; font-size: 13px; }
.account-email { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.login-layout { min-height: calc(100vh - 83px); display: grid; grid-template-columns: 1.1fr .8fr; align-items: center; gap: clamp(44px, 9vw, 130px); padding: 72px 0 100px; }
.confirmation-layout { min-height: calc(100vh - 83px); display: grid; place-items: center; padding: 48px 0 80px; }
.confirmation-card { width: min(520px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(155deg, rgba(255,255,255,.035), transparent 48%), #17232a; box-shadow: 0 22px 70px rgba(0,0,0,.2); }
.confirmation-card h1 { margin-bottom: 12px; font-size: clamp(34px, 5vw, 48px); line-height: 1.08; }
.confirmation-card .subhead { margin-bottom: 25px; }
.confirmation-card .full-width { text-decoration: none; }
.confirmation-fallback { display: block; margin-top: 20px; text-align: center; }
.intro-copy { max-width: 550px; padding-bottom: 30px; }
.eyebrow { margin: 0 0 15px; color: var(--mint); font-size: 10px; font-weight: 700; letter-spacing: 1.7px; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Manrope, "DM Sans", sans-serif; letter-spacing: -1.8px; }
.intro-copy h1, .library-heading h1 { margin-bottom: 22px; font-size: clamp(42px, 5.4vw, 64px); line-height: 1.05; }
.intro-copy h1 em { color: var(--mint); font-style: normal; }
.subhead { color: var(--muted); font-size: 15px; line-height: 1.75; }
.intro-copy .subhead { max-width: 440px; font-size: 16px; }
.privacy-note { display: flex; align-items: center; gap: 9px; margin-top: 34px; color: #b6c0bb; font-size: 12px; }
.privacy-note span { color: var(--mint); font-size: 11px; }
.login-card { padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(155deg, rgba(255,255,255,.035), transparent 48%), #17232a; box-shadow: 0 22px 70px rgba(0,0,0,.2); }
.card-heading { margin-bottom: 26px; }
.card-heading .eyebrow { margin-bottom: 9px; }
.card-heading h2 { margin-bottom: 5px; font-size: 29px; }
.card-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
label { display: block; margin: 18px 0 8px; color: #c5ceca; font-size: 12px; font-weight: 600; }
input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid rgba(225,239,232,.16); border-radius: 8px; outline: none; color: #f3f7f2; background: rgba(5,12,16,.28); }
input:focus, select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(182,241,108,.12); }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 9px; padding: 0 15px; font-size: 12px; font-weight: 700; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { color: #142015; background: var(--mint); }
.button.primary:hover { background: #c9f895; }
.button.secondary { border-color: var(--line); color: #e3e9e4; background: rgba(255,255,255,.035); }
.button.secondary:hover { border-color: rgba(225,239,232,.3); background: rgba(255,255,255,.07); }
.button.tertiary { min-height: 32px; padding: 0 9px; color: var(--muted); background: transparent; }
.full-width { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 23px; padding: 0 15px; }
.form-footnote { margin: 14px 0 0; text-align: center; color: #7f8e8a; font-size: 11px; }
.text-button { border: 0; padding: 0; color: var(--mint); background: none; font-size: inherit; font-weight: 700; }
.text-button:hover { color: #d0f6ae; text-decoration: underline; }
.message { min-height: 17px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.message.error, .library-message.error, .global-message.error { color: var(--coral); }

.library-view { padding: 62px 0 80px; }
.library-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.library-heading .eyebrow { margin-bottom: 10px; }
.library-heading h1 { margin-bottom: 8px; font-size: clamp(34px, 4vw, 45px); }
.library-heading .subhead { margin-bottom: 0; font-size: 13px; }
.library-toolbar { display: flex; align-items: center; gap: 14px; min-height: 72px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.team-picker-label { margin: 0; color: #82918d; font-size: 10px; letter-spacing: 1.4px; }
select { min-width: min(330px, 65vw); height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 34px 0 12px; color: #eaf0e9; background: #17232a; outline: none; }
.updated-label { margin-left: auto; color: #788681; font-size: 11px; }
.library-message { min-height: 20px; margin: 19px 0 12px; color: var(--muted); font-size: 12px; }
.player-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.player-row { width: 100%; display: flex; align-items: center; gap: 14px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; color: inherit; text-align: left; background: rgba(23,35,42,.72); }
.player-row.selected { border-color: rgba(182,241,108,.55); background: linear-gradient(110deg, rgba(182,241,108,.08), transparent 72%), #17232a; }
.jersey { flex: 0 0 39px; width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--mint); font: 700 13px Manrope, sans-serif; }
.player-copy { flex: 1; min-width: 0; }
.player-copy strong { display: block; overflow: hidden; margin: 0 0 4px; color: #eaf0e9; font: 700 14px Manrope, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.player-copy small { display: block; overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.intro-status { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: #92a09a; font-size: 10px; }
.intro-status::before { width: 6px; height: 6px; border-radius: 50%; background: #60706a; content: ""; }
.intro-status.ready { color: #c6eea4; }
.intro-status.ready::before { background: var(--mint); box-shadow: 0 0 9px rgba(182,241,108,.45); }
.intro-status.stale { color: #f4c68d; }
.intro-status.stale::before { background: #f4c68d; }
.player-panel { display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center; margin-top: 26px; padding: 23px 24px 17px; border: 1px solid rgba(182,241,108,.22); border-radius: 14px; background: linear-gradient(115deg, rgba(182,241,108,.07), transparent 65%), #17232a; }
.now-playing-copy .eyebrow { margin-bottom: 8px; }
.now-playing-copy h2 { margin-bottom: 4px; font-size: 20px; letter-spacing: -.6px; }
.now-playing-copy .subhead { margin: 0; font-size: 11px; }
.player-actions { display: flex; gap: 8px; }
.player-panel audio { grid-column: 1 / -1; width: 100%; height: 38px; }
.player-panel .message { grid-column: 1 / -1; margin: -9px 0 0; }
.library-footer { margin-top: 35px; padding-top: 17px; border-top: 1px solid var(--line); color: #77847f; font-size: 11px; }
.global-message { position: fixed; right: 22px; bottom: 20px; max-width: min(420px, calc(100vw - 44px)); color: var(--muted); font-size: 12px; }
.empty-state { grid-column: 1 / -1; padding: 38px 20px; border: 1px dashed rgba(225,239,232,.15); border-radius: 12px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 6px; color: #e6ebe7; font: 600 14px Manrope, sans-serif; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.6; }

@media (max-width: 760px) {
  .shell { width: min(100% - 32px, 560px); }
  .topbar { min-height: 68px; }
  .account-email { max-width: 120px; }
  .login-layout { min-height: auto; grid-template-columns: 1fr; gap: 34px; padding: 54px 0 70px; }
  .confirmation-card { padding: 28px; }
  .intro-copy { padding: 0; }
  .intro-copy h1 { font-size: clamp(40px, 11vw, 56px); }
  .intro-copy .subhead { font-size: 14px; }
  .privacy-note { margin-top: 22px; }
  .login-card { padding: 25px 22px; }
  .library-view { padding-top: 42px; }
  .library-heading { align-items: flex-start; }
  .library-heading .button { flex: 0 0 auto; }
  .library-toolbar { flex-wrap: wrap; gap: 8px 12px; padding: 13px 0; }
  .team-picker-label { flex: 0 0 100%; }
  select { min-width: 0; flex: 1; }
  .updated-label { flex: 0 0 auto; }
  .player-list { grid-template-columns: 1fr; }
  .player-panel { grid-template-columns: 1fr; padding: 19px; }
  .player-actions { grid-row: 2; }
  .player-actions .button { flex: 1; }
  .player-panel audio { grid-column: 1; }
  .player-panel .message { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
