/* ========================================
   Space Invaders - Stylesheet
   ======================================== */

/* Container */
#space-invaders-container {
    max-width: 1200px;
    margin: 0 auto;
}

.game-section {
    margin-bottom: 30px;
}

/* Tournament Banner */
.tournament-banner {
    text-align: center;
    font-size: 16px;
    padding: 15px;
    border-radius: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Controls Info */
.controls-info {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
}

.controls-info h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.control-item {
    text-align: center;
    padding: 10px;
}

.control-item kbd {
    display: block;
    margin: 0 auto 5px;
    padding: 5px 10px;
    font-size: 14px;
    background: #333;
    color: #fff;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.control-item span {
    display: block;
    font-size: 12px;
    color: #666;
}

/* Difficulty Selection */
.difficulty-selection {
    margin: 20px 0;
}

.difficulty-selection h4 {
    margin-bottom: 15px;
}

.difficulty-btn {
    position: relative;
    overflow: hidden;
}

.difficulty-btn.active {
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.5);
}

.difficulty-btn i {
    margin-right: 3px;
}

/* Games Limit Info */
.games-limit-info {
    margin: 20px 0;
}

/* Stats Sidebar */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: #fff;
}

.stat-value {
    font-weight: bold;
    color: #32cd32;
}

/* Game Canvas Container */
.game-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#game-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
}

/* HUD */
#game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, #1a1a1a, #000);
    color: #fff;
    padding: 10px 20px;
    border-bottom: 2px solid #00ff00;
    font-family: 'Courier New', monospace;
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    gap: 20px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hud-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.hud-value {
    font-size: 16px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#hud-lives i {
    color: #ff0000;
    margin: 0 2px;
}

#hud-combo {
    font-size: 20px;
    animation: comboGlow 0.5s ease-in-out infinite alternate;
}

@keyframes comboGlow {
    from { text-shadow: 0 0 10px rgba(0, 255, 0, 0.5); }
    to { text-shadow: 0 0 20px rgba(0, 255, 0, 1); }
}

/* Active Powerups */
#active-powerups {
    position: absolute;
    top: 60px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.powerup-indicator {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.powerup-timer {
    font-weight: bold;
    color: #00ff00;
}

/* Game Controls */
.game-controls {
    margin-top: 20px;
}

.game-controls button {
    margin: 0 5px;
}

/* Highscores */
.highscore-table {
    width: 100%;
    margin-top: 15px;
}

.highscore-table thead {
    background: linear-gradient(135deg, #1a5f1a, #228b22);
}

.highscore-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #1a5f1a;
    color: #fff !important;
    font-size: 14px;
}

.highscore-table tbody tr:hover td {
    color: #fff !important;
}

.highscore-table tbody tr:hover .score-value,
.highscore-table tbody tr:hover .player-name {
    color: #fff !important;
}

.player-name {
    font-weight: 500;
    font-size: 15px;
}

.highscore-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.highscore-table tr:hover {
    background: #f9f9f9;
}

.rank-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    color: #fff;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #000;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #e6a85c);
    color: #fff;
}

.rank-other {
    background: #666;
    color: #fff;
}

.score-value {
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #333;
}

.player-name {
    font-weight: 500;
}

.player-name.current-user {
    color: #007bff;
    font-weight: bold;
}

.suspicious-score {
    color: #dc3545;
}

.suspicious-score::after {
    content: " ?";
    color: #dc3545;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.achievement-card.unlocked {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4, #fff);
}

.achievement-card.locked {
    opacity: 0.6;
    background: #f5f5f5;
}

.achievement-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 10px;
}

.achievement-card.unlocked .achievement-icon {
    color: #ffd700;
    animation: iconShine 2s ease-in-out infinite;
}

@keyframes iconShine {
    0%, 100% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 215, 0, 1); }
}

.achievement-card.locked .achievement-icon {
    color: #999;
}

.achievement-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    text-align: center;
}

.achievement-description {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-bottom: 10px;
}

.achievement-points {
    text-align: center;
    font-size: 12px;
    color: #888;
}

.achievement-points strong {
    color: #ffd700;
}

.achievement-unlocked-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #28a745;
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

/* Achievement Unlock Notification */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideInDown 0.5s ease-out;
    max-width: 300px;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.achievement-notification-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.achievement-notification-icon {
    font-size: 24px;
}

