body.experiment-page {
  overflow: hidden;
  min-height: 100vh;
}

.experiment-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  z-index: 4;
}

.experiment-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0;
}

.experiment-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.experiment-link,
.experiment-sound {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-soft);
  text-decoration: none;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.experiment-link:hover,
.experiment-sound:hover {
  color: var(--ink);
  border-color: rgba(122, 217, 230, 0.5);
  background: var(--cyan-soft);
}

.experiment-stage {
  position: relative;
  width: min(1320px, calc(100% - 40px));
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at center, rgba(122, 217, 230, 0.04), transparent 44%),
    rgba(5, 7, 10, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

#experiment-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 580px;
  touch-action: none;
  cursor: crosshair;
}

.experiment-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.experiment-header {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.experiment-title {
  max-width: 540px;
}

.experiment-title span {
  color: var(--cyan);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.experiment-title h1 {
  margin: 12px 0 0;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.15;
  font-weight: 500;
}

.experiment-status {
  min-width: 210px;
  display: grid;
  gap: 9px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.62);
  font: 500 10px/1.5 var(--mono);
  letter-spacing: 0.06em;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink-dim);
}

.status-row strong {
  color: var(--ink);
  font-weight: 500;
}

.status-row strong.cyan { color: var(--cyan); }
.status-row strong.gold { color: var(--gold); }
.status-row strong.danger { color: var(--danger); }

.experiment-instruction {
  position: absolute;
  left: 24px;
  bottom: 22px;
  max-width: 540px;
  padding: 14px 16px;
  border-left: 1px solid var(--cyan);
  background: linear-gradient(90deg, rgba(5, 7, 10, 0.8), transparent);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.experiment-instruction strong {
  color: var(--ink);
  font-weight: 500;
}

.cost-ledger {
  position: absolute;
  right: 24px;
  bottom: 22px;
  width: min(310px, calc(100% - 48px));
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.7);
}

.cost-ledger h2 {
  margin: 0 0 12px;
  color: var(--ink-dim);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.cost-list {
  display: grid;
  gap: 8px;
}

.cost-entry {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--ink-dim);
  font: 400 10px/1.55 var(--mono);
  opacity: 0.48;
}

.cost-entry.visible {
  color: var(--ink-soft);
  opacity: 1;
}

.cost-entry .dot {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border: 1px solid var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(214, 107, 114, 0.35);
}

.experiment-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 5, 7, 0.72);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.experiment-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(660px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.modal-kicker {
  margin: 0 0 14px;
  color: var(--cyan);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.modal-card h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.18;
  font-weight: 500;
}

.modal-card > p {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.9;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.summary-item {
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.summary-item span {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-dim);
  font: 500 9px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-item strong {
  color: var(--ink);
  font: 500 28px/1 var(--mono);
}

.summary-item strong.gold { color: var(--gold); }
.summary-item strong.danger { color: var(--danger); }

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.experiment-footer {
  width: min(1320px, calc(100% - 40px));
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 18px 0 22px;
  color: var(--ink-dim);
  font: 400 10px/1.6 var(--mono);
}

.compensation-flash {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--danger);
  border-radius: 50%;
  pointer-events: none;
  animation: compensation-wave 900ms ease-out forwards;
}

@keyframes compensation-wave {
  from { transform: translate(-50%, -50%) scale(0.2); opacity: 1; box-shadow: 0 0 10px rgba(214, 107, 114, 0.7); }
  to { transform: translate(-50%, -50%) scale(8); opacity: 0; box-shadow: 0 0 60px rgba(214, 107, 114, 0); }
}

@media (max-width: 760px) {
  .experiment-nav,
  .experiment-stage,
  .experiment-footer {
    width: min(100% - 24px, 1320px);
  }

  .experiment-nav .brand-en,
  .experiment-link.legacy {
    display: none;
  }

  #experiment-canvas {
    min-height: calc(100vh - 150px);
  }

  .experiment-header {
    top: 16px;
    left: 16px;
    right: 16px;
  }

  .experiment-title h1 {
    font-size: 27px;
  }

  .experiment-status {
    min-width: 136px;
    padding: 10px;
  }

  .experiment-instruction {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
    padding-right: 120px;
    font-size: 12px;
  }

  .cost-ledger {
    right: 16px;
    bottom: 90px;
    width: 150px;
  }

  .cost-ledger h2,
  .cost-entry:nth-child(n+3) {
    display: none;
  }

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

  .experiment-footer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .compensation-flash {
    animation: none;
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(2);
  }
}
