:root {
  color-scheme: dark;
  --awn-red: #c8102e;
  --ink: #f7f9fc;
  --ink-strong: #ffffff;
  --muted: #9ca8b8;
  --line: rgba(255, 255, 255, .13);
  --paper: #050b14;
  --panel: rgba(10, 18, 30, .9);
  --panel-solid: #0b1524;
  --field: #07111f;
  --field-line: rgba(255, 255, 255, .18);
  --shadow: 0 18px 60px rgba(0, 0, 0, .32);
  --font: HelveticaNeue-CondensedBold, "HelveticaNeueLTStd-BdCn", "HelveticaNeueLTPro-BdCn", "HelveticaNeue-CondensedBlack", "AWN Condensed", "Arial Narrow", Arial, sans-serif;
}

@font-face {
  font-family: "Forecast Heading";
  src: url("./assets/fonts/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Forecast Body";
  src: url("./assets/fonts/roboto-condensed.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AWN Condensed";
  src: url("./assets/awn-condensed-var.woff2") format("woff2-variations"),
       url("./assets/awn-condensed-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

.logo-library {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  letter-spacing: 0;
}

.logo-library summary {
  cursor: pointer;
  font-size: 18px;
}

.logo-library summary span {
  display: block;
  margin: 6px 0;
  color: var(--muted);
  font-size: 14px;
}

.logo-library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0;
}

.logo-library-filters label {
  flex: 1 1 200px;
  max-width: 360px;
}

.logo-library-list {
  max-height: 540px;
  overflow-y: auto;
}

.logo-library-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 110px;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.logo-library-art {
  display: grid;
  place-items: center;
  width: 80px;
  height: 72px;
  background: white;
  color: #555;
  font-size: 12px;
  text-align: center;
}

.logo-library-art img {
  width: 72px;
  height: 64px;
  object-fit: contain;
}

.logo-library-school {
  overflow-wrap: anywhere;
}

.logo-library-school strong,
.logo-library-school span,
.logo-library-school small {
  display: block;
}

.logo-library-school span {
  margin: 4px 0;
  font-size: 14px;
}

.logo-library-school small,
.logo-library-no-source {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.logo-library-row a {
  color: white;
  text-underline-offset: 3px;
}

@media (max-width: 560px) {
  .logo-library-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }
  .logo-library-art { width: 64px; height: 64px; }
  .logo-library-art img { width: 58px; height: 58px; }
  .logo-library-row > a,
  .logo-library-no-source { grid-column: 2; }
}

[hidden] {
  display: none !important;
}

.artwork-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 2px solid var(--line);
  letter-spacing: 0;
}

.artwork-status[data-state="failed"] { border-color: var(--awn-red); }
.artwork-status span { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.artwork-status button { flex: 0 0 auto; letter-spacing: 0; }
button:disabled { opacity: .5; cursor: not-allowed; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(200, 16, 46, .16), rgba(200, 16, 46, 0) 240px),
    radial-gradient(circle at 72% -10%, rgba(255, 255, 255, .08), transparent 320px),
    linear-gradient(135deg, #03070d 0%, #07111f 48%, #111927 100%);
  color: var(--ink);
  font-family: var(--font);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--field-line);
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

button:hover {
  border-color: var(--awn-red);
  background: rgba(255, 255, 255, .1);
}

button:active {
  transform: translateY(1px);
}

.primary {
  background: var(--awn-red);
  border-color: var(--awn-red);
  color: #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 2px solid var(--awn-red);
  background: rgba(3, 7, 13, .94);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 104px;
  height: 52px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 4px;
  padding: 5px;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .1);
}

.brand p,
.panel-heading p,
.detail-heading p,
.examples p {
  margin: 0 0 3px;
  color: var(--awn-red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.brand h1,
.panel-heading h2,
.detail-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.source-pill {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: #d9e0ea;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .06);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.slate-panel {
  min-height: 0;
}

.slate-panel > .panel-heading {
  align-items: center;
  flex-wrap: wrap;
}

.slate-panel > .panel-heading > div:first-child {
  flex: 1;
  min-width: 220px;
}

.slate-panel > .panel-heading .tabs {
  flex-shrink: 0;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

.icon-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.icon-command img {
  flex: 0 0 18px;
  filter: invert(1);
}

.ranking-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.ranking-controls label {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  min-width: 150px;
}

.ranking-controls [hidden] { display: none; }
.ranking-controls select { margin: 0; }
.ranking-context { margin: 10px 0 16px; color: #bfc8d2; font-size: 13px; }
.ranking-context p { margin: 0 0 5px; line-height: 1.45; letter-spacing: 0; }
.ranking-context a { color: #e9edf2; }
.is-standings .rank-meta { grid-template-columns: 1fr; }
.ranking-empty { padding: 24px 0; }

@media (max-width: 480px) {
  .ranking-tabs { width: 100%; }
  .ranking-tabs .tab { flex: 1; min-width: 0; padding: 9px 7px; }
  .ranking-controls label { flex: 1; min-width: 120px; }
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.ranked-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.rank-card {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 8px;
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.rank-card.active {
  border-color: var(--awn-red);
  background: rgba(200, 16, 46, .13);
  box-shadow: 0 0 0 2px rgba(200, 16, 46, .28), 0 14px 30px rgba(0, 0, 0, .22);
}

.rank-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.rank-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--awn-red);
  color: #fff;
  border-radius: 6px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.rank-card strong {
  display: block;
  color: var(--ink-strong);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.rank-card span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}

.rank-card .schedule-line {
  display: block;
  margin-top: 3px;
  color: #dce4ef;
  font-size: 11px;
  line-height: 1.25;
}

.rank-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #151923;
  border-radius: 6px;
  background: #102033;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .28);
}

.ranked-list.is-story .rank-preview {
  aspect-ratio: 9 / 16;
}

.rank-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.rank-preview-canvas,
#graphicCanvas {
  letter-spacing: 0;
  word-spacing: 0;
}

.detail-workspace {
  background: rgba(5, 11, 20, .64);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  scroll-margin-top: 96px;
}

body[data-view="editor"] .workspace {
  padding-inline: clamp(14px, 3vw, 42px);
}

.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-source {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.stage {
  min-width: 0;
  align-self: start;
  background: rgba(5, 11, 20, .48);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.tabs {
  display: inline-flex;
  background: rgba(0, 0, 0, .26);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
}

.tab {
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  letter-spacing: 0;
}

.tab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.tab.active {
  background: var(--awn-red);
  color: #fff;
  border-color: var(--awn-red);
}

canvas {
  display: block;
  width: min(100%, 1120px);
  max-height: calc(100vh - 190px);
  margin: 0 auto;
  background: #111;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .5);
  cursor: pointer;
}

.canvas-shell {
  position: relative;
  width: min(100%, 1120px);
  margin: 0 auto;
}

.canvas-shell canvas {
  width: 100%;
}

.builder-panel {
  display: none;
}

.selection-box {
  position: absolute;
  z-index: 3;
  border: 2px solid var(--awn-red);
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 22px rgba(200, 16, 46, .46);
  pointer-events: none;
}

.selection-box::after {
  content: attr(data-label);
  position: absolute;
  left: -2px;
  bottom: calc(100% + 6px);
  max-width: 220px;
  overflow: hidden;
  padding: 5px 7px;
  border-radius: 4px;
  background: var(--awn-red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.inline-editor {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 8px;
  min-width: 210px;
  max-width: min(420px, 94%);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  background: rgba(7, 17, 31, .96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .46);
}

.inline-editor textarea {
  min-height: 74px;
  resize: vertical;
}

.inline-editor input[type="file"] {
  padding: 8px;
}

.inline-color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inline-color-grid label {
  margin-bottom: 0;
}

.inline-color-grid input[type="color"] {
  min-height: 40px;
  padding: 4px;
}

.inline-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #dce4ef;
  letter-spacing: .08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  padding: 10px;
  background: var(--field);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(200, 16, 46, .78);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, .16);
}

input::placeholder {
  color: #667384;
}

.source-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: .02em;
}

.source-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0 16px;
  background: rgba(255, 255, 255, .055);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.source-box p {
  margin: 0 0 4px;
  color: var(--awn-red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

textarea {
  resize: vertical;
}

.grid-2,
.temp-row,
.forecast-editor {
  display: grid;
  gap: 10px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.temp-row {
  grid-template-columns: repeat(3, 1fr);
}

.forecast-editor {
  grid-template-columns: 1fr 1fr;
}

.examples {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

#exampleStrip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

#exampleStrip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
}

.canvas-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 13, .72);
  backdrop-filter: blur(10px);
}

.canvas-editor {
  width: min(460px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .46);
}

.canvas-editor h3 {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.1;
  color: var(--ink-strong);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.canvas-editor label {
  margin-bottom: 10px;
}

.canvas-editor textarea {
  min-height: 82px;
}

.canvas-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 1500px) {
  .workspace {
    padding: 14px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  canvas {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    height: auto;
    align-items: start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .brand h1,
  .panel-heading h2,
  .detail-heading h2 {
    font-size: 20px;
  }

  .detail-heading,
  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs,
  .detail-actions .primary {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .dashboard-actions {
    width: 100%;
    gap: 8px;
  }

  .dashboard-actions .tabs {
    width: auto;
    flex: 1;
  }

  .dashboard-actions .tab {
    padding-inline: 10px;
  }

  .grid-2,
  .temp-row,
  .ranked-list {
    grid-template-columns: 1fr;
  }
}

/* College weekly producer controls. */
.week-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:16px 0;border-bottom:1px solid #ddd}
.week-controls label{display:flex;gap:10px;align-items:center;font-weight:700}.week-controls input{width:auto}
#draftStatus{font-size:12px;color:#626b76;margin-left:auto}
.bye-card{opacity:.85}.bye-art{min-height:190px;background:#edf0f3;display:flex;gap:20px;align-items:center;justify-content:center;flex-direction:column;font-family:'Barlow Condensed',sans-serif;font-size:26px;letter-spacing:2px}
.bye-art img{width:85px;height:85px;object-fit:contain}.bye-card a{color:#a40c24;font-size:12px;margin-top:6px}
.builder-panel.is-open{display:block;position:static;max-height:none;width:100%;grid-column:1 / -1}
.detail-grid:has(.builder-panel.is-open){grid-template-columns:minmax(0,1fr) 340px}.detail-grid:has(.builder-panel.is-open) .builder-panel{grid-column:auto}
@media(max-width:1000px){.detail-grid:has(.builder-panel.is-open){grid-template-columns:minmax(0,1fr)}#draftStatus{margin-left:0}.week-controls{gap:8px}.week-controls button{padding:10px}}

/* Compact editor header with room for readable game information. */
.detail-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:24px; }
.detail-heading > div { min-width:0; }
.detail-heading h2 { margin-bottom:8px; }
.detail-source { line-height:1.45; overflow-wrap:anywhere; }
.detail-actions { flex-wrap:wrap; justify-content:flex-end; gap:10px; }
.detail-actions button { white-space:nowrap; }
@media(max-width:1200px) { .detail-heading { grid-template-columns:minmax(0,1fr); gap:12px; } .detail-actions { justify-content:flex-start; } }

/* Scale canvas previews uniformly; export dimensions remain on the canvas itself. */
.rank-preview-canvas { width:100%; height:auto; max-height:none; border:0; }
.canvas-shell canvas { width:100%; height:auto; max-height:none; }
.canvas-shell[data-format="story"] { width:min(100%, 540px, max(300px, calc((100vh - 190px) * 0.5625))); }
