/* HIGH VISIBILITY GLASS - 2025 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

:root {
    /* --- DARK MODE (STANDARD) --- */
    --bg-color: #050505;
    --bg-image: radial-gradient(circle at 50% 120%, #1a0b2e 0%, #000000 70%);
    
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    
    /* DARK GLASS VARIABLES (Sichtbarer gemacht!) */
    /* Hintergrund: 12% Weiß -> hebt sich vom Schwarz ab */
    --glass-bg: rgba(255, 255, 255, 0.12);
    /* Rand: 30% Weiß -> Klare Kante */
    --glass-border: 1px solid rgba(255, 255, 255, 0.3); 
    --glass-highlight: rgba(255, 255, 255, 0.1);
    /* Schatten: Schwarz für Tiefe */
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    
    /* Text in Buttons */
    --btn-text-color: #ffffff;
    
    /* Player Colors */
    --neon-blue: #00f0ff;
    --neon-blue-glow: 0 0 20px rgba(0, 240, 255, 0.6);
    
    /* Logik Farben (Texte bleiben hell im Dark Mode) */
    --text-active: #fff;
    --text-disabled: #ffcccc;
    --text-winner: #ccffdd;

    /* Switch */
    --toggle-bg: rgba(255,255,255,0.15);
    --toggle-knob: #ffffff;
    
    /* Glows */
    --border-active: #00f0ff;
    --border-disabled: #ff0055;
    --border-winner: #00ff9d;
}

body.light-mode {
    /* --- LIGHT MODE (HELL & SICHTBAR) --- */
    --bg-color: #e0e5ec;
    --bg-image: radial-gradient(circle at 50% 0%, #ffffff 0%, #d1d9e6 100%);
    
    --text-main: #1f2937; /* Dunkelgrau */
    --text-muted: #64748b;
    
    /* LIGHT GLASS VARIABLES */
    /* Hintergrund: 70% Weiß -> Milchglas (Deutlich sichtbar!) */
    --glass-bg: rgba(255, 255, 255, 0.75); 
    /* Rand: Weiß für Highlight + Grau für Kontrast */
    --glass-border: 1px solid rgba(255, 255, 255, 1);
    
    /* WICHTIG: Schatten für Kontrast auf hellem Grund */
    --glass-shadow: 
        0 4px 6px rgba(100, 100, 100, 0.1), 
        0 1px 3px rgba(0, 0, 0, 0.1);
    
    --btn-text-color: #000000; /* Schwarze Zahlen */
    
    --neon-blue: #2563eb;
    --neon-blue-glow: 0 0 15px rgba(37, 99, 235, 0.4);
    
    /* Logik Farben (Dunkel im Light Mode für Lesbarkeit!) */
    --text-active: #0044cc;
    --text-disabled: #990033;
    --text-winner: #006633;
    
    --toggle-bg: rgba(0,0,0,0.1);
    --toggle-knob: #ffffff;
    
    --border-active: #2563eb;
    --border-disabled: #dc2626;
    --border-winner: #16a34a;
}

/* Pulsieren für Gewinner */
@keyframes glass-pulse {
    0% { box-shadow: 0 0 0 rgba(0, 255, 157, 0); border-color: var(--border-winner); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 157, 0.4); transform: scale(1.02); }
    100% { box-shadow: 0 0 0 rgba(0, 255, 157, 0); border-color: var(--border-winner); }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }

body {
    display: flex; justify-content: center; align-items: center;
    background-color: var(--bg-color); background-image: var(--bg-image);
    background-attachment: fixed; background-size: cover;
    font-family: 'Inter', sans-serif; color: var(--text-main);
    transition: background 0.4s ease;
}

/* --- CONTAINER (DIE PLATTE) --- */
.container {
    position: relative;
    display: flex; flex-direction: column;
    width: 90%; max-width: 380px; padding: 35px;
    
    /* Basisplatte */
    background: var(--glass-bg);
    /* Blur sorgt für den Effekt dahinter */
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    
    border: var(--glass-border);
    /* Doppelrand für mehr Tiefe */
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.2), 
        inset 0 0 0 1px rgba(255,255,255,0.2); 
        
    border-radius: 40px;
    z-index: 1; transition: all 0.3s;
}

