/* =============================================================
   AI DEATH CLOCK — Styles
   Supports dark mode (default) and light mode via [data-theme]
   ============================================================= */

/* ---- CSS Variables ---- */
:root[data-theme="dark"],
:root {
  --bg:           #0a0a0a;
  --bg-alt:       #111111;
  --surface:      #161616;
  --surface-2:    #1e1e1e;
  --surface-3:    #2a2a2a;
  --text:         #e8e8e8;
  --text-dim:     #888888;
  --text-muted:   #555555;
  --accent:       #ff3333;
  --accent-glow:  rgba(255,51,51,0.35);
  --accent-2:     #ff8800;
  --accent-3:     #00cc77;
  --accent-4:     #4af;
  --border:       #2a2a2a;
  --border-glow:  rgba(255,51,51,0.18);
  --shadow:       rgba(0,0,0,0.6);
  --scan-opacity: 0.03;
  --toggle-icon:  "☀️ Light Mode";
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:           #f0f3f0;
  --bg-alt:       #e8ebe8;
  --surface:      #ffffff;
  --surface-2:    #f5f7f5;
  --surface-3:    #eaecea;
  --text:         #1a1a1a;
  --text-dim:     #555555;
  --text-muted:   #aaaaaa;
  --accent:       #cc0000;
  --accent-glow:  rgba(204,0,0,0.2);
  --accent-2:     #cc6600;
  --accent-3:     #006633;
  --accent-4:     #0055aa;
  --border:       #d8dbd8;
  --border-glow:  rgba(204,0,0,0.12);
  --shadow:       rgba(0,0,0,0.12);
  --scan-opacity: 0;
  color-scheme: light;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Enforce [hidden] even when a class sets an explicit display value */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
  position: relative;
}

/* Scanline overlay (dark mode only) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,var(--scan-opacity)) 2px,
    rgba(0,0,0,var(--scan-opacity)) 4px
  );
  z-index: 9999;
}

a { color: var(--accent-4); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
  letter-spacing: 0.05em;
}

h1 { font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 900; }
h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1rem; font-weight: 700; }

/* ---- Layout ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

/* ---- GitHub Corner Banner ---- */
.github-corner {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1100;
  color: var(--bg);
}
.github-corner svg {
  fill: var(--accent);
  color: var(--bg);
  transition: fill 0.2s;
}
.github-corner:hover svg {
  fill: var(--accent-2);
  text-decoration: none;
}
.github-corner:hover .octo-arm {
  animation: octocat-wave 560ms ease-in-out;
}
@keyframes octocat-wave {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(-25deg); }
  40%, 80% { transform: rotate(10deg); }
}
.octo-arm { transform-origin: 130px 106px; }
@media (max-width: 500px) {
  .github-corner:hover .octo-arm { animation: none; }
  .github-corner .octo-arm { animation: octocat-wave 560ms ease-in-out; }
}

/* ---- Theme Toggle ---- */
#themeToggle {
  position: fixed;
  top: 1rem;
  right: 5.5rem;
  z-index: 1000;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#themeToggle:hover {
  background: var(--surface-3);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ---- Hero / Header ---- */
header {
  padding: 4rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  position: relative;
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.header-skull {
  font-size: clamp(3rem, 8vw, 5rem);
  display: block;
  margin-bottom: 0.5rem;
  animation: pulse-skull 2.5s ease-in-out infinite;
}

@keyframes pulse-skull {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 0px var(--accent)); }
  50%      { transform: scale(1.08); filter: drop-shadow(0 0 16px var(--accent)); }
}

.site-title {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.site-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
}

/* ---- Tab Bar ---- */
.tab-bar {
  display: flex;
  gap: 0;
  background: var(--bg-alt);
  border-bottom: 2px solid var(--border);
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 900;
}

.tab-btn {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn--active,
.tab-btn[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- News & References Tab ---- */
.news-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.news-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.news-card-category {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2em 0.55em;
  border-radius: 4px;
}

.news-cat-jobs     { background: rgba(255,136,0,0.18); color: var(--accent-2); border: 1px solid rgba(255,136,0,0.35); }
.news-cat-energy   { background: rgba(255,51,51,0.15);  color: var(--accent);   border: 1px solid rgba(255,51,51,0.3); }
.news-cat-water    { background: rgba(68,170,255,0.15); color: var(--accent-4); border: 1px solid rgba(68,170,255,0.3); }
.news-cat-carbon   { background: rgba(0,204,119,0.15);  color: var(--accent-3); border: 1px solid rgba(0,204,119,0.3); }
.news-cat-research { background: rgba(160,120,255,0.15); color: #b98aff;        border: 1px solid rgba(160,120,255,0.3); }

.news-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
}

.news-card-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.news-card-title a {
  color: var(--text);
  text-decoration: none;
}

.news-card-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.news-card-desc {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-dim);
  flex: 1;
}

.news-card-source {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'Orbitron', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.news-disclaimer {
  font-style: italic;
  border-left: 3px solid var(--accent-2);
  padding-left: 1rem;
}

/* ---- About Page ---- */
.about-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.about-lead {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 720px;
  margin-bottom: 2rem;
}

.about-body {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 1.25rem;
}

.about-origin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.about-origin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.about-origin-card:hover { box-shadow: 0 0 20px var(--accent-glow); }

.about-origin-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.about-origin-card h3 {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.about-origin-card p {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-dim);
}

.about-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 680px;
  margin-top: 1.5rem;
}

.about-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

.about-step-num {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent);
  min-width: 2.2rem;
  line-height: 1.4;
}

.about-step strong { color: var(--text); }

.about-step div:last-child {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-dim);
}

.about-sources-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.about-sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.about-sources-table th,
.about-sources-table td {
  text-align: left;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
}

.about-sources-table thead th {
  background: var(--surface-2);
  color: var(--text);
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.about-sources-table tbody tr:nth-child(odd) { background: var(--surface); }
.about-sources-table tbody tr:nth-child(even) { background: var(--bg-alt); }
.about-sources-table tbody td { color: var(--text-dim); }
.about-sources-table tbody td:first-child { color: var(--text); font-weight: 700; }
.about-sources-table tbody td:nth-child(2) { color: var(--accent-2); font-family: 'Orbitron', monospace; font-size: 0.72rem; }

.about-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.about-action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.2s;
}

.about-action-card:hover { box-shadow: 0 0 16px var(--accent-glow); }

