:root {
    --primary-color: #ff7675;
    --secondary-color: #fab1a0;
    --background-color: black;
    --text-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.9);
    --button-bg: rgba(0, 0, 0, 0.2);
    --button-hover-bg: rgba(0, 0, 0, 0.7);
    --highlight-color: gold;
    --border-color: white;
    --font-family: "Quicksand", sans-serif;
    --font-italic: "Ephesis", serif;
}

* {
    box-sizing: border-box;
    max-width: 100vw;
}

body {
    margin: 0;
	position: relative;
    font-family: var(--font-family);
    background: var(--background-color) url('../images/background/bg_background.jpg');
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-position: center; 
	background-size: cover;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.375);
}

.overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
    margin: 0;
    background: transparent url('../images/background/bg_overlay.png');
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-position: center; 
	background-size: cover;
    min-height: 100vh;
	box-shadow: 0 0 300px var(--shadow-color) inset;
	z-index: 3;
	pointer-events: none;
}

.moon {
	position: absolute;
	width: 25vw;
	height: 25vw;
	min-height: 25vw;
	top: 10vw;
	left: 50%;
	transform: translateX(-50%);
    background: transparent url('../images/background/bg_moon.png');
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-position: center; 
	background-size: cover;
	z-index: 2;
	pointer-events: none;
}

canvas#snow, canvas#sky {
    position: fixed;
    top: 0;
    left: 0;
	width: 100%;
    pointer-events: none;
    z-index: 4;
}

canvas#sky {
    z-index: 1;
}

main {
	display: flex;
	min-width: 100%;
	min-height: 100%;
	justify-content: space-between;
	flex-direction: column;
	z-index: 10;
}

.container {
	flex-shrink: 3;
	font-family: "Anta", sans-serif;
	margin: 0 50%;
	transform: translateX(-50%);
}

.container > .content {
	margin: 0 50%;
	transform: translateX(-50%);
	width: 700px;
    border-radius: 20px;
    padding: 10px 30px 40px 30px;
	border: 2px solid rgba(255,255,255,0.15);
	background: rgba(0, 0, 0, 0.2);
	backdrop-filter: blur(5px);
    box-shadow: 0 8px 30px rgba(255,255,255,0.15);
    text-align: center;
	color: #eee;
}

.quote-container {
    font-family: "Ephesis";
    font-weight: 400;
    font-style: normal;
    background-color: transparent;
    color: #dfe6e9;
    padding: 15px;
    text-align: center;
    font-size: 34px;
    font-style: italic;
    margin: 20px 0;
}

footer {
	flex-shrink: 0;
	margin: auto;
    background-color: transparent;
    color: #b2bec3;
    padding: 10px 0;
    text-align: center;
}

h1 {
	font-size: 30px;
	margin: 0 auto;
	padding: 5px;
}

.counter-box {
	flex-shrink: 0;
	margin: 40px auto;
	width: auto;
    display: flex;
    align-items: center;
    padding: 20px 40px 40px 20px;
    border-radius: 15px;
}

.number {
	font-family: "Anta", sans-serif;
    background: var(--primary-color);
    color: #fff;
    font-size: 50px;
    font-weight: 500;
    border-radius: 12px;
    padding: 10px 20px;
    margin-right: 20px;
    text-align: center;
}

.text {
	font-family: "Anta", sans-serif;
    font-size: 40px;
    font-weight: 500;
	color: #fff;
    text-align: left;
}

.card {
	margin: 0 50%;
	transform: translateX(-50%);
    width: 360px;
    border-radius: 20px;
    padding: 30px;
	background: rgba(225, 225, 225, 0.7);
	backdrop-filter: blur(20px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    text-align: center;
}

.card h1 {
	font-family: "Anta", sans-serif;
	font-size: 26px;
	margin: 0 0 20px;
	color: #333;
}

.card p.lead {
	font-family: "Anta", sans-serif;
	margin: 0 0 20px;
	color: #555;
	font-size: 16px;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 25px;
	pointer-events: none;
}

.pin-dot {
    width: 34px;
	height: 34px;
	border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.4);
    display: inline-flex;
	align-items: center;
	justify-content: center;
    background: transparent;
	transition: all .12s ease;
	color: #eee;
	pointer-events: none;
}

