#lock-screen {
    background-color: transparent; /* Let the main screen background show through */
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 100px 0 30px 0;
    box-sizing: border-box;
    cursor: pointer;
}

.lock-screen-content {
    text-align: center;
}

#lock-screen-time {
    font-size: 76px;
    font-weight: 200;
}

#lock-screen-date {
    font-size: 20px;
    font-weight: 400;
}

.lock-screen-footer {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    padding-bottom: 20px;
}

#passcode-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: transparent; /* Changed for liquid glass effect */
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    overflow: hidden; /* To contain pseudo-element */
}

#screen.broken-state #passcode-screen {
    backdrop-filter: blur(15px) saturate(0.5) hue-rotate(90deg); /* Apply corruption filter */
}

#passcode-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 180, 230, 0.1) 20%,
        rgba(180, 220, 255, 0.1) 40%,
        rgba(200, 255, 200, 0.1) 60%,
        rgba(255, 220, 180, 0.1) 80%,
        rgba(255, 255, 255, 0.2) 100%
    );
    background-size: 200% 200%;
    animation: var(--liquid-animation);
    z-index: -1;
}

#screen.broken-state #passcode-screen::before {
    /* Make the background noise red/broken */
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 0, 0, 0.2) 0%,
        rgba(255, 0, 0, 0.2) 5px,
        rgba(0, 0, 0, 0.5) 5px,
        rgba(0, 0, 0, 0.5) 10px
    );
    background-size: 20px 20px;
    animation: none;
}

#passcode-screen.visible {
    opacity: 1;
    visibility: visible;
}

.passcode-hint {
    color: white;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 500;
}

#screen.broken-state .passcode-hint {
    color: #ff453a;
}

#passcode-input {
    display: flex;
    gap: 20px;
    margin-bottom: 60px;
}

.passcode-dot {
    width: 13px;
    height: 13px;
    border: 1px solid white;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

#screen.broken-state .passcode-dot {
    border-color: #ff453a;
}

.passcode-dot.filled {
    background-color: white;
}

#screen.broken-state .passcode-dot.filled {
    background-color: #ff453a;
}

#passcode-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.keypad-button {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255,255,255,0.2);
    color: white;
    font-size: 32px;
    font-weight: 400;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.keypad-button:active {
    background-color: rgba(255,255,255,0.4);
}

.passcode-actions {
    height: 50px; /* To align cancel button */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: calc(75px * 3 + 20px * 2); /* Match keypad width */
}

.passcode-action-button {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    cursor: pointer;
}

#passcode-screen.shake #passcode-input {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}