:root {
  --pit-bg: #06070a;
  --pit-panel: rgba(17, 20, 28, 0.84);
  --pit-panel-strong: rgba(20, 24, 34, 0.94);
  --pit-line: rgba(157, 170, 190, 0.16);
  --pit-text: #f5f7fb;
  --pit-muted: #a0a9b9;
  --pit-amber: #ff9e4a;
  --pit-cyan: #5dd8ff;
  --pit-danger: #ff5b6e;
  --pit-success: #9bff9d;
  --pit-shadow: 0 22px 44px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--pit-text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(93, 216, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 158, 74, 0.18), transparent 26%),
    radial-gradient(circle at 50% 120%, rgba(255, 91, 110, 0.08), transparent 30%),
    linear-gradient(180deg, #040508 0%, #090b11 58%, #05060a 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 72%);
}

.pit-page {
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
  position: relative;
  z-index: 1;
}

.pit-topbar,
.pit-intro,
.pit-panel,
.pit-arena-panel {
  border: 1px solid var(--pit-line);
  box-shadow: var(--pit-shadow);
  backdrop-filter: blur(14px);
}

.pit-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(12, 15, 22, 0.8);
  position: sticky;
  top: 10px;
  z-index: 10;
}

.pit-home,
.pit-coffee,
.pit-account-menu summary,
.pit-account-panel a,
.pit-account-panel button,
.flip-button,
#startButton,
#demoButton,
.mobile-flip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pit-home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--pit-text);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pit-home img {
  width: 42px;
  height: 42px;
  padding: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 158, 74, 0.18), rgba(93, 216, 255, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pit-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pit-account-menu {
  position: relative;
}

.pit-account-menu summary,
.pit-coffee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--pit-text);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.pit-account-menu summary::-webkit-details-marker {
  display: none;
}

.pit-account-menu[open] summary,
.pit-home:hover,
.pit-coffee:hover,
.pit-account-panel a:hover,
.pit-account-panel button:hover,
.flip-button:hover,
#startButton:hover,
#demoButton:hover,
.mobile-flip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

.pit-coffee {
  background: linear-gradient(135deg, rgba(255, 158, 74, 0.96), rgba(255, 122, 89, 0.9));
  color: #14161d;
}

.pit-account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 240px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--pit-line);
  background: rgba(12, 15, 22, 0.96);
  box-shadow: var(--pit-shadow);
}

.pit-account-panel p {
  margin: 0 0 12px;
  color: var(--pit-muted);
  line-height: 1.45;
}

.pit-account-panel a,
.pit-account-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--pit-text);
  font: inherit;
  cursor: pointer;
}

.pit-shell {
  padding-top: 18px;
}

.pit-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 78% 15%, rgba(93, 216, 255, 0.12), transparent 20%),
    radial-gradient(circle at 30% 0%, rgba(255, 158, 74, 0.14), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--pit-panel-strong);
}

.eyebrow,
.panel-kicker,
.overlay-kicker {
  margin: 0 0 10px;
  color: #ffd8b0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pit-intro h1,
.pit-grid h2,
.overlay-card h3 {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  letter-spacing: 0.02em;
}

.pit-intro h1 {
  font-size: clamp(2.5rem, 7vw, 5.2rem);
  line-height: 0.92;
}

.intro-copy {
  max-width: 60ch;
  margin: 14px 0 0;
  color: #d9dfeb;
  font-size: 1.05rem;
  line-height: 1.65;
}

.intro-badges {
  display: grid;
  gap: 12px;
}

.intro-badges article,
.metric-card,
.field-status,
.event-feed,
.archive-panel,
.tips-panel,
.contract-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
}

.intro-badges article {
  min-height: 112px;
  padding: 16px;
}

.intro-badges strong,
.metric-card strong,
.contract-card strong,
.archive-row strong,
.event-item strong {
  display: block;
}

.intro-badges strong {
  margin-bottom: 8px;
  font-size: 1rem;
}

.intro-badges span {
  color: var(--pit-muted);
  line-height: 1.55;
}

.pit-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 18px;
  margin-top: 18px;
}

.pit-panel,
.pit-arena-panel {
  background: var(--pit-panel);
  border-radius: 28px;
  padding: 18px;
}

.pit-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2,
.arena-header h2 {
  font-size: 1.55rem;
}

.panel-header--compact h2 {
  font-size: 1.2rem;
}

.panel-header p,
.arena-header p {
  margin-bottom: 6px;
}

.metric-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
  min-height: 112px;
}

.metric-card span,
.status-row span,
.archive-row span,
.event-item span {
  color: var(--pit-muted);
  font-size: 0.85rem;
}

.metric-card strong {
  margin-top: 16px;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
}

.field-status,
.event-feed,
.archive-panel,
.tips-panel {
  padding: 16px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.status-row strong {
  font-size: 0.96rem;
}

.polarity-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 700;
}

.polarity-pill--amber {
  color: #ffd8b0;
  background: rgba(255, 158, 74, 0.12);
  box-shadow: inset 0 0 22px rgba(255, 158, 74, 0.08);
}

