@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:      #ffe5f7;
  --text:    #000000;
  --muted:   #534d48;
  --border:  rgba(47, 47, 47, 0.06);

  --rose:    #9d6ac4;
  --mauve:   #eaa6bd;
  --sand:    #9eabee;
  --sage:    #7a9e8a;

  --radius:    18px;
  --radius-sm: 11px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 40px 24px 64px;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 4px 28px;
}

.hero-text { flex: 1; }

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #544154;
  margin-bottom: 3px;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.reset-button,
.pause-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}

.reset-button {
  background: rgba(0,0,0,0.07);
  color: var(--muted);
}
.reset-button:hover { background: rgba(0,0,0,0.11); color: var(--text); }

.pause-button {
  background: #6a0829;
  color: var(--bg);
}
.pause-button:hover { opacity: 0.82; }
.reset-button:active, .pause-button:active { transform: scale(0.96); }

.stats {
  display: flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(8px);
}

.stat-card {
  flex: 1;
  padding: 18px 20px 16px;
  position: relative;
}

.stat-card + .stat-card {
  border-left: 1px solid var(--border);
}

.stat-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-card strong {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.left-card  { border-bottom: 2px solid var(--sage); }
.right-card { border-bottom: 2px solid var(--rose); }
.next-card  { border-bottom: 2px solid var(--sand); }
.angle-card { border-bottom: 2px solid var(--mauve); }

.scene-shell {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
}

.scene-header {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scene-header h2 {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.scene {
  position: relative;
  height: 360px;
  overflow: hidden;
}

.scene::before {
  content: '';
  position: absolute;
  bottom: 48px;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.08) 20%, rgba(0,0,0,0.08) 80%, transparent);
}

.seesaw-wrapper {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  height: 160px;
}

.plank {
  position: absolute;
  left: 50%;
  top: 80px;
  width: 420px;
  height: 11px;
  transform: translateX(-50%) rotate(0deg);
  transform-origin: center center;
  cursor: pointer;
  border-radius: 99px;
  background: linear-gradient(180deg, #b8907e 0%, #9e7060 100%);
  box-shadow:
    0 6px 20px rgba(140,90,70,0.2),
    inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

#objects-layer {
  position: absolute;
  inset: 0;
}

.object {
  position: absolute;
  bottom: 11px;
  transform: translateX(-50%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  white-space: nowrap;
  box-shadow:
    0 4px 14px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

.object.is-new {
  animation: drop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes drop-in {
  from {
    transform: translateX(-50%) translateY(-70px) scale(0.65);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
}


.pivot {
  position: absolute;
  left: 50%;
  top: 91px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 44px solid #550447;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

#pause-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(245,237,232,0.75);
  backdrop-filter: blur(16px);
  z-index: 20;
}


@media (max-width: 720px) {
  .stats { flex-wrap: wrap; }
  .stat-card { flex: 1 1 45%; }
  .stat-card + .stat-card { border-left: none; }
  .stat-card:nth-child(3),
  .stat-card:nth-child(4) { border-top: 1px solid var(--border); }
  .hero { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  body { padding: 20px 14px 40px; }
  h1 { font-size: 20px; }
  .scene { height: 300px; }
  .seesaw-wrapper { transform: translate(-50%, -50%) scale(0.76); }
  .reset-button, .pause-button { flex: 1; }
}

.log-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 13px;
}

.log-panel h3 {
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}

#event-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.log-item {
  font-family: monospace;
}