:root {
  color-scheme: dark;
  --bg: #070a0e;
  --panel: rgba(15, 20, 28, 0.94);
  --panel-2: rgba(24, 31, 42, 0.9);
  --line: rgba(239, 214, 160, 0.2);
  --line-strong: rgba(239, 214, 160, 0.36);
  --text: #f6edde;
  --muted: #aeb9c8;
  --gold: #f5c45f;
  --green: #65d69a;
  --red: #f07178;
  --blue: #82c3ff;
  --ink: #05070a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.68)),
    linear-gradient(145deg, #05070a 0%, #121316 48%, #071217 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 38px 38px;
}

a,
button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff7e6;
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

button { cursor: pointer; }

a.primary,
button.primary {
  border-color: rgba(245, 196, 95, 0.48);
  background: linear-gradient(180deg, rgba(188, 132, 48, 0.82), rgba(117, 72, 25, 0.86));
}

.watch-shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.watch-nav,
.watch-links,
.section-head,
.champion-actions,
.event-strip,
.score-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.watch-nav {
  justify-content: space-between;
  margin-bottom: 16px;
}

.watch-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff1ce;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.watch-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 3px;
  place-items: center;
  border: 1px solid rgba(245, 196, 95, 0.34);
  border-radius: 8px;
  background: #0b1119;
  overflow: hidden;
}

.watch-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.watch-wordmark {
  padding-top: 1px;
}

.watch-links { justify-content: flex-end; }

.watch-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 18px;
  align-items: stretch;
  min-height: 268px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(20, 25, 34, 0.96), rgba(11, 15, 21, 0.94));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.watch-copy {
  display: grid;
  align-content: end;
  min-width: 0;
}

.watch-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.08;
}

h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

#watchSubtitle {
  max-width: 690px;
  margin-bottom: 0;
  color: #d8e3ee;
  font-size: 16px;
  line-height: 1.45;
}

.watch-art {
  min-height: 210px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #111821;
}

.watch-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.pressure-grid,
.watch-layout {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.pressure-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.watch-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
}

.pressure-tile,
.champion-panel,
.calculator-panel,
.feed-panel,
.trust-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.25);
}

.pressure-tile {
  min-height: 118px;
  padding: 15px;
}

.pressure-tile span,
.trust-grid dt,
.feed-meta,
.estimate-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.pressure-tile strong {
  display: block;
  margin: 7px 0 4px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.pressure-tile.pot strong { color: #ffe09a; }

.pressure-tile em,
.estimate-box em {
  color: #bfccd9;
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.champion-panel,
.calculator-panel,
.feed-panel,
.trust-panel {
  padding: clamp(15px, 2.4vw, 22px);
}

.feed-panel,
.trust-panel { margin-top: 12px; }

.section-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.status-pill,
.event-chip,
.run-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(245, 196, 95, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(245, 196, 95, 0.1);
  color: #ffe6a6;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.status-pill.ok,
.event-chip.ok {
  border-color: rgba(101, 214, 154, 0.3);
  background: rgba(101, 214, 154, 0.1);
  color: #c8f7dc;
}

.status-pill.warn,
.event-chip.warn,
.event-chip.chase,
.run-label.chase {
  border-color: rgba(245, 196, 95, 0.38);
  background: rgba(245, 196, 95, 0.12);
  color: #ffe6a6;
}

.champion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 230px);
  gap: 14px;
  align-items: stretch;
}

.champion-main {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--panel-2);
}

.champion-score {
  display: block;
  margin: 4px 0;
  color: #ffe09a;
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 950;
  line-height: 0.98;
}

.champion-actions { margin-top: 14px; }

.champion-art {
  min-height: 220px;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(245, 196, 95, 0.2);
  border-radius: 8px;
  overflow: hidden;
  background: #0b1119;
}

.champion-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.score-buttons button {
  flex: 1 1 80px;
}

.score-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.score-entry label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.score-entry input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff7e6;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
}

.estimate-box {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.estimate-box strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--green);
  font-size: 30px;
}

.estimate-box .estimate-reset-value {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffe6a6;
  font-size: 13px;
  font-weight: 850;
  text-transform: none;
}

.estimate-box .estimate-reset-value:empty {
  display: none;
}

.event-strip {
  margin-bottom: 12px;
}

.challenger-feed {
  display: grid;
  gap: 8px;
}

.feed-row {
  display: grid;
  grid-template-columns: minmax(68px, 92px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.feed-score {
  color: #ffe09a;
  font-size: 22px;
  font-weight: 950;
}

.feed-title {
  margin: 0 0 3px;
  font-weight: 850;
}

.feed-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.feed-actions a {
  min-height: 34px;
  padding: 7px 10px;
}

.prize-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(101, 214, 154, 0.1);
  color: #c8f7dc;
  font-size: 12px;
  font-weight: 900;
}

.prize-label.none {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.trust-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.trust-grid dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: #dbe7f3;
  font-size: 13px;
  font-weight: 750;
}

.empty-state,
.error-state {
  margin: 0;
  color: var(--muted);
}

.error-state { color: #ffd0d3; }

@media (max-width: 860px) {
  .watch-hero,
  .watch-layout,
  .champion-card {
    grid-template-columns: 1fr;
  }

  .pressure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watch-art {
    min-height: 170px;
  }
}

@media (max-width: 560px) {
  .watch-shell {
    width: min(100% - 18px, 1220px);
    padding-top: 10px;
  }

  .watch-nav,
  .watch-links {
    align-items: stretch;
  }

  .watch-links,
  .watch-links a,
  #refreshBtn {
    width: 100%;
  }

  .watch-links a,
  #refreshBtn {
    justify-content: center;
    text-align: center;
  }

  .pressure-grid,
  .trust-grid {
    grid-template-columns: 1fr;
  }

  .feed-row {
    grid-template-columns: 1fr;
  }

  .feed-actions {
    justify-content: stretch;
  }

  .feed-actions .run-label,
  .feed-actions .prize-label,
  .feed-actions a {
    flex: 1;
    justify-content: center;
  }
}
