/* General Styles */
body {
    background: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
}

header img {
    width: auto;
    height: 60px;
    margin-bottom: 10px;
}

header h1 {
    margin: 0;
    color: #ffffff;
    font-size: 2em;
}

header button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #444;
    color: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
}

header button:hover {
    background: #555;
}

/* Game Container */
#game {
    background: #1e1e1e;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    width: 350px;
    max-width: 90vw;
    min-height: 60vh;
    max-height: 85vh;
    overflow-y: auto;
}

/* Board Styling */
#board {
    margin-bottom: 20px;
}

.guess-row {
    display: flex;
    align-items: center;
    justify-content: center; /* Center row content */
    margin-bottom: 15px;
}

.guess-slot {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin-right: 10px;
    border-radius: 50%;
    background: #121212;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
    font-weight: bold;
}

.guess-slot.active-slot {
    outline: 3px dashed #ffffff;
}

/* Clue (Feedback) Container */
.feedback {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.clue-square {
    width: 15px;
    height: 15px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Peg Colors */
.black-peg {
    background-color: #10b981;
    border: none;
}

.white-peg {
    background-color: #ef4444;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Separator between board and keypad */
#separator {
    height: 20px;
}

/* Keypad Styling */
#keypad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.key {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    transition: transform 0.1s;
    background: #2a2a2a;
    color: #e0e0e0;
    font-weight: bold;
}

.key:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.key.color-key {
    border: 2px solid transparent;
}

.key.backspace {
    background-color: #2a2a2a;
    font-size: 24px;
}

/* Submit Button */
#submit-guess {
    width: 100%;
    padding: 12px;
    background: #444;
    color: #e0e0e0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-size: 16px;
    margin-top: 10px;
}

#submit-guess:hover {
    background: #555;
    transform: translateY(-2px);
}

#submit-guess:active {
    transform: translateY(0);
}

#submit-guess:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#submit-guess:disabled:hover {
    transform: none;
    background: #444;
}

/* Pop-up Overlay Styles */
#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#popup {
    background: #1e1e1e;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#popup p {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #e0e0e0;
}

#popup button {
    padding: 10px 20px;
    background: #444;
    color: #e0e0e0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

#popup button:hover {
    background: #555;
    transform: translateY(-2px);
}

#popup button:active {
    transform: translateY(0);
}

/* Leaderboard Table Styles */
#leaderboard {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    color: #e0e0e0;
}

#leaderboard th,
#leaderboard td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    text-align: center;
}

#leaderboard th {
    background: #2a2a2a;
    color: #ffffff;
}

/* Secret Code Blob for Losing Pop-up */
.secret-blob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #121212;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
    margin: 10px;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    #game {
        width: 100%;
        max-width: 350px;
        padding: 10px;
    }
    
    header {
        margin-bottom: 10px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .guess-slot {
        width: 35px;
        height: 35px;
    }
    
    .key {
        width: 35px;
        height: 35px;
    }
    
    #popup {
        max-width: 90%;
    }
}