:root {
  --bg: #0f1220;
  --bg-soft: #171a2e;
  --card: #1d2138;
  --card-2: #242843;
  --line: #2e3354;
  --text: #eef0fb;
  --muted: #9aa0c4;
  --rawls: #4f8cff;
  --rawls-soft: #1b2c52;
  --nozick: #ff9f43;
  --nozick-soft: #4a3320;
  --good: #3ddc97;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(
      1200px 600px at 15% -10%,
      #1a2150 0%,
      transparent 55%
    ),
    radial-gradient(1000px 600px at 100% 0%, #3a1f12 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: clamp(22px, 5vw, 32px);
  margin: 0;
  letter-spacing: 0.2px;
}

.brand .vs {
  color: var(--muted);
  font-style: italic;
  font-weight: 500;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.dot.rawls {
  background: var(--rawls);
  box-shadow: 0 0 16px var(--rawls);
}
.dot.nozick {
  background: var(--nozick);
  box-shadow: 0 0 16px var(--nozick);
}

.pill {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
}

/* ---------- Cards / screens ---------- */
.screen {
  animation: fade 0.35s ease;
}
.hidden {
  display: none !important;
}

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-family: "Fraunces", serif;
  margin: 0 0 6px;
  font-size: 24px;
}

.lead {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 22px;
}
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
  line-height: 1.5;
}
.t-rawls {
  color: var(--rawls);
}
.t-nozick {
  color: var(--nozick);
}

/* ---------- Form ---------- */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border 0.2s;
}
input[type="text"]:focus {
  border-color: var(--rawls);
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  padding: 13px 20px;
  transition: transform 0.08s ease, filter 0.2s ease, background 0.2s;
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  width: 100%;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--rawls), #6aa0ff);
  color: #06122e;
}
.btn.primary:hover {
  filter: brightness(1.08);
}

.error {
  color: #ff6b6b;
  font-size: 14px;
  margin-top: 14px;
  font-weight: 500;
}

/* ---------- Player list ---------- */
.player-list {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.player-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 500;
}
.player-list .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--rawls-soft);
  color: var(--rawls);
}
.badge-host {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--nozick);
  background: var(--nozick-soft);
  padding: 4px 9px;
  border-radius: 999px;
}
.badge-you {
  font-size: 11px;
  font-weight: 700;
  color: var(--good);
  background: rgba(61, 220, 151, 0.12);
  padding: 4px 9px;
  border-radius: 999px;
}
.badge-off {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

/* ---------- Progress ---------- */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rawls), var(--nozick));
  transition: width 0.4s ease;
}
.progress-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Scenario ---------- */
.scenario-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.scenario-text {
  font-family: "Fraunces", serif;
  font-size: clamp(20px, 4.5vw, 26px);
  line-height: 1.35;
  margin: 0 0 24px;
}

.choices {
  display: grid;
  gap: 14px;
}
@media (min-width: 620px) {
  .choices {
    grid-template-columns: 1fr 1fr;
  }
}

.choice {
  text-align: left;
  cursor: pointer;
  border-radius: 16px;
  padding: 18px;
  border: 1.5px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.1s, border 0.2s, background 0.2s;
}
.choice:hover {
  transform: translateY(-3px);
}
.choice.rawls:hover {
  border-color: var(--rawls);
  background: var(--rawls-soft);
}
.choice.nozick:hover {
  border-color: var(--nozick);
  background: var(--nozick-soft);
}
.choice-tag {
  font-weight: 700;
  font-size: 15px;
}
.choice.rawls .choice-tag {
  color: var(--rawls);
}
.choice.nozick .choice-tag {
  color: var(--nozick);
}
.choice-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.answered-box {
  text-align: center;
  margin-top: 6px;
}
.answered-box p {
  font-weight: 600;
  margin-bottom: 12px;
}
.chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chips li {
  font-size: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
}

/* ---------- Reveal ---------- */
.center-card {
  text-align: center;
}
.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.envelope {
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 20px 14px;
  cursor: default;
  transition: transform 0.15s, border 0.2s;
}
.envelope .who {
  font-weight: 600;
  margin-bottom: 12px;
}
.envelope .seal {
  font-size: 38px;
  line-height: 1;
}
.envelope.mine {
  cursor: pointer;
  border-color: var(--rawls);
}
.envelope.mine:hover {
  transform: translateY(-4px) scale(1.02);
}
.envelope.opened {
  border-color: var(--good);
  background: rgba(61, 220, 151, 0.08);
}
.envelope .status {
  font-family: "Fraunces", serif;
  font-size: 19px;
  font-weight: 700;
  margin-top: 8px;
}
.envelope .tap {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.reveal-countdown {
  margin-top: 22px;
  font-weight: 600;
  font-size: 15px;
  color: var(--good);
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
}

/* ---------- Mudaria ---------- */
.question-big {
  font-family: "Fraunces", serif;
  font-size: clamp(21px, 4.5vw, 28px);
  line-height: 1.35;
  margin: 14px 0 26px;
}
.mudaria-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}
.btn.pick {
  background: var(--card-2);
  border: 1.5px solid var(--line);
  color: var(--text);
}
.btn.pick:hover {
  border-color: var(--rawls);
  background: var(--rawls-soft);
}

/* ---------- Results ---------- */
.results-grid {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}
.result-card {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.result-head .name {
  font-weight: 700;
  font-size: 17px;
}
.result-status {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.st-rico {
  color: #ffd166;
  border-color: #5a4a1a;
}
.st-empresário {
  color: #ff9f43;
  border-color: #5a3a1a;
}
.st-classe-média {
  color: #4f8cff;
  border-color: #1d3a6a;
}
.st-pobre {
  color: #3ddc97;
  border-color: #1d5a44;
}

.score-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--line);
}
.score-bar .r {
  background: var(--rawls);
}
.score-bar .n {
  background: var(--nozick);
}
.score-legend {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 8px;
  color: var(--muted);
}
.score-legend b {
  color: var(--text);
}
.result-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}
.tendency {
  font-weight: 700;
}
.tendency.Rawlsiana {
  color: var(--rawls);
}
.tendency.Nozickiana {
  color: var(--nozick);
}
.tendency.Equilibrada {
  color: var(--muted);
}
.mudaria-tag {
  color: var(--muted);
}
.mudaria-tag b {
  color: var(--text);
}

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