:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --accent: #e63946;
  --border: #111111;
  --card: #fafafa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

.brand-logo {
  text-decoration: none;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.4px;
}

.brand-logo:hover {
  opacity: 0.75;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kill-badge {
  border: 2px solid #111;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  box-shadow: 2px 2px 0 #111;
}

.kill-badge strong {
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sound-btn {
  width: 36px;
  height: 36px;
  border: 2px solid #111;
  border-radius: 50%;
  background: #fff;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 #111;
}

.sound-btn:hover {
  background: #f5f5f5;
}

.container {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 20px 64px;
  text-align: center;
  flex: 1;
}

.title-block {
  margin-bottom: 10px;
}

.level-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 4px;
}

.title-block h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4.8vw, 38px);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
}

/* Sketchy SVG Stage */
.stage-wrap {
  width: 100%;
  max-width: 740px;
  margin: 8px auto 12px;
  border: 2.5px solid #111;
  border-radius: 14px;
  background: #fffdf9;
  box-shadow: 4px 4px 0 #111;
  overflow: hidden;
}

#trolley-svg {
  width: 100%;
  height: auto;
  display: block;
}

#trolley-car {
  transition: transform 0.72s cubic-bezier(0.32, 0.72, 0.25, 1);
}

#trolley-car.rumble {
  animation: trolleyRumble 0.35s infinite alternate ease-in-out;
}

@keyframes trolleyRumble {
  0% { transform: translate(135px, 184px) rotate(-0.6deg); }
  100% { transform: translate(137px, 186px) rotate(0.6deg); }
}

#lever-arm {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dilemma-box {
  max-width: 660px;
  margin: 16px auto 22px;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dilemma-text {
  font-size: clamp(18px, 2.5vw, 22px);
  line-height: 1.48;
  font-weight: 500;
  margin: 0;
  color: #111;
}

/* Choice Buttons */
.choices {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.choice-btn {
  min-width: 225px;
  padding: 15px 26px;
  border: 2.5px solid #111;
  border-radius: 10px;
  background: #ffffff;
  color: #111;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 4px 4px 0 #111;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}

.choice-btn:hover:not(:disabled) {
  background: #fff4f4;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #111;
}

.choice-btn.nothing:hover:not(:disabled) {
  background: #f3f4f6;
}

.choice-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #111;
}

.choice-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Poll Results */
.result-panel {
  max-width: 560px;
  margin: 18px auto 0;
  padding: 20px 24px;
  border: 2.5px solid #111;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 4px 4px 0 #111;
  animation: popIn 0.25s ease-out;
}

.result-panel[hidden],
.finale-panel[hidden],
.choices[hidden] {
  display: none !important;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.poll-summary {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.poll-bar {
  height: 22px;
  border: 2px solid #111;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #e5e7eb;
}

.poll-fill-pull {
  background: #e63946;
  height: 100%;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.poll-fill-nothing {
  background: #457b9d;
  height: 100%;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.poll-legend {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: #444;
  margin: 8px 4px 18px;
}

.next-btn {
  padding: 12px 32px;
  border: 2.5px solid #111;
  border-radius: 9px;
  background: #111;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  transition: transform 0.1s, background 0.15s;
}

.next-btn:hover {
  background: #e63946;
  transform: translateY(-1px);
}

/* Finale Screen */
.finale-panel {
  max-width: 600px;
  margin: 16px auto 0;
  animation: popIn 0.35s ease-out;
}

.certificate {
  border: 3px solid #111;
  border-radius: 16px;
  padding: 36px 28px;
  background: #fffdf7;
  box-shadow: 6px 6px 0 #111;
}

.cert-badge {
  font-size: 54px;
  margin-bottom: 8px;
}

.certificate h2 {
  font-family: Georgia, serif;
  font-size: 36px;
  margin: 0 0 6px;
}

.cert-lead {
  font-size: 22px;
  color: #333;
  margin: 0 0 28px;
  font-weight: 500;
}

.cert-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  border: 2px solid #111;
  border-radius: 10px;
  padding: 14px 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card strong {
  font-size: 20px;
  font-weight: 800;
}

.cert-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.more-link {
  color: #111;
  font-weight: 700;
  text-decoration: underline;
  font-size: 15px;
}

@media (max-width: 600px) {
  .top-bar {
    padding: 14px 16px;
  }
  .cert-stats {
    grid-template-columns: 1fr;
  }
  .choice-btn {
    width: 100%;
  }
}
