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

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 60%, #1b1b4b 0%, #06060f 100%);
  color: white;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* Sterrenachtergrond (volledig scherm, achter alles) */
#sterren-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 32px 24px;
  text-align: center;
}

h1 {
  font-size: 2rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 24px;
  text-shadow: 0 0 20px rgba(100, 150, 255, 0.8);
}

.app-navigatie {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.app-link {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(159, 211, 255, 0.35);
  background: rgba(14, 28, 58, 0.72);
  color: #dce9ff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.app-link:hover {
  background: rgba(24, 41, 75, 0.92);
}

.terug-start {
  background: rgba(24, 41, 75, 0.92);
}

/* ---- Verbinding ---- */
.verbinding {
  margin-bottom: 40px;
}

#connect_disconnect {
  background: #2c3e70;
  color: white;
  border: 1px solid #4a6fa5;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

#connect_disconnect:hover { background: #3d5a9a; }

/* ---- Shelly IP invoer ---- */
.shelly-invoer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.shelly-invoer label {
  color: #9fbfff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.shelly-invoer input[type="text"] {
  background: #14213d;
  border: 1px solid #5177c2;
  color: #f8fbff;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.95rem;
  width: 160px;
}

.shelly-invoer input[type="text"]::placeholder { color: #6680aa; }
.shelly-invoer input[type="text"]:focus {
  outline: none;
  border-color: #7fa8ff;
  box-shadow: 0 0 0 2px rgba(127, 168, 255, 0.2);
}

.shelly-invoer button {
  background: #2c3e70;
  color: white;
  border: 1px solid #4a6fa5;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.shelly-invoer button:hover { background: #3d5a9a; }

.status-neutraal { color: #f39c12; font-weight: bold; margin-top: 8px; }

.status-aan { color: #2ecc71; font-weight: bold; margin-top: 8px; }
.status-uit { color: #e74c3c; font-weight: bold; margin-top: 8px; }

/* ---- Fases ---- */
.fase { animation: fadeIn 0.4s ease; }
.verborgen { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Knoppen ---- */
.grote-knop {
  border: none;
  padding: 18px 40px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: transform 0.1s;
}

.grote-knop:active { transform: scale(0.97); }

.start-knop {
  background: linear-gradient(135deg, #2980b9, #1abc9c);
  color: white;
  box-shadow: 0 0 24px rgba(26, 188, 156, 0.5);
}

.lanceer-knop {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  font-size: 1.5rem;
  padding: 22px 56px;
  box-shadow: 0 0 32px rgba(231, 76, 60, 0.7);
  animation: pulseerRood 1s infinite;
}

@keyframes pulseerRood {
  0%, 100% { box-shadow: 0 0 32px rgba(231, 76, 60, 0.7); }
  50%       { box-shadow: 0 0 60px rgba(231, 76, 60, 1.0); }
}

.reset-knop {
  background: #2c3e70;
  color: white;
  margin-top: 24px;
}

/* ---- Canvas countdown ---- */
#countdown-canvas {
  display: block;
  margin: 0 auto 12px;
  background: transparent;
}

.hint {
  color: #8899cc;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.knoppen-rij {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.abort-knop {
  background: #555;
  color: #ccc;
  border: 2px solid #888;
  font-size: 1rem;
  padding: 14px 28px;
}

.abort-knop:hover {
  background: #444;
  color: white;
  border-color: #aaa;
}

/* ---- Geannuleerd ---- */
.geannuleerd-tekst {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #e74c3c;
  text-shadow: 0 0 30px rgba(231, 76, 60, 0.7);
  padding: 48px 0;
  animation: fadeIn 0.3s ease;
}
#fase-finale {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  z-index: 100;
}

.finale-nummer {
  font-size: min(45vw, 55vh);
  font-weight: 900;
  line-height: 1;
  color: white;
  text-shadow: 0 0 60px rgba(231, 76, 60, 0.9), 0 0 120px rgba(231, 76, 60, 0.4);
  animation: telAf 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes telAf {
  from { transform: scale(1.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---- Liftoff ---- */
.liftoff-tekst {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: #f39c12;
  text-shadow: 0 0 40px rgba(243, 156, 18, 0.9);
  animation: knipperen 0.4s infinite;
  margin-bottom: 8px;
}

@keyframes knipperen {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.raket {
  font-size: 6rem;
  display: block;
  margin: 16px auto;
  animation: lanceer 2.5s ease-in forwards;
}

@keyframes lanceer {
  0%   { transform: translateY(0)      rotate(-45deg); opacity: 1; }
  100% { transform: translateY(-110vh) rotate(-45deg); opacity: 0; }
}
