/* ============================================================
   JOGO DESENHADO EM BASE FIXA 1280x720
   A tela inteira é escalada pelo JS (#app) para caber em
   qualquer TV, sem rolagem e sem cortar informações.
   ============================================================ */

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

:root {
  --ink: #2b1d0e;
  --paper: #f7ecd7;
  --paper-dark: #efe0c0;
  --red: #c0392b;
  --red-dark: #96281b;
  --gold: #f1c40f;
  --blue: #2980b9;
  --green: #27ae60;
  --orange: #e67e22;
  --purple: #8e44ad;
}

html, body {
  height: 100%;
  font-family: 'Inter', Arial, sans-serif;
  background: #1f1308;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body { font-size: 13px; }

.hidden { display: none !important; }

/* ============ APP (área escalada 1280x720) ============ */
#app {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle at 20% 10%, #3a2a1a 0%, #1f1308 70%);
  overflow: hidden;
}

/* ============ TELAS ============ */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.screen.active { display: flex; }
#game-screen { justify-content: flex-start; padding: 0; }

/* ============ MENU ============ */
.menu-content {
  width: 1240px;
  background: var(--paper);
  border-radius: 22px;
  border: 5px solid var(--gold);
  box-shadow: 0 16px 50px rgba(0,0,0,.6);
  padding: 16px 26px 20px;
  text-align: center;
}

.menu-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 11px;
  margin-bottom: 8px;
}
.banner-star { color: var(--gold); }

.game-title {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 46px;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--ink);
  text-shadow: 3px 3px 0 rgba(0,0,0,.08);
}
.title-accent { color: var(--red); }

.subtitle {
  font-size: 14px;
  color: #7a5a34;
  font-weight: 600;
  margin-top: 2px;
}

.menu-columns {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  margin-top: 12px;
  align-items: stretch;
}
.menu-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.story-box {
  background: #fff8e8;
  border: 2px dashed #c9a86a;
  border-radius: 14px;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
}
.story-box p + p { margin-top: 6px; }

.how-to { text-align: left; }
.how-to h3, .team-setup h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--red-dark);
  margin-bottom: 6px;
}
.how-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.how-card {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  border-bottom: 4px solid var(--gold);
  text-align: left;
  font-size: 11px;
  line-height: 1.35;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.how-quiz { border-bottom-color: var(--blue); }
.how-curio { border-bottom-color: var(--green); }
.how-desafio { border-bottom-color: var(--orange); }
.how-icon { font-size: 22px; line-height: 1; }
.how-card strong { display: block; margin-bottom: 2px; font-size: 12px; }

.menu-right { min-width: 0; }
.team-setup {
  background: var(--paper-dark);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  height: 100%;
}
.setup-hint { font-size: 11.5px; color: #7a5a34; margin-bottom: 8px; }

.team-count-btns { display: flex; gap: 10px; margin-bottom: 10px; }
.count-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.count-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red-dark);
  transform: scale(1.12);
}

.team-inputs { display: grid; gap: 8px; }

.team-input-row {
  display: grid;
  grid-template-columns: 1.3fr 2fr auto;
  gap: 8px;
  align-items: center;
}
.team-input-row input, .team-input-row select {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #c9a86a;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  background: #fff;
  outline: none;
}
.team-input-row input:focus, .team-input-row select:focus { border-color: var(--red); }
.team-input-row .team-color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #c9a86a;
  justify-self: center;
}

.btn-glow {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(180deg, #e74c3c, var(--red-dark));
  border: none;
  border-radius: 12px;
  padding: 12px 32px;
  cursor: pointer;
  box-shadow: 0 5px 0 #6e1a10, 0 10px 20px rgba(0,0,0,.35);
  transition: transform .12s, box-shadow .12s;
  min-width: 220px;
}
.btn-glow:hover { transform: translateY(-2px); }
.btn-glow:active { transform: translateY(4px); box-shadow: 0 1px 0 #6e1a10; }

.btn-secondary {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  background: #fff;
  border: 2px solid #c9a86a;
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
  margin-top: 6px;
}
.btn-secondary:hover { border-color: var(--red); color: var(--red); }

.footnote { margin-top: 10px; font-size: 11px; color: #7a5a34; }

/* ============ CABEÇALHO DO JOGO ============ */
.game-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: rgba(31,19,8,.92);
  border-bottom: 3px solid var(--gold);
}
.game-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--gold);
  letter-spacing: 2px;
  font-size: 18px;
}
.header-left, .header-right { display: flex; gap: 8px; align-items: center; }
.header-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: none;
  background: var(--paper-dark);
  font-size: 16px;
  cursor: pointer;
}
.header-btn:hover { background: var(--gold); }

