:root {
  --bg: #f4efe4;
  --panel: rgba(255, 252, 246, 0.92);
  --ink: #1f1b16;
  --muted: #65594d;
  --line: rgba(31, 27, 22, 0.12);
  --accent: #b84f2c;
  --accent-soft: #f8d4b3;
  --shadow: 0 22px 60px rgba(74, 44, 24, 0.12);
  --green: #3a7d44;
  --gold: #c9922a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(184, 79, 44, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(83, 121, 91, 0.18), transparent 26%),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 100%);
  background-attachment: fixed;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.hero {
  padding: 16px 4px 28px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.3rem, 5vw, 4.3rem);
  line-height: 0.95;
}

.hero-copy,
.panel p,
label,
dd,
span,
code,
pre,
.text-link {
  color: var(--muted);
}

.layout-grid,
.detail-layout {
  display: grid;
  gap: 18px;
}

.landing-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.layout-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.teams-panel {
  grid-column: 1 / -1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.accent-panel {
  position: relative;
  overflow: hidden;
}

.accent-panel::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: 0.55;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #1f1b16;
  color: #fff7ef;
  font-size: 0.8rem;
}

.badge.subtle {
  background: rgba(31, 27, 22, 0.08);
  color: var(--ink);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

input,
button,
.button-link {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(31, 27, 22, 0.12);
  font: inherit;
}

input {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.88);
}

button,
.button-link {
  padding: 13px 16px;
  cursor: pointer;
  background: linear-gradient(135deg, #1f1b16, #69422c);
  color: #fff8f0;
  text-align: center;
  text-decoration: none;
}

.metric-row,
.detail-grid {
  display: grid;
  gap: 14px;
}

.metric-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-row strong,
.detail-grid dt {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.team-list {
  display: grid;
  gap: 14px;
}

.team-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  color: inherit;
}

.team-card:hover,
button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

.team-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

dt {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

dd {
  margin: 0;
}

.log-panel pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(31, 27, 22, 0.05);
  border: 1px solid var(--line);
}

.text-link {
  text-decoration: none;
}

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

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

  .team-card {
    flex-direction: column;
  }

  .team-meta {
    justify-items: start;
  }
}

/* Scoreboard */
.scoreboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}

.scoreboard-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}

.scoreboard-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}

.scoreboard-table tbody tr:hover {
  background: rgba(184, 79, 44, 0.04);
}

.scoreboard-table td {
  padding: 14px;
  vertical-align: middle;
}

.scoreboard-table tbody tr:first-child td:first-child::before { content: "🥇 "; }
.scoreboard-table tbody tr:nth-child(2) td:first-child::before { content: "🥈 "; }
.scoreboard-table tbody tr:nth-child(3) td:first-child::before { content: "🥉 "; }

.score-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent);
}

/* Hero pulse animation */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.eyebrow {
  display: flex;
  align-items: center;
}

.badge-ok {
  background: #3a7d44;
}

.error-banner {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(184, 79, 44, 0.12);
  border: 1px solid rgba(184, 79, 44, 0.3);
  color: var(--accent);
  margin-bottom: 14px;
}

/* Landing hero */
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 48px 0 64px;
  max-width: 680px;
}

.landing-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 24px;
  font-family: Georgia, serif;
}

.landing-title {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.05;
  margin: 0 0 28px;
  color: var(--ink);
}

.landing-sub {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 36px;
}

.landing-cta {
  gap: 14px;
}

.landing-btn {
  width: auto;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 1rem;
}

.landing-btn-ghost {
  width: auto;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 1rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
}

.landing-btn-ghost:hover {
  background: rgba(31,27,22,0.05);
  transform: translateY(-1px);
}

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--line); color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.badge.warn { background: #fff3cd; color: #856404; }
.btn-small { padding: 4px 10px; font-size: 0.8rem; border-radius: 6px; background: var(--ink); color: #fff; border: none; cursor: pointer; }
.btn-small:hover { opacity: 0.8; }
