:root {
  --red: #d0272a;
  --red-dark: #b01f22;
  --yellow: #f4d100;
  --green: #2e8b3d;
  --green-dark: #226b2e;
  --danger: #c0392b;
  --ink: #1a1a1a;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--red);
  font-family: "Arial Rounded MT Bold", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}

.topbar {
  width: 100%;
  max-width: 520px;
  text-align: center;
  margin-bottom: 12px;
}

.topbar h1 {
  color: var(--white);
  font-size: clamp(22px, 6vw, 34px);
  letter-spacing: 1px;
  margin: 8px 0;
  text-transform: uppercase;
}

.topbar .highlight {
  color: var(--yellow);
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--white);
  border-radius: 28px;
  padding: 28px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-height: 60vh;
  justify-content: center;
}

/* ---------- Candidate photo ---------- */
.photo-wrap {
  width: 160px;
  height: 160px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--yellow);
  border: 4px solid var(--red);
  flex-shrink: 0;
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nome {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  margin: 0;
}

.cargo {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: #444;
  text-align: center;
  margin: -12px 0 0 0;
}

.extra {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-top: -8px;
}

/* ---------- Number boxes ---------- */
.numero-boxes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.digit-box {
  width: 52px;
  height: 62px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  background: var(--white);
}

.digit-box.filled {
  border-color: var(--ink);
}

.digit-box.correct {
  background: #d9f3dc;
  border-color: var(--green);
  color: var(--green-dark);
}

.digit-box.wrong {
  background: #fbdedb;
  border-color: var(--danger);
  color: var(--danger);
}

.digit-box.reveal {
  background: var(--yellow);
  border-color: var(--ink);
}

/* ---------- Timer ---------- */
.timer-wrap {
  width: 100%;
  max-width: 320px;
}

.timer-bar-bg {
  width: 100%;
  height: 10px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 6px;
  transition: width 1s linear;
}

.timer-label {
  text-align: center;
  font-size: 13px;
  color: #555;
  margin-top: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 26px;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--white);
  background: var(--green);
  transition: transform 0.05s ease, background 0.15s ease;
}

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

.btn.secondary {
  background: #888;
}

.btn.big {
  padding: 16px 36px;
  font-size: 18px;
}

/* ---------- Urna eletrônica ---------- */
.urna {
  width: 100%;
  max-width: 300px;
  background: linear-gradient(180deg, #4a4e54, #35383d);
  border-radius: 20px;
  padding: 14px 14px 18px;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.08),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4),
    0 10px 22px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.urna-label {
  text-align: center;
  color: #cfd2d6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.urna-screen {
  background: #0c1f11;
  border: 3px solid #1f2327;
  border-radius: 6px;
  padding: 10px 6px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.7);
}

.lcd-digit {
  width: 28px;
  height: 40px;
  background: #08150c;
  color: #43f16b;
  font-family: "Courier New", monospace;
  font-weight: 800;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  text-shadow: 0 0 6px rgba(67, 241, 107, 0.65);
}

.lcd-digit.empty {
  color: #16391f;
}

.lcd-digit.correct {
  color: #6dffa0;
  text-shadow: 0 0 8px rgba(109, 255, 160, 0.85);
}

.lcd-digit.wrong {
  color: #ff5b4d;
  text-shadow: 0 0 8px rgba(255, 91, 77, 0.85);
}

.urna-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.urna-key {
  background: #eceeec;
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  font-size: 19px;
  font-weight: 800;
  padding: 13px 0;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.urna-key:active {
  transform: translateY(1px);
  box-shadow: none;
}

.urna-key.corrige {
  background: #e08b1d;
  color: var(--white);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.urna-key.branco {
  background: #f6f6f1;
  color: #333;
  border: 1px solid #ccc;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.urna-confirma {
  grid-column: span 3;
  background: linear-gradient(180deg, #3fae4f, var(--green-dark));
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 14px 0;
  cursor: pointer;
  box-shadow: 0 3px 0 #1f6b2c;
}

.urna-confirma:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.urna-confirma:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}

/* ---------- Feedback ---------- */
.feedback {
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.feedback.correct {
  color: var(--green-dark);
}

.feedback.wrong {
  color: var(--danger);
}

/* ---------- Progress dots ---------- */
.progress-footer {
  margin-top: 14px;
}

.progress-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.dot.active {
  background: var(--yellow);
}

.dot.done-correct {
  background: var(--green);
}

.dot.done-wrong {
  background: var(--danger);
}

/* ---------- Summary screen ---------- */
.summary-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f7f7f7;
}

.summary-row img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.summary-row .info {
  flex: 1;
}

.summary-row .info .n {
  font-weight: 800;
  font-size: 14px;
}

.summary-row .info .num {
  font-size: 13px;
  color: #555;
}

.summary-row .mark {
  font-size: 22px;
}

.score {
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 900;
  text-align: center;
}