.polarity-pill--cyan {
  color: #c4f3ff;
  background: rgba(93, 216, 255, 0.12);
  box-shadow: inset 0 0 22px rgba(93, 216, 255, 0.08);
}

.pill-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

.flip-button,
#startButton,
#demoButton,
.mobile-flip {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--pit-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.flip-button {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(255, 158, 74, 0.22), rgba(93, 216, 255, 0.22));
}

.touch-note {
  margin: 12px 0 0;
  color: var(--pit-muted);
  line-height: 1.5;
}

.event-list,
.archive-list,
.contract-list {
  display: grid;
  gap: 10px;
}

.event-item,
.archive-row,
.contract-card {
  padding: 14px;
}

.event-item {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.event-item strong {
  margin-bottom: 6px;
}

.event-item--amber strong {
  color: #ffd4ac;
}

.event-item--cyan strong {
  color: #c1f2ff;
}

.event-item--danger strong {
  color: #ffb3bd;
}

.arena-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.arena-header-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
  color: var(--pit-muted);
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
}

.arena-stage {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.025), transparent 45%),
    linear-gradient(135deg, rgba(12, 14, 20, 0.96), rgba(4, 5, 8, 0.98));
}

.arena-stage::before,
.arena-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.arena-stage::before {
  background:
    radial-gradient(circle at center, transparent 54%, rgba(255, 94, 0, 0.08) 88%, rgba(255, 94, 0, 0.18) 100%);
  mix-blend-mode: screen;
}

.arena-stage::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.24;
}

#pitCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  touch-action: none;
}

.arena-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 6, 10, 0.3);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.arena-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-card {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(93, 216, 255, 0.12), transparent 24%),
    radial-gradient(circle at bottom left, rgba(255, 158, 74, 0.12), transparent 24%),
    rgba(11, 14, 20, 0.9);
  box-shadow: 0 28px 52px rgba(0, 0, 0, 0.44);
}

.overlay-card h3 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin-bottom: 12px;
}

.overlay-card p {
  margin: 0;
  color: #e1e7f2;
  line-height: 1.6;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

#startButton {
  background: linear-gradient(135deg, rgba(255, 158, 74, 0.98), rgba(255, 122, 89, 0.92));
  color: #171a23;
}

#demoButton {
  background: rgba(93, 216, 255, 0.12);
}

.mobile-flip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-width: 78px;
  background: linear-gradient(135deg, rgba(255, 158, 74, 0.76), rgba(93, 216, 255, 0.74));
  display: none;
}

.arena-overlay:not(.is-hidden) + .mobile-flip {
  opacity: 0;
  pointer-events: none;
}

.contract-card {
  border-left: 4px solid rgba(255, 255, 255, 0.18);
}

.contract-card.is-complete {
  border-left-color: var(--pit-success);
  background: rgba(155, 255, 157, 0.08);
}

.contract-card p,
.archive-row p {
  margin: 6px 0 0;
  color: var(--pit-muted);
  line-height: 1.45;
}

.contract-progress {
  margin-top: 12px;
}

.contract-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.contract-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 158, 74, 0.95), rgba(93, 216, 255, 0.95));
}

.archive-row {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.archive-row--best {
  background: rgba(255, 158, 74, 0.08);
  border-color: rgba(255, 158, 74, 0.24);
}

.tips-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--pit-muted);
  line-height: 1.6;
}

.tips-panel li + li {
  margin-top: 8px;
}

@media (max-width: 1260px) {
  .pit-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .pit-panel--right {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 980px) {
  .pit-page {
    width: min(100%, calc(100% - 16px));
    padding-top: 12px;
  }

  .pit-topbar {
    border-radius: 28px;
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .pit-topbar,
  .pit-topbar-actions {
    width: 100%;
  }

  .pit-topbar-actions {
    justify-content: space-between;
  }

  .pit-intro,
  .pit-grid {
    grid-template-columns: 1fr;
  }

  .pit-panel--right {
    grid-column: auto;
    display: flex;
  }

}

@media (max-width: 640px) {
  .pit-page {
    width: min(100%, calc(100% - 10px));
  }

  .pit-topbar,
  .pit-intro,
  .pit-panel,
  .pit-arena-panel {
    border-radius: 24px;
  }

  .pit-topbar-actions {
    gap: 8px;
  }

  .pit-coffee,
  .pit-account-menu summary {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.92rem;
  }

  .pit-home span {
    font-size: 0.88rem;
  }

  .metric-stack {
    grid-template-columns: 1fr 1fr;
  }

  .pit-panel--right {
    gap: 14px;
  }

  .overlay-card {
    width: min(310px, calc(100% - 22px));
    padding: 14px;
  }

  .overlay-card h3 {
    font-size: 1.72rem;
    margin-bottom: 8px;
  }

  .overlay-card p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .overlay-actions {
    flex-direction: row;
    gap: 8px;
    margin-top: 14px;
  }

  #startButton,
  #demoButton {
    width: auto;
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .arena-stage {
    min-height: 340px;
  }

  #pitCanvas {
    aspect-ratio: 1 / 1;
    min-height: 340px;
  }
}

@media (hover: none) and (pointer: coarse) and (max-width: 980px) {
  .mobile-flip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