#pin-input-visible {
	background-color: transparent;
    width: 300px;
	font-weight: 700;
    padding: 10px 15px;
    margin-bottom: -52px;
	margin-left: 18px;
    font-size: 25px; /* Duża czcionka, żeby kropki były widoczne */
    text-align: left;
    letter-spacing: 30px; /* Dodatkowe odstępy między kropkami */
    border: none;
    box-sizing: border-box;
    display: block;
    margin-right: auto;
    color: #555; /* Upewnij się, że kropki są widoczne */
}

#pin-input-visible:focus {
	outline: none;
}

.pad {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    margin-bottom: 12px;
}
  
.key {
	font-family: "Anta", sans-serif;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 0;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    border: 2px solid rgba(0, 0, 0, 0.3);
    transition: all .06s ease;
}

.key:hover {
	transform: scale(1.1);
}

.key:active {
	transform: scale(1.05);
}

.key.action {
	background: var(--accent);
	color: #fff;
	font-weight: 600;
}

.key.action:active {
	background: var(--accent-h);
}

.key.light {
	background: rgba(255,255,255,0.02);
}

.key.warn {
	background: var(--danger);
	color: #333;
	font-weight: 200;
	font-size: 22px;
}

.controls {
	display: flex;
	gap: 10px;
}

.btn {
	font-family: "Anta", sans-serif;
	flex: 1;
	float: center;
	font-size: 20px;
	padding: 20px 25px;
	margin: 10px;
	border-radius: 10px;
	border: 2px solid rgba(0, 0, 0, 0.3);
	background: rgba(255,255,255,0.06);
	color: var(--text);
	cursor: pointer;
	text-decoration: none;
	transition: all 0.1s ease;
}

.btn:hover {
	transform: scale(1.1);
}

.btn:active {
	transform: scale(1.05);
}

hr.style-two {
	margin: 40px auto;
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(255, 255, 255, 0.75), rgba(0, 0, 0, 0));
}

/* --- Sekcja Koła --- */
#wheel-area {
    position: relative;
    width: 650px; 
    height: 650px; 
    margin: 40px auto;
	
	transition: transform 0.2s ease-out;
}

.wheel-container {
    position: relative;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    position: absolute;
    top: 25px;
    left: 20px; 
    
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
    border: 10px solid #f1c40f; 
    overflow: hidden; /* Ważne, aby SVG nie wyjeżdżało poza ramkę */
}

#wheel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform-origin: 50% 50%;
    transition: transform 0.2s ease-out; 
}

#wheel-area.zoom-in {
    transform: scale(1.1);
}

#wheel.zoom-in {
    transform: scale(1.05);
}

/* Style dla SVG - segmenty i tekst */
#wheel-svg {
    width: 100%;
    height: 100%;
    /* Obrazy SVG będą obracane przez JS */
    transform-origin: 50% 50%; 
    transition: transform 5s cubic-bezier(0.25, 0.1, 0.25, 1); /* Przejście dla obrotu */
}

.segment-path {
    stroke: rgba(0,0,0,0.2); /* Linia oddzielająca segmenty */
    stroke-width: 1;
    cursor: pointer;
}

.segment-text {
    font-size: 4px; /* Rozmiar tekstu w SVG viewBox=100 */
    fill: white;
	margin-bottom: -5px;
    font-weight: bold;
    text-anchor: right; /* Wyrównanie tekstu do środka */
    /* Tekst w SVG będzie obracany razem z grupą */
}


/* --- Wskaźnik --- */
#pointer {
    position: absolute;
    top: 15px; 
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-top: 40px solid #c0392b; /* Czerwony trójkąt */
    z-index: 10;
}

/* --- Przycisk --- */
#spinner-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 0 5px 0 #27ae60;
    transition: all 0.1s ease;
    z-index: 11;
}

#spinner-button:hover:not(:disabled) {
    background-color: #27ae60;
}

#spinner-button:active:not(:disabled) {
    box-shadow: 0 2px 0 #27ae60;
    transform: translate(-50%, -50%) translateY(3px);
}

#spinner-button:disabled {
    background-color: #bdc3c7;
    box-shadow: none;
    cursor: not-allowed;
}

/* --- Panel Wyniku --- */
#result-panel {
	position: absolute;
    top: calc(50% + 35px);
    left: calc(50% + 3px);
    text-align: center;
	opacity: 0;
    visibility: hidden;
	z-index: 12;
}

#result {
    font-size: 2em;
    color: #eee;
}

