:root {
  --bg: #070707;
  --panel: #101010;
  --panel-2: #151515;
  --text: #f4f4f4;
  --muted: #9b9b9b;
  --line: #252525;
  --accent: #A9FB0C;
  --accent-text: #101400;
  --danger: #ff6b6b;
  --max: 860px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7,7,7,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.header-inner { height: 66px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--accent); color: #000; border-radius: 7px; font-size: 22px; line-height: 1; }
.admin-link { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.admin-link:hover { color: var(--text); }

.main-layout { padding-bottom: 72px; }
.hero { padding: 42px 0 34px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.hero h1, .admin-card h1 { margin: 0; line-height: .98; letter-spacing: -.055em; }
.hero h1 { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.15; letter-spacing: -.03em; }
.admin-card h1 { font-size: clamp(34px, 6vw, 56px); }
.hero-copy { margin: 20px 0 0; max-width: 650px; color: var(--muted); line-height: 1.65; font-size: 16px; }

.controls { position: sticky; top: 0; z-index: 10; padding: 6px 0 16px; background: linear-gradient(var(--bg) 80%, rgba(7,7,7,0)); }
.search-wrap { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.search-wrap:focus-within { border-color: #444; }
.search-icon { color: var(--muted); font-size: 22px; }
.search-wrap input { width: 100%; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 16px; }
.search-wrap input::placeholder { color: #777; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-top: 14px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-width: 52px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 700; }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #0d1200; }

.feed-section { margin-top: 24px; }
.feed-heading-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.feed-heading-row h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.result-count { color: var(--muted); font-size: 13px; }
.feed { display: grid; gap: 12px; }
.update-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.update-card-inner { padding: 18px; }
.card-topline { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.player-row { min-width: 0; }
.player-name { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.player-meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-size: 13px; }
.dot { opacity: .45; }
.category-badge { padding: 5px 8px; border-radius: 999px; border: 1px solid #303030; background: var(--panel-2); color: #cfcfcf; font-size: 11px; font-weight: 700; white-space: nowrap; }
.category-badge.injury { border-color: rgba(255,107,107,.35); color: #ff9292; }
.update-copy { margin: 17px 0 0; color: #e5e5e5; font-size: 15px; line-height: 1.65; white-space: pre-wrap; }
.card-image { display: block; width: 100%; max-height: 600px; object-fit: contain; background: #0b0b0b; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; }
.time-label { color: #787878; font-size: 12px; }
.source-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.empty-state { padding: 48px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--text); margin-bottom: 7px; }
.load-more { width: 100%; margin-top: 14px; padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); color: #707070; font-size: 12px; }
.footer-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.admin-body { background: #090909; }
.admin-main { width: min(calc(100% - 32px), 920px); padding: 42px 0 80px; display: grid; gap: 18px; }
.admin-card { padding: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.admin-card h1 { font-size: clamp(30px, 5vw, 44px); }
.admin-card h2 { margin: 0; font-size: 24px; }
.muted { color: var(--muted); line-height: 1.5; }
.admin-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.admin-form { display: grid; gap: 16px; }
.two-column-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-form label { display: grid; gap: 8px; color: #c7c7c7; font-size: 13px; font-weight: 700; }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; border: 1px solid #303030; border-radius: 11px; background: #0b0b0b; color: var(--text); outline: none; padding: 12px 13px; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: #5d5d5d; }
.admin-form textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
.full-width { grid-column: 1 / -1; }
.primary-btn, .secondary-btn, .danger-btn { border-radius: 10px; padding: 11px 15px; font-weight: 800; border: 1px solid transparent; }
.primary-btn { background: var(--accent); color: var(--accent-text); }
.secondary-btn { background: #191919; border-color: #303030; color: #d3d3d3; }
.danger-btn { background: transparent; color: #ff8b8b; border-color: rgba(255,107,107,.28); }
.status-text { min-height: 20px; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.status-text.error { color: #ff8b8b; }
.status-text.success { color: var(--accent); }
.demo-login { margin-top: 12px; }
.paste-zone { min-height: 128px; border: 1px dashed #3a3a3a; border-radius: 13px; display: grid; place-content: center; text-align: center; gap: 7px; color: var(--muted); padding: 18px; transition: .15s ease; }
.paste-zone strong { color: var(--text); }
.paste-zone.dragging, .paste-zone:focus { outline: none; border-color: var(--accent); background: rgba(169,251,12,.04); }
.paste-zone input { margin-top: 7px; max-width: 280px; }
.image-preview-wrap { margin-top: 12px; display: flex; align-items: flex-start; gap: 12px; }
.image-preview { max-width: min(100%, 420px); max-height: 360px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; }
.publish-row { display: flex; align-items: center; gap: 14px; }
.admin-recent-list { display: grid; gap: 10px; }
.admin-item { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0c0c0c; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.admin-item-main { min-width: 0; }
.admin-item-main strong { display: block; }
.admin-item-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 600px; }

@media (max-width: 640px) {
  .shell { width: min(calc(100% - 22px), var(--max)); }
  .header-inner { height: 60px; }
  .controls { top: 0; }
  .hero { padding-top: 30px; }
  .hero h1 { font-size: 18px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; }
  .two-column-form { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .admin-card { padding: 20px; }
  .admin-title-row { align-items: center; }
  .publish-row { align-items: flex-start; flex-direction: column; }
  .admin-item { align-items: flex-start; flex-direction: column; }
}

/* V5.2 bulk management */
.manage-bulk-actions { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.manage-bulk-actions .status-text { margin-left: 2px; }
@media (max-width: 640px) {
  .manage-bulk-actions { align-items: stretch; flex-direction: column; }
  .manage-bulk-actions button { width: 100%; }
}

/* V2 admin management */
.manage-title-row { margin-bottom: 16px; }
.manage-copy { margin: 7px 0 0; font-size: 13px; }
.admin-search-wrap { margin-bottom: 14px; }
.admin-item-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.compact-btn { padding: 8px 11px; font-size: 12px; }
.admin-item-meta { color: #777 !important; font-size: 11px !important; margin-bottom: 3px; }

@media (max-width: 640px) {
  .brand { font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; }
  .admin-item-actions { width: 100%; }
  .admin-item-actions button { flex: 1; }
}

/* V3 homepage filters */
.feed-filter-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.feed-filter-bar .filter-row { flex: 1 1 auto; min-width: 0; }
.team-filter-wrap { flex: 0 0 auto; padding-top: 14px; }
.team-filter-select {
  min-height: 37px;
  min-width: 150px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  outline: none;
}
.team-filter-select:focus { border-color: #555; }
.source-text { color: var(--muted); font-size: 13px; font-weight: 600; }
.optional-label { color: #777; font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .feed-filter-bar { align-items: stretch; flex-direction: column; gap: 0; }
  .team-filter-wrap { padding-top: 9px; }
  .team-filter-select { width: 100%; border-radius: 12px; }
}


/* V4 multi-player display */
.player-name .player-separator { color: #6f6f6f; font-weight: 500; }


/* V5 recap export tools */
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.export-note { margin: 12px 0 0; font-size: 12px; }
.custom-export { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.custom-export summary { cursor: pointer; font-weight: 800; color: #d7d7d7; }
.custom-range-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 12px; }
.custom-range-grid label { display: grid; gap: 8px; color: #c7c7c7; font-size: 13px; font-weight: 700; }
.custom-range-grid input { width: 100%; border: 1px solid #303030; border-radius: 11px; background: #0b0b0b; color: var(--text); outline: none; padding: 12px 13px; color-scheme: dark; }
.export-check { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; color: #888; font-size: 11px; font-weight: 700; cursor: pointer; }
.export-check input { accent-color: var(--accent); }
@media (max-width: 640px) {
  .custom-range-grid { grid-template-columns: 1fr; }
  .export-actions > button { flex: 1 1 100%; }
}

/* V5.1: full-width Publish Update button */
.publish-row { flex-wrap: wrap; }
#publishBtn { width: 100%; flex: 0 0 100%; min-height: 48px; }


/* V5.3: public branding moved into the homepage hero */
.hero-brand {
  margin: 0 0 14px;
  width: fit-content;
}
.hero-brand + h1 { margin-top: 0; }
@media (max-width: 640px) {
  .hero-brand { margin-bottom: 13px; }
}


/* V5.4: Player Update / General Update composer */
#player1Field[hidden],
#player2Field[hidden],
#player3Field[hidden],
#positionField[hidden] {
  display: none !important;
}


/* V5.6: per-player position inputs and category filtering */
.player-entry-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.player-entry-row[hidden] { display: none !important; }
.feed-filter-bar { flex-wrap: wrap; }
.category-filter-wrap { padding-top: 14px; }
.category-filter-select { min-width: 170px; }
.player-heading-unit { display: inline-flex; align-items: baseline; gap: 7px; }
.inline-position { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }
@media (max-width: 640px) {
  .player-entry-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .category-filter-wrap { padding-top: 0; }
  .category-filter-select { width: 100%; min-width: 0; border-radius: 12px; }
}


/* V5.7: tighter homepage intro spacing + admin header actions */
.hero { padding-bottom: 8px; }
.admin-top-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .hero { padding-bottom: 8px; }
  .admin-top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .admin-top-actions .secondary-btn { padding-left: 11px; padding-right: 11px; }
}
