:root {
  --bg: #f2efe4;
  --bg-strong: #e7dfc9;
  --panel: rgba(255, 252, 244, 0.92);
  --panel-strong: #fff8e8;
  --text: #1d2c27;
  --muted: #54645f;
  --accent: #0f766e;
  --accent-strong: #0c5d57;
  --accent-soft: rgba(15, 118, 110, 0.14);
  --warn: #9a3412;
  --warn-soft: rgba(154, 52, 18, 0.12);
  --success: #166534;
  --success-soft: rgba(22, 101, 52, 0.13);
  --border: rgba(29, 44, 39, 0.11);
  --shadow: 0 22px 60px rgba(30, 35, 30, 0.12);
  --mono: "IBM Plex Mono", monospace;
  --sans: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(12, 93, 87, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(180, 83, 9, 0.14), transparent 30%),
    linear-gradient(180deg, #f6f2e7 0%, #ebe3d1 100%);
}

button {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr minmax(260px, 360px);
  gap: 20px;
  align-items: stretch;
}

.hero-copy,
.status-card,
.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 28px;
  border-radius: 28px;
}

.eyebrow,
.status-label,
.share-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(1.75rem, 3vw, 3.05rem);
  line-height: 0.9;
  max-width: 22ch;
}

.lede {
  margin: 0;
  max-width: 72ch;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--muted);
}

.status-card {
  padding: 24px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.status-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
}

.status-pill--pending {
  background: rgba(29, 44, 39, 0.08);
}

.status-pill--online {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill--offline {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.95fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.stage,
.sidebar {
  display: grid;
  gap: 20px;
  align-content: start;
}

.panel {
  padding: 24px;
  border-radius: 24px;
}

.stage-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 45%),
    linear-gradient(180deg, var(--panel-strong), rgba(255, 250, 239, 0.95));
}

.cta-row,
.share-card,
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel h3 {
  margin: 6px 0 0;
  font-size: 1.4rem;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.session-view {
  display: grid;
  gap: 18px;
}

.display-card {
  border-radius: 28px;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 245, 224, 0.9));
  border: 1px solid rgba(29, 44, 39, 0.08);
}

.display-time {
  margin-top: 10px;
  font-size: clamp(3rem, 10vw, 6.2rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.display-subtext,
.session-meta,
.runtime-message {
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
}

.install-card {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(29, 44, 39, 0.04);
  border: 1px dashed rgba(29, 44, 39, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.install-copy h4 {
  margin: 8px 0 0;
  font-size: 1.1rem;
}

.install-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(29, 44, 39, 0.05);
  border: 1px solid rgba(29, 44, 39, 0.08);
}

.install-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.install-note p + p {
  margin-top: 8px;
}

.install-actions {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.install-steps {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.primary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 18px;
  text-decoration: none;
  background: var(--accent);
  color: #f6f9f7;
  box-shadow: 0 14px 30px rgba(12, 93, 87, 0.22);
  white-space: nowrap;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.primary-link-button:hover {
  transform: translateY(-1px);
}

a.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.result-banner {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--success-soft);
  color: var(--success);
  line-height: 1.5;
}

.result-banner--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
  border: 0;
  padding: 14px 18px;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.primary-button {
  background: var(--accent);
  color: #f6f9f7;
  box-shadow: 0 14px 30px rgba(12, 93, 87, 0.22);
}

.secondary-button {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
}

.danger-button {
  background: #b42318;
  color: #fff7f5;
  box-shadow: 0 14px 30px rgba(180, 35, 24, 0.2);
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(29, 44, 39, 0.14);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.share-card {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(29, 44, 39, 0.04);
  border: 1px dashed rgba(29, 44, 39, 0.12);
}

.sidebar-reset {
  width: 100%;
  color: var(--muted);
  background: rgba(29, 44, 39, 0.03);
  border-color: rgba(29, 44, 39, 0.1);
}

.sidebar-reset:hover {
  color: var(--text);
  background: rgba(29, 44, 39, 0.08);
  border-color: rgba(29, 44, 39, 0.16);
  transform: translateY(-1px);
}

.share-preview {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.steps {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0 0;
}

.stats-grid div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(29, 44, 39, 0.04);
}

.stats-grid dt {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stats-grid dd {
  margin: 10px 0 0;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.history-caption {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.history-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(29, 44, 39, 0.04);
}

.history-rank {
  font-family: var(--mono);
  color: var(--muted);
}

.history-main {
  min-width: 0;
}

.history-time {
  display: block;
  font-size: 1.1rem;
}

.history-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.history-empty {
  padding: 22px 18px;
  border-radius: 16px;
  background: rgba(29, 44, 39, 0.04);
  color: var(--muted);
  line-height: 1.55;
}

.history-badge--dnf {
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
}

.rules-note {
  position: relative;
}

.rules-note summary {
  list-style: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(29, 44, 39, 0.14);
  background: rgba(29, 44, 39, 0.04);
  font-family: var(--mono);
}

.rules-note summary::-webkit-details-marker {
  display: none;
}

.rules-card {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 4;
  width: min(360px, calc(100vw - 90px));
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 44, 39, 0.12);
  background: rgba(255, 252, 244, 0.98);
  box-shadow: 0 18px 42px rgba(29, 44, 39, 0.16);
}

.rules-card p {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
}

.rules-card p + p {
  margin-top: 8px;
}

@media (max-width: 1020px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 1280px);
    padding-top: 18px;
  }

  .hero-copy,
  .panel,
  .status-card {
    padding: 20px;
    border-radius: 22px;
  }

  .cta-row,
  .share-card,
  .install-card,
  .history-head,
  .stat-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .rules-card {
    position: static;
    width: 100%;
    margin-top: 10px;
  }
}
