/* --- GŁÓWNY KONTENER (TERAZ WYPEŁNIAJĄCY RODZICA) --- */
#wsn-game-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* ZMIANY: Wypełnienie kontenera nadrzędnego */
    width: 100%;
    height: 100%;
    max-width: none; /* Usunięto ograniczenie szerokości */
    margin: 0; /* Usunięto automatyczne marginesy */
    border-radius: 0; /* Usunięto zaokrąglenie, aby pasowało do krawędzi */
    box-shadow: none; /* Usunięto cień */
    
    padding: 20px;
    background: #f9f9f9;
    box-sizing: border-box;
    overflow: hidden; 
    position: relative;

    /* Nowość: Używamy flexboxa do lepszego ułożenia zawartości */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.wsn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    width: 100%; /* Rozciągnij nagłówek na całą szerokość */
    max-width: 800px; /* Ale niech nie będzie absurdalnie szeroki */
}

.wsn-header h2 {
    margin: 0;
    color: #333;
}

/* --- KOŁO FORTUNY (TERAZ RESPONSYWNE) --- */
.wsn-wheel-wrapper {
    position: relative;
    
    /* ZMIANY: Responsywny rozmiar koła */
    width: 80%; /* Szerokość jako procent kontenera */
    aspect-ratio: 1 / 1; /* Zachowaj kwadratowy kształt */
    max-width: 500px; /* Ustaw maksymalny rozsądny rozmiar */
    max-height: 70vh; /* Ogranicz też wysokość do 70% ekranu */
    
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#wsn-marker {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #c0392b; /* Kolor strzałki */
    position: absolute;
    top: -15px; /* Pozycjonowanie strzałki nad kołem */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

#wsn-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1), inset 0 0 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* --- SEGMENTY KOŁA --- */
.wsn-segment {
    position: absolute;
    width: 50%; 
    height: 50%;
    transform-origin: 100% 100%; 
    top: 0;
    left: 0;
    clip-path: polygon(100% 100%, 0 0, 0 100%);
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,0.05);
}

.wsn-segment span {
    position: absolute;
    display: block;
    width: 100%;
    text-align: center;
    left: -25%; /* Dostosowanie pozycji tekstu dla responsywności */
    top: 40%;
    transform: rotate(calc(360deg / (115 * 2) * -1));
    
    /* ZMIANA: Responsywna czcionka */
    font-size: calc(0.4em + 0.4vmin); /* Dopasowuje się do rozmiaru ekranu */
    
    font-weight: bold;
    color: #333;
    opacity: 0.8;
}

/* Stany segmentów (Użyte / Drzemka) */
.wsn-segment.used,
.wsn-segment.snoozed {
    background: #ccc !important; 
    opacity: 0.6;
}

.wsn-segment.used span,
.wsn-segment.snoozed span {
    text-decoration: line-through;
    color: #888;
}

/* --- PRZYCISKI --- */
.wsn-btn {
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wsn-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.wsn-btn-primary {
    background-color: #2ecc71;
    color: white;
}
.wsn-btn-primary:hover:not(:disabled) {
    background-color: #27ae60;
}

.wsn-btn-secondary {
    background-color: #f39c12;
    color: white;
}
.wsn-btn-secondary:hover:not(:disabled) {
    background-color: #e67e22;
}

#wsn-spin-button {
    position: absolute;
    /* ZMIANA: Rozmiar przycisku jako procent rozmiaru koła */
    width: 20%;
    height: 20%;
    min-width: 80px; /* Minimalny rozmiar */
    min-height: 80px;
    
    border-radius: 50%;
    z-index: 5;
    font-size: 20px; /* Dostosowano rozmiar czcionki */
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#wsn-edit-mode-toggle {
    background-color: #3498db;
    color: white;
}
#wsn-edit-mode-toggle:hover {
    background-color: #2980b9;
}

/* --- MODAL (OKIENKO WYNIKU) --- */
.wsn-modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.wsn-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
    width: 90%;
    max-width: 400px;
}

.wsn-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}
.wsn-modal-close:hover {
    color: #333;
}

.wsn-modal-content h1 {
    font-size: 72px;
    color: #c0392b; 
    margin: 10px 0;
}

.wsn-modal-content p {
    font-size: 18px;
    color: #555;
    margin-bottom: 20px;
}

.wsn-modal-content .wsn-btn {
    margin: 5px;
}

/* --- ALERTY --- */
#wsn-snooze-alert {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 1001;
    font-size: 16px;
}

/* --- TRYB EDYCJI --- */
.edit-mode-active #wsn-edit-mode-toggle {
    background-color: #e74c3c; 
}
.edit-mode-active #wsn-edit-mode-toggle:hover {
    background-color: #c0392b;
}

.edit-mode-active .wsn-segment {
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.edit-mode-active .wsn-segment:hover {
    opacity: 0.8;
    filter: brightness(1.1);
}

/* Dostosowanie do mniejszych ekranów */
@media (max-width: 640px) {
    #wsn-game-container {
        padding: 10px;
    }
    
    .wsn-wheel-wrapper {
        width: 95%; /* Na mobilce koło zajmuje prawie całą szerokość */
        max-width: 95vw;
    }

    #wsn-marker {
        border-left-width: 10px;
        border-right-width: 10px;
        border-top-width: 20px;
        top: -10px;
    }
    
    #wsn-spin-button {
        font-size: 18px; /* Mniejsza czcionka na przycisku */
    }
    
    .wsn-segment span {
        font-size: calc(0.4em + 1vmin); /* Dostosowanie czcionki dla mobilki */
    }

    .wsn-header h2 {
        font-size: 18px;
    }
    .wsn-btn {
        font-size: 14px;
        padding: 8px 12px;
    }
}