/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a0b;
  --bg2:         #111115;
  --bg3:         #1a1a1f;
  --card:        #141418;
  --border:      #28282f;
  --primary:     #F2559B;
  --primary-dim: #F2559B20;
  --primary-dark:#B81E64;
  --danger:      #E0115F;
  --danger-dim:  #E0115F20;
  --green:       #FFB3D1;
  --yellow:      #f5a623;
  --orange:      #f97316;
  --red:         #E0115F;
  --safe:        #ffffff;
  --text:        #f5f5f7;
  --text-dim:    #a1a1aa;
  --text-muted:  #6b7280;
  --font-title:  'Inter', sans-serif;
  --font-body:   'Inter', sans-serif;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow:      0 4px 24px rgba(0,0,0,0.7);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums; /* números do cronômetro e do placar não "pulam" */
  overflow-x: hidden;
}

/* ── SCREENS ── */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  animation: fadeIn 0.4s ease;
}
.screen.active { display: flex; flex-direction: column; align-items: center; justify-content: center; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--primary-dim); }
  50%       { box-shadow: 0 0 40px rgba(242,85,155,0.45), 0 0 80px rgba(242,85,155,0.12); }
}
@keyframes pulse-glow-red {
  0%, 100% { box-shadow: 0 0 20px var(--danger-dim); }
  50%       { box-shadow: 0 0 40px rgba(224,17,95,0.45), 0 0 80px rgba(224,17,95,0.12); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes shake {
  0%,100%{ transform: translateX(0); }
  20%    { transform: translateX(-8px); }
  40%    { transform: translateX(8px); }
  60%    { transform: translateX(-5px); }
  80%    { transform: translateX(5px); }
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #0a0a0b;
  border: none; border-radius: 50px;
  padding: 16px 36px;
  font-family: var(--font-title);
  font-size: 14px; font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(242,85,155,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(242,85,155,0.55);
  background: linear-gradient(135deg, #FFB3D1, var(--primary));
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.4; cursor: not-allowed;
  background: var(--bg3);
  color: var(--text-muted);
  box-shadow: none;
}
.btn-glow { animation: pulse-glow 2.5s infinite; }

/* ── SPLASH ── */
#screen-splash { position: relative; overflow: hidden; }
.splash-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #1b0f16 0%, #0a0a0b 70%);
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(242,85,155,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242,85,155,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.splash-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 28px 24px; gap: 18px;
  max-width: 1000px;
}
.logo-wrapper { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.logo-emblem { position: relative; width: 168px; height: 86px; display: flex; justify-content: center; align-items: flex-end; margin-bottom: -6px; }
.logo-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.logo-icon {
  position: relative; width: 62px; height: 62px; margin-bottom: 3px;
  animation: float 3.4s ease-in-out infinite;
  color: var(--primary);
  filter: drop-shadow(0 0 12px rgba(242,85,155,0.4));
}
.logo-icon svg { width: 100%; height: 100%; }
.logo-title {
  font-family: var(--font-body);
  font-size: clamp(40px, 5vw, 96px); font-weight: 900;
  letter-spacing: -0.02em; line-height: 0.95; white-space: nowrap;
}
.logo-title-a { color: #f2f2f4; text-shadow: 0 4px 24px rgba(0,0,0,0.6); }
.logo-title-b { color: var(--danger); text-shadow: 0 0 26px rgba(224,17,95,0.3); }
.logo-subtitle {
  font-family: var(--font-body); font-size: clamp(11px, 0.95vw, 18px); font-weight: 500;
  color: #d9d9de; letter-spacing: 0.36em; text-transform: uppercase;
  margin-right: -0.36em; /* compensa o espaçamento da última letra para centralizar */
}
.logo-subtitle span { color: var(--primary); font-weight: 700; }
.splash-desc { color: #a8a8b1; font-size: clamp(13px, 1vw, 19px); line-height: 1.6; max-width: 520px; }
.splash-desc strong { color: var(--text); font-weight: 600; }

/* ── VOLTAR ── */
.btn-back {
  position: absolute; top: 14px; left: 14px; z-index: 5;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 50px;
  padding: 9px 16px 9px 12px;
  font-family: var(--font-title); font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  cursor: pointer; transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-back:hover { color: var(--primary); border-color: var(--primary); transform: translateX(-2px); }
#screen-mode-select, #screen-register { position: relative; }

/* ── REGISTER ── */
#screen-register { padding: 40px 24px; }
.register-content {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 20px;
  max-width: 440px; width: 100%;
  animation: slideUp 0.5s ease;
}
.register-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 14px rgba(242,85,155,0.4));
  animation: float 3s ease-in-out infinite;
}
.register-title {
  font-family: var(--font-title); font-size: 28px; font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: 3px;
}
.register-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; }
.register-form { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.form-group { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.form-label {
  font-family: var(--font-title); font-size: 10px; letter-spacing: 2px;
  color: var(--primary); opacity: 0.8;
}
.form-input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-family: var(--font-body); font-size: 14px; color: var(--text);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* ── LEADERBOARD ── */
#screen-leaderboard { padding: 24px 20px; justify-content: flex-start; overflow-y: auto; }
.leaderboard-content {
  width: 100%; max-width: 600px;
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px 0 40px; animation: slideUp 0.4s ease;
}
.leaderboard-header { text-align: center; }
.leaderboard-title {
  font-family: var(--font-title); font-size: 24px; font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: 3px;
}
.leaderboard-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; letter-spacing: 1px; }
.leaderboard-list { display: flex; flex-direction: column; gap: 10px; }
.leaderboard-empty {
  text-align: center; color: var(--text-muted);
  font-size: 14px; padding: 40px 0;
}
.lb-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 18px;
  transition: border-color 0.2s;
}
.lb-item.lb-gold   { border-color: #FFD700; }
.lb-item.lb-silver { border-color: #C0C0C0; }
.lb-item.lb-bronze { border-color: #CD7F32; }
.lb-rank {
  font-family: var(--font-title); font-size: 18px; font-weight: 900;
  color: var(--text-muted); min-width: 28px; text-align: center;
}
.lb-rank.rank-1 { color: #FFD700; }
.lb-rank.rank-2 { color: #C0C0C0; }
.lb-rank.rank-3 { color: #CD7F32; }
.lb-medal { font-size: 22px; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-area { font-size: 11px; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.5px; }
.lb-score {
  text-align: right; flex-shrink: 0;
}
.lb-pts {
  font-family: var(--font-title); font-size: 18px; font-weight: 700;
  color: var(--primary);
}
.lb-date { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── LEADERBOARD BUTTON ── */
.btn-leaderboard {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 50px;
  padding: 11px 28px; font-family: var(--font-title);
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: all 0.2s; text-transform: uppercase;
}
.btn-leaderboard:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-dim);
}

/* ── GAME HEADER ── */
.game-header {
  width: 100%; max-width: 680px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
.header-level {
  font-family: var(--font-title); font-size: 11px;
  color: var(--primary); letter-spacing: 2px; white-space: nowrap;
}
.header-timer {
  flex: 1; display: flex; align-items: center; gap: 10px;
  justify-content: center;
}
#question-timer-num {
  font-family: var(--font-title); font-size: 15px; font-weight: 700;
  color: var(--primary); min-width: 20px; text-align: right;
}
.timer-bar-track {
  flex: 1; max-width: 220px; height: 8px; border-radius: 4px;
  background: var(--bg3); border: 1px solid var(--border); overflow: hidden;
}
.timer-bar-fill {
  height: 100%; width: 100%; border-radius: 4px;
  background: var(--primary); transition: width 0.1s linear, background 0.3s;
}
.timer-bar-fill.danger { background: var(--danger); }
.header-score {
  font-family: var(--font-title); font-size: 13px;
  color: var(--primary); white-space: nowrap;
}
#header-score { font-weight: 700; }

/* ── PERGUNTA ── */
#screen-question {
  height: 100vh; height: 100dvh; overflow: hidden;
  justify-content: flex-start; align-items: center; padding: 0;
}
.scenario-wrapper {
  flex: 1; min-height: 0; overflow-y: auto;
  width: 100%; max-width: 640px;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.scenario-context {
  font-size: 13px; font-style: italic; color: var(--text-muted);
  text-align: center; padding: 0 8px; line-height: 1.5;
}

.scenario-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); animation: slideUp 0.4s ease;
  flex-shrink: 0;
}
.scenario-type-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.type-icon { font-size: 18px; }
.type-label {
  font-family: var(--font-title); font-size: 12px;
  font-weight: 700; letter-spacing: 1px; color: var(--primary);
}

/* ── DECISION SECTION ── */
.decision-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 20px; align-items: center;
  flex-shrink: 0;
  position: sticky; bottom: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.step-label {
  font-size: 14px; font-weight: 600; color: var(--text-dim);
  text-align: center; margin-bottom: 4px;
}

.decision-step { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.decision-buttons { display: flex; gap: 14px; width: 100%; }

.decision-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px; border-radius: var(--radius-lg);
  border: 2px solid var(--border); background: var(--bg3);
  cursor: pointer; transition: all 0.2s; color: var(--text);
  font-family: var(--font-title);
}
.decision-icon { font-size: 32px; }
.decision-text { font-size: 14px; font-weight: 700; letter-spacing: 1px; }

.btn-scam:hover, .btn-scam.selected {
  border-color: var(--danger); background: var(--danger-dim);
  box-shadow: 0 6px 24px rgba(224,17,95,0.3); transform: translateY(-3px);
  color: var(--danger);
}
.btn-legit:hover, .btn-legit.selected {
  border-color: var(--safe); background: rgba(255,255,255,0.08);
  box-shadow: 0 6px 24px rgba(255,255,255,0.14); transform: translateY(-3px);
  color: var(--safe);
}

.question-waiting-msg {
  font-size: 14px; color: var(--text-dim); text-align: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; width: 100%;
}

.host-monitor {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.host-monitor-count {
  font-family: var(--font-title); font-size: 15px; font-weight: 700;
  color: var(--primary); letter-spacing: 0.5px;
}

/* ── REVELAÇÃO ── */
#screen-reveal { padding: 20px; justify-content: flex-start; overflow-y: auto; }
.reveal-content {
  width: 100%; max-width: 640px; padding: 20px 0 40px;
  display: flex; flex-direction: column; gap: 18px; align-items: center;
  animation: slideUp 0.4s ease;
}
.reveal-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.reveal-title {
  font-family: var(--font-title); font-size: 22px;
  background: linear-gradient(135deg, #fff, var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.reveal-explanation {
  font-size: 14px; line-height: 1.7; color: var(--text-dim); text-align: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px; width: 100%;
}
.reveal-players-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.reveal-player-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 18px;
}
.reveal-player-row.status-correct { border-color: var(--primary); }
.reveal-player-row.status-wrong   { border-color: var(--text-muted); }
.reveal-player-row.status-none    { border-color: var(--border); opacity: 0.75; }

.ans-chip { padding: 3px 12px; border-radius: 50px; font-weight: 600; font-size: 12px; font-family: var(--font-title); }
.ans-chip.scam  { background: rgba(224,17,95,0.12);  color: var(--danger);  border: 1px solid var(--danger); }
.ans-chip.legit { background: rgba(255,255,255,0.1); color: var(--safe); border: 1px solid var(--safe); }

/* ── FINAL ── */
#screen-final { padding: 40px 24px; }
.final-content {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 24px; max-width: 520px; width: 100%;
  animation: slideUp 0.5s ease;
}
.final-trophy { animation: float 3s ease-in-out infinite; }

/* Grade ring */
.grade-ring {
  position: relative; width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.grade-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--border); stroke-width: 8; }
.ring-fill {
  fill: none; stroke: var(--primary); stroke-width: 8;
  stroke-dasharray: 264; stroke-dashoffset: 264;
  stroke-linecap: round; transition: stroke-dashoffset 1s ease;
}
.grade-ring.grade-gold   .ring-fill { stroke: #FFD700; }
.grade-ring.grade-silver .ring-fill { stroke: #C0C0C0; }
.grade-ring.grade-bronze .ring-fill { stroke: #CD7F32; }
.grade-pct {
  position: relative; z-index: 1;
  font-family: var(--font-title); font-size: 26px; font-weight: 900;
  color: var(--text); line-height: 1;
}
.grade-pct small { font-size: 14px; color: var(--text-muted); }
.final-title {
  font-family: var(--font-title); font-size: clamp(28px,6vw,42px); font-weight: 900;
  color: #fff; letter-spacing: 1px; text-align: center; text-wrap: balance;
  text-shadow: 0 0 28px rgba(242,85,155,0.35);
}
.final-subtitle { font-size: 15px; color: var(--text-dim); line-height: 1.7; }
.final-score-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 48px;
}
.final-score-num { font-family: var(--font-title); font-size: 56px; font-weight: 900; color: var(--primary); line-height: 1; }
.final-score-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; letter-spacing: 1px; text-transform: uppercase; }
.final-stars { display: flex; align-items: center; gap: 10px; }
.star-bar { display: flex; gap: 4px; }
.star-seg {
  width: 28px; height: 8px; border-radius: 4px;
  background: var(--border); transition: all 0.4s;
}
.star-seg.filled { background: var(--primary); box-shadow: 0 0 8px rgba(242,85,155,0.4); }
.star-label { font-family: var(--font-title); font-size: 13px; color: var(--text-muted); }
.final-tip {
  background: rgba(242,85,155,0.07); border: 1px solid rgba(242,85,155,0.2);
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 13px; color: var(--text-dim); line-height: 1.6;
  text-align: left; max-width: 440px;
}
.final-tip::before { content: "DICA  "; font-family: var(--font-title); font-size: 10px; letter-spacing: 2px; font-weight: 700; color: var(--primary); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── RESPONSIVE ── */

/* Tablet (até 768px) */
@media (max-width: 768px) {
  .splash-content { padding: 32px 20px; gap: 22px; }
  .game-header { padding: 12px 16px; }
  .scenario-wrapper { padding: 12px 14px; }
  .decision-section { padding: 18px 16px; }
  .final-score-box { padding: 20px 32px; }
  .reveal-content { padding: 12px 0 32px; }
  .brand-logo-png { height: 34px; }
  .brand-logo-img { height: 34px; }
  .brand-logo-edufc-img { height: 64px; }
  .brand-logos-divider { height: 48px; }
  .brand-watermark-right img { height: 28px; }
  .brand-watermark-left img { height: 26px !important; }
}

/* Smartphone (até 480px) */
@media (max-width: 480px) {
  /* Splash */
  .splash-content { padding: 24px 16px; gap: 18px; max-width: 100%; }
  .logo-icon { width: 54px; height: 54px; }
  .splash-desc { font-size: 13px; }
  .btn-back { top: 10px; left: 10px; padding: 8px 12px 8px 10px; }
  .mode-select-content, .register-content { padding-top: 56px; }
  .mode-card { padding: 14px 16px; gap: 12px; }
  .mode-card-icon { width: 44px; height: 44px; }
  .splash-brand { margin-top: 1rem; gap: 0.5rem; }
  .brand-logos-row { gap: 12px; }
  .brand-logos-divider { height: 36px; }
  .brand-logo-png { height: 28px; }
  .brand-logo-img { height: 26px; }
  .brand-logo-edufc-img { height: 48px; }

  /* Watermarks: no celular cobrem os botões de resposta e o "Jogar novamente".
     A marca já aparece completa na tela inicial, então aqui somem. */
  .brand-watermark { display: none !important; }
  .brand-watermark-right { right: 0.75rem; }
  .brand-watermark-left  { left: 0.75rem; }
  .brand-watermark-right img { height: 22px; }
  .brand-watermark-left img { height: 22px !important; }

  /* Header do jogo */
  .game-header { padding: 10px 12px; gap: 10px; }
  .header-level { font-size: 10px; }
  .header-score { font-size: 11px; }
  .timer-bar-track { max-width: 120px; }

  /* Scenario */
  .scenario-wrapper { padding: 10px 10px; gap: 12px; }

  /* Decisão */
  .decision-section { padding: 14px 12px; gap: 14px; }
  .decision-buttons { gap: 10px; }
  .decision-btn { padding: 14px 6px; }
  .decision-text { font-size: 12px; }
  .decision-icon svg { width: 28px; height: 28px; }

  /* Modo sala: escolha e lobby */
  .mode-select-buttons .btn-primary,
  .mode-select-buttons .btn-secondary { padding: 14px 20px; font-size: 13px; }
  .lobby-code { letter-spacing: 5px; }
  .host-monitor-count { font-size: 13px; text-align: center; }

  /* Final */
  #screen-final { padding: 28px 16px; }
  .final-score-box { padding: 16px 24px; }
  .final-score-num { font-size: 44px; }
  .final-content { gap: 18px; }

  /* Revelação */
  #screen-reveal { padding: 12px; }
}

/* Celular deitado: tela larga mas baixa — mesmo problema dos logos por cima dos botões */
@media (max-height: 500px) {
  .brand-watermark { display: none !important; }
}

/* ── TRANSITION OVERLAY ── */
.transition-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.transition-overlay.active { opacity: 1; pointer-events: all; }

/* ── BRAND / LOGO ── */
.splash-brand {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.brand-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-body);
  opacity: 0.7;
}
.brand-logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.brand-logos-divider {
  width: 1px;
  height: 60px;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
}
.brand-logo-png {
  height: 40px;
  width: auto;
  display: block;
}
.brand-logo-invert {
  filter: invert(1) hue-rotate(180deg);
  opacity: 0.85;
  transition: opacity 0.2s;
}
.brand-logo-invert:hover { opacity: 1; }
.brand-logo-edufc { height: 52px; }
.brand-logo-pill--edu {
  background: white;
  border-radius: 8px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  opacity: 0.88;
  transition: opacity 0.2s;
}
.brand-logo-pill--edu:hover { opacity: 1; }
.brand-logo-edufc-img {
  height: 76px;
  width: auto;
  display: block;
  margin-right: -8px;
}
.brand-logo-img {
  height: 40px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.brand-logo-img:hover { opacity: 1; }

#screen-splash.active ~ .brand-watermark { display: none !important; }

.brand-watermark {
  position: fixed;
  bottom: 1.25rem;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.25s;
}
.brand-watermark-right { right: 1.5rem; }
.brand-watermark-left  {
  left: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.brand-watermark:hover {
  opacity: 1;
  pointer-events: auto;
}
.brand-watermark-right img {
  height: 36px;
  width: auto;
}

/* ── MEDAL ── */
.medal-wrapper {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: float 3s ease-in-out infinite;
}
.medal-name {
  font-family: var(--font-title); font-size: 11px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; text-align: center;
}

/* ── FINAL ACTIONS ── */
.final-actions {
  display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%;
}

/* ── MODO SALA: escolha de modo, lobby, ranking final ── */
.mode-select-content {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 20px; max-width: 440px; width: 100%;
  padding: 40px 24px; animation: slideUp 0.5s ease;
}
.mode-select-title {
  font-family: var(--font-title); font-size: 30px; font-weight: 900;
  color: #fff; letter-spacing: 3px;
}
.mode-select-title span { color: var(--primary); }
.mode-select-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; }
.mode-select-buttons { display: flex; flex-direction: column; gap: 14px; width: 100%; margin-top: 8px; }
.mode-card {
  display: flex; align-items: center; gap: 16px; width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; text-align: left; color: var(--text);
  font-family: var(--font-body); cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.mode-card:hover { transform: translateY(-2px); }
.mode-card-icon {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.mode-card-icon svg { width: 26px; height: 26px; }
.mode-card-host .mode-card-icon   { color: var(--primary); background: var(--primary-dim); }
.mode-card-player .mode-card-icon { color: var(--danger);  background: var(--danger-dim); }
.mode-card-host:hover   { border-color: var(--primary); box-shadow: 0 8px 30px rgba(242,85,155,0.18); }
.mode-card-player:hover { border-color: var(--danger);  box-shadow: 0 8px 30px rgba(224,17,95,0.18); }
.mode-card-text { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mode-card-title { font-family: var(--font-title); font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.mode-card-sub { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.mode-card-arrow { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s, color 0.2s; }
.mode-card:hover .mode-card-arrow { transform: translateX(3px); color: var(--text); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: transparent; color: var(--text);
  border: 2px solid var(--border); border-radius: 50px;
  padding: 15px 36px; font-family: var(--font-title);
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: all 0.2s; text-transform: uppercase;
}
.btn-secondary:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-dim); transform: translateY(-2px);
}

.form-input-code { text-transform: uppercase; letter-spacing: 4px; font-family: var(--font-title); text-align: center; }
.register-error {
  font-size: 13px; color: var(--danger);
  background: var(--danger-dim); border: 1px solid var(--danger);
  border-radius: var(--radius); padding: 10px 14px; text-align: center;
}

#screen-lobby { padding: 40px 24px; }
.lobby-content {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 16px; max-width: 480px; width: 100%;
  animation: slideUp 0.5s ease;
}
.lobby-label { font-family: var(--font-title); font-size: 11px; letter-spacing: 3px; color: var(--text-muted); }
.lobby-code-row { display: flex; align-items: center; gap: 12px; }
.lobby-code {
  font-family: var(--font-title); font-size: clamp(36px, 9vw, 56px); font-weight: 900;
  color: var(--primary); letter-spacing: 8px;
  text-shadow: 0 0 24px rgba(242,85,155,0.35);
}
.btn-copy-code {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text-dim);
  cursor: pointer; transition: all 0.2s;
}
.btn-copy-code:hover { border-color: var(--primary); color: var(--primary); }
.lobby-hint { font-size: 13px; color: var(--text-muted); }
.lobby-link { font-size: 13px; color: var(--primary); word-break: break-all; margin-top: -8px; }
.lobby-link:empty { display: none; }
/* Fundo branco + margem: leitores de QR precisam de contraste e "zona de silêncio" */
.lobby-qr {
  background: #fff; padding: 14px; border-radius: 14px;
  box-shadow: 0 0 32px rgba(242,85,155,0.25);
}
.lobby-qr img, .lobby-qr canvas { display: block; width: 220px; height: 220px; }

/* ── BOTÃO DE SOM ── */
.sound-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 10000;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2); color: var(--text-muted);
  border: 1px solid var(--border); cursor: pointer;
  opacity: 0.85; transition: opacity 0.2s, color 0.2s;
}
.sound-toggle:hover { opacity: 1; color: var(--primary); }
.sound-toggle[aria-pressed="true"] { color: var(--primary); }
/* Abaixo de 800px o cabeçalho do jogo ocupa a largura toda: o botão desce pro canto de baixo */
@media (max-width: 799px), (max-height: 500px) {
  .sound-toggle { top: auto; bottom: 12px; right: 12px; }
  .brand-watermark-right { display: none !important; }
}
.lobby-players {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  width: 100%; min-height: 40px;
}
.lobby-player-chip {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 16px;
}
.lobby-player-name { font-size: 13px; font-weight: 600; color: var(--text); }
.lobby-player-area { font-size: 11px; color: var(--text-muted); }
.lobby-waiting-msg { font-size: 14px; color: var(--text-dim); }

.final-room-ranking-wrap { width: 100%; }
.final-room-ranking-title {
  font-family: var(--font-title); font-size: 13px; letter-spacing: 2px;
  color: var(--text-muted); margin-bottom: 12px; text-align: center;
}
.final-room-ranking { display: flex; flex-direction: column; gap: 10px; width: 100%; }

.rank-reveal {
  opacity: 0; transform: scale(0.7) translateY(18px);
}
.rank-reveal.rank-reveal-in {
  opacity: 1; transform: scale(1) translateY(0);
  transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── SPLASH: barra superior, botão e traçados laterais ── */
.splash-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 32px calc(5vw + 48px) 32px 5vw; pointer-events: none;
}
.splash-top-brand { display: flex; align-items: center; gap: 14px; color: var(--primary); }
.splash-top-brand svg { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(242,85,155,0.4)); }
.splash-top-brand span {
  display: flex; flex-direction: column; color: #ececef;
  font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.splash-top-brand small { font-size: 10.5px; font-weight: 500; color: var(--text-dim); letter-spacing: 0.22em; }
.splash-top-tagline { display: flex; align-items: center; gap: 14px; }
.splash-top-tagline span {
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); line-height: 1.8;
}
.splash-top-tagline i { display: block; width: 64px; height: 1.5px; background: linear-gradient(90deg, transparent, var(--primary)); }

/* Cantos chanfrados no mesmo ângulo dos traçados laterais */
.btn-start-hero {
  --cut: 14px;
  position: relative; overflow: hidden;
  font-family: var(--font-body); font-size: clamp(14px, 0.9vw, 17px); font-weight: 800;
  letter-spacing: 0.12em; padding: 16px 44px; gap: 14px;
  border-radius: 0; box-shadow: none;
  background: linear-gradient(180deg, #F77DB3 0%, var(--primary) 60%, #D93A80 100%);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
/* Brilho que atravessa o botão no hover */
.btn-start-hero::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg); transition: left 0.6s ease;
}
.btn-start-hero:hover:not(:disabled) {
  box-shadow: none;
  background: linear-gradient(180deg, #FA95C2 0%, #F0679F 60%, var(--primary) 100%);
}
.btn-start-hero:hover::after { left: 120%; }
.btn-start-hero svg { transition: transform 0.2s; }
.btn-start-hero:hover svg { transform: translateX(4px); }
/* clip-path corta o box-shadow: o brilho fica num wrapper com drop-shadow */
.btn-start-wrap { filter: drop-shadow(0 6px 22px rgba(242,85,155,0.28)); }

.splash-deco {
  position: absolute; top: 0; height: 100%; width: min(28vw, 430px); opacity: 0.8;
  z-index: 1; pointer-events: none; overflow: hidden;
}
/* A borda interna some em degradê: em telas estreitas o desenho é cortado sem aparecer a quina */
.splash-deco-left  { left: 0;  -webkit-mask-image: linear-gradient(to right, #000 72%, transparent); mask-image: linear-gradient(to right, #000 72%, transparent); }
.splash-deco-right { right: 0; -webkit-mask-image: linear-gradient(to left,  #000 72%, transparent); mask-image: linear-gradient(to left,  #000 72%, transparent); }
.deco-piece { will-change: transform, opacity; }

#screen-splash .splash-content { padding-top: 90px; gap: 16px; }
@media (min-width: 769px) {
  #screen-splash .brand-logo-png { height: 30px; }
  #screen-splash .brand-logo-img { height: 30px; }
  #screen-splash .brand-logo-edufc-img { height: 56px; }
  #screen-splash .brand-logos-divider { height: 40px; }
}
.splash-brand .brand-label { letter-spacing: 0.22em; }

@media (max-width: 900px) {
  .splash-top-tagline { display: none; }
}
@media (max-width: 600px) {
  .splash-top { padding: 18px 16px; }
  .logo-title { font-size: clamp(34px, 11vw, 52px); }
  .splash-top-brand svg { width: 32px; height: 32px; }
  .splash-top-brand span { font-size: 12px; }
  .splash-top-brand small { font-size: 10px; }
  .splash-deco { width: 28vw; opacity: 0.55; }
  #screen-splash .splash-content { padding-top: 84px; }
  .logo-emblem { width: 130px; height: 66px; }
  .logo-icon { width: 48px; height: 48px; }
  .logo-subtitle { letter-spacing: 0.22em; margin-right: -0.22em; }
  .btn-start-hero { padding: 15px 34px; --cut: 12px; }
  #screen-splash .brand-logo-png { height: 22px; }
  #screen-splash .brand-logo-img { height: 22px; }
  #screen-splash .brand-logo-edufc-img { height: 40px; }
  #screen-splash .brand-logos-divider { height: 30px; }
}
/* Telas grandes (TV / projetor Full HD): o conteúdo acompanha o tamanho */
@media (min-width: 1700px) and (min-height: 900px) {
  .logo-emblem { width: 210px; height: 106px; }
  .logo-icon { width: 76px; height: 76px; }
  .btn-start-hero { padding: 20px 56px; --cut: 16px; }
  #screen-splash .splash-content { gap: 20px; }
  #screen-splash .brand-logo-png, #screen-splash .brand-logo-img { height: 38px; }
  #screen-splash .brand-logo-edufc-img { height: 70px; }
  #screen-splash .brand-logos-divider { height: 50px; }
  .splash-top-brand svg { width: 42px; height: 42px; }
  .splash-top-brand span { font-size: 15px; }
  .splash-top-brand small { font-size: 12px; }
  .splash-top-tagline span { font-size: 12px; }
}
/* Celular pequeno: subtítulo cabe numa linha */
@media (max-width: 360px) {
  .logo-subtitle { font-size: 10px; letter-spacing: 0.14em; margin-right: -0.14em; }
  .splash-desc { font-size: 12.5px; }
  .splash-brand .brand-label { letter-spacing: 0.12em; font-size: 9px; }
}
/* Celular deitado / telas baixas: versão compacta, tudo cabe sem rolar */
@media (max-height: 500px) and (orientation: landscape) {
  .splash-top { padding: 12px 20px; }
  .splash-top-brand svg { width: 26px; height: 26px; }
  .splash-top-brand span { font-size: 11px; }
  .splash-top-brand small { font-size: 9px; }
  #screen-splash .splash-content { padding: 52px 24px 12px; gap: 10px; }
  .logo-emblem { display: none; }
  .logo-wrapper { gap: 8px; }
  .logo-title { font-size: 40px; }
  .splash-desc { font-size: 12.5px; line-height: 1.5; }
  .btn-start-hero { padding: 12px 32px; font-size: 13px; --cut: 10px; }
  .splash-brand { margin-top: 0; gap: 4px; }
  .splash-brand .brand-label { display: none; }
  #screen-splash .brand-logo-png, #screen-splash .brand-logo-img { height: 20px; }
  #screen-splash .brand-logo-edufc-img { height: 34px; }
  #screen-splash .brand-logos-divider { height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-icon, .btn-glow { animation: none; }
}

/* Celular deitado: botões de decisão compactos, pra não cobrir o cenário */
@media (max-height: 500px) and (orientation: landscape) {
  .scenario-wrapper { padding: 10px 16px; gap: 10px; }
  .decision-section { padding: 10px 12px; gap: 8px; }
  .decision-section .step-label { display: none; }
  .decision-buttons { gap: 10px; }
  .decision-btn { flex-direction: row; justify-content: center; gap: 10px; padding: 10px 12px; }
  .decision-icon svg { width: 22px; height: 22px; }
}
