:root {
  color-scheme: dark;
  --bg: #080a08;
  --panel: #0f130f;
  --panel-2: #131813;
  --ink: #e8e3d5;
  --ink-soft: #a5aaa2;
  --muted: #687069;
  --line: #222a22;
  --green: #c8d94b;
  --green-soft: #9fb13c;
  --green-deep: #24331f;
  --gold: #d6ad52;
  --silver: #9ca5a1;
  --bronze: #a9784e;
  --red: #a76565;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Playfair Display", Georgia, serif;
  --body: Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  content: "";
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 8, 0.9);
  backdrop-filter: blur(16px);
}

.app-brand,
.app-access,
.room-freshness {
  display: flex;
  align-items: center;
}

.app-brand {
  gap: 10px;
}

.app-brand-portrait {
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid rgba(200, 217, 75, 0.42);
  border-radius: 50%;
}

.app-brand-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 31% 41%;
  transform: scale(1.8);
}

.app-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.app-brand-copy strong {
  color: var(--green);
  font-family: var(--display);
  font-size: 19px;
}

.app-brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-access,
.room-freshness {
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(200, 217, 75, 0.45);
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  60% {
    box-shadow: 0 0 0 7px rgba(200, 217, 75, 0);
  }
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.loading-state {
  min-height: 65vh;
  display: grid;
  place-content: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: var(--display);
  letter-spacing: 0;
}

.loading-state h1 {
  font-size: clamp(34px, 7vw, 64px);
}

.room-hero {
  position: relative;
  min-height: 292px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.room-hero-art {
  position: absolute;
  inset: 0;
}

.room-hero-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(8, 10, 8, 0.08), rgba(8, 10, 8, 0.72) 56%, rgba(8, 10, 8, 0.98)),
    linear-gradient(0deg, rgba(8, 10, 8, 0.92), transparent 46%);
}

.room-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 41%;
  opacity: 0.86;
}

.room-hero-copy {
  position: relative;
  z-index: 2;
  width: min(560px, 64%);
  margin-left: auto;
  padding: 62px clamp(24px, 5vw, 64px) 40px 24px;
}

.room-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.94;
}

.room-note {
  max-width: 520px;
  margin-bottom: 26px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
}

.app-controls {
  position: sticky;
  top: 64px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 8, 0.94);
  backdrop-filter: blur(14px);
}

.period-control,
.view-tabs {
  display: flex;
  align-items: center;
}

