:root {
  --primary-pink: #ff2e93;
  --primary-purple: #7928ca;
  --accent-gold: #ffb800;
  --bg-gradient-top: #1e1035;
  --bg-gradient-bottom: #0d0618;
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.15);
  --text-white: #ffffff;
  --text-dim: #cbd5e1;
  --font-display: 'Nunito', 'Fredoka', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-display);
  background: radial-gradient(circle at 50% 25%, #4c1d68, #210a3c 60%, #0d041a 100%);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 10px;
}

#game-container {
  width: 100%;
  max-width: 960px;
  height: 94vh;
  max-height: 950px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(circle at 50% 15%, rgba(68, 25, 110, 0.95), rgba(16, 7, 32, 0.98) 85%);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 50px rgba(255, 46, 147, 0.3), inset 0 0 25px rgba(255, 208, 0, 0.1);
  border-radius: 28px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

@media (max-width: 600px) {
  body {
    padding: 0;
  }
  #game-container {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    max-width: 100%;
  }
}

/* TOP HUD */
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 8px;
  z-index: 10;
}

.hud-brand-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #ff2e93, #ff8a00);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 46, 147, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.hud-brand-pill:hover {
  transform: scale(1.04);
  filter: brightness(1.1);
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.hud-controls {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}

/* STATS ROW */
.hud-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr 1fr;
  gap: 10px;
  padding: 4px 20px 8px;
  z-index: 10;
}

.stat-card {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 8px 10px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
}

.stat-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.8px;
}

.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
}