.about-action-card span { font-size: 1.8rem; }

.about-action-card strong {
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  color: var(--accent-3);
  letter-spacing: 0.04em;
}

.about-action-card p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}

.about-inline-tab-link {
  background: none;
  border: none;
  color: var(--accent-4);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-inline-tab-link:hover { color: var(--accent); }

/* ---- FAQ Accordion ---- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 780px;
  margin-top: 1.5rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.faq-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-question {
  list-style: none;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
  user-select: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::before {
  content: '▶';
  font-size: 0.6rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] .faq-question::before {
  transform: rotate(90deg);
}

.faq-question-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.faq-answer {
  padding: 0 1.25rem 1rem 1.25rem;
  font-size: 0.87rem;
  line-height: 1.75;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.faq-answer p { margin-bottom: 0.6rem; }
.faq-answer p:last-child { margin-bottom: 0; }

.faq-answer strong { color: var(--text); }

.faq-answer .faq-example {
  background: var(--surface-2);
  border-left: 3px solid var(--accent-4);
  border-radius: 0 0.25rem 0.25rem 0;
  padding: 0.5rem 0.75rem;
  margin: 0.6rem 0;
  font-size: 0.83rem;
  color: var(--text-dim);
}

/* ---- Changelog Tab ---- */
.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.changelog-release {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.changelog-release:hover {
  box-shadow: 0 0 16px var(--accent-glow);
}

.changelog-release--unreleased {
  border-color: var(--accent-2);
  border-style: dashed;
}

.changelog-release-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.changelog-version {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.changelog-version:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.changelog-release--unreleased .changelog-version {
  color: var(--accent-2);
}

.changelog-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
}

.changelog-section {
  margin-top: 0.75rem;
}

.changelog-section-heading {
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 0.4rem;
}

.changelog-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.changelog-item {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-dim);
  padding-left: 1.25rem;
  position: relative;
}

.changelog-item::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 0.25em;
}

.changelog-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}


/* ---- Live Counter Section ---- */
#counter-section { background: var(--bg-alt); }

.counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.counter-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.counter-box:hover { box-shadow: 0 0 24px var(--accent-glow); }

.counter-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255,51,51,0.04));
  pointer-events: none;
}

.counter-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.counter-value {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
  word-break: break-all;
  line-height: 1.3;
}

.counter-value.session { color: var(--accent-2); text-shadow: 0 0 12px rgba(255,136,0,0.4); }
.counter-value.rate    { color: var(--accent-3); text-shadow: 0 0 12px rgba(0,204,119,0.4); }

.counter-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ---- Impact Stats Strip ---- */
.impact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.impact-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
}

.impact-stat .stat-icon { font-size: 1.8rem; display: block; margin-bottom: 0.4rem; }

.impact-stat .stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-2);
}

.impact-stat .stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

/* ---- Milestones ---- */
#milestones-section { background: var(--bg); }

.milestone-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.5rem;
}

.milestone-filter-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.milestones-grid.hide-completed .milestone-card.triggered {
  display: none;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.milestone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.3s;
}

.milestone-card:hover { transform: translateY(-2px); }

.milestone-card.triggered {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), inset 0 0 30px rgba(255,51,51,0.04);
  animation: card-trigger 0.6s ease-out;
}

.milestone-card.triggered::after {
  content: '⚠ THRESHOLD BREACHED';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  animation: blink 1.5s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes card-trigger {
  0%  { box-shadow: 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 40px var(--accent-glow); }
  100%{ box-shadow: 0 0 20px var(--accent-glow); }
}

.milestone-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.milestone-icon { font-size: 2rem; flex-shrink: 0; }

.milestone-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.milestone-threshold {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.milestone-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.milestone-consequence {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.milestone-event {
  font-size: 0.82rem;
  color: var(--accent-2);
  background: var(--surface-2);
  border-left: 3px solid var(--accent-2);
  padding: 0.5rem 0.75rem;
  border-radius: 0 0.25rem 0.25rem 0;
  line-height: 1.4;
}

.milestone-progress-wrap {
  margin-top: 0.75rem;
}

.milestone-progress-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  transition: width 1s ease;
}

.milestone-card.triggered .progress-fill {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.milestone-predict {
  font-size: 0.72rem;
  color: var(--accent-4);
  margin-top: 0.5rem;
  text-align: right;
}

/* ---- Chart Section ---- */
#chart-section { background: var(--bg-alt); }

.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
  position: relative;
}

.chart-wrapper { position: relative; height: 380px; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---- Predictions Table ---- */
#predictions-section { background: var(--bg); }

.predictions-table-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead { background: var(--surface-2); }

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--surface-2); }

.passed-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 2rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  animation: blink 2s step-start infinite;
}

.future-date { color: var(--accent-4); }

/* ---- Scoring Section ---- */
#scoring-section { background: var(--bg-alt); }

.scoring-toggle-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: background 0.2s;
}
.scoring-toggle-btn:hover { background: var(--surface-3); }

#scoring-content { display: none; }
#scoring-content.open { display: block; }

.score-summary {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.score-badge {
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem 2rem;
  min-width: 150px;
}

.score-badge.final { border-color: var(--accent-3); }
.score-badge .badge-score {
  font-family: 'Orbitron', monospace;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent-2);
}
.score-badge.final .badge-score { color: var(--accent-3); }
.score-badge .badge-label { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.3rem; text-transform: uppercase; letter-spacing: 0.08em; }

.scoring-categories { display: flex; flex-direction: column; gap: 1rem; }

.scoring-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

.scoring-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.scoring-cat-name { font-weight: 700; font-size: 0.9rem; }
.scoring-cat-score { font-family: 'Orbitron', monospace; color: var(--accent-2); font-size: 0.85rem; }
.scoring-cat-notes { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 0.5rem; }

.rec-list { list-style: none; }

.rec-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.2rem 0;
}

.rec-item.done { color: var(--accent-3); }

.rec-impact {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--surface-2);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
  white-space: nowrap;
  color: var(--accent-3);
}

.rec-item:not(.done) .rec-impact { color: var(--text-muted); }

/* ---- Life Blocks Section ---- */
#life-blocks-section { background: var(--bg); }

.lb-desc {
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.lb-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
  min-height: 2rem;
}

.lb-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .78rem;
  color: var(--text-dim);
}

