:root {
  color-scheme: light dark;
  --bg: #f7f7f6;
  --surface: #ffffff;
  --surface-soft: #eeeeec;
  --ink: #1a1b1c;
  --muted: #63676e;
  --line: rgba(0, 0, 0, 0.10);
  --charcoal: #202123;
  --charcoal-2: #2b2c2f;
  --red: #c94e35;
  --red-dark: #a63d2a;
  --gold: #d7ae5e;
  --green: #60a874;
  --yellow: #d7ae5e;
  --danger: #c94e35;
  --message-blue: #1074ff;
  --received-bubble: #ebecee;
  --shadow: 0 12px 34px rgba(26, 27, 28, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(215, 174, 94, 0.38);
  outline-offset: 2px;
}
a { color: inherit; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 20px 16px;
  color: var(--ink);
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0 4px; border: 0; color: var(--ink); background: transparent; text-align: left; }
.brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 24px; font-weight: 900; }
.brand small { color: var(--muted); font-size: 12px; }
.sidebar-nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 700; text-align: left; }
.nav-item:hover { background: var(--surface-soft); color: var(--ink); }
.nav-item.active { background: var(--gold); color: #17110b; }
.nav-item svg { width: 19px; }
.sidebar-account { margin-top: auto; display: grid; grid-template-columns: 38px minmax(0,1fr) 34px; gap: 10px; align-items: center; padding: 12px 8px; border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--gold); color: #17110b; font-size: 12px; font-weight: 900; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-copy { min-width: 0; display: grid; gap: 2px; }
.account-copy strong, .account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 13px; }
.account-copy small { color: var(--muted); font-size: 11px; }

