html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings:
      "wdth" 100;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-image: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #ffffff 10px,
        #ffffff 20px
    );
}

header {
    flex-shrink: 0;
    padding: 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
}

.header-left,
.header-right {
    flex: 1;
}

.header-left {
    text-align: left;
}

.header-center {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 0px 8px 0px 8px ;
}

.header-right {
    text-align: right;
}

#player-name {
    font-size: 1rem;
    font-weight: bold;
}

.header-left p,
.header-right p,
#active-players,
#status {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.header-center button {
    min-width: 80px;
    min-height: 40px;
    padding: 0.5rem 1rem;
    box-sizing: border-box;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#flag-container {
    height: 100%;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#flag-container img {
    display: block;
    max-width: 100%;
    max-height: 85%;
    border-radius: 6px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

#flag-container,
#answers-grid {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-out {
    opacity: 0;
    transform: scale(0.1);
    pointer-events: none;
}

footer {
    flex-shrink: 0;
}

#answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 0.5rem;
    padding: 1rem;
}

#answers-grid button {
    padding: 4vh;
    font-size: clamp(1rem, 2vh, 1.4rem);
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 6px;
    touch-action: manipulation;
}

.drawer-slide-up {
    animation: slideUp 0.3s forwards ease-out;
}

.drawer-slide-down {
    animation: slideDown 0.3s forwards ease-in;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

#scoreboard p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.correct-flash {
    animation: flash-green 0.5s;
}

@keyframes flash-green {
    0% {
        background-color: #8f8;
    }

    100% {
        background-color: #fff;
    }
}

.incorrect-flash {
    animation: flash-red 0.5s;
}

@keyframes flash-red {
    0% {
        background-color: #f88;
    }

    100% {
        background-color: #fff;
    }
}

#confetti-container {
    pointer-events: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 9999;
}

.confetti-piece {
    position: absolute;
    bottom: -10px;
    opacity: 0.9;
    animation: confetti-fly 3s linear forwards;
    border-radius: 2px;
}

@keyframes confetti-fly {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-110vh) rotate(720deg);
        opacity: 0;
    }
}