:root {
  --paper: #fff4dd;
  --ink: #26201a;
  --ink-2: #63584a;
  --ink-3: #8b7e6c;
  --card: #fffdf7;
  --accent: #ff5c2b;
  --yellow: #ffd84d;
  --pink: #ffb9cc;
  --blue: #a5dcff;
  --peach: #ffb07a;
  --empty: #f1e3c4;
  --border: 2px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-small: 3px 3px 0 var(--ink);
  --radius: 14px;
  --display: "Baloo Clone", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --paper: #1b1713;
  --ink: #f6ebd8;
  --ink-2: #c6b9a7;
  --ink-3: #a3917a;
  --card: #28221c;
  --accent: #ff7446;
  --yellow: #e8bd3f;
  --pink: #db8fa6;
  --blue: #79b7dc;
  --peach: #db8d5d;
  --empty: #40362a;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

button {
  font: inherit;
}

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

.page-shell {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 30px 24px 70px;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand h1,
h2 {
  font-family: var(--display);
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 38px);
}

.avatar {
  position: relative;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: var(--border);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--shadow-small);
  transform: rotate(-4deg);
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  font-family: var(--display);
  font-size: 24px;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.language-control select {
  width: 112px;
  height: 36px;
  padding: 0 8px;
  border: var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
}

.icon-button {
  display: inline-grid;
  position: relative;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
}

.icon-button::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: var(--border);
  border-radius: 50%;
  background: var(--card);
  box-shadow: 1px 1px 0 var(--ink);
}

.icon-button > * {
  position: relative;
  z-index: 1;
}

.x-mark {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
}

.hero-explainer {
  max-width: 70ch;
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 16px;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  min-height: 46px;
}

.pill,
.show-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border: var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.pill:hover,
.show-more:hover {
  color: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.pill:active,
.show-more:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.pill-yellow {
  background: var(--yellow);
}

.pill-icon {
  font-family: var(--mono);
  font-size: 16px;
}

.source-status {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}

.hero-card,
.log-bubble {
  border: var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  margin-top: 34px;
  padding: 27px 30px 25px;
  overflow: hidden;
  background-image: radial-gradient(var(--ink-3) 1px, transparent 1px);
  background-position: 1px 1px;
  background-size: 15px 15px;
}

.eyebrow,
.stat-tile dt,
.legend,
.site-footer,
.hero-footer,
.source-status {
  font-family: var(--mono);
}

.eyebrow {
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.latest-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.latest-figure {
  display: inline-block;
  padding: 3px 17px 8px;
  border-radius: 11px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1;
}

.latest-badge {
  padding: 7px 10px;
  border: var(--border);
  border-radius: 8px;
  background: var(--accent);
  color: #fffdf7;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 11px;
}

.hero-footer a {
  color: var(--ink);
}

.reset-plea {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.reset-plea-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--pink);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.reset-plea-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.reset-plea-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.reset-plea-button.is-pleading {
  animation: reset-plea-button-pleading 280ms ease-out;
}

@keyframes reset-plea-button-pleading {
  0%,
  100% {
    transform: translate(0, 0) rotate(0);
  }

  22% {
    transform: translate(-2px, -2px) rotate(-3deg);
  }

  46% {
    transform: translate(2px, 0) rotate(3deg);
  }

  70% {
    transform: translate(-1px, 0) rotate(-1deg);
  }
}

.reset-plea[data-mode="thanks"] .reset-plea-button {
  background: var(--blue);
}

.reset-plea-emoji {
  font-size: 14px;
}

.reset-plea-count {
  min-width: 7ch;
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.reset-plea-bursts {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.reset-plea-burst {
  position: absolute;
  left: 50%;
  bottom: 50%;
  z-index: 1;
  display: grid;
  width: max-content;
  place-items: center;
  color: var(--accent);
  font-family: var(--display);
  font-size: var(--burst-size, 20px);
  font-weight: 800;
  line-height: 1;
  text-shadow: 1px 1px 0 var(--card), -1px -1px 0 var(--card), 1px -1px 0 var(--card), -1px 1px 0 var(--card);
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(calc(-50% + var(--burst-x)), 8px, 0) rotate(0) scale(0.65);
  animation: reset-plea-burst 850ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.reset-plea-burst--avatar {
  width: var(--burst-size, 40px);
  height: var(--burst-size, 40px);
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
  overflow: hidden;
}

.reset-plea-burst-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes reset-plea-burst {
  0% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--burst-x)), 8px, 0) rotate(0) scale(0.65);
  }

  18% {
    opacity: 1;
  }

  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--burst-x)), var(--burst-y), 0) rotate(var(--burst-rotate)) scale(1);
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 35px 0 48px;
}