.lb-breadcrumb-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: .3rem;
  padding: .2rem .55rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  color: var(--accent-4);
}
.lb-breadcrumb-item:hover { background: var(--surface-3); color: var(--text); }
.lb-breadcrumb-item.lb-bc-current {
  color: var(--text-muted);
  cursor: default;
  background: transparent;
  border-color: transparent;
}
.lb-breadcrumb-sep {
  color: var(--text-muted);
  font-size: .7rem;
  user-select: none;
}

.lb-info {
  font-family: 'Orbitron', monospace;
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .06em;
}

/* ---- Grid ---- */
.lb-container {
  width: 100%;
  overflow-x: auto;
  padding-bottom: .5rem;
}

.lb-grid {
  display: grid;
  grid-template-columns: repeat(var(--lb-cols, 52), var(--lb-block-size, 11px));
  gap: var(--lb-gap, 2px);
  width: max-content;
  animation: lb-grid-in .25s ease-out;
}

@keyframes lb-grid-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---- Blocks ---- */
.lb-block {
  width:  var(--lb-block-size, 11px);
  height: var(--lb-block-size, 11px);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: transform .1s, box-shadow .15s;
  outline: none;
}
.lb-block:focus-visible { box-shadow: 0 0 0 2px var(--accent-4); }

/* Future — dim green, shows potential */
.lb-block.lb-future {
  background: #0f2a0f;
  border: 1px solid #1a3a1a;
}
.lb-block.lb-future:hover {
  background: #1e4a1e;
  transform: scale(1.5);
  box-shadow: 0 0 8px rgba(0, 200, 80, .45);
  z-index: 10;
}

/* Dead — consumed, faded */
.lb-block.lb-dead {
  background: #0a0a0a;
  border: 1px solid #111;
  opacity: .35;
  cursor: default;
}

/* Dying — currently being consumed */
.lb-block.lb-dying {
  background: #1a0800;
  border: 1px solid var(--accent-2);
  animation: lb-pulse-dying 1.4s ease-in-out infinite;
  overflow: hidden;
  cursor: pointer;
  z-index: 5;
}
/* Fill representing elapsed fraction of the time unit */
.lb-block.lb-dying::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--progress, 0%);
  background: linear-gradient(to top, var(--accent) 0%, var(--accent-2) 70%, #ffff44 100%);
  pointer-events: none;
  transition: height .1s linear;
}

@keyframes lb-pulse-dying {
  0%,100% { border-color: var(--accent-2); box-shadow: 0 0 4px var(--accent-glow); }
  50%     { border-color: var(--accent);   box-shadow: 0 0 12px var(--accent-glow); }
}

/* Exploding — death animation */
.lb-block.lb-exploding {
  animation: lb-explode .55s ease-out forwards !important;
  z-index: 20;
  pointer-events: none;
}

@keyframes lb-explode {
  0%   { transform: scale(1);    background: var(--accent-2); box-shadow: 0 0 0 rgba(255,200,0,.0); opacity: 1; }
  15%  { transform: scale(2.2);  background: #ffff55;         box-shadow: 0 0 18px rgba(255,220,0,.9); opacity: 1; }
  35%  { transform: scale(1.6) rotate(12deg);  background: var(--accent);   box-shadow: 0 0 24px var(--accent-glow); opacity: .9; }
  60%  { transform: scale(.9)  rotate(-18deg); background: #660000;         box-shadow: 0 0 8px rgba(100,0,0,.5);   opacity: .6; }
  80%  { transform: scale(.5)  rotate(30deg);  background: #220000;         opacity: .3; }
  100% { transform: scale(0)   rotate(60deg);  background: transparent;     opacity: 0; }
}

/* ---- Zoomed (hour/minute/second) blocks ---- */
.lb-grid.lb-zoom {
  --lb-cols: 12;
  --lb-block-size: 38px;
  --lb-gap: 4px;
}
.lb-zoom .lb-block {
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3px;
}
.lb-zoom .lb-block.lb-dying::after {
  border-radius: 4px 4px 0 0;
}
.lb-zoom .lb-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: .6rem;
  color: rgba(255,255,255,.55);
  line-height: 1;
  position: relative;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}
.lb-zoom .lb-dead .lb-label    { color: rgba(255,255,255,.15); }
.lb-zoom .lb-dying .lb-label   { color: rgba(255,255,255,.8); }
.lb-zoom .lb-future:hover      { transform: scale(1.15); }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .lb-grid { --lb-block-size: 8px; --lb-gap: 1px; }
  .lb-grid.lb-zoom { --lb-cols: 10; --lb-block-size: 28px; --lb-gap: 3px; }
}

/* ---- Always-On Stack Panel ---- */
.lb-stack-panel {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: .9rem 1.1rem;
}

.lb-stack-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.lb-stack-label {
  font-family: 'Orbitron', monospace;
  font-size: .58rem;
  color: var(--text-muted);
  letter-spacing: .07em;
  width: 3.6rem;
  flex-shrink: 0;
  padding-top: 1px;
  text-transform: uppercase;
}

.lb-stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-content: flex-start;
}

/* Compact block size for the stack */
.lb-stack-grid .lb-block {
  --lb-block-size: 9px;
  width: var(--lb-block-size);
  height: var(--lb-block-size);
  cursor: default;
}

/* Future + dying blocks in the stack are interactive */
.lb-stack-grid .lb-block.lb-future,
.lb-stack-grid .lb-block.lb-dying {
  cursor: pointer;
}

/* Overflow badge is informational only */
.lb-stack-grid .lb-block.lb-overflow {
  cursor: default;
  font-size: .5rem;
  color: var(--text-dim);
}

.lb-stack-grid .lb-block.lb-future:hover {
  transform: scale(1.6);
  box-shadow: 0 0 6px rgba(0,200,80,.4);
  z-index: 10;
}

/* Mobile: slightly smaller blocks (flex-wrap already set on .lb-stack-grid) */
@media (max-width: 600px) {
  .lb-stack-grid .lb-block {
    --lb-block-size: 8px;
  }
  .lb-stack-label {
    width: 3rem;
    font-size: .53rem;
  }
}

/* ---- Token-Saving Tips Section ---- */
#tips-section { background: var(--bg-alt); }

.tips-intro {
  color: var(--text-dim);
  font-size: .9rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  max-width: 680px;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  transition: border-color .2s, box-shadow .2s;
}

.tip-card:hover {
  border-color: var(--accent-3);
  box-shadow: 0 0 12px rgba(0,204,119,.15);
}

