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

:root {
  --bg: #0F1117;
  --surface: #16192a;
  --surface2: #1e2236;
  --border: #2a2d45;
  --text: #e8e8f0;
  --subtext: #8888aa;
  --accent: #1d9bf0;
  --danger: #e0245e;
  --safe: #00ba7c;
  --warn: #f4a723;
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

#app {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* Screens */
.screen { display: none; flex-direction: column; flex: 1; }
.screen.active { display: flex; }

/* ── START SCREEN ── */
.start-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  text-align: center;
  padding: 20px 0;
}

.game-logo { font-size: 4rem; }

h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 900;
  background: linear-gradient(135deg, #1d9bf0, #e0245e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--subtext);
  font-size: 1rem;
  max-width: 340px;
}

.rules {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  width: 100%;
  max-width: 380px;
}

.rule {
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hi-score-display {
  background: linear-gradient(135deg, #ffd70022, #ffd70011);
  border: 1px solid #ffd70044;
  color: #ffd700;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
}

.disclaimer {
  color: var(--subtext);
  font-size: 0.72rem;
  max-width: 340px;
}

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, #1d9bf0, #0d5fa0);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 24px #1d9bf044;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px #1d9bf066; }
.btn-primary:active { transform: scale(0.96); }

.btn-secondary {
  background: var(--surface);
  color: var(--subtext);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 10px 28px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── GAME SCREEN ── */
.game-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.score-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.clapback-btn {
  background: linear-gradient(135deg, #2a1a4a, #1a1030);
  border: 1px solid #6c3faa55;
  color: #c084fc;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.clapback-btn:hover { border-color: #c084fc; box-shadow: 0 0 12px #c084fc33; }
.clapback-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Cancel Meter */
.meter-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--subtext);
  margin-bottom: 8px;
}

.meter-track {
  background: #0a0a14;
  border-radius: 50px;
  height: 22px;
  position: relative;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 50px;
  background: linear-gradient(90deg, #00ba7c, #f4a723, #e0245e);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.meter-faces {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 0.9rem;
  pointer-events: none;
  padding: 0 4px;
}

/* Scenario Card */
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.scenario-category {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}

.scenario-text {
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

/* Answers */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.answer-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  line-height: 1.3;
  min-height: 64px;
}

.answer-btn:hover {
  border-color: var(--accent);
  background: #1d9bf011;
}

.answer-btn.correct {
  border-color: var(--safe);
  background: #00ba7c22;
  color: #6ee7b7;
}

.answer-btn.wrong {
  border-color: var(--danger);
  background: #e0245e22;
  color: #fca5a5;
  animation: shake 0.4s ease;
}

.answer-btn:disabled { cursor: not-allowed; opacity: 0.5; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Feedback */
.feedback {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  color: var(--subtext);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.3s;
}

.feedback.good {
  background: #00ba7c18;
  color: #34d399;
  border: 1px solid #00ba7c33;
}

.feedback.bad {
  background: #e0245e18;
  color: #f87171;
  border: 1px solid #e0245e33;
}

/* ── RESULT SCREENS ── */
.result-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  text-align: center;
  padding: 20px 0;
}

.result-icon { font-size: 5rem; }

.cancelled-title {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 900;
  color: var(--danger);
  text-shadow: 0 0 30px #e0245e55;
}

.based-title {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 30px #ffd70055;
}

.cancel-reason {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--subtext);
  font-style: italic;
  max-width: 380px;
}

.based-sub {
  color: var(--subtext);
  font-size: 0.9rem;
  max-width: 340px;
}

.final-score {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
}

.hi-score {
  color: #ffd700;
  font-size: 0.88rem;
  font-weight: 700;
}

.twitter-mob {
  display: flex;
  gap: 6px;
  font-size: 1.4rem;
  animation: mobRage 1s ease infinite alternate;
}

@keyframes mobRage {
  from { transform: translateX(-4px) rotate(-5deg); }
  to   { transform: translateX(4px) rotate(5deg); }
}

.cancelled-icon {
  animation: cancelledBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cancelledBounce {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.based-icon {
  animation: basedSpin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes basedSpin {
  0% { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0); }
}

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