@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/NotoSans-Medium.ttf') format('truetype');
    font-weight: 500; /* Medium entspricht in der Regel font-weight 500 */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Sans Condensed ExtraBold';
    src: url('../fonts/NotoSans_Condensed-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

:root {
    --bg-color: #1f2227;
    --card-bg-rgb: 30, 30, 33;
    --card-bg: rgb(var(--card-bg-rgb));
    --text-color: #f8fafc;
    --accent-color: #38bdf8;
    --danger-color: #ef4444;
    --piano-height: calc(10vw + 35px);
    --btn-height: 42px;
    --border-color: rgba(255, 255, 255, 0.2);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --modal-opacity: 1;
    --modal-blur: 0px;
    /* Initialisierung zur Vermeidung von Validierungsfehlern */
    --chordbox-color: #4caf50; 
    --left-hand-color: #ef4444;
    --right-hand-color: #3b82f6;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Noto Sans', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color); 
    color: var(--text-color);
    overflow: hidden; 
    transition: background-color 0.5s ease;
}

/* Der eigenständige Layer für das Bild (ohne Blend-Mode, reines Alpha-Blending) */
#bg-texture {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1; 
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease, background-image 0.5s ease;
}

#app { 
    display: flex; 
    flex-direction: column; 
    height: 100vh;
    position: relative;
    z-index: 10;
    background: transparent; 
}

header { 
    padding: 20px 40px; 
    display: flex; 
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 150;
}

.app-main-title {
    position: relative;
    font-family: 'Noto Sans Condensed ExtraBold', 'Noto Sans', sans-serif;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.15);
    -webkit-text-stroke: 1px black;
    letter-spacing: 1px;
    user-select: none;
    pointer-events: none;
}

/* Das Overlay-Element für den sanften Color-Crossfade */
.app-main-title::after {
    content: 'Piano Progression Lab';
    position: absolute;
    left: 0;
    top: 0;
    color: transparent;
    background: linear-gradient(120deg, transparent 20%, #facc15 45%, #ffffff 50%, #facc15 55%, transparent 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-stroke: 1px black; /* Hält den Rand deckungsgleich */
    opacity: 0; /* Startet unsichtbar */
    pointer-events: none;
}

/* Bewegung des Lichtreflexes von LINKS (-100%) nach RECHTS (200%) */
@keyframes title-glitter-sweep {
    0% { background-position: -100% 50%; }
    100% { background-position: 200% 50%; }
}

/* Opacity-Fade für weiches Ein- und Ausblenden der Farbe 
   (33% von 3 Sekunden = ca. 1 Sekunde Fade-In & Fade-Out) */
@keyframes title-glitter-fade {
    0%   { opacity: 0; }
    33%  { opacity: 1; }
    66%  { opacity: 1; }
    100% { opacity: 0; }
}

/* Trigger für das Overlay */
.app-main-title.gold-glitter::after {
    animation: 
        title-glitter-sweep 3s ease-in-out forwards,
        title-glitter-fade 3s ease-in-out forwards;
}

.header-controls { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

main { 
    flex: 1;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    padding: 0 10px;
    padding-bottom: var(--piano-height);
}

#current-chord-display {
    transition: color 0.3s ease, background 0.3s ease;
}

#primary-chord {
    font-size: 5.5rem;
    font-weight: 500;
    color: var(--chordbox-color);
    line-height: 1.1;
    word-wrap: break-word;
}

#alternative-chords {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.6;
    margin-top: 10px;
    min-height: 1.8rem;
    color: var(--text-color);
}

.hidden { 
    display: none !important;
}

/* Mobile Blocker (versteckt per default) */
#mobile-blocker {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #1f2227;
    z-index: 10000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #f8fafc;
}

.mobile-logo {
    width: 120px;
    height: auto;
    margin-bottom: 30px;
}

.mobile-text {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 450px;
    margin-bottom: 40px;
}

.mobile-footer {
    font-size: 0.6rem;
    opacity: 0.3;
}

/* Wenn die Breite unter 768px fällt, sperre die App und zeige den Mobile Blocker */
@media (max-width: 767px) {
    #mobile-blocker {
        display: flex;
    }
    #app, #app-loader, .modal-overlay, .floating-overlay {
        display: none !important;
    }
}