/* ============ LAYOUT DO JOGO ============ */
#game-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 56px 14px 14px;
  align-items: stretch;
}

#board-container { position: relative; min-height: 0; }

#board {
  position: relative;
  height: 100%;
  min-height: 480px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.12), transparent 60%),
    linear-gradient(160deg, #d9b46a, #b8893f);
  border-radius: 20px;
  border: 7px solid #6e4a1e;
  box-shadow: inset 0 0 40px rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.4);
  padding: 14px;
  overflow: hidden;
}

#board-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 10px;
  height: 100%;
}

.house {
  position: relative;
  border-radius: 12px;
  border: 3px solid #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
  font-family: 'Inter', sans-serif;
  min-height: 0;
  padding: 4px;
}
.house .house-num {
  position: absolute;
  top: 3px; left: 7px;
  font-size: 10px;
  font-weight: 800;
  opacity: .55;
}
.house .house-icon { font-size: 26px; line-height: 1; }
.house .house-label { font-size: 8.5px; font-weight: 700; letter-spacing: .4px; line-height: 1.1; margin-top: 2px; }

.house.house-start {
  background: linear-gradient(160deg, #ff6b5e, var(--red));
  color: #fff;
  border-color: #ffd9d5;
}
.house.house-finish {
  background: linear-gradient(160deg, #ffe066, var(--gold));
  color: var(--ink);
  border-color: #fff;
  animation: pulse-finish 1.6s infinite;
}
.house.house-quiz { background: linear-gradient(160deg, #5dade2, var(--blue)); color: #fff; }
.house.house-curio { background: linear-gradient(160deg, #58d68d, var(--green)); color: #fff; }
.house.house-desafio { background: linear-gradient(160deg, #f0a35e, var(--orange)); color: #fff; }

@keyframes pulse-finish {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 7px rgba(255,224,102,.35); }
}

/* PEÇAS */
#tokens-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.token {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,.5);
  box-shadow: 0 4px 8px rgba(0,0,0,.4);
  transition: left .6s cubic-bezier(.3,1.4,.4,1), top .6s cubic-bezier(.3,1.4,.4,1);
  z-index: 10;
}
.token.current { box-shadow: 0 0 0 6px rgba(255,255,255,.9); }

/* ============ LATERAL ============ */
#sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
#turn-card {
  background: var(--paper);
  border-radius: 14px;
  border: 4px solid var(--gold);
  padding: 10px;
  text-align: center;
}
.turn-label { font-size: 10px; font-weight: 700; color: #7a5a34; letter-spacing: 1px; }
.turn-name { font-family: 'Bebas Neue', sans-serif; font-size: 30px; line-height: 1; }
.turn-group { font-size: 11px; color: #7a5a34; font-weight: 600; margin-top: 2px; }

.dice-area {
  background: var(--paper-dark);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dice {
  width: 72px;
  height: 72px;
  background: #fff;
  border-radius: 16px;
  border: 4px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 800;
  box-shadow: 0 5px 0 var(--ink);
}
.dice.rolling { animation: dice-shake .5s infinite; }
@keyframes dice-shake {
  0% { transform: rotate(0deg) translate(0,0); }
  25% { transform: rotate(12deg) translate(-5px,-3px); }
  50% { transform: rotate(-12deg) translate(5px,3px); }
  75% { transform: rotate(8deg) translate(-3px,2px); }
  100% { transform: rotate(0deg) translate(0,0); }
}
.dice-area .btn-glow { min-width: 100%; padding: 10px 12px; font-size: 19px; }

#teams-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
  justify-content: flex-start;
}
.team-panel {
  background: #fff;
  border-radius: 12px;
  border-left: 9px solid #ccc;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.team-panel.active { outline: 4px solid var(--gold); }
.team-panel .team-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}
.team-panel .team-meta { flex: 1; min-width: 0; }
.team-panel .team-name { font-weight: 800; font-size: 13px; }
.team-panel .team-group { font-size: 10px; color: #7a5a34; }
.team-panel .team-pos { font-size: 10px; color: #999; font-weight: 600; }
.team-panel .team-points {
  text-align: center;
  background: #fff8e0;
  border: 2px solid var(--gold);
  border-radius: 9px;
  padding: 3px 9px;
  flex-shrink: 0;
}
.team-panel .team-points .pts-val { font-weight: 800; font-size: 17px; line-height: 1; }
.team-panel .team-points .pts-lbl { font-size: 8px; color: #7a5a34; font-weight: 700; }

/* ============ MODAIS ============ */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  width: 820px;
  max-height: 94%;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px;
  border: 5px solid var(--gold);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  padding: 20px 26px;
  animation: modal-in .3s ease;
}
@keyframes modal-in {
  from { transform: scale(.85) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.modal-team { font-family: 'Bebas Neue', sans-serif; font-size: 24px; color: var(--red-dark); letter-spacing: 1px; }
.modal-type-badge {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  padding: 5px 13px;
  border-radius: 999px;
  letter-spacing: 1px;
}
.badge-quiz { background: var(--blue); }
.badge-curio { background: var(--green); }
.badge-desafio { background: var(--orange); }
.badge-debate { background: var(--purple); }

/* QUIZ */
.quiz-question {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 14px;
}
.quiz-options { display: grid; gap: 10px; }
.quiz-opt {
  text-align: left;
  font-size: 14.5px;
  font-weight: 600;
  background: #fff;
  border: 3px solid #c9a86a;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.quiz-opt:hover { border-color: var(--red); transform: scale(1.01); }
.quiz-opt.correct {
  background: #d5f5e3;
  border-color: var(--green);
  color: #145a32;
}
.quiz-opt.wrong {
  background: #fadbd8;
  border-color: var(--red);
  color: #7b241c;
}
.quiz-opt:disabled { cursor: default; }
.quiz-feedback {
  margin-top: 12px;
  background: #fff8e8;
  border-left: 6px solid var(--gold);
  border-radius: 10px;
  padding: 10px 14px;
}
#quiz-verdict { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
#quiz-verdict.correct-verdict { color: #145a32; }
#quiz-verdict.wrong-verdict { color: #7b241c; }
.quiz-info { font-size: 13px; line-height: 1.45; }

.modal-footer { margin-top: 14px; text-align: center; }
.modal-footer .btn-glow { min-width: 200px; }

/* CURIOSIDADE */
.curio-emoji { font-size: 46px; text-align: center; margin: 4px 0; }
.curio-text { font-size: 19px; font-weight: 800; text-align: center; line-height: 1.35; }
.curio-info {
  margin-top: 12px;
  background: #eafaf1;
  border-left: 6px solid var(--green);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
}

/* DESAFIO */
.desafio-emoji { font-size: 42px; text-align: center; margin: 4px 0; }
.desafio-text { font-size: 18px; font-weight: 800; text-align: center; line-height: 1.35; }
.desafio-dica { margin-top: 10px; font-size: 12.5px; color: #7a5a34; text-align: center; font-style: italic; }
.desafio-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.btn-yes, .btn-maybe, .btn-no {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 12.5px;
  padding: 13px 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: transform .12s;
}
.btn-yes { background: var(--green); }
.btn-maybe { background: var(--orange); }
.btn-no { background: var(--red); }
.btn-yes:hover, .btn-maybe:hover, .btn-no:hover { transform: scale(1.04); }

/* FIM DE JOGO */
.end-icon { font-size: 62px; text-align: center; }
#end-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  text-align: center;
  color: var(--red-dark);
  line-height: 1.05;
}
.end-sub { text-align: center; color: #7a5a34; font-weight: 600; margin: 3px 0 12px; font-size: 13px; }
.end-ranking { display: grid; gap: 8px; margin-bottom: 12px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  border-left: 9px solid #ccc;
}
.rank-row .rank-num { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--gold); width: 38px; text-align: center; }
.rank-row .rank-name { font-weight: 800; flex: 1; font-size: 14px; }
.rank-row .rank-pts { font-weight: 700; color: #7a5a34; font-size: 12.5px; }
.rank-row.winner { outline: 4px solid var(--gold); }
.end-modal .btn-glow, .end-modal .btn-secondary { display: block; margin: 6px auto; }
.end-modal .btn-glow { font-size: 17px; }

/* DEBATE */
.debate-question {
  font-family: 'Caveat', cursive;
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  color: var(--red);
  margin: 8px 0 14px;
  line-height: 1.15;
}
.debate-points { list-style: none; display: grid; gap: 8px; margin-bottom: 12px; }
.debate-points li {
  background: #fff;
  border-radius: 10px;
  border-left: 6px solid var(--purple);
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.45;
}
.debate-challenge {
  background: #f4ecf7;
  border: 2px dashed var(--purple);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
}

/* ============ CONFETES ============ */
.confetti-layer { position: absolute; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti {
  position: absolute;
  width: 12px;
  height: 16px;
  top: -22px;
  border-radius: 3px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(760px) rotate(720deg); opacity: .5; }
}