.stat-tile {
  min-height: 90px;
  padding: 17px 18px 14px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-yellow {
  background: var(--yellow);
}

.stat-pink {
  background: var(--pink);
}

.stat-blue {
  background: var(--blue);
}

.stat-tile dt {
  color: var(--ink-2);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-tile dd {
  margin: 7px 0 0;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
}

.mono {
  font-family: var(--mono);
}

.section {
  margin-top: 48px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  font-size: 25px;
}

.announcement-head p {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
}

.live-alert {
  margin-top: 18px;
  padding: 15px 17px;
  border: var(--border);
  border-radius: 12px;
  background: var(--yellow);
  box-shadow: var(--shadow-small);
}

.live-alert strong {
  display: block;
  margin-bottom: 3px;
  font-family: var(--display);
  font-size: 20px;
}

.live-alert p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}

.live-alert.watch {
  background: var(--pink);
}

.live-alert.scheduled {
  background: var(--blue);
}

.log-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.log-avatar {
  width: 44px;
  height: 44px;
  border: var(--border);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--shadow-small);
  object-fit: cover;
}

.log-bubble {
  position: relative;
  padding: 14px 18px 17px;
}

.log-bubble::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -9px;
  width: 15px;
  height: 15px;
  border-bottom: var(--border);
  border-left: var(--border);
  background: var(--card);
  transform: rotate(45deg);
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}

.log-time {
  padding: 4px 9px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
}

.log-text {
  display: -webkit-box;
  margin: 10px 0 9px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  white-space: pre-line;
}

.log-link {
  font-family: var(--mono);
  font-size: 10px;
}

.show-more {
  display: flex;
  margin: 24px auto 0;
}

.site-footer {
  margin-top: 66px;
  padding-top: 19px;
  border-top: var(--border);
  color: var(--ink-2);
  font-size: 11px;
}

.site-footer p {
  margin: 7px 0;
}

.noscript-fallback {
  margin-top: 34px;
  padding: 18px 20px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-small);
}

.noscript-fallback h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.noscript-fallback p {
  margin: 7px 0;
  color: var(--ink-2);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  border: var(--border);
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-small);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .reset-plea-button.is-pleading {
    animation: none;
  }

  .reset-plea-burst {
    animation: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 20px 16px 48px;
  }

  .masthead {
    margin-bottom: 20px;
  }

  .brand {
    gap: 9px;
  }

  .avatar {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .brand h1 {
    font-size: 24px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .hero-explainer {
    font-size: 16px;
  }

  .notification-actions {
    gap: 8px;
  }

  .pill {
    padding-inline: 12px;
  }

  .source-status {
    width: 100%;
  }

  .hero-card {
    margin-top: 25px;
    padding: 22px 18px 19px;
  }

  .latest-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .latest-figure {
    font-size: 42px;
  }

  .hero-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .reset-plea {
    margin-left: 0;
  }

  .stat-row {
    gap: 10px;
    margin: 28px 0 40px;
  }

  .stat-tile {
    min-height: 75px;
    padding: 12px 11px 11px;
  }

  .stat-tile dt {
    font-size: 8px;
    white-space: nowrap;
  }

  .stat-tile dd {
    font-size: 22px;
  }

  .section {
    margin-top: 42px;
  }

  .section-head,
  .announcement-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  h2 {
    font-size: 23px;
  }

  .log-item {
    grid-template-columns: 35px minmax(0, 1fr);
    gap: 10px;
  }

  .log-avatar {
    width: 35px;
    height: 35px;
  }

  .log-bubble {
    padding: 13px 16px 15px;
  }

  .log-text {
    -webkit-line-clamp: 5;
  }
}
