﻿/* ==== ELEMENTS ==== */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background-color: #f4f4f4;
    min-width: 320px;
}

h1 {
    text-align: center;
}

button {
    cursor: pointer;
}

/* ==== CLASSES ==== */
.row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.guess-slots {
    display: flex;
    gap: 4px;
}

.slot {
    width: 40px;
    height: 40px;
    border: 2px solid #555;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.feedback {
    margin-left: auto;
    display: flex;
    gap: 4px;
    align-items: center;
}

.feedback .peg {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    color: #fff;
}

.message {
    text-align: center;
    font-size: 1.2em;
    margin-top: 12px;
}

.popover-content {
    /* Merged duplicate styles */
    background: linear-gradient(135deg, #fffbe7 0%, #ffe3ec 100%);
    border-radius: 12px;
    border: 3px solid #ffb700;
    box-shadow: 0 8px 32px rgba(255, 183, 0, 0.25), 0 4px 24px rgba(0,0,0,0.2), 0 2px 16px rgba(0,0,0,0.2);
    animation: pop-in 0.7s cubic-bezier(.68,-0.55,.27,1.55);
    text-align: center;
    padding: 2em;
    min-width: 260px;
    width: 90%;
    margin: 40px auto auto auto;
}

.popover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.confetti {
    pointer-events: none;
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 120%;
    z-index: 10;
    overflow: visible;
}

.confetti-piece {
    position: absolute;
    width: 12px;
    height: 18px;
    border-radius: 4px;
    opacity: 0.85;
    animation: confetti-fall 1.8s linear forwards;
}

/* ==== IDS ==== */
#footer {
    width: 100%;
    text-align: center;
    font-size: 0.8em;
    color: #666;
    margin-top: 20px;
    position: fixed;
    bottom: 10px;
    left: 0px;
}

#game-container {
    width: 230px;
}

#guess-btn,
#results-btn {
    padding: 8px 12px;
    margin-left: 8px;
}

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

#results-btn {
    display: none;
    height: 35px;
    line-height: 11px;
    padding-top: 5px;
}

#main-logo  {
    float: left;
}

#title {
    float: right;
}

#history {
    clear: both;
}

#results-popover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8); /* Opaque dark overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    min-width: 100%;
}

#results-popover h2, #results .message, #results .congrats {
    font-family: 'Comic Sans MS', 'Comic Sans', cursive, Arial, sans-serif;
    color: #ff5e62;
    text-shadow: 0 2px 8px #fffbe7, 0 1px 0 #ffb700;
    font-size: 2em;
    margin-bottom: 0.5em;
}

#results-popover::after {
    content: "✨";
    font-size: 2.5em;
    position: absolute;
    top: 24px;
    right: 24px;
    animation: sparkle 1.2s infinite alternate;
    pointer-events: none;
}

#results-share {
    font-size: 1.5em;
    margin: 1em 0;
    white-space: pre-wrap;
    background: #f8f8f8;
    padding: 1em;
    border-radius: 8px;
}

#share-btn,
#close-popover-btn,
#reset-btn {
    padding: 0.5em 1.5em;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    line-height: 20px;
    width: 30%;
}

#share-btn {
    background: #007bff;
    color: #fff;
}

#close-popover-btn {
    background: #aea;
    color: #333;
}

#reset-btn {
    background: #ffb700;
    color: #333;
}

/* ==== MEDIA QUERIES ==== */
@media (max-width:500px) {
    #share-btn,
    #close-popover-btn,
    #reset-btn {
        width: 100%;
        margin-top: 5px;
    }
}

/* ==== KEYFRAMES ==== */
@keyframes pop-in {
    0% { transform: scale(0.7); opacity: 0; }
    80% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-40px) rotateZ(0deg);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(640px) rotateZ(360deg);
        opacity: 0;
    }
}

@keyframes sparkle {
    0% { opacity: 0.7; transform: scale(1) rotate(-10deg);}
    100% { opacity: 1; transform: scale(1.2) rotate(10deg);}
}