.tip-header {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.tip-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.tip-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-3);
  line-height: 1.3;
}

.tip-text {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.6;
}

.tip-detail {
  font-size: .78rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.tip-impact {
  font-size: .78rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 4px;
  padding: .5rem .75rem;
  line-height: 1.7;
}

.tip-impact strong { color: var(--accent-3); }

.tip-ref {
  font-size: .75rem;
  color: var(--accent-4);
  text-decoration: none;
  margin-top: auto;
}

.tip-ref:hover { text-decoration: underline; }

/* ---- Milestone reference links ---- */
.milestone-ref {
  display: inline-block;
  font-size: .75rem;
  color: var(--accent-4);
  text-decoration: none;
  margin-top: .4rem;
}

.milestone-ref:hover { text-decoration: underline; }
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

footer strong { color: var(--accent-2); }

footer a {
  color: var(--accent-2);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-disclaimer {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
  color: var(--text-muted);
}

.footer-meta-irony {
  margin-top: 0.75rem;
  font-style: italic;
  opacity: 0.75;
}

.footer-meta-irony strong {
  color: var(--accent);
  font-style: normal;
}

.footer-share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.footer-share-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-right: 0.25rem;
}

.footer-share-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.35rem 0.8rem;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.footer-share-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--accent);
}


.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

/* ---- Utilities ---- */
.glow-text { text-shadow: 0 0 10px var(--accent-glow); }

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

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .milestones-grid { grid-template-columns: 1fr; }
  .score-summary { flex-direction: column; }
  th, td { padding: 0.5rem 0.6rem; }
}

/* =============================================================
   NEW FUN FEATURES
   ============================================================= */

/* ---- Equivalences Strip ---- */
.equiv-wrap {
  margin-top: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
}

.equiv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.equiv-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.snarky-toggle {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.3rem 0.8rem;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.snarky-toggle:hover { background: var(--surface-2); border-color: var(--accent-2); }
.snarky-toggle[aria-pressed="true"] {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.equiv-display {
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 1.8rem;
  transition: opacity 0.4s;
}

.equiv-icon { font-size: 1.4rem; flex-shrink: 0; }

.equiv-text {
  font-style: italic;
  color: var(--accent-3);
}

/* ---- Receipt Trigger ---- */
.receipt-trigger-wrap {
  margin-top: 1.25rem;
  text-align: center;
}

.receipt-trigger-btn {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 2rem;
  padding: 0.5rem 1.25rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.receipt-trigger-btn:hover { border-color: var(--accent-4); color: var(--accent-4); }

/* ---- Ticker Section ---- */
#ticker-section { background: var(--bg-alt); }

.ai-ticker-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.ai-ticker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ai-ticker-text {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--accent-2);
  text-shadow: 0 0 8px rgba(255,136,0,0.3);
  flex: 1;
  cursor: pointer;
  transition: color 0.2s;
  min-height: 1.5em;
}
.ai-ticker-text:hover { color: var(--accent); }

.ai-ticker-toggle-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.3rem 0.8rem;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}
.ai-ticker-toggle-btn:hover { background: var(--surface-3); }

.ai-ticker-expanded {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ai-ticker-math {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border-radius: 0.4rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.ai-ticker-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---- Small Button ---- */
.btn-sm {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.35rem 0.9rem;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-sm:hover { background: var(--surface-3); box-shadow: 0 0 6px var(--accent-glow); }

/* ---- Calculator Section ---- */
#calculator-section { background: var(--bg); }

.calc-content {
  margin-top: 1rem;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.calc-field { display: flex; flex-direction: column; gap: 0.5rem; }

.calc-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.calc-label strong { color: var(--accent-2); font-family: 'Orbitron', monospace; }

.calc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 6px rgba(255,136,0,0.4);
  cursor: pointer;
}
.calc-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-2);
  border: none;
  cursor: pointer;
}

.calc-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  max-width: 420px;
}
.calc-select:focus { outline: 2px solid var(--accent-4); }

.calc-results {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.calc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.calc-result-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  text-align: center;
}
.calc-result-box.global {
  grid-column: 1 / -1;
  border-color: var(--accent);
  background: var(--bg-alt);
}

.crb-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.crb-value {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-2);
}
.calc-result-box.global .crb-value { color: var(--accent); }

.crb-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.calc-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-primary {
  background: var(--accent);
  border: none;
  border-radius: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { background: #cc0000; box-shadow: 0 0 12px var(--accent-glow); }

.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--surface-3); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); }

/* ---- Achievements Section ---- */
#achievements-section { background: var(--bg-alt); }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.badge-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 0.75rem;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.2s;
}

.badge-item.earned {
  border-color: var(--accent-2);
  box-shadow: 0 0 12px rgba(255,136,0,0.2);
}

.badge-item.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.badge-item.earned:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255,136,0,0.35);
}

.badge-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.badge-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  word-break: break-word;
}
.badge-item.earned .badge-name { color: var(--accent-2); }

/* ---- Share Doom Panel (floating) ---- */
.share-doom-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.share-doom-btn {
  background: var(--accent);
  border: none;
  border-radius: 2rem;
  padding: 0.65rem 1.4rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,51,51,0.5);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.share-doom-btn:hover {
  background: #cc0000;
  box-shadow: 0 6px 28px rgba(255,51,51,0.7);
  transform: scale(1.04);
}

