/* Password Minigame Specific Styles */

.password-minigame-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    background: #1a1a1a;
    position: relative;
    max-width: 600px;
    margin: 20px auto;
}

.password-image-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.password-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.password-info h4 {
    font-family: 'Press Start 2P', monospace;
    font-size: 20px;
    margin: 0 0 10px 0;
    color: #3498db;
}

.password-info p {
    font-size: 20px;
    margin: 0;
    color: #ecf0f1;
    line-height: 1.4;
}

.password-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.monitor-bezel {
    background: #666;
    border: 8px solid #444;
    clip-path: polygon(
      0px calc(100% - 10px),
      2px calc(100% - 10px),
      2px calc(100% - 6px),
      4px calc(100% - 6px),
      4px calc(100% - 4px),
      6px calc(100% - 4px),
      6px calc(100% - 2px),
      10px calc(100% - 2px),
      10px 100%,
      calc(100% - 10px) 100%,
      calc(100% - 10px) calc(100% - 2px),
      calc(100% - 6px) calc(100% - 2px),
      calc(100% - 6px) calc(100% - 4px),
      calc(100% - 4px) calc(100% - 4px),
      calc(100% - 4px) calc(100% - 6px),
      calc(100% - 2px) calc(100% - 6px),
      calc(100% - 2px) calc(100% - 10px),
      100% calc(100% - 10px),
      100% 10px,
      calc(100% - 2px) 10px,
      calc(100% - 2px) 6px,
      calc(100% - 4px) 6px,
      calc(100% - 4px) 4px,
      calc(100% - 6px) 4px,
      calc(100% - 6px) 2px,
      calc(100% - 10px) 2px,
      calc(100% - 10px) 0px,
      10px 0px,
      10px 2px,
      6px 2px,
      6px 4px,
      4px 4px,
      4px 6px,
      2px 6px,
      2px 10px,
      0px 10px
    );
    padding: 20px;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 0, 0, 0.8);
}

.monitor-bezel::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #444, #666, #444);
    border-radius: 19px;
    z-index: -1;
}

.monitor-bezel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    /* border-radius: 7px; */
    z-index: 1;
}

.monitor-screen {
    border: 2px solid #333;
    /* border-radius: 8px; */
    padding: 15px;
    min-height: 250px;
    position: relative;
    background-image: url('../assets/mini-games/desktop-wallpaper.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.monitor-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.1), rgba(0, 255, 255, 0.1));
    /* border-radius: 6px; */
    z-index: 1;
}

.monitor-screen > * {
    position: relative;
    z-index: 2;
}

.password-input-container label {
    /* font-size: 12px; */
    color: #00ff00;
    margin-bottom: 5px;
}

.password-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field {
    width: 100%;
    padding: 12px 45px 12px 12px;
    background: #1a1a1a;
    border: 2px solid #00ff00;
    /* border-radius: 5px; */
    color: white;
    font-size: 18px;
    outline: none;
    transition: border-color 0.3s ease;
}

.password-field:focus {
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.password-field::placeholder {
    color: #666;
}

.toggle-password-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #00ff00;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    /* border-radius: 3px; */
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password-btn:hover {
    background: rgba(0, 255, 0, 0.1);
}



.icon-keyboard {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.password-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
    position: relative;
    z-index: 10;
}

.keyboard-toggle-btn {
    background: #444;
    border: 2px solid #666;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.keyboard-toggle-btn:hover {
    background: #555;
    border-color: #00ff00;
}

.keyboard-toggle-btn:active {
    background: #00ff00;
    transform: scale(0.95);
}

.hint-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.password-hint-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hint-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 12px 24px;
    /* border-radius: 5px; */
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.hint-btn:hover {
    background: #e67e22;
}

.password-hint {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid #f39c12;
    /* border-radius: 5px; */
    padding: 10px;
    font-size: 18px;
    color: #f39c12;
}

.postit-note {
    background: #ffff88;
    border: 1px solid #ddd;
    /* border-radius: 3px; */
    padding: 15px;
    margin: 10px 0;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: rotate(-2deg);
    font-family: 'Pixelify Sans', 'Comic Sans MS', cursive;
    font-size: 18px;
    color: #333;
    max-width: 200px;
    word-wrap: break-word;
    top: -40px;
    z-index: 15;
}

/* Post-it notes stuck to monitor bezel */
.monitor-bezel .postit-note {
    bottom: -15px;
    left: 20px;
    z-index: 15;
    margin: 0;
    transform: rotate(-3deg);
}

/* Post-it notes between monitor-bezel and keyboard */
.password-minigame-area .postit-note {
    position: relative;
    margin: 15px 20px;
    z-index: 15;
    transform: rotate(-3deg);
    align-self: flex-start;
}

.password-minigame-area .postit-note:nth-child(2) {
    margin-left: 140px;
    transform: rotate(2deg);
}

.password-minigame-area .postit-note:nth-child(3) {
    margin-left: 260px;
    transform: rotate(-1deg);
}

.monitor-bezel .postit-note:nth-child(2) {
    left: 120px;
    transform: rotate(2deg);
}

.monitor-bezel .postit-note:nth-child(3) {
    left: 220px;
    transform: rotate(-1deg);
}

.postit-note::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-top: 15px solid #f0f0f0;
}

.postit-note::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #fff, 0 0 0 2px #ff6b6b;
}