.score-card .stat-value { color: #ffd000; text-shadow: 0 0 12px rgba(255, 208, 0, 0.4); }
.combo-card .stat-value { color: #38bdf8; text-shadow: 0 0 12px rgba(56, 189, 248, 0.4); }
.wave-card .stat-value { color: #c084fc; font-size: 16px; line-height: 26px; font-weight: 900; }
.timer-card .stat-value { color: #f43f5e; text-shadow: 0 0 12px rgba(244, 63, 94, 0.4); }

.timer-card.timer-boost {
  background: rgba(34, 197, 94, 0.45) !important;
  border-color: #22c55e !important;
  transform: scale(1.18) !important;
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.8) !important;
  transition: all 0.2s ease !important;
}

.timer-card.timer-boost .stat-value {
  color: #4ade80 !important;
}

/* TOFFEE LOGO BADGE */
.toffee-logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
  filter: drop-shadow(0 8px 22px rgba(255, 184, 0, 0.5));
  animation: toffee-float 2.8s ease-in-out infinite alternate;
}

.toffee-logo-svg {
  width: 150px;
  height: 95px;
}

@keyframes toffee-float {
  0% { transform: translateY(0) rotate(-3deg) scale(1); }
  100% { transform: translateY(-8px) rotate(3deg) scale(1.04); }
}

/* FEVER METER */
.fever-meter-wrap {
  padding: 0 16px 6px;
  z-index: 10;
}

.fever-meter-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fever-meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff007a, #ffd000, #ff007a);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
  transition: width 0.2s ease;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.fever-label {
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  color: #fbbf24;
  margin-top: 3px;
  letter-spacing: 0.5px;
}

/* CANVAS WRAPPER */
.canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* FEVER BANNER OVERLAY */
.fever-banner {
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  pointer-events: none;
  animation: pulse-banner 0.6s infinite alternate;
  z-index: 15;
}

@keyframes pulse-banner {
  0% { transform: scale(0.96); filter: drop-shadow(0 0 10px #ff2e93); }
  100% { transform: scale(1.04); filter: drop-shadow(0 0 25px #ffd000); }
}

.fever-text {
  font-size: 22px;
  font-weight: 900;
  color: #fffb00;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 15px #ff2e93;
}

.fever-sub {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  margin-top: 4px;
}

/* OVERLAYS */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 6, 24, 0.94);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px;
  z-index: 35;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.25s ease;
}

.overlay-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  border: 2px solid rgba(255, 215, 0, 0.25);
  border-radius: 28px;
  padding: 26px 22px;
  width: 100%;
  max-width: 560px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 46, 147, 0.2);
  margin: auto 0;
  flex-shrink: 0;
}

.game-title {
  font-size: 34px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd000 20%, #ff2e93 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  text-shadow: 0 8px 24px rgba(255, 46, 147, 0.4);
}

.game-subtitle {
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.5;
  margin-bottom: 18px;
}

.sponsor-ticker {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.ticker-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 6px;
}

.ticker-items {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ticker-brand-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 900;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #ff2e93, #7928ca);
  color: #fff;
  padding: 14px 28px;
  font-size: 16px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(255, 46, 147, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 46, 147, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 14px 20px;
  font-size: 15px;
  width: 100%;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  background: linear-gradient(135deg, #ffb800, #ff8a00);
  color: #000;
  font-weight: 900;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 10px;
}

.btn-full {
  width: 100%;
  margin-top: 14px;
}

.pulse-btn {
  animation: pulse-button 1.6s infinite;
}

@keyframes pulse-button {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.b2b-link-container {
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover {
  color: #ffffff;
}

/* GAMEOVER CARD */
.gameover-card {
  max-height: none;
  overflow: visible;
  padding-top: 22px;
  padding-bottom: 22px;
}

.gameover-title {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.final-score-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.final-label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.final-score {
  font-size: 40px;
  font-weight: 900;
  color: #ffd000;
  line-height: 1.1;
  display: block;
}

.high-score-note {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 700;
}

/* BRAND COUPONS SECTION */
.unlocked-coupons-section {
  text-align: left;
  margin-bottom: 16px;
}

.section-title {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 8px;
}

.coupons-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coupon-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border: 1px dashed rgba(255, 215, 0, 0.5);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.coupon-info h5 {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.coupon-info p {
  font-size: 11px;
  color: #cbd5e1;
}

.coupon-badge {
  background: #ffb800;
  color: #000;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 6px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 3px;
}

.coupon-btn {
  background: #22c55e;
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.action-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.gameover-ad-banner {
  background: linear-gradient(90deg, rgba(147, 51, 234, 0.35), rgba(236, 72, 153, 0.35));
  border: 1px solid rgba(236, 72, 153, 0.5);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  margin-top: 14px;
  flex-shrink: 0;
}

.ad-banner-text strong {
  display: block;
  font-size: 12px;
  color: #fbcfe8;
}

.ad-banner-text span {
  font-size: 10px;
  color: #cbd5e1;
}

/* MODAL DIALOGS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-dialog {
  background: linear-gradient(165deg, #241142, #110722);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.modal-sm {
  max-width: 440px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-header {
  margin-bottom: 18px;
}

.badge {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 6px;
}

.badge-accent {
  background: #ff2e93;
  color: #fff;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
}

.modal-header p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

/* SIMULATOR BOX */
.simulator-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 18px;
}

.simulator-box h3 {
  font-size: 14px;
  font-weight: 800;
  color: #ffd000;
  margin-bottom: 4px;
}

.sim-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.sim-controls {
  display: grid;
  grid-template-columns: 2fr 2fr 44px;
  gap: 8px;
  margin-bottom: 10px;
}

.sim-controls input[type="text"],
.sim-controls select,
.inquiry-form input,
.inquiry-form select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.sim-controls input[type="color"] {
  width: 100%;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
}

.sim-preview-area {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
}

#sim-canvas {
  width: 100%;
  max-width: 300px;
  height: 90px;
}

.sim-demo-text {
  font-size: 11px;
  color: #a7f3d0;
  font-weight: 700;
  margin-top: 4px;
}

/* TIERS GRID */
.tiers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 540px) {
  .tiers-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.tier-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.tier-platinum {
  border-color: #ffd000;
  background: linear-gradient(160deg, rgba(255, 208, 0, 0.12), rgba(255, 255, 255, 0.04));
}

.tier-badge {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffd000;
  margin-bottom: 4px;
}

.tier-card h4 {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.tier-price {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  margin: 6px 0 10px;
}

.tier-price span {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.tier-card ul {
  list-style: none;
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* CONTACT ACTIONS */
.contact-actions {
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
}

.contact-actions h3 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.contact-actions p {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.instant-contact-buttons {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  text-align: center;
  justify-content: center;
}

.btn-whatsapp:hover {
  background: #20ba5a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* INQUIRY FORM */
.inquiry-form {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 14px;
}

.form-title {
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.lead-status {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.lead-status.success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid #22c55e;
}

.lead-status.error {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid #ef4444;
}

/* HOW TO PLAY LEGEND */
.legend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  text-align: left;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
}

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

.hazard-item {
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

.hidden {
  display: none !important;
}
