* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0b0f19;
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Ana Ekran Düzeni */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, #111827 0%, #030712 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 1.2s ease-out;
    padding: 15px; /* Mobilde ekran kenarlarına çarpmayı önler */
}

/* Şalter / Enerji Butonu */
#energy-btn {
    padding: 15px 35px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(45deg, #ff5722, #ffeb3b);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
    margin-bottom: 20px;
    flex-shrink: 0;
}

#energy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 235, 59, 0.8);
}

/* Kablo Tesisatı */
.cables-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 280px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.cable {
    height: 8px;
    width: 100%;
    border-radius: 5px;
    position: relative;
    background-color: #222;
    transition: background-color 0.4s ease;
}

.cable span {
    position: absolute;
    right: 105%;
    top: -6px;
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: bold;
}

.cable.phase.active { background-color: #8B4513; box-shadow: 0 0 12px #8B4513; }
.cable.neutral.active { background-color: #0066FF; box-shadow: 0 0 12px #0066FF; }
.cable.earth.active { background-color: #00FF44; box-shadow: 0 0 12px #00FF44; }

/* Hizmet Başlık Alanı */
#services-container {
    height: 50px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

.service-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: serviceFadeUp 0.5s ease forwards;
    width: 100%;
    max-width: 100%;
}

.service-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 0.5px;
    white-space: nowrap; /* Büyük ekranlarda tek satır tut */
}

.check-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00FF44;
    text-shadow: 0 0 8px rgba(0, 255, 68, 0.5);
    flex-shrink: 0;
}

@keyframes serviceFadeUp {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Final Aksiyon Butonları */
#final-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    height: 45px;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: opacity 0.5s ease, transform 0.5s ease;
    flex-shrink: 0;
}

#final-actions.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.action-btn {
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    white-space: nowrap;
}

/* Mavi Buton */
.site-btn {
    background-color: #0066FF;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.3);
}
.site-btn:hover {
    background-color: #0052cc;
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.6);
    transform: translateY(-2px);
}

/* Yeşil Buton */
.off-btn {
    background-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}
.off-btn:hover {
    background-color: #059669;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    transform: translateY(-2px);
}

