:root {
  --grid-w: 420px;
  --col: 140px;
  --gap: 2px;
  --primary: #5a6f89;
  --header-bg: #2c3e50;
  --highlight: #1abc9c;
}

body {
  margin: 0;
  background: var(--primary);
  font-family: "Segoe UI", Arial, sans-serif;
  color: white;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  width: 100%;
  background: var(--header-bg);
  padding: 20px 0;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  letter-spacing: 1px;
}

/* ================= CENTRALIZA CASA ================= */

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.house {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.roof {
  width: 100%;
  height: 120px;
  margin-bottom: -20px;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.planta {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, var(--col));
  grid-template-rows: 110px 40px 110px 100px;
  gap: var(--gap);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  border-radius: 16px;
  overflow: hidden;
  padding: 5px;
}

.room {
  background: var(--header-bg);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.room:hover {
  background: var(--highlight);
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* ================= POSICIONAMENTO ================= */

.quarto_solteiro { grid-column: 1; grid-row: 1; }
.banheiro        { grid-column: 2; grid-row: 1; }
.quarto_casal    { grid-column: 3; grid-row: 1; }

.sala            { grid-column: 1; grid-row: 2 / span 2; }
.hall            { grid-column: 2; grid-row: 2; }
.sala_jantar     { grid-column: 2; grid-row: 3; }

.extra {
  grid-column: 3;
  grid-row: 2 / span 2;
  background: repeating-linear-gradient(45deg, #aaa, #aaa 12px, #ccc 12px, #ccc 24px);
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  font-weight: bold;
}

.hall_saida { 
  grid-column: 1; 
  grid-row: 4; 
  display:flex; 
  justify-content:center; 
  align-items:center; 
}

.cozinha    { grid-column: 2; grid-row: 4; }
.lavanderia { grid-column: 3; grid-row: 4; }

.hall_saida span { writing-mode: vertical-rl; transform: rotate(180deg); }
.lavanderia span { writing-mode: vertical-rl; }

/* ================= RESPONSIVO ================= */

@media (max-width: 480px) {
  :root { --grid-w: 300px; --col: 100px; }
  .roof { height: 90px; margin-bottom: -15px; }
  .planta { grid-template-rows: 80px 30px 80px 80px; }
  .room { font-size: 12px; }
  header { font-size: 22px; padding: 15px 0; }
}

/* ===================================================== */
/* ================== IRIS INDICATOR =================== */
/* ===================================================== */

#iris-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 22px;
  border-radius: 30px;
  font-weight: bold;
  font-size: 14px;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  cursor: default;
  user-select: none;
}

/* 🟢 STANDBY */
.iris-standby {
  background: #2ecc71;
}

/* 🔵 CAPTANDO ÁUDIO (PISCA) */
.iris-listening {
  background: #3498db;
  animation: irisBlink 0.8s infinite;
}

/* 🟣 WAKE WORD DETECTADA */
.iris-awake {
  background: #9b59b6;
  animation: irisPulse 1s infinite;
}

/* 🔴 PROCESSANDO */
.iris-processing {
  background: #e74c3c;
}

/* ⚫ ERRO */
.iris-error {
  background: #555;
}

/* ===== ANIMAÇÕES ===== */

@keyframes irisBlink {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: 0.5; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes irisPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ===================================================== */
/* ================= BOTÃO ATIVAR ÁUDIO ================= */
/* ===================================================== */

#startAudio {
  position: fixed;
  top: 20px;
  right: 80px;
  padding: 10px 20px;
  background: #3498db;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s ease;
}

#startAudio:hover {
  transform: scale(1.05);
}