.share-doom-options {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 8px 32px var(--shadow);
  min-width: 160px;
  animation: pop-in 0.15s ease-out;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(4px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.share-opt-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.5rem 0.9rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.share-opt-btn:hover { background: var(--surface-3); }

.share-opt-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.share-opt-close:hover { color: var(--text); }

/* ---- Receipt Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.receipt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7);
  animation: slide-up 0.2s ease-out;
}

@keyframes slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Thermal-receipt look */
:root[data-theme="dark"] .receipt-body {
  color: #00ff88;
  text-shadow: 0 0 6px rgba(0,255,136,0.3);
}
:root[data-theme="light"] .receipt-body {
  color: #1a3a1a;
}

.receipt-body {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
  background: transparent;
  margin-bottom: 1.25rem;
  padding: 0;
  border: none;
}

.receipt-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 1500;
  background: var(--surface);
  border: 1px solid var(--accent-2);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  box-shadow: 0 8px 32px var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 320px;
  transform: translateY(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-in  { animation: toast-enter 0.3s ease-out; }
.toast-out { animation: toast-leave 0.3s ease-in forwards; }

@keyframes toast-enter {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes toast-leave {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(20px); opacity: 0; }
}

.toast-icon { font-size: 1.8rem; flex-shrink: 0; }

.toast-content { flex: 1; min-width: 0; }

.toast-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 0.2rem;
}

.toast-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0.2rem;
  line-height: 1;
}
.toast-close:hover { color: var(--text); }

/* ---- Responsive additions ---- */
@media (max-width: 600px) {
  .share-doom-panel { bottom: 1rem; right: 1rem; }
  .toast { bottom: 5rem; right: 1rem; max-width: calc(100vw - 2rem); }
  .receipt-card { padding: 1rem; }
  .badges-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .calc-result-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .toast, .toast-in, .toast-out,
  .modal-overlay, .receipt-card,
  .share-doom-options,
  .ai-ticker-text { transition: none; animation: none; }
}

/* =============================================================
   ACCELERATE THE DOOM — Styles
   ============================================================= */

#accelerator-section { background: var(--bg-alt); }

/* ---- Stats Strip ---- */
.accel-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.accel-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  text-align: center;
}

.accel-stat-dp { border-color: var(--accent-2); }

.accel-stat-value {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  font-weight: 700;
  color: var(--accent-3);
  line-height: 1.2;
}

.accel-stat-dp .accel-stat-value { color: var(--accent-2); }

.accel-stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

/* ---- Big Red Button ---- */
.brb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.combo-display {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 900;
  color: var(--accent-2);
  text-shadow: 0 0 14px rgba(255,136,0,0.5);
  letter-spacing: 0.05em;
  min-height: 2.5rem;
  transition: color 0.1s, text-shadow 0.1s;
}

.combo-display.combo-max {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
  animation: combo-max-pulse 0.4s ease-in-out infinite alternate;
}

@keyframes combo-max-pulse {
  from { text-shadow: 0 0 14px var(--accent-glow); }
  to   { text-shadow: 0 0 32px var(--accent-glow); }
}

.big-red-button {
  /* Minimum 96×96 px for accessibility (WCAG 2.5.5) */
  width: clamp(96px, 28vw, 168px);
  height: clamp(96px, 28vw, 168px);
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: radial-gradient(circle at 40% 35%, #3a0000, #1a0000);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  box-shadow:
    0 0 24px var(--accent-glow),
    inset 0 0 20px rgba(255,51,51,0.08);
  transition: box-shadow 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
  /* Prevent touch delay */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.big-red-button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,80,80,0.15), transparent 60%);
  pointer-events: none;
}

.big-red-button:hover {
  box-shadow:
    0 0 40px var(--accent-glow),
    inset 0 0 28px rgba(255,51,51,0.14);
  transform: scale(1.04);
}

.big-red-button:active,
.big-red-button.tapping {
  transform: scale(0.94);
  box-shadow:
    0 0 56px var(--accent-glow),
    inset 0 0 40px rgba(255,51,51,0.25);
}

.big-red-button.combo-max {
  border-color: var(--accent);
  box-shadow:
    0 0 48px var(--accent-glow),
    0 0 80px rgba(255,51,51,0.2),
    inset 0 0 32px rgba(255,51,51,0.18);
  animation: brb-max-glow 0.6s ease-in-out infinite alternate;
}

@keyframes brb-max-glow {
  from { box-shadow: 0 0 40px var(--accent-glow), inset 0 0 28px rgba(255,51,51,0.14); }
  to   { box-shadow: 0 0 72px var(--accent-glow), 0 0 100px rgba(255,51,51,0.25), inset 0 0 40px rgba(255,51,51,0.22); }
}

.brb-icon {
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  line-height: 1;
  pointer-events: none;
}

.brb-label {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.48rem, 1.5vw, 0.65rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.75);
  pointer-events: none;
  text-align: center;
  padding: 0 0.4rem;
  line-height: 1.2;
}

.brb-rate {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-height: 1rem;
  letter-spacing: 0.06em;
}

/* ---- Milestone Race Bar ---- */
.milestone-race-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.5rem;
}

.milestone-race-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.milestone-race-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.milestone-race-label strong {
  color: var(--accent-2);
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
}

.milestone-race-pct {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--accent-3);
  font-weight: 700;
}

.milestone-race-fill {
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  transition: width 0.3s ease;
}

/* Flash when player personally triggers a milestone */
.milestone-race-wrap.milestone-triggered {
  animation: race-milestone-flash 0.6s ease-out;
}

@keyframes race-milestone-flash {
  0%,100% { border-color: var(--border); }
  25%,75%  { border-color: var(--accent); box-shadow: 0 0 16px var(--accent-glow); }
}

/* ---- Section Sub-Titles ---- */
.accel-section-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 1.25rem 0 0.75rem;
}

/* ---- Challenge Row ---- */
.challenge-row {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0.5rem;
}

.challenge-row::-webkit-scrollbar { height: 4px; }
.challenge-row::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 2px; }
.challenge-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.challenge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  min-width: 180px;
  max-width: 220px;
  flex-shrink: 0;
  scroll-snap-align: start;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.challenge-card.completed {
  border-color: var(--accent-3);
  box-shadow: 0 0 10px rgba(0,204,119,0.2);
}

.challenge-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
  display: block;
}

.challenge-card-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
}

.challenge-card-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.challenge-card-reward {
  font-size: 0.65rem;
  color: var(--accent-2);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
}

.challenge-card-progress {
  margin-top: 0.5rem;
}

.challenge-card-pct {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 0.2rem;
}

.challenge-progress-fill {
  background: linear-gradient(90deg, var(--accent-4), var(--accent-3));
  transition: width 0.3s ease;
}

.challenge-card.completed .challenge-progress-fill {
  background: var(--accent-3);
}

.challenge-checkmark {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  font-size: 1rem;
}

/* ---- Upgrade Shop ---- */
.upgrade-shop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.upgrade-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, opacity 0.2s;
  position: relative;
}

.upgrade-card:hover:not(:disabled):not(.unaffordable) {
  border-color: var(--accent-2);
  box-shadow: 0 0 12px rgba(255,136,0,0.2);
  transform: translateY(-2px);
}

.upgrade-card.unaffordable {
  opacity: 0.4;
  pointer-events: none;
}

.upgrade-card.owned {
  border-color: var(--accent-3);
  background: var(--bg-alt);
  cursor: default;
}

