:root {
  color-scheme: dark;
  --ink: #1c1916;
  --ink-soft: #4c453c;
  --enamel: #f4f0e6;
  --enamel-deep: #e7dfd0;
  --paper: #fffaf3;
  --caution: #f5c400;
  --alert: #d92b1f;
  --alert-deep: #9e1d16;
  --clear: #1c8a46;
  --wall: #1c242c;
  --frame: #12171c;
  --legend: #c5d0da;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(176, 196, 214, 0.1), transparent 42%),
    radial-gradient(ellipse at center, transparent 46%, rgba(0, 0, 0, 0.42) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    var(--wall);
}

.wall {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 18px;
  padding: 32px 16px 48px;
}

.sign {
  position: relative;
  width: min(860px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 18%),
    var(--enamel);
  border: 12px solid var(--frame);
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 22px 40px rgba(0, 0, 0, 0.38),
    0 2px 0 #000;
  overflow: hidden;
}

.stripes {
  height: 18px;
  background: repeating-linear-gradient(
    -45deg,
    var(--frame) 0 12px,
    var(--caution) 12px 24px
  );
}

.sign[data-state="alert"] .stripes {
  background: repeating-linear-gradient(-45deg, var(--frame) 0 12px, var(--alert) 12px 24px);
}

.sign[data-state="clear"] .stripes {
  background: repeating-linear-gradient(-45deg, #0e3a22 0 12px, #8ed4a8 12px 24px);
}

.sign[data-state="loading"] .stripes,
.sign[data-state="fault"] .stripes {
  background: repeating-linear-gradient(-45deg, var(--frame) 0 12px, #8e99a4 12px 24px);
}

.sign-body { padding: 22px 28px 18px; }

.screw {
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #e6cc8c, #8d6b38 55%, #3a2c16);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), 0 1px 1px rgba(0, 0, 0, 0.45);
}

.screw::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 7px;
  height: 2px;
  background: #14110e;
  transform: rotate(28deg);
}

.tl { top: 8px; left: 8px; }
.tr { top: 8px; right: 8px; }
.bl { bottom: 8px; left: 8px; }
.br { bottom: 8px; right: 8px; }

.sign-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 14px;
  align-items: center;
}

h1 {
  margin: 0;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: clamp(26px, 4.4vw, 42px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

.subtitle {
  grid-column: 2;
  margin: 36px 0 0;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: clamp(13px, 2.2vw, 18px);
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.lamp {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c5ced6, #6d7882 50%, #2c343c);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--frame);
}

.sign[data-state="alert"] .lamp {
  background: radial-gradient(circle at 35% 35%, #ffd0c8, #e23b2f 46%, #8d1a12);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--frame), 0 0 14px rgba(217, 43, 31, 0.85);
  animation: pulse 1.6s ease-in-out infinite;
}

.sign[data-state="watch"] .lamp {
  background: radial-gradient(circle at 35% 35%, #ffe9a8, #f0b400 48%, #8a6408);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--frame), 0 0 10px rgba(245, 196, 0, 0.7);
}

.sign[data-state="clear"] .lamp {
  background: radial-gradient(circle at 35% 35%, #d7f5df, #2ea85a 48%, #0f5c2c);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--frame), 0 0 10px rgba(28, 138, 70, 0.75);
}

.scoreboard {
  position: relative;
  margin-top: 18px;
}

.stamp {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 2%;
  margin: 0;
  padding: 0 8px;
  border: 4px solid rgba(217, 43, 31, 0.82);
  border-radius: 8px;
  color: rgba(176, 32, 24, 0.9);
  font-family: "Permanent Marker", "Comic Sans MS", cursive;
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(14deg);
  pointer-events: none;
  mix-blend-mode: multiply;
}

.digits {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0;
}

.digit {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(72px, 16vw, 124px);
  height: clamp(96px, 20vw, 158px);
  border-radius: 8px;
  background: linear-gradient(#2a3138, #14191e 46%, #07090b 54%, #1a2127);
  color: var(--paper);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(76px, 16vw, 140px);
  line-height: 0.8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -10px 16px rgba(0, 0, 0, 0.45),
    0 8px 0 #0a0a0a;
}

.digit::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.days-label {
  margin: 10px 0 0;
  text-align: center;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: 18px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
}

.clock {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
}

.quip {
  min-height: 1.35em;
  margin: 10px auto 2px;
  max-width: 34em;
  text-align: center;
  color: var(--alert-deep);
  font-family: "Permanent Marker", "Comic Sans MS", cursive;
  font-size: clamp(16px, 2.5vw, 21px);
  font-weight: 400;
  line-height: 1.35;
}

.cell {
  min-width: 72px;
  text-align: center;
}

.cell b {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: 0.04em;
}

.cell small {
  display: block;
  margin-top: 2px;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.colon {
  padding-top: 2px;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 42px;
  line-height: 0.8;
}

.week {
  margin: 14px auto 0;
  max-width: 36em;
  text-align: center;
  color: var(--ink-soft);
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.plate {
  margin-top: 16px;
  padding: 14px 14px 12px;
  background: rgba(28, 36, 44, 0.05);
  border: 1px solid rgba(28, 25, 22, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

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

.sign a {
  color: inherit;
  text-underline-offset: 3px;
}

.cve-id {
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration-thickness: 1px;
}

.badge {
  flex: none;
  margin: 4px 0 0;
  padding: 4px 8px;
  background: var(--frame);
  color: var(--paper);
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.sign[data-state="alert"] .badge { background: var(--alert); }

.meta,
.prior,
.waiting,
.legend {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.summary {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prior { font-style: italic; }

.legend {
  width: min(860px, 100%);
  margin: 0;
  color: var(--legend);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.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;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.legend :focus-visible,
.sign :focus-visible { outline-color: var(--ink); }

@keyframes pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

@media (max-width: 640px) {
  .sign-body { padding: 18px 16px 16px; }
  .sign-head { column-gap: 8px; }
  h1 { font-size: 22px; letter-spacing: 0.02em; }
  .cell { min-width: 56px; }
  .plate-top { flex-direction: column; }
  .scoreboard { margin-top: 46px; }
  .stamp { top: -40px; right: 0; font-size: 20px; border-width: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .sign[data-state="alert"] .lamp { animation: none; }
}
