/* ================= GRUND-RESET ================= */
html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* Zwingt die Seite dazu, niemals zu scrollen oder zu verrutschen */
}

/* ================= LOGIN PAGE STYLES ================= */
.login-body {
    background-image: url('/background.jpg');
    background-size: cover;
    background-position: center center; 
    background-repeat: no-repeat;
    background-color: #0a0005; 
    position: relative; /* Wichtig für absolute Zentrierung der Kinder */
}

/* Partikel-Container und Animation */
.particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

.heart {
    position: absolute;
    font-size: 20px;
    animation: floatAround linear infinite;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

@keyframes floatAround {
    0% { transform: translateY(100vh) translateX(0) scale(1) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(0vh) translateX(30px) scale(1.2) rotate(15deg); }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(-30px) scale(1) rotate(-15deg); opacity: 0; }
}

/* ================= DAS GROSSE PINKE COUNTDOWN-HERZ ================= */
.login-box-wrapper {
    /* Absolute Zentrierung: Nagelt das Herz zu 100% in die Mitte! */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* Der leuchtende Herz-Hintergrund aus purem CSS */
.css-heart-bg {
    position: absolute;
    top: 100px; /* Verschiebung nach unten, um den Schwerpunkt auszugleichen */
    left: 100px;
    width: 200px;
    height: 200px;
    background: rgba(255, 20, 147, 0.35); /* Deep Pink mit Transparenz */
    backdrop-filter: blur(5px); /* Macht die Blumen dahinter unscharf */
    transform: rotate(-45deg);
    box-shadow: 0 0 50px rgba(255, 105, 180, 0.8); /* Starker pinker Glow */
    z-index: -1;
}

.css-heart-bg::before,
.css-heart-bg::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 20, 147, 0.35);
    backdrop-filter: blur(5px);
    border-radius: 50%;
}

.css-heart-bg::before {
    top: -100px;
    left: 0;
}

.css-heart-bg::after {
    top: 0;
    left: 100px;
}

/* Text und Countdown im Herz */
.login-content {
    position: relative;
    z-index: 10;
    text-align: center;
    transform: translateY(-15px); /* Zieht den Text leicht nach oben in den Bauch des Herzens */
}

.mysterious-title {
    font-family: 'Segoe UI', sans-serif;
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 20px;
    color: #ffe6f2; /* Sehr zartes Pink/Weiß */
    text-shadow: 0 0 10px rgba(255, 20, 147, 0.9);
}

.wait-text {
    font-size: 12px;
    color: #ffb3d9;
    margin-bottom: 15px;
}

#countdown {
    font-family: 'Segoe UI', sans-serif;
    font-size: 32px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 105, 180, 0.9);
    white-space: nowrap; /* VERHINDERT ZEILENUMBRUCH */
}

/* ================= MUSIK STEUERUNG UNTEN RECHTS ================= */
.music-login-container {
    position: fixed; /* Fixiert am Fenster, verrutscht niemals */
    /* Passe diese beiden Werte an, um es perfekt auf den Stern zu schieben! */
    bottom: 65px;
    right: 65px;   
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Der Slider taucht drüber auf */
#slider-container {
    position: absolute;
    bottom: 100%; /* Schiebt ihn exakt über den Button */
    margin-bottom: 15px; /* Abstand zum Button */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.4); /* Leichter Hintergrund zur Lesbarkeit */
    padding: 5px 10px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

/* Der Play Button als kleines Herz */
.heart-play-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.heart-play-btn-bg {
    position: absolute;
    top: 20px;
    left: 15px;
    width: 30px;
    height: 30px;
    background: rgba(255, 0, 102, 0.8);
    transform: rotate(-45deg);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.9);
    transition: all 0.3s;
    z-index: -1;
}

.heart-play-btn-bg::before,
.heart-play-btn-bg::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    background: inherit;
    border-radius: 50%;
}

.heart-play-btn-bg::before { top: -15px; left: 0; }
.heart-play-btn-bg::after { top: 0; left: 15px; }

.heart-play-btn:hover .heart-play-btn-bg {
    transform: rotate(-45deg) scale(1.1);
    background: #ff3399;
}

.play-text {
    color: white;
    font-size: 11px;
    font-weight: bold;
    z-index: 2;
    margin-top: -5px; /* Korrigiert die optische Mitte */
    text-shadow: 0 0 5px black;
}

/* Das große CSS Herz in der Mitte */
.big-heart-container {
    margin-top: 50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,0,0,0.1) 0%, rgba(0,0,0,0) 70%);
    border: 2px solid rgba(255, 0, 85, 0.5);
    /* Ein simpler Clip-Path, der den Container in eine Herzform schneidet */
    clip-path: path('M150 280 C 150 280, 0 160, 0 80 C 0 30, 40 0, 80 0 C 115 0, 150 40, 150 40 C 150 40, 185 0, 220 0 C 260 0, 300 30, 300 80 C 300 160, 150 280, 150 280 Z');
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.3);
}

.letters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    width: 200px; /* Damit es ins Herz passt */
}

.letter-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.letter-btn:hover {
    transform: scale(1.3);
}

/* Modals (Popups) */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1a0000;
    border: 2px solid #ff4d4d;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    max-width: 80%;
    position: relative;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
}

.compliment-text {
    font-size: 22px;
    font-style: italic;
    color: #ffcccc;
}

