:root {
    --bg-color: #f0f0f0; /* Lekko szare tło jest niezbędne dla efektu 3D */
    --player-width: calc(100% - 80px);
    --max-player-width: 380px;
}

body {
    margin: 0;
    font-family: 'Courier Prime', monospace;
    background-color: var(--bg-color);
    overflow: hidden;
    height: 100vh;
    height: 100dvh; /* Dynamiczna wysokość dla urządzeń mobilnych */
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    /* Uwzględnienie bezpiecznych obszarów dla telefonów z notchem */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.container {
    position: fixed; /* Zmienione na fixed, aby zawsze wypełniało ekran */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
    pointer-events: none;
}

.flower {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url('assets/flower.png?v=2.2');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.8;
}

.audio-player {
    width: var(--player-width);
    max-width: var(--max-player-width);
    position: relative;
    z-index: 10;
}

.player-bg {
    position: absolute;
    top: -30px;
    left: -20px;
    right: -20px;
    bottom: -30px;
    background-color: var(--bg-color);
    border-radius: 50px;
    /* EFEKT 3D (Neumorphism) */
    box-shadow: 20px 20px 60px #cbcbcb, 
               -20px -20px 60px #ffffff;
    z-index: 5;
}

.player-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.play-btn {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    background-color: var(--bg-color);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    /* EFEKT 3D DLA PRZYCISKU */
    box-shadow: 6px 6px 12px #cbcbcb, 
               -6px -6px 12px #ffffff;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.play-btn:active {
    box-shadow: inset 4px 4px 8px #cbcbcb, 
                inset -4px -4px 8px #ffffff;
    transform: scale(0.98);
}

.play-btn svg {
    width: 30px;
    height: 30px;
    stroke: #333;
    fill: #333;
}

.timeline {
    width: 100%;
    height: 6px;
    background-color: var(--bg-color);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    margin-bottom: 20px;
    /* WYTŁOCZONY PASEK */
    box-shadow: inset 2px 2px 5px #cbcbcb, 
                inset -2px -2px 5px #ffffff;
    touch-action: manipulation;
}

.timeline::before {
    content: '';
    position: absolute;
    top: -15px;
    bottom: -15px;
    left: 0;
    right: 0;
}

.progress {
    height: 100%;
    width: 0;
    background-color: #333;
    border-radius: 10px;
    pointer-events: none;
    position: relative;
}

/* Kropka jako wystający element 3D */
.progress::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-color: var(--bg-color);
    border-radius: 50%;
    box-shadow: 3px 3px 6px #cbcbcb, 
               -3px -3px 6px #ffffff;
}

.time-display {
    font-size: 12px;
    color: #888;
    letter-spacing: 1.5px;
    font-weight: bold;
}

/* --- PIN SCREEN STYLES --- */
.pin-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.pin-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.pin-header {
    font-size: 18px;
    color: #333;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.hint-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    max-width: 320px;
    background-color: var(--bg-color);
    padding: 55px 25px 35px 25px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 20px 20px 60px #cbcbcb, 
               -20px -20px 60px #ffffff;
    z-index: 200;
    transition: all 0.3s ease;
}

.hint-box.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -45%);
}

.hint-content {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    font-weight: bold;
}

.hint-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 3px 3px 6px #cbcbcb, 
               -3px -3px 6px #ffffff;
    transition: all 0.2s ease;
}

.hint-close:active {
    box-shadow: inset 2px 2px 4px #cbcbcb, 
                inset -2px -2px 4px #ffffff;
}

.pin-dots {
    display: flex;
    gap: 15px;
    margin-bottom: 60px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--bg-color);
    box-shadow: inset 2px 2px 5px #cbcbcb, 
                inset -2px -2px 5px #ffffff;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dot.active {
    background-color: #333;
    box-shadow: none;
}

.pin-dots.error {
    animation: shake 0.4s ease-in-out;
}

.pin-dots.error .dot {
    background-color: #ff4d4d;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.pin-keyboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pin-row {
    display: flex;
    gap: 25px;
}

.pin-btn, .pin-btn-action, .pin-btn-empty {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-color);
    font-family: 'Courier Prime', monospace;
    font-size: 24px;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 6px 6px 12px #cbcbcb, 
               -6px -6px 12px #ffffff;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.pin-btn-empty {
    box-shadow: none;
    cursor: default;
}

.pin-btn-action svg {
    width: 24px;
    height: 24px;
    stroke: #333;
}

.pin-btn:active, .pin-btn-action:active {
    box-shadow: inset 4px 4px 8px #cbcbcb, 
                inset -4px -4px 8px #ffffff;
    transform: scale(0.96);
}

/* --- MAIN CONTENT STYLES --- */
.main-content {
    transition: opacity 0.8s ease;
    opacity: 1;
    position: fixed; /* Zmienione na fixed, aby idealnie pokrywało się z ekranem PIN */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.main-content.hidden {
    display: none;
    opacity: 0;
}

.main-content.fade-in {
    animation: fadeIn 0.8s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
