/* ==========================================================================
   DrinkDuel — Minigame Layouts & Interactive Components
   Simultaneous grids (2, 3, 4 players) and turn-based viewports
   ========================================================================== */

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Simultaneous Grid Base */
.sim-grid {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 8px;
    padding: 4px;
}

/* 2 Players: Split Top / Bottom */
.sim-grid.players-2 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
}

/* 3 Players: 2x2 with P3 at bottom-left having exact same width as P1 & P2, right slot empty */
.sim-grid.players-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

/* 4 Players: 2x2 Grid */
.sim-grid.players-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

/* Player Zone Cell */
.player-zone {
    position: relative;
    border-radius: 20px;
    background: rgba(18, 22, 34, 0.75);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.1s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.player-zone.active-touch {
    transform: scale(0.98);
}

/* 180° rotation for players seated across the table */
.player-zone.seat-top {
    transform: rotate(180deg);
}

.player-zone.seat-top.active-touch {
    transform: rotate(180deg) scale(0.98);
}

.duel-zone.seat-top {
    transform: rotate(180deg);
}

.duel-zone.seat-top:active {
    transform: rotate(180deg) scale(0.98);
}

.player-zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 6px 6px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.zone-player-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 800;
}

.zone-status-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.player-zone-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}

/* QUICK TAP */
.tap-zone-btn {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
}

.tap-count-huge {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
}

.tap-progress-wrap {
    width: 85%;
    height: 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    overflow: hidden;
}

.tap-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.05s linear;
}

/* WACHT OP GROEN */
.waitgreen-zone {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: background-color 0.1s ease;
    text-align: center;
    padding: 8px;
}

.waitgreen-zone.state-wait {
    background: rgba(231, 76, 60, 0.15);
}

.waitgreen-zone.state-ready {
    background: rgba(46, 204, 113, 0.95);
    color: #ffffff;
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.8);
}

.waitgreen-zone.state-early {
    background: rgba(192, 57, 43, 0.85);
    color: #ffffff;
}

.waitgreen-zone.state-done {
    background: rgba(52, 152, 219, 0.25);
}

/* SNIPER */
.sniper-clock-center {
    width: 100%;
    padding: 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 18px;
    margin-bottom: 6px;
}

.sniper-target-label {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffd166;
}

.sniper-display-time {
    font-family: monospace, monospace;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #ffffff;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.sniper-display-time.hidden-blur {
    filter: blur(8px);
    opacity: 0.4;
}

/* TIJDBOM */
.timebomb-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    padding: 12px;
    text-align: center;
}

.bomb-graphic-wrap {
    position: relative;
    font-size: 6rem;
    margin: 10px 0;
}

.bomb-fuse-spark {
    position: absolute;
    top: 5px;
    right: 25px;
    font-size: 2.2rem;
}

.bomb-prompt-card {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 18px 20px;
    width: 100%;
    max-width: 420px;
}

.bomb-prompt-label {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #ffd166;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.bomb-prompt-text {
    font-size: 1.45rem;
    font-weight: 900;
    color: #ffffff;
}

/* MIJNENVELD */
.minefield-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 6px;
    gap: 8px;
}

.minefield-turn-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.minefield-turn-bar.seat-top {
    transform: rotate(180deg);
}

.powerup-floating-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 60;
    background: rgba(10, 12, 18, 0.94);
    border: 3px solid #f1c40f;
    border-radius: 24px;
    padding: 18px 24px;
    text-align: center;
    box-shadow: 0 0 35px rgba(241, 196, 15, 0.45);
    pointer-events: none;
    animation: popup-bounce-fade 1.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popup-bounce-fade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6);
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }
    28% {
        transform: translate(-50%, -50%) scale(1);
    }
    75% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

.math-announcer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    background: rgba(10, 12, 18, 0.92);
    border: 2px solid #ffd166;
    border-radius: 20px;
    padding: 14px 22px;
    font-size: 1.2rem;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.minefield-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 6px;
    width: 100%;
    height: 100%;
}

.mine-cell {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.12s ease, background 0.2s ease;
}

.mine-cell:active {
    transform: scale(0.92);
}

.mine-cell.safe {
    background: rgba(46, 204, 113, 0.25);
    border-color: rgba(46, 204, 113, 0.6);
    pointer-events: none;
}

.mine-cell.exploded {
    background: #e74c3c;
    border-color: #ffffff;
    box-shadow: 0 0 20px #e74c3c;
}

/* REKENRACE */
.math-top-card {
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    margin-bottom: 6px;
}

.math-equation {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #ffffff;
}

.math-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
    width: 100%;
    height: 100%;
}

.math-choice-btn {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
}

.math-choice-btn:active {
    transform: scale(0.94);
}

/* VIND DE AFWIJKER (KLEURENTEST AFVALRACE) */
.color-odd-grid {
    display: grid;
    gap: 6px;
    width: 100%;
    height: 100%;
    padding: 2px;
}

.color-tile {
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.color-tile:active {
    transform: scale(0.92);
}

.self-thirst-bubble {
    position: fixed;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    background: #ffd166;
    color: #0b0c10;
    font-size: 1.25rem;
    font-weight: 900;
    padding: 16px 24px;
    border-radius: 24px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
    text-align: center;
    pointer-events: none;
    animation: popup-bounce-fade 1.6s forwards;
}

/* GEHEUGENTEST (MEMORY) */
.memory-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 6px;
    gap: 8px;
}

.memory-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 6px;
}

.memory-card {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.2s ease;
}

.memory-card.face-down {
    background: linear-gradient(135deg, #1f2438 0%, #111422 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.memory-card.face-down::after {
    content: "❓";
    font-size: 1.1rem;
    opacity: 0.5;
}

.memory-card.matched {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
    pointer-events: none;
}

/* DUELLEREN (WESTERN SHOOTOUT) */
.duel-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
}

.duel-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    margin: 6px;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease, transform 0.1s ease;
}

.duel-zone:active {
    transform: scale(0.98);
}

.duel-center-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    background: rgba(10, 12, 18, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    padding: 12px 28px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}