.period-control {
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.period-button,
.view-tab {
  min-height: 38px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.period-button {
  min-width: 56px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.period-button.is-active {
  color: #11160d;
  background: var(--green);
}

.view-tabs {
  gap: 22px;
}

.view-tab {
  position: relative;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: lowercase;
}

.view-tab::after {
  position: absolute;
  right: 0;
  bottom: -15px;
  left: 0;
  height: 1px;
  content: "";
  background: transparent;
}

.view-tab.is-active {
  color: var(--ink);
}

.view-tab.is-active::after {
  background: var(--green);
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.stat {
  min-width: 0;
  padding: 22px 18px 24px;
  border-right: 1px solid var(--line);
}

.stat:first-child {
  padding-left: 0;
}

.stat:last-child {
  border-right: 0;
}

.stat-label,
.stat-value {
  display: block;
  font-family: var(--mono);
}

.stat-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.stat-value {
  overflow: hidden;
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value--accent {
  color: var(--green);
}

.view-panel {
  display: none;
  padding: 42px 0 12px;
}

.view-panel.is-active {
  display: block;
  animation: appear 0.24s ease both;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-heading--later {
  margin-top: 54px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 45px);
  line-height: 1;
}

.section-aside {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.caller-board {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.caller-row {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(170px, 1.4fr) repeat(4, minmax(90px, 0.7fr)) 24px;
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.caller-row:hover {
  z-index: 2;
  transform: translateY(-2px);
  background: rgba(200, 217, 75, 0.025);
  box-shadow: inset 2px 0 var(--green);
}

.caller-row--first {
  min-height: 104px;
  background:
    radial-gradient(circle at 22% 50%, rgba(200, 217, 75, 0.095), transparent 34%),
    var(--panel);
}

.caller-rank {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.caller-row--first .caller-rank {
  color: var(--gold);
}

.caller-name {
  min-width: 0;
}

.caller-name a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caller-name a:hover {
  color: var(--green);
}

.caller-subline {
  display: none;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.caller-cell {
  min-width: 0;
  padding: 0 10px;
}

.caller-cell small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.caller-cell strong {
  font-family: var(--mono);
  font-size: 13px;
}

.caller-cell--points strong {
  color: var(--green);
  font-size: 22px;
}

.caller-arrow {
  color: var(--muted);
  font-size: 16px;
}

.caller-board--compact .caller-row:nth-child(n + 6) {
  display: none;
}

.points-note {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.command-card {
  min-height: 210px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(200, 217, 75, 0.025), transparent 58%),
    rgba(15, 19, 15, 0.72);
}

.command-card--primary {
  background:
    radial-gradient(circle at 18% 0%, rgba(200, 217, 75, 0.18), transparent 42%),
    rgba(20, 29, 18, 0.86);
}

.command-kicker {
  display: block;
  margin-bottom: 28px;
  color: var(--green-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.command-card strong {
  display: block;
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: clamp(21px, 2.3vw, 31px);
  line-height: 1;
}

.command-card p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}

.invite-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid rgba(200, 217, 75, 0.28);
  background:
    linear-gradient(90deg, rgba(200, 217, 75, 0.09), transparent 60%),
    rgba(11, 15, 11, 0.92);
}

.invite-strip strong,
.invite-strip span {
  display: block;
}

.invite-strip strong {
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: 26px;
}

.invite-strip span {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
}

.invite-strip code {
  color: var(--green);
  font-family: var(--mono);
}

.invite-strip a {
  flex: 0 0 auto;
  padding: 13px 18px;
  border: 1px solid var(--green);
  color: #0b1008;
  background: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.receipt {
  min-height: 202px;
  padding: 22px;
  background: var(--panel);
  transition: background 0.18s ease;
}

.receipt:hover {
  background: var(--panel-2);
}

.receipt-top,
.receipt-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receipt-ticker {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-id,
.receipt-bottom {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.receipt-multiple {
  margin: 24px 0 22px;
  color: var(--green);
  font-family: var(--display);
  font-size: clamp(50px, 6vw, 74px);
  font-weight: 800;
  line-height: 0.85;
}

.receipt-bottom a:hover {
  color: var(--green);
}

.call-table {
  border-top: 1px solid var(--line);
}

.call-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) minmax(130px, 1fr) repeat(3, minmax(82px, 0.7fr)) 30px;
  align-items: center;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.call-row:hover {
  background: rgba(200, 217, 75, 0.02);
}

.call-primary {
  min-width: 0;
  font-family: var(--mono);
  font-weight: 700;
}

.call-primary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-primary small,
.call-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.call-cell {
  padding-right: 10px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.call-multiple {
  color: var(--green);
  font-weight: 700;
}

.status-open {
  color: var(--muted);
}

.status-hit {
  color: var(--green);
}

.status-live {
  color: var(--ink-soft);
}

/* Live call row — subtle left border accent */
.call-row--live {
  border-left: 2px solid rgba(200, 217, 75, 0.35);
  padding-left: 10px;
}

/* Pulsing dot for live calls */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: middle;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* Thesis quote under the ticker in call rows */
.call-thesis {
  overflow: hidden;
  max-width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rank delta badges */
.rank-delta {
  margin-left: 5px;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  vertical-align: middle;
}

.rank-delta--up   { color: var(--green); }
.rank-delta--down { color: var(--red); }
.rank-delta--same { color: var(--muted); }
.rank-delta--new  {
  color: var(--green-soft);
  letter-spacing: 0.06em;
}

.empty-state {
  padding: 38px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 44px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.app-footer a:hover {
  color: var(--green);
}

.access-state {
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.access-art {
  align-self: stretch;
  min-height: 520px;
  overflow: hidden;
}

.access-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% center;
  filter: saturate(0.85);
}

.access-copy {
  padding: 54px clamp(28px, 6vw, 82px);
}

.access-copy h1 {
  margin-bottom: 20px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.98;
}

.access-copy > p:not(.eyebrow, .access-foot) {
  max-width: 480px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

code {
  color: var(--green);
  font-family: var(--mono);
}

.access-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
}

.button-primary {
  color: #11160d;
  border-color: var(--green);
  background: var(--green);
}

.button-secondary:hover {
  border-color: var(--green-deep);
  color: var(--green);
}

.access-foot {
  margin-top: 48px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    padding-top: 12px;
  }

  .room-hero {
    min-height: 360px;
  }

  .room-hero-art::after {
    background: linear-gradient(0deg, rgba(8, 10, 8, 0.98) 8%, rgba(8, 10, 8, 0.3) 70%);
  }

  .room-hero-art img {
    object-position: 29% center;
  }

  .room-hero-copy {
    width: 100%;
    margin: 0;
    padding: 210px 20px 28px;
  }

  .app-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .period-control,
  .view-tabs {
    width: 100%;
  }

  .period-button,
  .view-tab {
    flex: 1;
  }

  .view-tabs {
    gap: 0;
    justify-content: space-between;
  }

  .view-tab::after {
    bottom: -11px;
  }

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

  .stat {
    border-bottom: 1px solid var(--line);
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:first-child,
  .stat:nth-child(3) {
    padding-left: 0;
  }

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

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

  .invite-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .invite-strip a {
    text-align: center;
  }

  .caller-row {
    grid-template-columns: 36px minmax(0, 1fr) 74px 20px;
    min-height: 84px;
  }

  .caller-cell {
    display: none;
  }

  .caller-cell--points {
    display: block;
    padding: 0;
    text-align: right;
  }

  .caller-subline {
    display: block;
  }

  .call-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(90px, 0.8fr) 70px;
  }

  .call-row .call-cell:nth-child(3),
  .call-row .call-cell:nth-child(5),
  .call-row .call-arrow {
    display: none;
  }

  .access-state {
    grid-template-columns: 1fr;
  }

  .access-art {
    min-height: 300px;
  }

  .access-copy {
    padding: 40px 16px 54px;
  }
}

@media (max-width: 500px) {
  .app-header {
    padding-inline: 12px;
  }

  .app-access {
    font-size: 8px;
  }

  .app-shell {
    width: calc(100% - 20px);
  }

  .period-button {
    min-width: 0;
  }

  .view-tab {
    font-size: 9px;
  }

  .stat {
    padding: 18px 10px 20px;
  }

  .stat-value {
    font-size: 26px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

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

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

  .command-card {
    min-height: 170px;
    padding: 20px;
  }

  .receipt {
    min-height: 176px;
  }

  .receipt-multiple {
    font-size: 60px;
  }

  .points-note,
  .app-footer {
    flex-direction: column;
  }

  .access-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