.upgrade-card-icon { font-size: 1.8rem; display: block; margin-bottom: 0.4rem; }

.upgrade-card-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
}

.upgrade-card.owned .upgrade-card-name { color: var(--accent-3); }

.upgrade-card-flavour {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.upgrade-card-cost {
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-2);
}

.upgrade-card.owned .upgrade-card-cost {
  color: var(--accent-3);
}

.upgrade-card-mult {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ---- Footer row ---- */
.accel-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.best-score-row {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.best-score-row .new-record {
  color: var(--accent-2);
  animation: new-record-flash 0.5s ease-out 3;
}

@keyframes new-record-flash {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ---- Milestone card "Accelerated by You" flash ---- */
.milestone-card.player-triggered {
  animation: player-trigger-flash 0.6s ease-out;
}

@keyframes player-trigger-flash {
  0%,100% { box-shadow: 0 0 20px var(--accent-glow); }
  25%,75%  { box-shadow: 0 0 50px var(--accent-glow), 0 0 80px rgba(255,51,51,0.3); }
}

/* ---- Company Stage Banner ---- */
.company-stage-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.company-stage-icon {
  font-size: 2rem;
  line-height: 1;
}

.company-stage-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.company-stage-name {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  font-weight: 700;
  color: var(--accent-3);
  letter-spacing: 0.04em;
}

.passive-rate-wrap {
  margin-left: auto;
  text-align: right;
}

.passive-rate-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.passive-rate-value {
  font-family: 'Orbitron', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-2);
}

/* ---- Workforce Panel ---- */
.workforce-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.worker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, opacity 0.2s;
  position: relative;
}

.worker-card:hover:not(.fired):not(.unaffordable) {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-2px);
}

.worker-card.unaffordable {
  opacity: 0.4;
  pointer-events: none;
}

.worker-card.fired {
  border-color: var(--accent-3);
  background: var(--bg-alt);
  cursor: default;
  opacity: 0.7;
}

.worker-card-icon { font-size: 1.8rem; display: block; margin-bottom: 0.4rem; }

.worker-card-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
}

.worker-card.fired .worker-card-name { color: var(--accent-3); }

.worker-card-flavour {
  font-size: 0.62rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.worker-card-tps {
  font-size: 0.65rem;
  color: var(--accent-3);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.worker-card-cost {
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.worker-card.fired .worker-card-cost {
  color: var(--accent-3);
}

/* ---- AI Agent Shop ---- */
.agent-shop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, opacity 0.2s;
  position: relative;
}

.agent-card:hover:not(.unaffordable) {
  border-color: var(--accent-2);
  box-shadow: 0 0 12px rgba(255,136,0,0.2);
  transform: translateY(-2px);
}

.agent-card.unaffordable {
  opacity: 0.4;
  pointer-events: none;
}

.agent-card-icon { font-size: 1.8rem; display: block; margin-bottom: 0.4rem; }

.agent-card-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
}

.agent-card-flavour {
  font-size: 0.62rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.agent-card-tps {
  font-size: 0.65rem;
  color: var(--accent-3);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.agent-card-cost {
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-2);
}

.agent-card-owned {
  font-size: 0.65rem;
  color: var(--accent-3);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .upgrade-shop { grid-template-columns: 1fr 1fr; }
  .accel-stats-strip { grid-template-columns: 1fr 1fr; }
  .workforce-panel { grid-template-columns: 1fr 1fr; }
  .agent-shop { grid-template-columns: 1fr 1fr; }
}

/* ---- Reduced motion (accelerator additions) ---- */
@media (prefers-reduced-motion: reduce) {
  .big-red-button,
  .big-red-button:hover,
  .big-red-button:active,
  .big-red-button.tapping,
  .big-red-button.combo-max,
  .combo-display.combo-max,
  .milestone-race-fill,
  .challenge-progress-fill,
  .upgrade-card,
  .worker-card,
  .agent-card { transition: none; animation: none; }
}

/* =============================================================
   ENGAGEMENT FEATURES — Phase 2
   Social Ripple · Witness History Log · Milestone Alert
   ============================================================= */

/* ---- Social Ripple / Presence Strip ---- */

.presence-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  flex-shrink: 0;
  animation: presence-pulse 2s ease-in-out infinite;
}

@keyframes presence-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.presence-count {
  font-family: 'Orbitron', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-3);
}

.presence-label {
  color: var(--text-dim);
}

.presence-reaction {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  transition: opacity 0.5s ease;
  flex-basis: 100%;
  padding-left: 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
  .presence-dot { animation: none; }
  .presence-reaction { transition: none; }
}

/* ---- Witness History Log ---- */

#event-log-section { background: var(--bg-alt); }

.event-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  max-height: 280px;
  overflow-y: auto;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--text-dim);
  scroll-behavior: smooth;
}

.event-log:empty::before {
  content: 'Waiting for first entry…';
  display: block;
  color: var(--text-muted);
  font-style: italic;
}

.event-log-entry {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.18rem 0;
  border-bottom: 1px solid var(--border);
  animation: log-entry-in 0.3s ease-out;
}

.event-log-entry:last-child { border-bottom: none; }

@keyframes log-entry-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.log-time {
  color: var(--accent-3);
  flex-shrink: 0;
  min-width: 5.5rem;
}

.log-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
}

.log-text { color: var(--text); flex: 1; min-width: 0; }

.event-log-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
  .event-log-entry { animation: none; }
  .event-log { scroll-behavior: auto; }
}

/* ---- Milestone Countdown Alert Banner ---- */

.milestone-alert-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1800;
  background: linear-gradient(135deg, #2a0505, #1a0000);
  border-bottom: 2px solid var(--accent);
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: 0 2px 24px rgba(255, 51, 51, 0.4);
  animation: alert-slide-down 0.35s ease-out;
}

