:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #181818;
  --panel-soft: #202020;
  --line: #2e2e2e;
  --text: #f2f2f2;
  --muted: #a8a8a8;
  --dim: #737373;
  --open: #35c98b;
  --open-soft: rgba(53, 201, 139, 0.16);
  --closed: #ff5964;
  --closed-soft: rgba(255, 89, 100, 0.16);
  --break: #f3ba4d;
  --break-soft: rgba(243, 186, 77, 0.16);
  --info: #48b8d6;
  --info-soft: rgba(72, 184, 214, 0.14);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  padding: 18px;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar,
.section-head,
.notice-row,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.muted,
.clock-sub,
.source-line,
.event-meta,
.card-subtitle,
.next-label {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

section {
  margin-top: 20px;
}

.clock-stack {
  text-align: right;
}

.clock-main {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 750;
}

.clock-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.notice-row {
  min-height: 42px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notice-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-chip,
.coverage-pill,
.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.notice-chip {
  background: var(--info-soft);
  border-color: rgba(72, 184, 214, 0.42);
}

.coverage-pill {
  background: var(--panel-soft);
  color: var(--muted);
}

.section-head {
  margin-bottom: 10px;
}

.primary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

.market-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.market-card.open {
  border-color: rgba(53, 201, 139, 0.5);
}

.market-card.closed,
.market-card.holiday {
  border-color: rgba(255, 89, 100, 0.45);
}

.market-card.break,
.market-card.preopen {
  border-color: rgba(243, 186, 77, 0.45);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  min-width: 0;
}

.card-title h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
}

.card-subtitle {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.25;
}

.status-pill.open {
  color: var(--open);
  background: var(--open-soft);
  border-color: rgba(53, 201, 139, 0.46);
}

.status-pill.closed,
.status-pill.holiday {
  color: var(--closed);
  background: var(--closed-soft);
  border-color: rgba(255, 89, 100, 0.44);
}

.status-pill.break,
.status-pill.preopen {
  color: var(--break);
  background: var(--break-soft);
  border-color: rgba(243, 186, 77, 0.42);
}

.countdown {
  margin-top: 18px;
  font-variant-numeric: tabular-nums;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.market-grid .countdown {
  margin-top: 14px;
  font-size: 30px;
}

.market-card.compact {
  min-height: 168px;
}

.market-card.compact .card-top {
  align-items: center;
}

.market-card.compact .countdown {
  margin-top: 22px;
}

.market-card.compact .next-label {
  font-size: 13px;
}

.next-label {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}

.card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag {
  background: var(--panel-soft);
  color: var(--muted);
}

.card-details .tag {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.source-line {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.4;
}

.event-list {
  display: grid;
  gap: 8px;
}

.event-item {
  display: grid;
  grid-template-columns: minmax(118px, 150px) 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
}

.event-date {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.event-title {
  font-size: 13px;
  font-weight: 700;
}

.event-meta {
  margin-top: 2px;
  font-size: 12px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: var(--panel);
}

.footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
}

a {
  color: var(--info);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  body {
    padding: 12px;
  }

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

@media (max-width: 560px) {
  .topbar,
  .section-head,
  .notice-row,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .clock-stack {
    text-align: left;
  }

  .primary-grid,
  .market-grid {
    grid-template-columns: 1fr;
  }

  .event-item {
    grid-template-columns: 1fr;
  }

  .countdown {
    font-size: 32px;
  }
}