.achievement-notification-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.achievement-notification-desc {
    font-size: 13px;
    opacity: 0.9;
}

/* Game Over Modal */
#game-over-modal {
    z-index: 1050 !important;
}

#game-over-modal .modal-dialog {
    z-index: 1051 !important;
    position: relative;
    margin-top: 80px !important; /* Abstand von oben */
}

#game-over-modal .modal-content {
    z-index: 1052 !important;
    position: relative;
    background: #fff !important;
}

.custom-modal-backdrop {
    z-index: 1040 !important;
}

#game-over-modal .modal-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
    position: relative;
    z-index: 1053;
}

#game-over-modal .modal-title {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-stats-table {
    width: 100%;
    margin: 20px 0;
}

.game-stats-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.game-stats-table .stat-label {
    font-weight: 600;
    color: #666;
}

.game-stats-table .stat-value {
    text-align: right;
    font-weight: bold;
    color: #333;
}

.new-highscore-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    margin: 10px 0;
    animation: badgePulse 1s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Canvas Overlays */
.canvas-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 30px 50px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #00ff00;
    z-index: 100;
}

.canvas-overlay h2 {
    font-family: 'Courier New', monospace;
    font-size: 36px;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #00ff00;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
}

.canvas-overlay p {
    font-size: 16px;
    color: #aaa;
    margin: 0;
}

/* Particle Effects */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    #game-hud {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .hud-left, .hud-center, .hud-right {
        flex-direction: column;
        gap: 5px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .difficulty-btn {
        font-size: 12px;
        padding: 8px 5px;
    }
    
    .control-item kbd {
        font-size: 12px;
        padding: 3px 8px;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 255, 0, 0.2);
    border-top-color: #00ff00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Score Animation */
@keyframes scoreIncrease {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: #ffd700; }
    100% { transform: scale(1); }
}

.score-increase {
    animation: scoreIncrease 0.3s ease-out;
}

/* Combo Multiplier */
.combo-multiplier {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    pointer-events: none;
    animation: comboFloat 1s ease-out forwards;
}

@keyframes comboFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(1.5);
        opacity: 0;
    }
}

/* Power-Up Glow Effects */
.powerup-doubleshot-active {
    filter: drop-shadow(0 0 10px #00ffff);
}

.powerup-shield-active {
    filter: drop-shadow(0 0 10px #ffff00);
}

.powerup-slowmo-active {
    filter: hue-rotate(180deg);
}

/* Screen Shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.screen-shake {
    animation: shake 0.3s;
}

/* Print Styles */
@media print {
    #game-canvas-container,
    .game-controls,
    .difficulty-selection,
    #start-game-btn {
        display: none !important;
    }
}

/* =========================
   Difficulty Button Group
   ========================= */

.difficulty-group {
    display: inline-flex;
    gap: 6px;
}

.difficulty-btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 6px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.05s ease;
}

/* Icons leicht anpassen */
.difficulty-btn i {
    font-size: 0.9em;
}

/* =========================
   Farbvarianten
   ========================= */

/* Grün – Easy */
.diff-easy {
    background-color: #198754;
}
.diff-easy:hover {
    background-color: #157347;
}
.diff-easy:active,
.diff-easy.active {
    background-color: #146c43;
}

/* Blau – Normal */
.diff-normal {
    background-color: #0d6efd;
}
.diff-normal:hover {
    background-color: #0b5ed7;
}
.diff-normal:active,
.diff-normal.active {
    background-color: #0a58ca;
}

/* Orange – Hard */
.diff-hard {
    background-color: #ffc107;
    color: #000;
}
.diff-hard:hover {
    background-color: #ffca2c;
}
.diff-hard:active,
.diff-hard.active {
    background-color: #e0a800;
    color: #000;
}

/* Rot – Ultra */
.diff-ultra {
    background-color: #dc3545;
}
.diff-ultra:hover {
    background-color: #bb2d3b;
}
.diff-ultra:active,
.diff-ultra.active {
    background-color: #b02a37;
}

/* =========================
   Active / Press Effekt
   ========================= */

/* Basis Active-State */
.difficulty-btn.active {
    box-shadow: none;
    transform: scale(0.98);
}

