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

body {
  font-family: 'Inter', sans-serif;
  background: #0b1628;
  color: #e8edf3;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

a { color: inherit; }

.screen {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===========================================================
   INVOCASH HEADER
   =========================================================== */

.invocash-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-logo {
  height: 38px;
  object-fit: contain;
  filter: brightness(1.5);
}

.header-logo-fallback {
  display: flex;
  align-items: center;
}

.fallback-text {
  font-weight: 700;
  font-size: 17px;
  color: #6b9cc4;
  letter-spacing: 1.5px;
}

.header-badge {
  background: rgba(0,102,204,0.12);
  color: #6b9cc4;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0,102,204,0.2);
}

/* ===========================================================
   START SCREEN
   =========================================================== */

#screen-start {
  background: linear-gradient(180deg, #0b1628 0%, #101a2e 50%, #0f1520 100%);
}

.start-content {
  text-align: center;
  padding: 16px 24px;
  max-width: 520px;
  width: 100%;
  max-height: 100vh;
  overflow-y: auto;
}

.fire-emoji {
  font-size: 44px;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.game-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 38px;
  line-height: 1.1;
  margin: 8px 0;
  color: #fff;
  letter-spacing: -0.5px;
}

.game-title .highlight {
  background: linear-gradient(135deg, #ff6b35, #ffcc02);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-title span {
  font-size: 18px;
  font-weight: 400;
  color: #6b9cc4;
  -webkit-text-fill-color: #6b9cc4;
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
  margin: 2px 0;
}

.subtitle {
  font-size: 14px;
  color: #ff9f43;
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.rules-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.rules-box p {
  font-size: 14px;
  color: #b0bec5;
  margin: 4px 0;
  line-height: 1.5;
}

.rules-box .tagline {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.rules-box .tagline a {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 700;
}

/* Buttons - more professional */
.btn-fire {
  background: #0066cc;
  color: #fff;
  border: none;
  padding: 13px 40px;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 2px 12px rgba(0,102,204,0.3);
  display: inline-block;
}

.btn-fire:hover {
  background: #0055aa;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,102,204,0.4);
}

.btn-fire:active {
  transform: translateY(0);
}

.btn-fire.btn-play {
  background: linear-gradient(135deg, #ff6b35, #e85d2c);
  box-shadow: 0 2px 16px rgba(255,107,53,0.3);
  font-size: 18px;
  padding: 14px 48px;
}

.btn-fire.btn-play:hover {
  background: linear-gradient(135deg, #e85d2c, #d04e20);
  box-shadow: 0 4px 24px rgba(255,107,53,0.45);
}

.btn-secondary {
  background: transparent;
  color: #6b9cc4;
  border: 1px solid rgba(107,156,196,0.25);
  padding: 9px 28px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s;
  display: inline-block;
}

.btn-secondary:hover {
  background: rgba(107,156,196,0.08);
}

.btn-invocash {
  display: inline-block;
  background: #0066cc;
  color: #fff;
  text-decoration: none;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  margin: 8px 0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 16px rgba(0,102,204,0.3);
}

.btn-invocash:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(0,102,204,0.45);
}

.prize-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,204,2,0.15);
  border-radius: 10px;
  padding: 14px;
  margin: 16px 0 10px;
}

.prize-icon { font-size: 24px; }

.prize-box p {
  font-size: 13px;
  color: #b0bec5;
  margin-top: 4px;
  line-height: 1.6;
}

.prize-box a {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 600;
}

/* Footer */
.invocash-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.cta-link {
  color: #b0bec5;
  text-decoration: none;
  font-size: 15px;
  display: block;
}

.cta-link strong {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 700;
}

.footer-sub {
  color: #4a6a85;
  font-size: 12px;
  margin-top: 6px;
  font-style: italic;
}

/* ===========================================================
   GAME SCREEN
   =========================================================== */

#screen-game {
  background: #070b14;
  flex-direction: column;
}

#game-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  z-index: 20;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.hud-score { color: #ffcc02; }
.hud-petardos { color: #ff6b35; }

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* ===========================================================
   GAME OVER SCREEN
   =========================================================== */

#screen-gameover {
  background: linear-gradient(180deg, #0b1628 0%, #101a2e 50%, #0f1520 100%);
}

.gameover-content {
  text-align: center;
  padding: 16px 24px;
  max-width: 520px;
  width: 100%;
  max-height: 100vh;
  overflow-y: auto;
}

.gameover-invocash-header { margin-bottom: 12px; }

.gameover-logo {
  height: 34px;
  object-fit: contain;
  filter: brightness(1.5);
}

.gameover-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 32px;
  color: #ff6b35;
  letter-spacing: 1px;
}

.final-score { margin: 12px 0; }

.final-score span {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 64px;
  background: linear-gradient(135deg, #ffcc02, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.final-score small {
  display: block;
  color: #6b9cc4;
  font-size: 14px;
  font-weight: 400;
  margin-top: -4px;
}

.score-msg {
  color: #b0bec5;
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.destroy-stat {
  font-size: 12px;
  color: #4a6a85;
}

.gameover-cta {
  background: rgba(0,102,204,0.08);
  border: 1px solid rgba(0,102,204,0.2);
  border-radius: 10px;
  padding: 18px;
  margin: 16px 0;
}

.gameover-cta p {
  color: #b0bec5;
  font-size: 14px;
  margin-bottom: 6px;
}

.gameover-tagline {
  color: #4a6a85 !important;
  font-size: 12px !important;
  font-style: italic;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
}

/* Form */
#register-form { margin: 16px 0; }

#register-form input {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 8px auto;
  padding: 11px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
}

#register-form input::placeholder { color: #4a6a85; }

#register-form input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.15);
}

.register-text { color: #b0bec5; font-size: 13px; margin-bottom: 6px; line-height: 1.5; }

.consent-label {
  display: table;
  max-width: 300px;
  margin: 12px auto;
  text-align: left;
  cursor: pointer;
}

.consent-label input[type="checkbox"] {
  display: table-cell;
  vertical-align: top;
  width: 20px;
  min-width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #0066cc;
  cursor: pointer;
}

.consent-label span {
  display: table-cell;
  vertical-align: top;
  font-size: 11px;
  color: #6b9cc4;
  line-height: 1.5;
  padding-left: 8px;
}

.consent-label a {
  color: #4fc3f7;
  text-decoration: underline;
}
.error-text { color: #e74c3c; font-size: 13px; margin-top: 4px; }
.thanks-text { color: #0066cc; font-size: 16px; font-weight: 600; margin: 14px 0; }
.gameover-actions { margin-top: 14px; }
.gameover-actions .btn-fire { margin-right: 8px; }

/* ===========================================================
   RANKING SCREEN
   =========================================================== */

#screen-ranking {
  background: linear-gradient(180deg, #0b1628 0%, #101a2e 50%, #0f1520 100%);
}

.ranking-content {
  text-align: center;
  padding: 16px 24px;
  max-width: 520px;
  width: 100%;
  max-height: 100vh;
  overflow-y: auto;
}

.ranking-header { margin-bottom: 14px; }

.ranking-logo {
  height: 34px;
  object-fit: contain;
  filter: brightness(1.5);
}

.ranking-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ranking-subtitle { color: #6b9cc4; font-size: 12px; margin-bottom: 18px; }
.ranking-subtitle a { color: #0066cc; text-decoration: underline; font-weight: 600; }

.ranking-list { text-align: left; max-width: 420px; margin: 0 auto 14px; }

.ranking-entry {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.ranking-entry:nth-child(1) { background: rgba(255,204,2,0.08); border: 1px solid rgba(255,204,2,0.2); }
.ranking-entry:nth-child(2) { background: rgba(192,192,192,0.06); border: 1px solid rgba(192,192,192,0.15); }
.ranking-entry:nth-child(3) { background: rgba(205,127,50,0.06); border: 1px solid rgba(205,127,50,0.15); }

.rank-pos { font-weight: 800; font-size: 18px; color: #ff6b35; width: 36px; text-align: center; }
.ranking-entry:nth-child(1) .rank-pos { color: #ffcc02; }
.ranking-entry:nth-child(2) .rank-pos { color: #c0c0c0; }
.ranking-entry:nth-child(3) .rank-pos { color: #cd7f32; }
.rank-name { flex: 1; font-size: 14px; font-weight: 600; }
.rank-score { font-weight: 800; font-size: 18px; color: #ffcc02; }
.ranking-stats { color: #4a6a85; font-size: 12px; margin-bottom: 14px; }
.ranking-empty { color: #4a6a85; padding: 30px; font-size: 14px; }

.ranking-gate-text {
  color: #b0bec5;
  font-size: 14px;
  margin: 16px 0;
  line-height: 1.5;
}

.gate-input {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 8px auto;
  padding: 11px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
}

.gate-input::placeholder { color: #4a6a85; }

.gate-input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.15);
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */

@media (max-height: 700px) {
  .game-title { font-size: 30px; }
  .fire-emoji { font-size: 32px; }
  .prize-box { padding: 8px; margin: 8px 0; }
  .btn-fire { padding: 10px 28px; font-size: 15px; }
  .final-score span { font-size: 48px; }
  .gameover-cta { padding: 12px; margin: 10px 0; }
}

@media (max-height: 550px) {
  .game-title { font-size: 24px; }
  .fire-emoji { display: none; }
  .rules-box { padding: 6px 10px; margin-bottom: 8px; }
  .prize-box { display: none; }
  .invocash-header { margin-bottom: 6px; padding: 6px 0; }
}