/* Görsel Sahne Alanı */
.scene {
    display: flex;
    width: 95%;
    max-width: 900px;
    justify-content: space-between;
    align-items: flex-end;
    height: 240px; /* Taşmayı önlemek için sahne yüksekliği biraz dengelendi */
    border-bottom: 4px solid #27272a;
    position: relative;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.house {
    width: 110px;
    height: 90px;
    background-color: #1e293b;
    border-radius: 6px 6px 0 0;
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px;
    flex-shrink: 0;
}

.window {
    width: 26px;
    height: 32px;
    background-color: #334155;
    border-radius: 4px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.house.active .window {
    background-color: #fde047;
    animation: elektrikFlicker 0.4s ease forwards;
}

.road {
    display: flex;
    align-items: flex-end;
    gap: 35px;
    position: relative;
}

.lamp-post {
    background-color: #475569;
    position: relative;
    border-radius: 2px 2px 0 0;
}

.t-bar {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #64748b;
    border-radius: 2px;
    display: flex;
    justify-content: space-between;
}

.bulb {
    width: 30%;
    height: 150%;
    background-color: #1e293b;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.bulb-left { left: 0; transform: translate(-30%, -20%); }
.bulb-right { right: 0; transform: translate(30%, -20%); }

.lamp-post.active .bulb {
    background-color: #fff;
    animation: elektrikFlicker 0.5s ease forwards;
}

.light-beam {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 300%;
    height: 130px;
    background: radial-gradient(ellipse at top, rgba(253, 224, 71, 0.5) 0%, rgba(253, 224, 71, 0) 75%);
    clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lamp-post.active .light-beam {
    animation: isikHuzmesiFlicker 0.5s ease forwards;
}

@keyframes elektrikFlicker {
    0%   { opacity: 0.3; background-color: #475569; box-shadow: none; }
    15%  { opacity: 1; background-color: #fde047; box-shadow: 0 0 20px #fde047; }
    30%  { opacity: 0.2; box-shadow: none; }
    45%  { opacity: 1; background-color: #fde047; box-shadow: 0 0 25px #fde047; }
    65%  { opacity: 0.5; box-shadow: 0 0 5px #fde047; }
    80%  { opacity: 0.9; box-shadow: 0 0 20px #fde047; }
    100% { opacity: 1; background-color: #fff; box-shadow: 0 0 25px 5px #fde047; }
}

@keyframes isikHuzmesiFlicker {
    0%   { opacity: 0; }
    15%  { opacity: 0.8; }
    30%  { opacity: 0.1; }
    45%  { opacity: 1; }
    65%  { opacity: 0.3; }
    80%  { opacity: 0.9; }
    100% { opacity: 1; }
}

/* Perspektif Ölçüleri (Masaüstü) */
.pole-1 { width: 14px; height: 150px; } .pole-1 .t-bar { width: 60px; height: 8px; }
.pole-2 { width: 11px; height: 120px; } .pole-2 .t-bar { width: 46px; height: 7px; }
.pole-3 { width: 9px;  height: 98px; }  .pole-3 .t-bar { width: 38px; height: 6px; }
.pole-4 { width: 7px;  height: 80px; }  .pole-4 .t-bar { width: 28px; height: 5px; }
.pole-5 { width: 5px;  height: 62px; }  .pole-5 .t-bar { width: 20px; height: 4px; }


/* ==========================================================================
   📱 %100 KUSURSUZ MOBİL VE TABLET KORUMA KATMANI
   ========================================================================== */

/* 1. TABLET VE KÜÇÜK EKRANLAR (Max 768px Genişlik) */
@media (max-width: 768px) {
    .service-title { font-size: 1.3rem; }
    .check-icon { font-size: 1.3rem; }
    .road { gap: 20px; }
    .house { width: 95px; height: 80px; }
    .window { width: 20px; height: 26px; }
    
    .pole-1 { width: 12px; height: 120px; } .pole-1 .t-bar { width: 46px; height: 7px; }
    .pole-2 { width: 10px; height: 102px; } .pole-2 .t-bar { width: 38px; height: 6px; }
    .pole-3 { width: 8px;  height: 85px; }  .pole-3 .t-bar { width: 30px; height: 5px; }
    .pole-4 { width: 6px;  height: 70px; }  .pole-4 .t-bar { width: 24px; height: 4px; }
    .pole-5 { width: 4px;  height: 55px; }  .pole-5 .t-bar { width: 18px; height: 3px; }
}

/* 2. AKILLI TELEFONLAR (Max 480px Genişlik) */
@media (max-width: 480px) {
    #intro-overlay { padding: 10px; justify-content: space-evenly; }
    #energy-btn { padding: 12px 28px; font-size: 1rem; margin-bottom: 15px; }
    .cables-container { max-width: 200px; margin-bottom: 15px; gap: 8px; }
    .cable { height: 6px; }
    .cable span { font-size: 0.65rem; top: -5px; }

    /* Başlıkların mobilde alt satıra güvenle geçmesini sağlayan kural */
    .service-wrapper { flex-wrap: nowrap; justify-content: center; gap: 8px; }
    .service-title { font-size: 1.05rem; white-space: normal; line-height: 1.3; }
    .check-icon { font-size: 1.1rem; }

    /* Final Butonlarının Taşmasını Engelleyen Esnek Yan Yana Düzen */
    #final-actions { gap: 10px; margin-bottom: 15px; width: 100%; }
    .action-btn { padding: 10px 16px; font-size: 0.85rem; border-radius: 5px; }

    /* Sahne Küçültmesi */
    .scene { height: 170px; width: 100%; border-bottom-width: 3px; }
    .house { width: 60px; height: 55px; padding: 6px; }
    .window { width: 12px; height: 18px; }
    
    .road { gap: 10px; }

    /* Telefon İçin Sıkıştırılmış Perspektif (Taşmayı %100 Önler) */
    .pole-1 { width: 8px; height: 85px; }  .pole-1 .t-bar { width: 30px; height: 5px; }
    .pole-2 { width: 7px; height: 72px; }  .pole-2 .t-bar { width: 24px; height: 4px; }
    .pole-3 { width: 6px; height: 60px; }  .pole-3 .t-bar { width: 20px; height: 4px; }
    .pole-4 { width: 5px; height: 50px; }  .pole-4 .t-bar { width: 16px; height: 3px; }
    .pole-5 { width: 4px; height: 42px; }  .pole-5 .t-bar { width: 14px; height: 3px; }
    
    .light-beam { height: 95px; }
}

/* 3. ÇOK KÜÇÜK VE ESKİ EKRANLI TELEFONLAR (Max 360px Genişlik) */
@media (max-width: 360px) {
