/**
 * ═══════════════════════════════════════════════════════════════════════════
 * GAME GHOST - GLOBAL STYLES (GRAUES DESIGN)
 * ═══════════════════════════════════════════════════════════════════════════
 */

:root {
    --primary: #5b7c99;
    --primary-light: #7a9ab8;
    --secondary: #4a90e2;
    --accent: #3498db;
    --success: #10b981;
    --danger: #ef4444;
    --bg-light: #c5cad1;
    --bg-medium: #dce1e6;
    --bg-card: #f0f2f5;
    --bg-dark: #3d4a5c;
    --text-dark: #2c3e50;
    --text-medium: #546e7a;
    --text-dim: #78909c;
    --border-color: #b8bec5;
    --glow: rgba(74, 144, 226, 0.3);
    --spotify-green: #1DB954;
    --font-size-base: 16px;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-h3: 1.5rem;
    --font-size-h2: 2rem;
    --font-size-h1: 2.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASIS & GLOBALE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
    width: 100%;
    position: fixed;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    font-size: var(--font-size-base);
    line-height: 1.6;
    touch-action: manipulation;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(91, 124, 153, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(74, 144, 226, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 40% 20%, rgba(52, 152, 219, 0.06) 0%, transparent 40%);
    animation: backgroundShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCREENS & CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
    z-index: 10;
    padding: 1rem;
    padding-top: calc(1rem + env(safe-area-inset-top));
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#start-screen, #end-screen {
    justify-content: flex-start;
    overflow-y: auto;
}

.container {
    width: 100%;
    max-width: 1100px;
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--bg-medium);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAFIE
   ═══════════════════════════════════════════════════════════════════════════ */
h1 {
    font-size: var(--font-size-h1);
    font-weight: 900;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: var(--text-dark);
}

h2 {
    font-size: var(--font-size-h2);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-medium);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎵 ARTIST BANNER (NEU) - MIT BILD + TEXT
   ═══════════════════════════════════════════════════════════════════════════ */
.artist-banner {
    display: block;
    width: 100%;
    max-width: 700px;
    margin: 1.5rem auto;
    padding: 0;
    background: linear-gradient(135deg, rgba(29, 185, 84, 0.1), rgba(74, 144, 226, 0.1));
    border: 2px solid var(--spotify-green);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.15);
}

.artist-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(29, 185, 84, 0.3);
    border-color: var(--secondary);
}

.artist-banner:active {
    transform: translateY(-2px);
}

.artist-banner-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px 18px 0 0;
}

.artist-banner-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
}

.artist-image {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--spotify-green), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}

