.streamrecorder-game {
    position: relative;
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
    border: 2px solid var(--bs-primary);
    cursor: url('/static/streamrecorder/images/Icon16.png') 4 4, crosshair;
    user-select: none;
}

.streamrecorder-game * {
    cursor: url('/static/streamrecorder/images/Icon16.png') 4 4, crosshair !important;
}

.streamrecorder-game.clicking {
    cursor: url('/static/streamrecorder/images/Icon16.png') 3 3, crosshair !important;
}

.streamrecorder-game.clicking * {
    cursor: url('/static/streamrecorder/images/Icon16.png') 3 3, crosshair !important;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    flex-wrap: wrap;
    gap: 10px;
}

.game-stats {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.fullscreen-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid var(--bs-primary);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fullscreen-btn:hover {
    background: var(--bs-primary);
    transform: scale(1.05);
}

.streamrecorder-game.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

.streamrecorder-game.fullscreen .stream-card {
    transform-origin: center;
}

.score-display {
    font-size: 18px;
    font-weight: bold;
    color: var(--bs-primary);
}

.time-display {
    font-size: 16px;
    color: #ff6b6b;
}

.lives-display {
    font-size: 16px;
    color: #ff9f43;
}

.highscore-display {
    font-size: 14px;
    color: #ffd93d;
}

.stream-card {
    position: absolute;
    background: #2a2a3e;
    border-radius: 8px;
    border: 2px solid var(--bs-primary);
    cursor: pointer;
    transform: scale(0);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.3);
    overflow: hidden;
}

.stream-card.active {
    animation: streamGrow 0.5s ease forwards;
}

.stream-card.shrinking {
    animation: streamShrink 0.3s ease forwards;
}

@keyframes streamGrow {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes streamShrink {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

.stream-card.disappearing {
    animation: streamDisappear 1s ease forwards;
}

@keyframes streamDisappear {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

.stream-thumbnail {
    width: 100%;
    height: 60%;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 36px;
}

.stream-info {
    padding: 8px;
    height: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.streamer-name {
    font-size: 11px;
    font-weight: bold;
    color: white;
    margin-bottom: 2px;
    text-align: center;
    width: 100%;
    text-overflow: ellipsis;
    height: fit-content;
    overflow: clip;
    white-space: nowrap;
}

.viewer-count {
    font-size: 9px;
    color: #ff6b6b;
    text-align: center;
}

.live-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #ff4757;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: bold;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.capture-popup {
    position: absolute;
    color: #4ade80;
    font-weight: bold;
    font-size: 20px;
    pointer-events: none;
    z-index: 200;
    animation: captureFloat 1s ease forwards;
}

.miss-popup {
    position: absolute;
    color: #ff4757;
    font-weight: bold;
    font-size: 18px;
    pointer-events: none;
    z-index: 200;
    animation: missFloat 1s ease forwards;
}

@keyframes missFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.8);
    }
}

@keyframes captureFloat {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    color: white;
    z-index: 300;
    border: 2px solid var(--bs-primary);
}

.play-again-btn {
    background: var(--bs-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.play-again-btn:hover {
    background: var(--bs-primary-darker);
    transform: translateY(-2px);
}

.start-screen {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 300;
}

.scoreboard {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 12px;
    border: 2px solid var(--bs-primary);
    color: white;
    z-index: 300;
    display: none;
    min-width: 300px;
}

.scoreboard h3 {
    color: var(--bs-primary);
    margin-bottom: 20px;
    text-align: center;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.score-item:last-child {
    border-bottom: none;
}

.score-mode {
    font-weight: bold;
}

.score-value {
    color: var(--bs-primary);
    font-weight: bold;
}

.scoreboard-toggle {
    background: var(--bs-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.scoreboard-toggle:hover {
    background: var(--bs-primary-darker);
    transform: translateY(-2px);
}

.start-btn {
    background: var(--bs-primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.start-btn:hover {
    background: var(--bs-primary-darker);
    transform: translateY(-2px);
}

.game-instructions {
    margin-bottom: 20px;
    font-size: 14px;
    color: #ccc;
}

.time-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid var(--bs-primary);
    color: white;
    z-index: 400;
    display: none;
    text-align: center;
    min-width: 350px;
}

.time-modal h3 {
    color: var(--bs-primary);
    margin-bottom: 25px;
}

.time-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.time-modal-btn {
    background: var(--bs-primary);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 80px;
}

.time-modal-btn:hover {
    background: var(--bs-primary-darker);
    transform: translateY(-2px);
}

.time-modal-close {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.time-modal-close:hover {
    background: #c0392b;
}

@media (max-width: 768px) {
    .streamrecorder-game {
        height: 300px;
    }

    .game-ui {
        padding: 10px;
        font-size: 14px;
    }

    .stream-card {
        min-width: 80px !important;
        min-height: 60px !important;
    }
}