/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 15px;
    color: white;
    flex-shrink: 0;
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5em;
    margin-bottom: 5px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    animation: titlePulse 3s infinite ease-in-out;
    background: linear-gradient(45deg, #ffffff, #f0f0f0, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
        text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.6);
    }
}

@keyframes floatingElements {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.game-subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Game Controls */
.game-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 
                0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.6s ease-out;
    flex-shrink: 0;
}

.players-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 700;
}

.add-player {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.add-player input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.add-player input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    max-height: 120px;
    overflow-y: auto;
}

.player-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 12px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 30px rgba(240, 147, 251, 0.4);
}

.player-name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.player-score {
    font-size: 0.9em;
    opacity: 0.9;
}

.remove-player {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 0.8em;
}

.game-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.setting label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.setting input,
.setting select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 30px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff5f6d 0%, #ffc371 100%);
    color: white;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.2em;
    display: block;
    margin: 0 auto;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Game Area */
.game-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.timer-section {
    margin-bottom: 30px;
}

.timer {
    font-size: 5em;
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.timer-label {
    font-size: 1.1em;
    color: #666;
}

.current-task {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 35px;
    border-radius: 25px;
    margin-bottom: 30px;
    box-shadow: 0 12px 30px rgba(240, 147, 251, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.current-task::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.task-category {
    font-size: 1.2em;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 10px;
}

.task-number {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 15px;
}

.task-description {
    font-size: 1.3em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.task-points {
    font-size: 1.1em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
}

.task-bonus {
    font-size: 0.95em;
    opacity: 0.9;
    font-style: italic;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.current-round-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
}

.current-player h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.player-score {
    font-size: 1.2em;
    font-weight: 600;
}

/* Categories Section */
.categories-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out;
    flex: 1;
}

.categories-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.category-card {
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    color: white;
    transition: transform 0.3s;
    cursor: pointer;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.category-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.category-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.category-3 { background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%); }
.category-4 { background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%); }
.category-5 { background: linear-gradient(135deg, #ff5f6d 0%, #ffc371 100%); }

.category-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.category-card h3 {
    font-size: 1em;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.2;
}

.category-card p {
    opacity: 0.9;
    margin-bottom: 8px;
    line-height: 1.3;
    font-size: 0.85em;
}

.category-stats {
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 15px;
    display: inline-block;
}

/* Scoreboard */
.scoreboard {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.scoreboard h2 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.scoreboard-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 15px;
    transition: all 0.3s;
}

.score-item:first-child {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    font-weight: 700;
}

.score-item:nth-child(2) {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.score-item:nth-child(3) {
    background: linear-gradient(135deg, #cd7f32 0%, #d4a574 100%);
    color: white;
}

.score-rank {
    font-size: 1.2em;
    font-weight: 700;
    width: 30px;
}

.score-name {
    flex: 1;
    margin-left: 15px;
    font-size: 1.1em;
}

.score-points {
    font-size: 1.2em;
    font-weight: 700;
}

/* Game Results */
.game-results {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-results h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 2.5em;
}

.final-scores {
    margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 8px;
        height: 100vh;
    }

    .game-title {
        font-size: 2.2em;
        margin-bottom: 3px;
    }

    .game-subtitle {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .header {
        margin-bottom: 10px;
    }

    .timer {
        font-size: 3.5em;
    }

    .add-player {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 10px;
    }

    .game-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .game-actions .btn {
        width: 100%;
        max-width: 250px;
        padding: 12px 16px;
        font-size: 1em;
    }

    .categories-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .category-card {
        padding: 12px;
        min-height: 120px;
    }

    .category-card h3 {
        font-size: 0.9em;
    }

    .category-card p {
        font-size: 0.8em;
    }

    .game-settings {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .current-task {
        padding: 20px;
        margin-bottom: 15px;
    }

    .task-description {
        font-size: 1.1em !important;
    }

    .game-controls {
        padding: 15px;
        margin-bottom: 10px;
    }

    .players-list {
        max-height: 80px;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .player-card {
        padding: 8px;
    }

    .categories-section {
        padding: 15px;
    }

    .scoreboard {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8em;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        min-height: 100px;
        padding: 10px;
    }

    .players-list {
        grid-template-columns: 1fr;
    }
}

/* Animationen */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(40px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.8s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1.05); }
    75% { transform: scale(1.15); }
}

.heartbeat {
    animation: heartbeat 1.5s infinite;
}

/* Timer Animation */
.timer-warning {
    color: #ff7043 !important;
    animation: pulse 0.5s infinite;
}

.timer-critical {
    color: #f44336 !important;
    animation: pulse 0.3s infinite;
}

/* Countdown */
.countdown-area {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.countdown-number {
    font-size: 6em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: countdownPulse 1s ease-in-out;
}

.countdown-text {
    font-size: 1.5em;
    color: #333;
    margin-top: 10px;
}

@keyframes countdownPulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Player Selection */
.player-selection-area {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.player-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.player-checkbox {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    border: 3px solid transparent;
}

.player-checkbox:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 147, 251, 0.4);
}

.player-checkbox.selected {
    border-color: #4ecdc4;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    animation: successPulse 0.3s ease-out;
}

.player-checkbox input {
    display: none;
}

.player-checkbox-label {
    font-weight: 600;
    font-size: 1.1em;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Bonus Selection */
.bonus-selection {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffc107;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.bonus-selection h4 {
    color: #f57c00;
    margin-bottom: 10px;
}

.bonus-player-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.bonus-player-option {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.bonus-player-option:hover {
    background: #ffc107;
    color: white;
}

.bonus-player-option.selected {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.selection-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

/* Sound Controls */
.sound-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.sound-controls .btn {
    padding: 8px 12px;
    font-size: 0.9em;
    border-radius: 20px;
}

/* Alert Animations */
@keyframes alertFlash {
    0%, 100% { background-color: rgba(255, 0, 0, 0.8); }
    50% { background-color: rgba(255, 100, 100, 0.9); }
}

.time-up-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: alertFlash 0.5s infinite;
}

.time-up-text {
    color: white;
    font-size: 4em;
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    animation: pulse 0.5s infinite;
}

/* Interrupt Button Animation */
@keyframes glowing {
    0% { box-shadow: 0 0 5px #ffc107; }
    50% { box-shadow: 0 0 20px #ffc107, 0 0 30px #ffc107; }
    100% { box-shadow: 0 0 5px #ffc107; }
}

.interrupt-active {
    animation: glowing 2s infinite;
}