@import url('https://fonts.googleapis.com/css2?family=Open+Sans&family=Poppins:ital,wght@0,300;0,400;0,500;1,300&display=swap');

body {
    font-family: "Open Sans", Arial, Tahoma, Geneva, sans-serif;
    margin: 0;
    padding: 0;
    color: #555;
    background-color: #f4f4f4;
}

h1 {
    font-size: 2.5em;
    margin: 20px 0;
    text-align: center;
    color: #333;
}

#board {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.banner {
    font-weight: bold;
    font-size: 0.9em;
}

select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

button {
    background-color: #4A90E2;
    border: none;
    padding: 10px 20px;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

button:hover {
    background-color: #357ABD;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#game-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fafafa;
    border-radius: 8px;
}

.peg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background-color: #eee;
    cursor: pointer;
    transition: transform 0.1s;
}

.peg.selected {
    border-color: #333;
    transform: scale(1.1);
}

.hole {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px dashed #ccc;
    background-color: #fff;
    cursor: pointer;
}

.hole.filled {
    border-style: solid;
}

.hole.selected {
    border-color: #4A90E2;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
    border-style: solid;
}

#secret-row {
    background: #333;
    min-height: 60px;
}

#secret-row .peg.hidden {
    background-color: #555;
    background-image: radial-gradient(circle, #666, #444);
    border-color: #444;
}

#history {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 5px;
}

.history-pegs {
    display: flex;
    gap: 5px;
}

.history-peg {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.feedback {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    width: 80px;
}

.feedback-peg {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #eee;
    border: 1px solid #ddd;
}

.feedback-peg.black {
    background-color: #000;
    border-color: #000;
}

.feedback-peg.white {
    background-color: #fff;
    border-color: #000;
}

#palette-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    padding: 15px;
    background: #eee;
    border-radius: 8px;
}

#palette {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* Peg Colors */
.color-0 { background-color: #f33; } /* #FF4136; } /* Red */
.color-1 { background-color: #070; } /* #2ECC40; } /* Green */
.color-2 { background-color: #00f; } /* #0074D9; } /* Blue */
.color-3 { background-color: #ff3; } /* #FFDC00; } /* Yellow */
.color-4 { background-color: #76f; } /* #B10DC9; } /* Purple */
.color-5 { background-color: #f70; } /* #FF851B; } /* Orange */
.color-6 { background-color: #0ff; } /* Cyan #39CCCC; } /* Teal */
.color-7 { background-color: #f0f; } /* Magenta #F012BE; } /* Fuchsia */
.color-8 { background-color: #7f0; } /* #01FF70; } /* Lime */
.color-9 { background-color: #505; } /* #85144b; } /* Maroon */

#current-guess .hole.bouncing {
    animation: peg-bounce 0.4s ease;
}

@keyframes peg-bounce {
    0%, 100% { transform: translateY(0); }
    35% { transform: translateY(-22px); }
    55% { transform: translateY(-8px); }
    75% { transform: translateY(-14px); }
}

.game-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.game-overlay.visible {
    opacity: 1;
}

.game-overlay.fade-out {
    opacity: 0;
    transition: opacity 1.8s ease;
}

.overlay-winner {
    font-family: "Poppins", "Open Sans", Arial, sans-serif;
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #ffd700;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),
        0 4px 12px rgba(0, 0, 0, 0.5);
    transform: scale(0.85);
    transition: transform 0.6s ease;
}

.game-overlay.visible .overlay-winner {
    transform: scale(1);
}

.dead-smiley {
    position: relative;
    width: 140px;
    height: 140px;
    background: #ffdc00;
    border: 4px solid #333;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transform: scale(0.85) rotate(-8deg);
    transition: transform 0.6s ease;
}

.game-overlay.visible .dead-smiley {
    transform: scale(1) rotate(-8deg);
}

.dead-smiley-face {
    display: flex;
    justify-content: space-between;
    padding: 34px 28px 0;
}

.dead-smiley-eye {
    font-size: 2.4rem;
    line-height: 1;
    font-weight: 700;
    color: #333;
}

.dead-smiley-mouth {
    position: absolute;
    left: 50%;
    bottom: 28px;
    width: 56px;
    height: 28px;
    margin-left: -28px;
    border-bottom: 4px solid #333;
    border-radius: 0 0 56px 56px;
    transform: rotate(180deg);
}