/* Gedrückt (Mouse / Touch) */
.difficulty-btn:active {
    box-shadow: none;
    transform: scale(0.98);
}

/* =========================
   Farbabhängiger Active-Glow
   ========================= */

.diff-easy.active {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(25, 135, 84, 0.6);
}

.diff-normal.active {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.6);
}

.diff-hard.active {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.7);
}

.diff-ultra.active {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.7);
}

/* =========================
   Sidebar Promo Image
   ========================= */

.sidebar-promo {
    margin-top: 15px;
    text-align: center;
}

.sidebar-promo-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    border: 1px solid #32cd32;
    border-radius:10px;
}

/* =========================
   Difficulty Tabs as Buttons
   ========================= */

/* Bootstrap-Tab-Mechanik neutralisieren */
.difficulty-tabs {
    display: flex;
    gap: 6px;
    border-bottom: none !important;
    margin-bottom: 0 !important;   /* wichtig: -1px von Bootstrap killen */
    padding-left: 0;
}

/* Listenelemente */
.difficulty-tabs > li {
    float: none;
    margin-bottom: 0;
}

/* Button-Optik */
.difficulty-tabs > li > a {
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 3px 10px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    background-color: #6c757d; /* Fallback */
    margin: 0;
    line-height: 1.4;
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.05s ease;
}

/* Hover */
.difficulty-tabs > li > a:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Active (Bootstrap setzt .active auf <li>) */
.difficulty-tabs > li.active > a,
.difficulty-tabs > li.active > a:hover,
.difficulty-tabs > li.active > a:focus {
    transform: none;
    box-shadow: none;
}

/* =========================
   Farbzuordnung pro Difficulty
   ========================= */

/* Easy – Grün */
.difficulty-tabs a[data-difficulty="easy"] {
    background-color: #198754;
}
.difficulty-tabs a[data-difficulty="easy"]:hover {
    background-color: #157347;
}
.difficulty-tabs li.active a[data-difficulty="easy"] {
    border-color: #198754;
    box-shadow: 0 0 8px rgba(25,135,84,0.6);
}

/* Normal – Blau */
.difficulty-tabs a[data-difficulty="normal"] {
    background-color: #0d6efd;
}
.difficulty-tabs a[data-difficulty="normal"]:hover {
    background-color: #0b5ed7;
}
.difficulty-tabs li.active a[data-difficulty="normal"] {
    border-color: #0d6efd;
    box-shadow: 0 0 8px rgba(13,110,253,0.6);
}

/* Hard – Orange */
.difficulty-tabs a[data-difficulty="hard"] {
    background-color: #ffc107;
    color: #000;
}
.difficulty-tabs a[data-difficulty="hard"]:hover {
    background-color: #ffca2c;
}
.difficulty-tabs li.active a[data-difficulty="hard"] {
    border-color: #ffc107;
    box-shadow: 0 0 8px rgba(255,193,7,0.7);
}

/* Ultra – Rot */
.difficulty-tabs a[data-difficulty="ultra"] {
    background-color: #dc3545;
}
.difficulty-tabs a[data-difficulty="ultra"]:hover {
    background-color: #bb2d3b;
}
.difficulty-tabs li.active a[data-difficulty="ultra"] {
    border-color: #dc3545;
    box-shadow: 0 0 8px rgba(220,53,69,0.7);
}

/* Fokus neutralisieren */
.difficulty-tabs a:focus {
    outline: none;
}

/* =========================
   Abstand zum Tab-Content
   ========================= */

.tab-content {
    padding-top: 12px;   /* DAS trennt Tabs sauber vom Inhalt */
}

/* Highscore Tabelle - Username größer */
.highscore-table .player-name {
    font-weight: 500;
    font-size: 16px !important;  /* Größer gemacht */
}

/* Highscore Tabelle - Score heller */
.highscore-table .score-value {
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #fff !important;  /* Viel heller - weiß */
}

/* Bei Hover bleiben alle hell */
.highscore-table tbody tr:hover .score-value,
.highscore-table tbody tr:hover .player-name {
    color: #fff !important;
}

/* Auch ohne Hover sollen Username und Score hell sein */
.highscore-table tbody td {
    color: #e0e0e0;  /* Heller Grauton für alle Zellen */
}