:root[data-theme="light"] .milestone-alert-banner {
  background: linear-gradient(135deg, #5a0000, #3a0000);
}

@keyframes alert-slide-down {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

.milestone-alert-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.milestone-alert-msg {
  font-size: 0.85rem;
  color: #ffcccc;
  flex: 1;
  min-width: 0;
  text-align: center;
}

.milestone-alert-countdown {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent);
  min-width: 3.5rem;
  text-align: right;
  animation: countdown-tick 1s ease-in-out infinite alternate;
}

@keyframes countdown-tick {
  from { text-shadow: 0 0 8px  var(--accent-glow); }
  to   { text-shadow: 0 0 22px var(--accent-glow); }
}

@media (prefers-reduced-motion: reduce) {
  .milestone-alert-banner { animation: none; }
  .milestone-alert-countdown { animation: none; }
}

/* ---- Milestone Crossing Flash Overlay ---- */

.milestone-flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(255, 20, 20, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: milestone-bg-flash 1.4s ease-out forwards;
}

@keyframes milestone-bg-flash {
  0%   { background: rgba(255, 51, 51, 0.32); }
  35%  { background: rgba(255, 51, 51, 0.18); }
  100% { background: rgba(255, 51, 51, 0.08); }
}

.milestone-flash-content {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 1rem;
  padding: 2rem 2.5rem;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow:
    0 0 60px var(--accent-glow),
    0 20px 60px rgba(0, 0, 0, 0.65);
  animation: flash-card-in 0.3s ease-out;
}

@keyframes flash-card-in {
  from { transform: scale(0.82); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.milestone-flash-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.milestone-flash-name {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1rem, 3vw, 1.55rem);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

.milestone-flash-desc {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.milestone-flash-close {
  background: var(--accent);
  border: none;
  border-radius: 0.4rem;
  padding: 0.55rem 1.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s;
}

.milestone-flash-close:hover { background: #cc0000; }

@media (max-width: 600px) {
  .milestone-flash-content { padding: 1.5rem 1.25rem; }
  .milestone-alert-msg { font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .milestone-flash-overlay { animation: none; background: rgba(255, 51, 51, 0.1); }
  .milestone-flash-content { animation: none; }
}

/* =============================================================
   SCARY & SATIRICAL FEATURES — PRDs 1–7
   ============================================================= */

/* ── PRD 1: Doomsday Clock Strip ──────────────────────────── */

.doomsday-strip {
  background: #0d0000;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.65rem 1.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 850;
  box-shadow: 0 2px 20px rgba(255,51,51,0.25);
}

:root[data-theme="light"] .doomsday-strip {
  background: #1a0000;
}

.doomsday-clock-wrap {
  flex-shrink: 0;
}

.doom-clock-svg {
  width: 56px;
  height: 56px;
  overflow: visible;
}

.doom-clock-face {
  fill: #0d0000;
  stroke: var(--accent);
  stroke-width: 2;
}

.doom-tick {
  stroke: rgba(255, 51, 51, 0.5);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.doom-tick-major {
  stroke: var(--accent);
  stroke-width: 2.5;
}

.doom-tick-sm {
  stroke-width: 1;
}

.doom-tick-warn {
  stroke: var(--accent);
  stroke-width: 2;
}

.doom-clock-hand {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px var(--accent));
  transition: none;
}

.doom-clock-dot {
  fill: #fff;
  filter: drop-shadow(0 0 3px var(--accent));
}

.doomsday-text-wrap {
  flex: 1;
  min-width: 160px;
}

.doomsday-time {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.75rem, 2.5vw, 1.1rem);
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
  letter-spacing: 0.08em;
}

.doomsday-sub {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  margin-top: 0.2rem;
  letter-spacing: 0.04em;
}

.doomsday-bar-wrap {
  flex: 1;
  min-width: 120px;
  max-width: 260px;
}

.doomsday-bar-track {
  height: 8px;
  background: rgba(255,51,51,0.12);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,51,51,0.25);
}

.doomsday-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #330000, var(--accent));
  border-radius: 4px;
  transition: width 1s linear;
  box-shadow: 0 0 6px var(--accent-glow);
}

.doomsday-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.58rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
  text-transform: uppercase;
}

/* ── PRD 1: Emergency Broadcast Overlay ───────────────────── */

.emergency-broadcast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  background: #8b0000;
  border-bottom: 3px solid #ff0000;
  padding: 0.75rem 1.5rem;
  animation: eb-slidein 0.3s ease-out, eb-pulse 0.6s ease-in-out infinite alternate;
  box-shadow: 0 4px 32px rgba(255,0,0,0.7);
}

@keyframes eb-slidein {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes eb-pulse {
  from { background: #8b0000; }
  to   { background: #aa0000; }
}

.eb-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.eb-icon {
  font-size: 1.3rem;
  animation: eb-icon-flash 0.5s step-start infinite;
  flex-shrink: 0;
}

@keyframes eb-icon-flash {
  50% { opacity: 0; }
}

.eb-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: #ff0000;
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.eb-msg {
  font-family: 'Orbitron', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}

.eb-sign-off {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.7);
  font-style: italic;
  flex-basis: 100%;
  padding-left: 2.8rem;
}

/* ── PRD 4: Your Tab (Running) ────────────────────────────── */

.session-tab-strip {
  background: var(--surface);
  border: 1px solid rgba(255,51,51,0.3);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
}

.session-tab-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,51,51,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.session-tab-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.session-tab-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.session-tab-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

.session-tab-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
}

.session-tab-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.sti-icon { font-size: 1.1rem; flex-shrink: 0; }

.sti-val {
  font-family: 'Orbitron', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-2);
  min-width: 3.5rem;
  text-align: right;
  flex-shrink: 0;
}

.sti-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── PRD 2: Apology Generator ─────────────────────────────── */

#apology-section { background: var(--bg); }

.apology-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-2);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-top: 1rem;
  position: relative;
  min-height: 6rem;
}

.apology-card::before {
  content: '❝';
  font-size: 3rem;
  color: rgba(255,136,0,0.12);
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
}

.apology-quote {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
  font-style: italic;
  padding-left: 1.5rem;
  animation: apology-fade 0.5s ease-out;
}

@keyframes apology-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.apology-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.apology-signoff {
  font-size: 0.78rem;
  color: var(--accent-2);
  font-style: normal;
}

.apology-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
}

.apology-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ── PRD 3: Wanted Poster ──────────────────────────────────── */

.wanted-poster {
  background: #1a0f00;
  border: 3px solid #8b5a00;
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 0 20px rgba(139,90,0,0.3);
}

.wanted-poster::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 4px,
    rgba(0,0,0,0.04) 4px, rgba(0,0,0,0.04) 5px
  );
  pointer-events: none;
}

:root[data-theme="light"] .wanted-poster {
  background: #f5e6c8;
  border-color: #8b5a00;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.1);
}