.onscreen-keyboard {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: #2a2a2a;
    border: 2px solid #444;
    /* border-radius: 8px; */
    padding: 10px;
    margin: 10px 0;
    position: relative;
    z-index: 10;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 3px;
    flex-wrap: wrap;
}

.key {
    background: #444;
    color: white;
    border: 1px solid #666;
    /* border-radius: 4px; */
    padding: 8px 12px;
    cursor: pointer;
    font-size: 18px;
    min-width: 35px;
    text-align: center;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    z-index: 11;
}

.key:hover {
    background: #555;
    border-color: #00ff00;
}

.key:active {
    background: #00ff00;
    color: black;
    transform: scale(0.95);
}

.key-backspace {
    background: #e74c3c;
    min-width: 60px;
}

.key-backspace:hover {
    background: #c0392b;
}

.key-space {
    background: #3498db;
    min-width: 100px;
}

.key-space:hover {
    background: #2980b9;
}

.key-special {
    background: #9b59b6;
    min-width: 80px;
}

.key-special:hover {
    background: #8e44ad;
}

.key-shift {
    background: #e67e22;
    min-width: 60px;
}

.key-shift:hover {
    background: #d35400;
}

.key-shift.active {
    background: #f39c12;
    color: #000;
}

.password-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    position: relative;
    z-index: 10;
}

.submit-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 12px 24px;
    /* border-radius: 5px; */
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
    position: relative;
    z-index: 11;
}

.submit-btn:hover {
    background: #27ae60;
}

.submit-btn:active {
    background: #229954;
}

.cancel-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 24px;
    /* border-radius: 5px; */
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
    position: relative;
    z-index: 11;
}

.cancel-btn:hover {
    background: #c0392b;
}

.cancel-btn:active {
    background: #a93226;
}

.attempts-counter {
    text-align: center;
    font-size: 18px;
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid #f39c12;
    /* border-radius: 5px; */
    padding: 8px;
    margin-top: 10px;
    position: relative;
    z-index: 10;
}

.attempts-counter span {
    color: #e74c3c;
    font-weight: bold;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .onscreen-keyboard {
        padding: 5px;
    }
    
    .key {
        padding: 6px 8px;
        font-size: 7px;
        min-width: 30px;
    }
    
    .key-backspace {
        min-width: 50px;
    }
    
    .key-space {
        min-width: 80px;
    }
    
    .key-special {
        min-width: 60px;
    }
    
    .password-field {
        font-size: 18px;
        padding: 10px 40px 10px 10px;
    }
    
    .submit-btn, .cancel-btn {
        padding: 10px 20px;
        font-size: 18px;
    }

    .password-image-section {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }

    .password-image {
        width: 60px;
        height: 60px;
    }
}