.music-note {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.artist-info {
    text-align: left;
}

.artist-label {
    font-size: 0.85rem;
    color: var(--spotify-green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.artist-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.artist-subtitle {
    font-size: 0.95rem;
    color: var(--text-medium);
    font-weight: 500;
}

.spotify-logo {
    width: 50px;
    height: 50px;
    color: var(--spotify-green);
    transition: transform 0.3s ease;
}

.artist-banner:hover .spotify-logo {
    transform: scale(1.15) rotate(5deg);
}

/* Mobile Optimierung Banner */
@media (max-width: 600px) {
    .artist-banner-image {
        display: none;
    }
    
    .artist-banner {
        margin: 1rem auto;
    }
    
    .artist-banner-content {
        grid-template-columns: auto 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .artist-image {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .artist-name {
        font-size: 1.1rem;
    }
    
    .spotify-logo {
        display: none;
    }
    
    #game-intro-screen .container {
        padding: 1rem;
    }
    
    .game-preview {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .game-instructions {
        font-size: 1rem;
    }
    
    .ready-prompt {
        margin: 1rem 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS (TOUCH-OPTIMIERT)
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    min-height: 52px;
    font-size: var(--font-size-lg);
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(74, 144, 226, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LADEBILDSCHIRM
   ═══════════════════════════════════════════════════════════════════════════ */
#loading-screen {
    background: var(--bg-light);
}

.loader {
    width: 60px;
    height: 60px;
    border: 6px solid var(--border-color);
    border-top: 6px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-screen p {
    margin-top: 1.5rem;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-medium);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME GRID & CARDS (PRACTICE MODE)
   ═══════════════════════════════════════════════════════════════════════════ */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    width: 100%;
}

@media (min-width: 640px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    touch-action: manipulation;
    min-height: 200px;
}

.game-card:active {
    transform: scale(0.98);
}

.game-icon {
    font-size: 0;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 14px;
    overflow: hidden;
}

.game-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.game-card p {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    flex: 1;
}

.game-tag {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: rgba(74, 144, 226, 0.15);
    color: var(--secondary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME INTRO SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */
#game-intro-screen .container {
    padding: 2rem 1.5rem;
    overflow-y: auto;
    max-height: 100vh;
}

.game-number {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 30px;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: var(--font-size-lg);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.game-preview {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    border: 2px solid var(--border-color);
}

.game-instructions {
    font-size: var(--font-size-lg);
    color: var(--text-medium);
    margin-top: 1rem;
    line-height: 1.8;
}

.ready-prompt {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-dark);
    margin: 2rem 0 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */
#game-screen {
    padding: 1rem;
    padding-top: calc(1rem + env(safe-area-inset-top));
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
    flex-direction: column;
}

.game-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    padding-top: calc(1rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left)); 
    padding-right: calc(1rem + env(safe-area-inset-right)); 
    border-radius: 16px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 900px;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#current-score {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.instructions {
    font-size: var(--font-size-base);
    color: var(--text-medium);
}

.game-container {
    flex: 1;
    width: 100%;
    max-width: 900px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: calc(1rem + env(safe-area-inset-left)); 
    margin-right: calc(1rem + env(safe-area-inset-right)); 
    margin-bottom: calc(1rem + env(safe-area-inset-bottom)); 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ENDBILDSCHIRM
   ═══════════════════════════════════════════════════════════════════════════ */
.final-score-display {
    background: linear-gradient(135deg, rgba(91, 124, 153, 0.12), rgba(74, 144, 226, 0.12));
    padding: 2rem;
    border-radius: 20px;
    margin: 1.5rem 0;
    border: 2px solid var(--secondary);
}

.final-score-display .label {
    display: block;
    font-size: var(--font-size-lg);
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.final-score {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.score-form {
    margin: 2rem 0;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.name-input {
    width: 100%;
    padding: 0.8rem 1rem;
    min-height: 48px;
    font-size: var(--font-size-lg);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
    touch-action: manipulation;
}

.name-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.2);
}

.player-rank {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--success);
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.12);
    border-radius: 16px;
    border: 2px solid var(--success);
}

.highscore-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-top: 1.5rem;
    text-align: left;
}

.highscore-entry {
    display: grid;
    grid-template-columns: 40px 1fr 80px;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: background 0.3s ease;
}

.highscore-entry .rank {
    font-weight: 700;
    font-size: 1rem;
    color: var(--secondary);
}

.highscore-entry .name {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dark);
}

.highscore-entry .score {
    text-align: right;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--success);
    font-variant-numeric: tabular-nums;
}

.highscore-entry.player-entry {
    background: linear-gradient(135deg, rgba(91, 124, 153, 0.18), rgba(74, 144, 226, 0.18));
    border: 1px solid var(--secondary);
    transform: scale(1.02);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.button-group .btn {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */
.legal-footer {
    width: 100%;
    padding: 1rem;
    margin-top: 3rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
}

.legal-footer .links {
    display: flex;
    gap: 1.5rem;
}

.legal-footer a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ZERTIFIKAT-VORSCHAU
   ═══════════════════════════════════════════════════════════════════════════ */
#certificate-preview-container {
    margin-top: 2rem;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

#certificate-preview-container.hidden {
    display: none;
}

.preview-title {
    font-size: 1.25rem;
    color: #f59e0b;
    margin: 0;
}

#certificate-image {
    width: 100%;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#certificate-actions {
    width: 100%;
}

#share-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    font-size: 1.1rem;
    padding: 0.9rem 1rem;
}

#share-download-icon {
    font-size: 1.5rem;
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AD CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
.ad-unit-container {
    background: rgba(74, 144, 226, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    :root {
        --font-size-base: 18px;
        --font-size-h2: 2rem;
        --font-size-h1: 3rem;
    }
    .container {
        padding: 3rem 2rem;
    }
    .btn {
        padding: 1rem 2.5rem;
    }
    .button-group {
        flex-direction: row;
    }
    #game-screen {
        padding: 1.5rem;
        padding-top: calc(1.5rem + env(safe-area-inset-top));
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
        padding-left: calc(1.5rem + env(safe-area-inset-left));
        padding-right: calc(1.5rem + env(safe-area-inset-right));
    }
    .game-header {
        padding: 1.5rem 2rem;
        padding-top: 1.5rem;
    }
    .final-score {
        font-size: 5rem;
    }
    .highscore-entry {
        grid-template-columns: 60px 1fr 100px;
    }
    
    /* Größere Icons auf Tablet */
    .game-icon {
        width: 120px;
        height: 120px;
    }
    
    .game-card {
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    :root {
        --font-size-h1: 3.5rem;
    }
    .highscore-list {
        max-height: 500px;
    }
    .legal-footer {
        flex-direction: row;
        gap: 2rem;
    }
    
    /* Noch größere Icons auf Desktop */
    .game-icon {
        width: 160px;
        height: 160px;
    }
    
    .game-card {
        min-height: 300px;
        padding: 2rem 1.5rem;
        gap: 1rem;
    }
}

@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    }
    .game-card:hover {
        transform: translateY(-5px);
        border-color: var(--secondary);
        box-shadow: 0 6px 20px rgba(74, 144, 226, 0.25);
    }
    .legal-footer a:hover {
        color: var(--primary-light);
    }
    .highscore-entry:hover {
        background: rgba(74, 144, 226, 0.1);
    }
}
/* ═══════════════════════════════════════════════════════════════════════════
   ABBRECHEN-BUTTON (NUR IM TRAININGSMODUS)
   ═══════════════════════════════════════════════════════════════════════════ */

.abort-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    padding: 0.75rem 1.25rem;
    
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    
    cursor: pointer;
    transition: all 0.2s ease;
    
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    
    /* Mobile Optimierung */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.abort-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.abort-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.abort-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* Responsive: Kleinerer Button auf mobilen Geräten */
@media (max-width: 640px) {
    .abort-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .abort-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .abort-btn span {
        display: none; /* Text auf sehr kleinen Screens verstecken */
    }
    
    .abort-btn {
        padding: 0.7rem;
        border-radius: 50%;
    }
}

/* Verstecken-Klasse */
.abort-btn.hidden {
    display: none;
}