#result-panel.show-final-result {
	width: 500px;
	height: 500px;
    transform: translate(-50%, -50%); /* Centrowanie względem siebie */
    z-index: 10; /* Nad kołem */
    
    padding: 20px 40px;
    border-radius: 50%;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease;
}

/* Bluruje kontener koła (wheel-area) */
#wheel-area.blurred {
    filter: blur(10px);
    pointer-events: none; /* Wyłącz interakcję z rozmytym kołem */
    transition: filter 0.5s ease;
}

/* --------------------------------------
 * 7. MATERIAL INPUTS (Formularze)
 * -------------------------------------- */

.add-form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
	flex-shrink: 0;
}

.flex-row {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    width: 100%; 
}

/* Kontener inputa, który umożliwi animację etykiety */
.material-input-group {
    position: relative;
    margin-bottom: 0; 
	min-width: 150px;
    flex-grow: 1;
}

/* Stylowanie inputów i selektów */
.material-input-group input[type="text"],
.material-input-group input[type="password"],
.material-input-group textarea,
.material-input-group select {
    /* Zmieniono: Dodanie padding-top/bottom, aby input i przycisk były równe */
    width: 100%;
    padding: 12px 10px 8px 10px; 
    font-size: 1em;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    outline: none;
    transition: all .2s ease-out;
    box-sizing: border-box;
    color: #333;
    appearance: none; /* Reset dla select */
}

/* Strzałka dla selekta (dane jako SVG) */
.material-input-group select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%232b3643" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

.material-input-group textarea {
    min-height: 100px;
}

/* Etykieta */
.material-input-group label {
    position: absolute;
    left: 14px;
    /* Dostosowanie pozycji etykiety po zmianie paddingu inputa */
    top: 8px; 
    font-size: 1em;
    color: #eee;
    pointer-events: none;
    transition: all .2s ease-out;
    background-color: transparent;
    padding: 0 5px;
    margin-left: -5px;
}

/* Stan focus / wypełniony */
.material-input-group input[type="text"]:focus,
.material-input-group input[type="password"]:focus,
.material-input-group textarea:focus,
.material-input-group select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 1px #007bff;
}

/* Animacja etykiety na focus lub wypełnienie */
.material-input-group input[type="text"]:focus + label,
.material-input-group input[type="text"]:not(:placeholder-shown) + label,
.material-input-group input[type="password"]:focus + label,
.material-input-group input[type="password"]:not(:placeholder-shown) + label,
.material-input-group textarea:focus + label,
.material-input-group textarea:not(:placeholder-shown) + label,
.material-input-group select:focus + label,
.material-input-group select:not([value=""]) + label {
    top: -8px;
    font-size: 0.75em;
    color: #007bff;
}

.material-input-group textarea:focus + label,
.material-input-group textarea:not(:placeholder-shown) + label {
    top: -16px;
	color: #eee;
}

/* Ukryj placeholder, aby działała animacja etykiety */
.material-input-group input::placeholder {
    color: transparent;
}

/* Poprawka stylów przycisku, aby był wyśrodkowany pionowo i miał margines */
.add-form-row .btn {
    /* Ustawienie górnego i dolnego marginesu na auto dla lepszego wyśrodkowania pionowego */
    margin-top: auto; 
    margin-bottom: auto;
    height: 40px; /* Dopasowanie wysokości do inputa, który ma około 40px wysokości po uwzględnieniu paddingu i borderu */
    line-height: 1; /* Upewnienie się, że tekst w przycisku jest dobrze wyśrodkowany */
    white-space: nowrap;
}

.btn-submit {
	background: #3498db;
	font-size: 16px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
	color: #eee;
	transition: all 0.1s;
}

.btn-action {
	margin: 0 -4px;
	padding: 6px 6px 5px 7px;
	font-size: 20px;
}

.btn-submit:hover {
	transform: scale(1.1);
}

/* ... Twoje istniejące style ... */