/* Date Design */
.date-design {
    background: linear-gradient(135deg, #ff0055, #8b0000);
    border: 2px solid gold;
}

.date-text {
    font-size: 28px;
    color: white;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.small-text {
    font-size: 14px;
    font-weight: normal;
}

/* Schatztruhe */
.treasure-section {
    margin-top: auto; /* Drückt es nach unten */
    margin-bottom: 50px;
    text-align: center;
    background: rgba(20, 0, 0, 0.8);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #ff0000;
}

.treasure-title {
    color: gold;
    margin-bottom: 15px;
}

.chest-input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.chest {
    font-size: 60px;
    margin: 20px 0;
    transition: transform 0.5s;
}

.chest-open-anim {
    transform: scale(1.2) rotate(5deg);
    text-shadow: 0 0 30px gold;
}

.carousel {
    min-height: 60px;
    font-size: 18px;
    color: #ffcccc;
    font-style: italic;
    transition: opacity 1s ease-in-out;
    margin-bottom: 15px;
}

.the-code {
    font-size: 30px;
    color: #ff4d4d;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.btn-hint {
    background: transparent;
    color: #aaa;
    border: 1px solid #aaa;
    padding: 5px 15px;
    border-radius: 5px;
    margin-top: 15px;
    cursor: pointer;
}

.btn-secret {
    background: gold;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}
/* --- Scatter Layout für Briefe & Musik --- */
.scatter-container {
    position: absolute;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none; /* Klicks gehen durch zu den Knöpfen */
    z-index: 10;
}

.scatter-item {
    position: absolute;
    pointer-events: auto; /* Buttons sind klickbar */
    transform: translate(-50%, -50%);
}

.next-page-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.next-page-container a {
    text-decoration: none;
}

/* --- Rätsel Seite --- */
.riddle-box {
    background: rgba(139, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.2);
    margin: 0 auto;
    color: white;
}

.riddle-question {
    font-size: 20px;
    margin-bottom: 20px;
}

/* --- SVG Truhe --- */
.svg-chest-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto;
}

.svg-chest {
    width: 100%;
    height: 100%;
    transition: filter 0.5s;
}

.glow-effect {
    filter: drop-shadow(0 0 20px gold);
}
/* --- Briefe im Herz zentriert (Großes, weites Herz-Layout) --- */
.heart-letters-container {
    position: absolute;
    /* Etwas höher angesetzt (45% statt 50%), da das unsichtbare Matrix-Herz auch weiter oben ist */
    top: 52%; 
    left: 50%;
    transform: translate(-50%, -50%); 
    z-index: 10;
    pointer-events: none; 
    width: 100%;
    display: flex;
    justify-content: center;
}

.letter-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px; /* Sehr viel größerer vertikaler Abstand zwischen den Reihen */
    pointer-events: auto; 
}

.grid-row {
    display: flex;
    justify-content: space-between; /* Schiebt die Briefe maximal nach links und rechts */
}

/* Oben: Die zwei Bögen des Herzens */
.row-top {
    width: 450px; /* Sehr breit, damit sie genau in den Bögen sitzen */
}

/* Mitte: Der breiteste Teil des Herzens */
.row-middle {
    width: 650px; /* Zieht das Brief-Herz richtig schön in die Breite */
}

/* Unten: Das Herz verjüngt sich zur Spitze */
.row-lower {
    width: 280px; /* Deutlich schmaler als die Mitte */
}

/* Spitze: Ganz unten */
.row-bottom {
    width: 50px; 
    justify-content: center;
}

/* Design der Brief-Knöpfe */
.letter-btn {
    background: rgba(20, 0, 0, 0.6);
    border: 1px solid #ff4d4d;
    border-radius: 50%;
    width: 60px; /* Ein kleines bisschen größer gemacht (vorher 50px) */
    height: 60px;
    font-size: 28px; /* Emoji minimal vergrößert */
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.letter-btn:hover {
    transform: scale(1.2);
    background: rgba(139, 0, 0, 0.8);
    box-shadow: 0 0 25px rgba(255, 105, 180, 0.9);
    border-color: #ff66b2;
}

/* --- Musik Unten Links --- */
.music-bottom-left {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.heart-play-btn {
    background: rgba(139, 0, 0, 0.8);
    color: white;
    border: 1px solid #ff4d4d;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    transition: all 0.3s;
}

.heart-play-btn:hover {
    background: #ff0055;
    box-shadow: 0 0 20px #ff0055;
}

.heart-slider {
    -webkit-appearance: none;
    width: 150px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
}

.heart-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ff66b2;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px #ff66b2;
}
/* ================= MAIN PAGE (MATRIX) FIXES ================= */
.main-body {
    background-color: #000000 !important; /* Zwingt die Seite zu tiefschwarz */
    color: #fff;
    overflow: hidden;
}

/* Der schöne rote Button */
.btn-red {
    background: linear-gradient(45deg, #8b0000, #ff0055);
    color: white;
    padding: 12px 24px;
    border: 1px solid #ff4d4d;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none; /* Entfernt den Unterstrich bei Links */
    display: inline-block;
}

.btn-red:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.8);
}

.next-page-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

/* ================= GAME PAGE STYLES ================= */
.game-body {
    background-color: #0a0a0a;
    color: white;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
}

#gameCanvas {
    background: #111;
    border: 2px solid #ff0055;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
    max-width: 100%;
}

.game-ui {
    position: absolute;
    top: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #ff66b2;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.8);
}

.game-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 0, 0, 0.9);
    padding: 40px;
    border: 2px solid #ff4d4d;
    border-radius: 15px;
    text-align: center;
    display: none; /* Standardmäßig versteckt */
    z-index: 100;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
}