/* ============================================================
   X vs ? — Negotiation Intelligence Test
   game.css — fully self-contained, no external imports
   ============================================================ */

:root {
  --bg: #050505;
  --text: #f0f0f0;
  --muted: rgba(255,255,255,0.4);
  --border: rgba(255,255,255,0.08);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

/* ── Base ── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ── Game root container ── */
#game-root {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

/* ── Screens ── */
.game-screen {
  width: 100%;
  animation: screenIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ============================================================
   INTRO SCREEN
   ============================================================ */

.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.game-title {
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  font-family: var(--font-sans);
}

.game-title .vs {
  color: rgba(255,255,255,0.2);
  font-weight: 900;
}

.game-title .qmark {
  color: rgba(255,255,255,0.45);
  font-weight: 900;
}

.intro-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.intro-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2.25rem;
  max-width: 34rem;
}

.btn-begin {
  margin-bottom: 1.25rem;
}

.intro-footnote {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.04em;
}

/* ============================================================
   QUIZ SCREEN
   ============================================================ */

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.quiz-progress {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.decisive-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: #f5a623;
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 100px;
  padding: 0.2rem 0.55rem;
  letter-spacing: 0.05em;
}

/* Timer */
.timer-track {
  width: 100%;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
  transform-origin: left;
  transition: width linear;
}

.timer-bar.warning {
  background: #f5a623;
}

.timer-bar.danger {
  background: #e55;
}

/* Quiz body */
.quiz-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-question {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Option buttons */
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.5;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  animation: optionIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-option:nth-child(1) { animation-delay: 0.04s; }
.quiz-option:nth-child(2) { animation-delay: 0.09s; }
.quiz-option:nth-child(3) { animation-delay: 0.14s; }
.quiz-option:nth-child(4) { animation-delay: 0.19s; }

@keyframes optionIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.quiz-option:hover:not(.disabled):not(.selected) {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
}

.quiz-option.selected {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
}

.quiz-option.disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}

.quiz-option.selected.disabled {
  opacity: 1;
}

.option-key {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  width: 16px;
  min-width: 16px;
  padding-top: 0.1rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
}

/* ============================================================
   CALCULATING SCREEN
   ============================================================ */

.calc-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1rem 0;
}

.calc-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.calc-label {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  min-height: 1.2em;
  transition: opacity 0.2s ease;
}

.calc-track {
  width: 100%;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.calc-fill {
  height: 100%;
  background: var(--text);
  border-radius: 1px;
  width: 0%;
  transition: width 0.5s ease;
}

/* ============================================================
   RESULT SCREEN
   ============================================================ */

.result-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.result-tag {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.result-rarity {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.04em;
  text-align: right;
}

.result-type {
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  animation: revealType 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.result-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.result-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

.result-desc {
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.72);
  margin-bottom: 1.25rem;
}

.result-truth {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
  border-left: 2px solid rgba(255,255,255,0.15);
  padding-left: 1rem;
  margin: 0;
}

/* Score bar */
.result-score-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.rsb-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.rsb-track {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.rsb-fill {
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0.15), rgba(255,255,255,1));
  border-radius: 2px;
  width: 0%;
  transition: width 1s ease 0.5s;
}

.result-parallel {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.04em;
  margin-top: 0.6rem;
}

/* Result decisive badge */
.result-decisive-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #f5a623;
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 100px;
  padding: 0.25rem 0.65rem;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  letter-spacing: 0.05em;
}

/* Result actions */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.result-back {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.25);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
}

.result-back:hover {
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #f0f0f0;
  color: #050505;
  border-color: #f0f0f0;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}

.btn-outline:hover {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.04);
}

/* ============================================================
   ANIMATIONS — pulse
   ============================================================ */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 480px) {
  #game-root {
    padding: 1.5rem 1rem;
    justify-content: flex-start;
    padding-top: 2.5rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-begin {
    width: 100%;
    justify-content: center;
  }

  .quiz-option {
    padding: 0.75rem 0.875rem;
  }
}

@media (max-width: 360px) {
  .game-title {
    font-size: 3rem;
  }
}