.main-content { min-width: 0; padding: 0 34px 60px; }
.topbar { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; min-height: 94px; padding: 16px 0; background: rgba(247,247,246,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(15px); }
.topbar h1 { margin: 2px 0 0; font-size: clamp(24px, 3vw, 34px); font-weight: 900; line-height: 1.05; }
.eyebrow { margin: 0; color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; }
.connection-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.connection-pill.online span { background: var(--green); }
.connection-pill.offline span { background: var(--danger); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.icon-button:hover { background: var(--surface-soft); }
.icon-button svg { width: 18px; }
.sidebar .icon-button { border-color: var(--line); background: transparent; color: var(--ink); }
.view { max-width: 1240px; margin: 0 auto; padding-top: 26px; }
.home-brand { display: grid; justify-items: center; gap: 12px; padding: 4px 20px 24px; text-align: center; }
.home-brand img { width: 132px; height: 132px; object-fit: contain; }
.home-brand h2 { margin: 5px 0; font-size: 25px; font-weight: 900; }
.home-brand > div > p:last-child { margin: 0; color: var(--muted); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 30px 0 13px; }
.section-heading h2 { margin: 2px 0 0; font-size: 22px; font-weight: 900; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 0; border: 0; background: transparent; color: var(--red); font-weight: 800; }
.text-button svg { width: 16px; }
.grid { display: grid; gap: 14px; }
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.matchup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card { min-height: 108px; padding: 17px; }
.stat-card small { color: var(--muted); font-weight: 700; }
.stat-value { margin-top: 8px; font-size: 29px; font-weight: 900; }
.stat-detail { margin-top: 2px; color: var(--muted); font-size: 12px; }
.sleeper-link { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--red); font-weight: 900; text-decoration: none; }
.sleeper-link:hover { border-color: var(--gold); background: var(--surface-soft); }
.sleeper-link svg { width: 18px; }
.feature-card { min-height: 138px; display: block; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: left; text-decoration: none; }
.feature-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--shadow); }
.feature-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: rgba(215,174,94,.16); color: var(--gold); }
.feature-card:nth-child(1) .feature-icon { background: rgba(96,168,116,.16); color: var(--green); }
.feature-card:nth-child(3) .feature-icon, .feature-card:nth-child(6) .feature-icon { background: rgba(201,78,53,.14); color: var(--red); }
.feature-icon svg { width: 19px; }
.feature-card h3 { margin: 14px 0 5px; font-size: 15px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.matchup-card { padding: 16px; }
.matchup-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 9px 0; }
.matchup-row + .matchup-row { border-top: 1px solid var(--line); }
.matchup-team { min-width: 0; display: grid; gap: 2px; }
.matchup-team strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matchup-team small { color: var(--muted); }
.matchup-score { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.matchup-score.winner { color: var(--green); }
.weekly-split { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.weekly-result { padding: 18px; }
.weekly-result + .weekly-result { border-left: 1px solid var(--line); }
.weekly-result small { color: var(--muted); font-weight: 700; }
.weekly-result h3 { margin: 8px 0 2px; }
.weekly-result strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.weekly-result.high strong { color: var(--green); }
.weekly-result.low strong { color: var(--danger); }

.article-list { display: grid; gap: 12px; }
.article-card { display: grid; grid-template-columns: 126px minmax(0,1fr) auto; gap: 17px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; }
.article-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.article-date { min-height: 84px; display: grid; align-content: center; padding: 12px; border-radius: 6px; background: var(--charcoal); color: #fff; }
.article-date strong { font-size: 24px; font-weight: 900; }
.article-date small { color: #b8c0c2; }
.article-copy { min-width: 0; }
.article-copy h3 { margin: 4px 0 5px; font-size: 19px; font-weight: 900; }
.article-copy p { margin: 0; color: var(--muted); line-height: 1.45; }
.article-copy small { color: var(--gold); font-weight: 800; }
.article-card > svg { width: 19px; color: var(--muted); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.toolbar input { flex: 1 1 240px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.segmented button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-weight: 800; }
.segmented button.active { background: var(--gold); color: #17110b; }
.shotgun-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shotgun-card { overflow: hidden; }
.video-thumb { position: relative; width: 100%; aspect-ratio: 16/9; display: block; overflow: hidden; border: 0; background: #111; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb::after { content: ""; position: absolute; inset: 45% 0 0; background: rgba(0,0,0,.38); }
.play-icon { position: absolute; inset: 50% auto auto 50%; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.94); color: var(--red); transform: translate(-50%,-50%); }
.play-icon svg { width: 21px; fill: currentColor; }
.shotgun-content { padding: 14px; }
.shotgun-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.shotgun-content h3 { margin: 8px 0 4px; font-size: 16px; }
.shotgun-content p { min-height: 36px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.rating-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rating-score { min-width: 43px; padding: 5px 7px; border-radius: 5px; color: #fff; font-weight: 900; text-align: center; }
.rating-score.good { background: var(--green); }
.rating-score.average { background: var(--yellow); }
.rating-score.low { background: var(--danger); }
.rating-score.empty { background: #7d8588; }
.rating-line small { color: var(--muted); }

.chat-layout { height: calc(100vh - 140px); min-height: 520px; display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.chat-header h2 { margin: 0; font-size: 16px; }
.chat-header small { color: var(--muted); }
.chat-tools { display: flex; gap: 8px; }
.recipient-strip { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.recipient-strip > span { padding-top: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.recipient-strip > div { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 3px; }
.recipient-chip { flex: 0 0 auto; }
.recipient-chip input { position: absolute; opacity: 0; pointer-events: none; }
.recipient-chip span { display: block; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 800; }
.recipient-chip.selected span { border-color: var(--message-blue); background: var(--message-blue); color: #fff; }
.message-list { overflow: auto; padding: 18px; scroll-behavior: smooth; }
.message-row { display: flex; gap: 10px; margin-bottom: 14px; }
.message-row.mine { flex-direction: row-reverse; }
.message-row .avatar { flex: 0 0 auto; }
.message-stack { max-width: min(72%, 680px); display: grid; gap: 4px; }
.message-row.mine .message-stack { justify-items: end; }
.message-author { padding: 0 5px; color: var(--muted); font-size: 11px; }
.message-bubble { padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: var(--received-bubble); line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-row.mine .message-bubble { border-radius: 16px 16px 4px 16px; background: var(--message-blue); color: #fff; }
.message-time { padding: 0 5px; color: #92999b; font-size: 10px; }
.attachment-list { display: grid; gap: 6px; max-width: 420px; }
.attachment-list img, .attachment-list video { display: block; max-width: 100%; border-radius: 7px; }
.attachment-link { display: flex; gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-decoration: none; }
.attachment-link svg { width: 17px; }
.reaction-row { display: flex; gap: 5px; flex-wrap: wrap; }
.reaction-chip { padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 11px; }
.chat-compose { display: grid; grid-template-columns: 38px 48px minmax(0,1fr) 42px; gap: 7px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.chat-compose .icon-button { align-self: end; border-radius: 50%; }
#chatGif { width: 48px; font-size: 11px; font-weight: 900; }
.chat-compose textarea { width: 100%; min-height: 42px; max-height: 130px; resize: vertical; padding: 10px 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.send-button { width: 42px; height: 42px; display: grid; place-items: center; align-self: end; border: 0; border-radius: 50%; background: var(--message-blue); color: #fff; }
.send-button:disabled { opacity: .45; }
.send-button svg { width: 18px; }
.pending-attachments { display: flex; gap: 7px; overflow-x: auto; padding: 9px 12px 0; background: var(--surface-soft); }
.pending-attachments > span { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; max-width: 260px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 11px; }
.pending-attachments svg { width: 15px; }
.pending-attachments button { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); }
.gif-panel { padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.gif-panel form { display: flex; gap: 8px; }
.gif-panel input { min-width: 0; flex: 1; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.gif-results { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; max-height: 220px; overflow-y: auto; margin-top: 9px; }
.gif-results button { aspect-ratio: 1; padding: 0; overflow: hidden; border: 0; border-radius: 5px; background: var(--surface-soft); }
.gif-results img { width: 100%; height: 100%; object-fit: cover; }

.ghost-panel { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); overflow: hidden; }
.ghost-copy { padding: clamp(24px, 5vw, 60px); background: var(--surface); }
.ghost-copy h2 { max-width: 620px; margin: 10px 0 14px; font-size: clamp(30px, 5vw, 58px); font-weight: 900; line-height: 1; }
.ghost-copy p { max-width: 620px; color: var(--muted); line-height: 1.6; }
.ghost-art { min-height: 420px; display: grid; place-items: center; padding: 28px; background: var(--charcoal); }
.ghost-art img { width: min(100%, 420px); max-height: 420px; object-fit: contain; }
.primary-button, .secondary-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border-radius: 7px; font-weight: 850; text-decoration: none; }
.primary-button { border: 1px solid var(--gold); background: var(--gold); color: #17110b; }
.primary-button:hover { background: var(--red); border-color: var(--red); color: #fff; }
.secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.primary-button svg, .secondary-button svg { width: 17px; }
.more-card { min-height: 132px; display: grid; align-content: space-between; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; text-decoration: none; }
.more-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.more-card svg { width: 21px; color: var(--gold); }
.more-card h3 { margin: 18px 0 4px; font-size: 15px; }
.more-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.resource-band { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.document-link { min-height: 92px; display: grid; grid-template-columns: 42px minmax(0,1fr) 22px; gap: 12px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; }
.document-link:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.document-link > svg:first-child { width: 34px; color: var(--gold); }
.document-link > svg:last-child { width: 18px; color: var(--muted); }
.document-link span { display: grid; gap: 5px; }
.document-link small { color: var(--muted); }
.timeline { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.timeline-item { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 16px; padding: 17px; }
.timeline-item + .timeline-item { border-top: 1px solid var(--line); }
.timeline-item > span { color: var(--red); font-weight: 900; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); }
.rules-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.rule-card { min-height: 150px; padding: 17px; }
.rule-card small { color: var(--green); font-weight: 900; }
.rule-card h3 { margin: 12px 0 6px; }
.rule-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.submit-card { color: inherit; text-decoration: none; }
.submit-card small { color: var(--red); }
.history-table { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.history-row { display: grid; grid-template-columns: 70px 1.4fr 1fr 1fr; gap: 14px; align-items: center; padding: 12px 15px; }
.history-row + .history-row { border-top: 1px solid var(--line); }
.history-row > span { min-width: 0; }
.history-row b { display: block; }
.history-row small { display: block; margin-top: 3px; color: var(--muted); }
.history-head { background: var(--charcoal); color: #fff; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.golden-card { display: flex; align-items: center; gap: 18px; padding: 18px; }
.golden-card > span { padding: 10px; border-radius: 6px; background: var(--gold); color: #17110b; font-weight: 900; }
.golden-card p { margin: 4px 0 0; color: var(--muted); }
.form-page { max-width: 820px; margin: 0 auto; }
.form-page > div > h2 { margin: 5px 0 8px; font-size: 34px; }
.form-page > div > p:last-child { color: var(--muted); }
.submission-form { display: grid; gap: 15px; margin-top: 18px; padding: 20px; }
.submission-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.submission-form input, .submission-form textarea, .submission-form select, .trade-controls select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.submission-form textarea { resize: vertical; }
.submission-form > small { color: var(--muted); text-align: center; }
.feedback-types { width: fit-content; }
.settings-list { display: grid; gap: 12px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px; }
.setting-row p { margin: 4px 0 0; color: var(--muted); }
.legal-page { max-width: 760px; margin: 20px auto; padding: clamp(24px,5vw,54px); }
.legal-page > svg { width: 38px; color: var(--gold); }
.legal-page h2 { margin: 10px 0; font-size: 34px; }
.legal-page > p:not(.eyebrow) { margin-bottom: 24px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.trade-controls { display: grid; grid-template-columns: minmax(240px,.7fr) 1fr; gap: 18px; align-items: end; margin-bottom: 14px; }
.trade-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.trade-controls p { margin: 0; color: var(--muted); line-height: 1.5; }
.trade-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trade-roster { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.trade-team-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 15px; border-bottom: 1px solid var(--line); }
.trade-team-heading small, .trade-team-heading p { color: var(--muted); }
.trade-team-heading h3 { margin: 3px 0; }
.trade-team-heading p { margin: 0; font-size: 11px; }
.trade-player { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; }
.trade-player + .trade-player { border-top: 1px solid var(--line); }
.trade-player span { display: grid; gap: 2px; }
.trade-player small { color: var(--muted); }
.trade-player > strong { font-variant-numeric: tabular-nums; }
.calculate-trade { width: 100%; margin-top: 14px; }
.trade-result { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 20px; align-items: center; margin-top: 14px; padding: 18px; border-color: var(--gold); }
.trade-result > div:first-child { display: grid; text-align: center; }
.trade-result > div:first-child small { color: var(--muted); }
.trade-result > div:first-child strong { color: var(--gold); font-size: 36px; }
.trade-result h3, .trade-result p { margin: 0; }
.trade-result p { margin-top: 4px; color: var(--muted); }
.signed-in-banner { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px; }
.signed-in-banner .avatar { width: 44px; height: 44px; }
.signed-in-banner > div:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.signed-in-banner small, .signed-in-banner span { color: var(--muted); font-size: 11px; }
.signed-in-banner strong, .signed-in-banner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 48px 22px; color: var(--muted); text-align: center; }
.empty-state svg { width: 34px; margin-bottom: 10px; }
.loading-grid { display: grid; gap: 14px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.skeleton { min-height: 120px; border-radius: 8px; background: #e5e8e6; animation: pulse 1.25s ease-in-out infinite alternate; }
@keyframes pulse { to { background: #f5f6f5; } }

.bottom-nav { display: none; }
.login-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(10,13,14,.92); backdrop-filter: blur(14px); }
.login-panel { width: min(420px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.login-logo { width: 126px; height: 126px; display: block; margin: 0 auto 18px; object-fit: contain; }
.login-panel h1 { margin: 7px 0 9px; font-size: 34px; font-weight: 900; line-height: 1.03; }
.login-copy { color: var(--muted); line-height: 1.5; }
.login-form { display: grid; gap: 8px; margin-top: 22px; }
.login-form label { margin-top: 5px; font-size: 12px; font-weight: 850; }
.login-form input, .login-form select { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.login-form .primary-button { margin-top: 9px; }
.form-error { min-height: 19px; margin: 2px 0 0; color: var(--danger); font-size: 12px; font-weight: 700; }

dialog { width: min(900px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 90px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,13,14,.72); backdrop-filter: blur(6px); }
.dialog-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.dialog-bar h2 { margin: 3px 0 0; font-size: 21px; font-weight: 900; }
.video-frame { width: 100%; aspect-ratio: 16/9; background: #000; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
#mediaDetails { padding: 18px; }
.rating-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; gap: 10px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.rating-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.rating-form input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; }
.article-dialog { width: min(760px, calc(100vw - 30px)); }
.article-byline { padding: 18px 24px 0; color: var(--muted); }
.article-dialog article { padding: 4px 24px 34px; font-size: 17px; line-height: 1.68; white-space: pre-wrap; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; max-width: 360px; padding: 12px 15px; border-radius: 7px; background: var(--charcoal); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #202123;
    --surface: #2b2c2f;
    --surface-soft: #2f3034;
    --ink: #f5f5f5;
    --muted: #b0b2b8;
    --line: rgba(255, 255, 255, 0.10);
    --received-bubble: #343539;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  }
  .topbar { background: rgba(32,33,35,.94); }
  .dialog-bar, .bottom-nav { background: rgba(43,44,47,.96); }
  .article-date, .ghost-art, .toast { background: #1a1b1c; }
  .play-icon { background: rgba(245,245,245,.94); }
  .skeleton { background: #343539; }
  @keyframes pulse { to { background: #404146; } }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f6; --surface: #ffffff; --surface-soft: #eeeeec; --ink: #1a1b1c; --muted: #63676e;
  --line: rgba(0,0,0,.10); --received-bubble: #ebecee; --shadow: 0 12px 34px rgba(26,27,28,.08);
}
html[data-theme="light"] .topbar { background: rgba(247,247,246,.94); }
html[data-theme="light"] .dialog-bar, html[data-theme="light"] .bottom-nav { background: rgba(255,255,255,.96); }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #202123; --surface: #2b2c2f; --surface-soft: #2f3034; --ink: #f5f5f5; --muted: #b0b2b8;
  --line: rgba(255,255,255,.10); --received-bubble: #343539; --shadow: 0 12px 34px rgba(0,0,0,.22);
}
html[data-theme="dark"] .topbar { background: rgba(32,33,35,.94); }
html[data-theme="dark"] .dialog-bar, html[data-theme="dark"] .bottom-nav { background: rgba(43,44,47,.96); }

@media (max-width: 1000px) {
  .feature-grid, .shotgun-grid, .more-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 0 15px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 78px; }
  .topbar h1 { font-size: 26px; }
  .connection-pill { display: none; }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5,1fr); padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); }
  .bottom-nav button { min-width: 0; display: grid; justify-items: center; gap: 2px; padding: 5px 2px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; }
  .bottom-nav button.active { color: var(--gold); }
  .bottom-nav svg { width: 20px; }
  .view { padding-top: 18px; }
  .home-brand { padding-bottom: 20px; }
  .home-brand img { width: 112px; height: 112px; }
  .stats-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stat-card { min-height: 94px; padding: 12px 10px; }
  .stat-value { font-size: 23px; }
  .stat-detail { display: none; }
  .feature-grid, .more-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .matchup-grid, .shotgun-grid { grid-template-columns: 1fr; }
  .weekly-split { grid-template-columns: 1fr; }
  .weekly-result + .weekly-result { border-left: 0; border-top: 1px solid var(--line); }
  .article-card { grid-template-columns: 72px minmax(0,1fr); gap: 12px; }
  .article-card > svg { display: none; }
  .article-date { min-height: 72px; padding: 8px; }
  .article-date strong { font-size: 18px; }
  .article-copy h3 { font-size: 17px; }
  .article-copy p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ghost-panel { grid-template-columns: 1fr; }
  .ghost-copy { padding: 28px 20px; }
  .ghost-art { min-height: 260px; }
  .chat-layout { height: calc(100dvh - 178px); min-height: 430px; }
  .message-list { padding: 13px 10px; }
  .message-stack { max-width: 82%; }
  .rating-form { grid-template-columns: 1fr; }
  .resource-band, .rules-grid, .trade-board, .trade-controls { grid-template-columns: 1fr; }
  .history-table { overflow-x: auto; }
  .history-row { min-width: 680px; }
  .gif-results { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .setting-row { align-items: stretch; flex-direction: column; }
  .chat-compose { grid-template-columns: 36px 46px minmax(0,1fr) 40px; padding: 9px; }
  .chat-compose .icon-button { width: 36px; height: 36px; }
  #chatGif { width: 46px; }
  .trade-result { grid-template-columns: 90px minmax(0,1fr); }
  .login-panel { padding: 23px; }
  .login-panel h1 { font-size: 30px; }
  .signed-in-banner { grid-template-columns: 42px minmax(0,1fr); }
  .signed-in-banner .secondary-button { grid-column: 1 / -1; }
  .toast { right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 12px; max-width: none; }
}

@media (max-width: 760px) and (prefers-color-scheme: dark) {
  .bottom-nav { background: rgba(43,44,47,.96); }
}

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