.wanted-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  color: #cc3300;
  letter-spacing: 0.15em;
  text-shadow: 3px 3px 0 #660000;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.wanted-subtitle {
  font-size: 0.75rem;
  color: #cc9900;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.wanted-divider {
  height: 3px;
  background: linear-gradient(90deg, transparent, #8b5a00, transparent);
  margin: 0.75rem 0;
}

.wanted-charges {
  text-align: left;
  margin: 1rem 0;
}

.wanted-charge {
  font-size: 0.8rem;
  color: #d4a843;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(139,90,0,0.3);
  line-height: 1.5;
}

:root[data-theme="light"] .wanted-charge {
  color: #5a3500;
}

.wanted-charge strong {
  color: #ff6600;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
}

:root[data-theme="light"] .wanted-charge strong {
  color: #cc3300;
}

.wanted-bail {
  font-size: 0.78rem;
  color: #ff9900;
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(139,90,0,0.2);
  border: 1px solid rgba(139,90,0,0.4);
  border-radius: 0.3rem;
}

:root[data-theme="light"] .wanted-bail {
  color: #7a3d00;
  background: rgba(139,90,0,0.1);
}

.wanted-global {
  font-size: 0.68rem;
  color: rgba(204,153,0,0.6);
  margin-top: 0.75rem;
  font-style: italic;
}

:root[data-theme="light"] .wanted-global {
  color: rgba(90,53,0,0.6);
}

/* ── PRD 5: Prompt Hall of Shame ──────────────────────────── */

#shame-section { background: var(--bg-alt); }

.shame-feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 1rem;
  font-family: 'Share Tech Mono', monospace;
  scroll-behavior: smooth;
}

.shame-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  animation: shame-slide 0.4s ease-out;
  font-size: 0.8rem;
}

.shame-entry:last-child { border-bottom: none; }

@keyframes shame-slide {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.shame-entry.user-submitted {
  border-left: 3px solid var(--accent-2);
  background: var(--surface-2);
}

.shame-entry-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.shame-entry-content { flex: 1; min-width: 0; }

.shame-entry-text {
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.shame-entry-cost {
  font-size: 0.65rem;
  color: var(--accent);
  margin-top: 0.2rem;
  font-family: 'Orbitron', monospace;
}

.shame-entry-user-tag {
  font-size: 0.6rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

.shame-submit-wrap {
  margin-top: 1.25rem;
}

.shame-submit-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.shame-input-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.shame-input {
  flex: 1;
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.55rem 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.shame-input:focus { border-color: var(--accent-2); }
.shame-input::placeholder { color: var(--text-muted); }

/* ── PRD 6: Villain Leaderboard ───────────────────────────── */

.villain-leaderboard-wrap {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.villain-rank-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1.1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.villain-rank-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: 0.06em;
}

.villain-rank-score {
  font-family: 'Orbitron', monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.villain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.villain-table th {
  font-family: 'Orbitron', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: var(--surface-2);
}

.villain-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.villain-table tr:last-child td { border-bottom: none; }

.villain-table .villain-row-you {
  background: rgba(255,51,51,0.06);
}

.villain-table .villain-row-you td {
  color: var(--accent-2);
  font-weight: 700;
}

.villain-table .villain-pos {
  width: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
}

.villain-table .villain-name { font-weight: 700; }

.villain-table .villain-score {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  color: var(--accent-2);
}

.villain-table .villain-rank-cell {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
}

.villain-congratulations {
  background: var(--accent);
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  text-align: center;
  animation: villain-congrats-flash 0.4s ease-out;
}

@keyframes villain-congrats-flash {
  0%   { transform: scale(1);    box-shadow: 0 0 0 rgba(255,51,51,0); }
  40%  { transform: scale(1.03); box-shadow: 0 0 24px rgba(255,51,51,0.6); }
  100% { transform: scale(1);    box-shadow: 0 0 8px rgba(255,51,51,0.3); }
}

/* ── PRD 7: The Intervention ──────────────────────────────── */

.intervention-overlay {
  position: fixed;
  inset: 0;
  z-index: 3500;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in 0.25s ease-out;
}

.intervention-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 64px var(--shadow);
  animation: slide-up 0.25s ease-out;
}

.intervention-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.intervention-avatar {
  font-size: 1.6rem;
}

.intervention-sender {
  font-family: 'Orbitron', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-3);
}

.intervention-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

.intervention-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0 1rem 1rem 1rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}

.intervention-greeting {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.intervention-msg {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 0.6rem;
}

.intervention-coda {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.intervention-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.intervention-btn-stay {
  flex: 1;
  background: var(--accent-3);
  border: none;
  border-radius: 0.4rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s;
}

.intervention-btn-stay:hover { background: #00a35e; }

.intervention-btn-leave {
  flex: 1;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.intervention-btn-leave:hover { background: var(--surface-2); color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
  .doomsday-strip { padding: 0.5rem 1rem; gap: 0.75rem; }
  .doomsday-bar-wrap { display: none; }
  .doom-clock-svg { width: 44px; height: 44px; }
  .session-tab-items { grid-template-columns: 1fr 1fr; }
  .villain-table .villain-rank-cell { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .emergency-broadcast { animation: none; }
  .eb-icon { animation: none; }
  .apology-quote { animation: none; }
  .shame-entry { animation: none; }
  .villain-congratulations { animation: none; }
  .doomsday-bar-fill { transition: none; }
  .doom-clock-hand { transition: none; }
  .intervention-overlay, .intervention-card { animation: none; }
}

.eb-dismiss {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 1.75rem;
  height: 1.75rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eb-dismiss:hover { background: rgba(255,255,255,0.15); }

/* ---- Grim Reaper ---- */
.grim-reaper {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 10;
  opacity: 0.22;
  transform: translateX(-22px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.grim-reaper:hover {
  opacity: 0.55;
  transform: translateX(0);
}

.grim-reaper svg {
  display: block;
  width: 80px;
  height: auto;
  animation: reaper-float 5s ease-in-out infinite;
}

@keyframes reaper-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.reaper-eye-inner {
  filter: drop-shadow(0 0 4px #ff3333);
  animation: reaper-eye-pulse 3s ease-in-out infinite;
}

@keyframes reaper-eye-pulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

@media (max-width: 480px) {
  .grim-reaper svg { width: 55px; }
}

@media (prefers-reduced-motion: reduce) {
  .grim-reaper svg,
  .reaper-eye-inner { animation: none; }
  .grim-reaper { transition: none; }
}