/* Zmiany dla wszystkich małych ekranów (np. telefony i mniejsze tablety) */
@media (max-width: 768px) {
    /* 1. Kontenery i Karty - Płynna szerokość i uproszczone centrowanie */
    .container,
    .container > .content,
    .card {
        /* Usuwamy sztywne szerokości i stałe marginesy */
        width: 95%; /* Użyj płynnej szerokości */
        margin: 20px auto; /* Centruj za pomocą auto, zachowując pionowe marginesy */
        transform: none; /* Usuń stałą transformację X, która była problematyczna przy stałej szerokości */
        max-width: 100%; /* Upewnij się, że nie wyjdzie poza ekran */
        padding: 10px 15px 20px 15px; /* Mniejszy padding dla telefonów */
    }

    /* 2. Księżyc (Moon) - Mniejszy i płynniejszy rozmiar */
    .moon {
        width: 70vw; /* Większy na telefonie w stosunku do ekranu */
        height: 70vw;
        min-height: 70vw;
        top: 5vw; /* Trochę wyżej */
        left: 50%;
        transform: translateX(-50%);
    }

    /* 3. Liczniki (Counter Box) - Układ w pionie */
    .counter-box {
        flex-direction: column; /* Ułóż elementy w kolumnie */
        align-items: center; /* Centruj w pionie */
        padding: 15px 10px 20px 10px; /* Mniejszy padding */
        margin: 20px auto;
    }

    .number {
        font-size: 40px; /* Mniejsza czcionka */
        margin-right: 0; /* Usuń prawy margines */
        margin-bottom: 10px; /* Dodaj margines pod spodem */
    }

    .text {
        font-size: 30px; /* Mniejsza czcionka */
        text-align: center; /* Centruj tekst */
    }
    
    /* 4. Cytat */
    .quote-container {
        font-size: 24px; /* Mniejsza czcionka */
        margin: 15px 0;
        padding: 10px;
    }

    /* 5. Koło Fortuny (Wheel) - Zmniejszenie rozmiaru */
    #wheel-area {
        width: 90vw; /* Użyj jednostek viewport (dostosuje się do szerokości ekranu) */
        height: 90vw;
        max-width: 500px; /* Ogranicz maksymalny rozmiar dla większych tabletów */
        max-height: 500px;
        margin: 20px auto;
    }

    .wheel-container {
        /* Dopasowanie do nowego rozmiaru wheel-area */
        width: calc(100% - 10px); 
        height: calc(100% - 10px);
        top: 5px; 
        left: 5px;
        border-width: 5px; /* Cieńsza ramka */
    }
    
    /* Zmniejszenie rozmiaru przycisku i wskaźnika */
    #pointer {
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
        border-top: 30px solid #c0392b; 
    }
    
    #spinner-button {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    /* Panel wyniku również powinien być skalowany */
    #result-panel.show-final-result {
        width: 80vw;
        height: 80vw;
        max-width: 400px;
        max-height: 400px;
    }


    /* 6. Klawiatura PIN (Pad) - Większe dotykowe przyciski */
    .key {
        padding: 18px 0; /* Większy padding dla łatwiejszego dotyku */
        font-size: 22px;
    }

    /* 7. Inputy (Formularze) - Mniejsze marginesy i rozmiary */
    .add-form-row {
        flex-direction: column; /* Układaj elementy formularza w kolumnie */
        gap: 5px;
        align-items: stretch; /* Rozciągnij elementy na całą szerokość */
    }
    
    .flex-row {
        flex-direction: column; 
        gap: 5px;
    }

    .material-input-group,
    .add-form-row .btn {
        width: 100%; /* Rozciągnij na całą szerokość */
        margin-top: 0;
        margin-bottom: 0;
    }
    
    .add-form-row .btn {
        height: auto;
        padding: 12px 10px;
    }
    
    /* Korekta rozmiaru pola PIN */
    #pin-input-visible {
        width: 90%;
        margin-left: 5%;
        letter-spacing: 20px;
    }
    
    .pin-dot {
        width: 30px;
        height: 30px;
    }
}

/* Wzmocnienie dla bardzo małych ekranów (poniżej 600px) */
@media screen and (max-width: 600px) {
	/* Poprawki w Twoich istniejących regułach dla 600px */
	 .container {
	  flex-direction: column;
	}

	.right-panel {
	  display: none;
	}

	.left-panel {
	  padding: 15px; /* Mniejszy padding */
	}
	
	.menu-button {
		  width: 100%; /* Użyj 100% dla pełnej szerokości */
	}
	
	.menu-bar {
		  gap: 5px;
	}

    /* Dodatkowe czyszczenie marginesów i centrowanie dla pewności */
    body {
        /* Usuwamy min-height: 100% i dodajemy min-height: 100vh dla pełnego ekranu mobilnego */
        min-height: 100vh; 
        height: auto;
    }
    
    main {
        padding: 10px 5px; /* Mniejszy padding wokół głównej zawartości */
    }
    
    /* Zmniejszenie nagłówków */
    h1 {
        font-size: 24px;
    }
}