/* --- HEADER --- */
.header-bar {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; margin-bottom: 30px; padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative; z-index: 10;
}
#meddler-title {
    font-size: 16px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-main);
    line-height: 1.2; max-width: 70%;
}

/* --- SWITCH --- */
.toggle-switch {
    width: 52px; height: 32px;
    background-color: var(--toggle-bg);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px; cursor: pointer; padding: 4px;
    touch-action: manipulation; z-index: 100;
}
.toggle-knob {
    width: 22px; height: 22px;
    background-color: var(--toggle-knob);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s cubic-bezier(0.5, 1.5, 0.5, 1);
    pointer-events: none;
}
.toggle-knob .icon svg { width: 14px; height: 14px; stroke: #555; }
body.light-mode .toggle-knob { transform: translateX(20px); background: #fbbf24; }
body.light-mode .toggle-knob .icon svg { stroke: #fff; }

/* --- PLAYER --- */
.controls-section { width: 100%; margin-bottom: 30px; }

#play-button {
    width: 100%; height: 70px;
    border-radius: 24px;
    
    /* Sichtbarer Hintergrund */
    background: var(--glass-bg);
    border: var(--glass-border);
    /* Innerer Schatten für Tiefe */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    
    cursor: pointer; position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 15px;
    transition: transform 0.1s; touch-action: none;
}

/* Flüssigkeit */
#play-button::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), rgba(0, 240, 255, 0.9));
    box-shadow: 0 0 20px var(--neon-blue);
    border-right: 1px solid rgba(255,255,255,0.8);
    z-index: 1; pointer-events: none;
}

#play-button:active { transform: scale(0.98); }

#play-icon-container, #play-text {
    position: relative; z-index: 3; pointer-events: none;
    color: var(--text-main);
    display: flex; align-items: center;
}
#play-icon-container svg { width: 24px; height: 24px; fill: currentColor; }
#play-text { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }

/* --- BUTTONS (VISIBLE GLASS) --- */
.keypad-section { width: 100%; }
.buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; }

.buttons button {
    width: 100%; aspect-ratio: 1; margin: 0;
    font-family: 'Inter', sans-serif; font-size: 28px; font-weight: 600;
    
    /* HIER IST DIE SICHTBARKEIT */
    background: var(--glass-bg); /* Nutzt jetzt die deutlichere Farbe */
    border: var(--glass-border); /* Dickerer Rand */
    color: var(--btn-text-color); /* Schwarz im Light, Weiß im Dark */
    
    border-radius: 24px;
    /* Starker Schatten für den "Pop"-Effekt */
    box-shadow: var(--glass-shadow);
    
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    touch-action: manipulation;
    transition: all 0.15s ease-out;
    position: relative;
    overflow: hidden;
}

/* Der "Glanz" oben drauf (Reflection) */
.buttons button::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 45%;
    /* Weißer Verlauf von Oben nach Unten */
    background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 22px 22px 50% 50% / 30%;
    pointer-events: none;
}

/* ACTIVE STATE (KLICK) */
.buttons button:active:not(:disabled) {
    transform: scale(0.95);
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--border-active);
    color: var(--text-active);
    box-shadow: 0 0 15px var(--neon-blue);
}

/* DISABLED (ROT) */
.buttons button:disabled {
    opacity: 1 !important; transform: scale(0.96);
    background: rgba(255, 0, 85, 0.15) !important;
    border: 1px solid var(--border-disabled) !important;
    color: var(--text-disabled) !important;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.3) !important;
}

/* WINNER (GRÜN) */
.buttons button.green {
    z-index: 5;
    background: rgba(0, 255, 157, 0.2) !important;
    border: 1px solid var(--border-winner) !important;
    color: var(--text-winner) !important;
    animation: glass-pulse 2s infinite ease-in-out;
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.3) !important;
}

/* --- RESET --- */
#reset {
    margin-top: 40px; width: 100%; padding: 18px;
    background: var(--glass-bg); /* Auch Reset ist jetzt sichtbar */
    border: var(--glass-border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 3px;
    cursor: pointer; transition: all 0.2s;
    box-shadow: var(--glass-shadow);
}
#reset:hover {
    color: var(--text-main);
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.2);
}
#reset:active { transform: scale(0.98); }