/* =========================================================
   GLOBAL RESET
   ========================================================= */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f3f4f6;
  color: #0f172a;
  overflow-x: hidden;
}


/* =========================================================
   APP SHELL
   ========================================================= */

.app{
  min-height:100dvh;
  display:flex;
  justify-content:center;
}

@media (min-width: 900px){

  .app{
    justify-content:center;
    padding:40px;
  }

}

/* =========================================================
   MAIN CARD
   ========================================================= */

.sy-card{
  width:min(640px, 100%);
  background:#fff;
  border-radius:24px;
  box-shadow:0 10px 24px rgba(0,0,0,.12);

  display:flex;
  flex-direction:column;

  padding: 0 16px;     /* symmetrischer Innenabstand */

  min-height:100dvh;
  overflow:hidden;
}

@media (min-width: 900px){
  .sy-card{
    min-height:auto;      /* 🔥 wichtig */
  }
}

/* =========================================================
   TITLE
   ========================================================= */

.sy-title{
  text-align:center;
  margin:10px 0 20px;
  font-weight:800;
  font-size:clamp(18px, 2.2vh, 22px);
}

/* =========================================================
   SWITCH GRID (ESP IDENTISCH)
   ========================================================= */

.switch-grid{
  flex-grow:1;
  display:grid;
  gap:12px;
  width:100%;
  padding:0;
  align-content:start;
}

/* Layout Helpers */

.switch-grid.center-1{
  grid-template-columns:1fr;
}

.switch-grid.two{
  grid-template-columns:1fr 1fr;
}

.switch-grid.three{
  grid-template-columns:1fr 1fr;
}

.switch-grid.three .switch-btn:nth-child(1){
  grid-column:1 / -1;   /* erste Zeile volle Breite */
}

.switch-grid.four{
  grid-template-columns:1fr 1fr;
}

/* Spacer */

.flex-spacer{
  flex-grow:1;
}

/* =========================================================
   SWITCH BUTTON
   ========================================================= */

.switch-btn{
  width:100%;                 /* 🔥 verhindert Überlaufen */
  border:1px solid #cbd5e1;
  background:#f1f5f9;
  border-radius:18px;
  padding:14px 12px;
  min-height:72px;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;

  font-weight:700;
  cursor:pointer;
  transition:.15s ease;
}

.switch-btn:hover{
  background:#e5edf7;
}

/* Active ON */

.switch-btn.switch-on{
  background:#357dff;
  color:#fff;
  border-color:#357dff;
}

/* Icon */

.switch-btn .icon{
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.switch-btn .icon svg{
  width:100%;
  height:100%;
  stroke:currentColor;
  fill:none;
}

/* =========================================================
   SWITCH STATES
   ========================================================= */

/* OFF */
.switch-off{
  background:#f6f9fc;
  border-color:#c9d6e6;
  color:#0b1b3a;
}

/* ON */
.switch-on{
  background:#1f3c88;
  border-color:#1f3c88;
  color:white;
}

/* PENDING ON */
.switch-pending-on{
  background:#7fb6ff;
  border-color:#4a90ff;
  color:#0b1b3a;
}

/* PENDING OFF */
.switch-pending-off{
  background:#ff9c9c;
  border-color:#ff5a4d;
  color:#7a0000;
}

.switch-pending-on,
.switch-pending-off{
  animation:pulse 1.2s infinite ease-in-out;
}

@keyframes pulse{
  0%   { opacity:1; }
  50%  { opacity:0.7; }
  100% { opacity:1; }
}

/* =========================================================
   TIMER
   ========================================================= */

.switch-timer{
  font-size:13px;
  opacity:.8;
  margin-top:4px;
  font-weight:500;
}

/* =========================================================
   LOGO
   ========================================================= */

#logoContainer{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:10px 0;
  flex-shrink:0;
}

#logoContainer img{
  width:320px;
  height:320px;

  max-width:80vw;
  max-height:35vh;

  object-fit:contain;

  transition:width .25s ease,
             height .25s ease;
}

/* =========================================================
   FOOTER
   ========================================================= */

.sy-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:
    14px 16px
    max(14px, env(safe-area-inset-bottom));

  border-top:1px solid #e5e7eb;
  background:#fff;

  flex-shrink:0;
}

.footer-text{
  text-align:center;
  font-size:14px;
  line-height:1.4;
}

.stop-btn{
  width:56px;
  height:56px;
  border-radius:18px;
  background:#ff5a4d;
  color:white;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
}

.menu-btn{
  width:56px;
  height:56px;
  border-radius:18px;
  border:1px solid #c9d6e6;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
  padding:12px;
}

.menu-btn span{
  height:4px;
  background:#0b1b3a;
  border-radius:2px;
}