/* === ZMIENNE I MOTYW CIEMNY === */
:root {
    --bg-color: #0f172a;       /* Głębokie, ciemne tło */
    --card-bg: #1e293b;        /* Tło kafelków */
    --text-main: #f8fafc;      /* Biały tekst */
    --text-sub: #94a3b8;       /* Szary tekst podrzędny */
    --color-on: #10b981;       /* Szmaragdowy zielony dla ON */
    --color-off: #ef4444;      /* Czerwony dla OFF */
    --color-wait: #f59e0b;     /* Pomarańczowy dla oczekiwania */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-sub);
    font-size: 14px;
    margin-bottom: 30px;
}

/* === UKŁAD SIATKI (RESPONSIVE) === */
.panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 540px; /* Nieco szerszy, aby pomieścić więcej kafelków */
}

/* === STYL KAFELKÓW (CARDS) === */
.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 130px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card h3 {
    margin: 0 0 15px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-sub);
}

/* === NOWOCZESNE PRZYCISKI MOBILNE === */
.btn {
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.off { background-color: var(--color-off); }
.on { background-color: var(--color-on); }
.waiting { background-color: var(--color-wait); cursor: wait; animation: pulse 1.5s infinite; }

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

/* === WYŚWIETLACZE TEMPERATURY === */
.temp-display {
    font-size: 32px;
    font-weight: 700;
    margin: 10px 0;
}

.temp-salon {
    color: #3b82f6; /* Jasnoniebieski dla salonu */
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.temp-boiler {
    color: #f97316; /* Ciepły pomarańczowy dla bojlera */
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

/* === PASEK STATUSU NA DOLE === */
#status {
    margin-top: auto;
    padding-top: 30px;
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
}
