:root {
    --primary: #F8BBD0;
    --primary-dark: #F48FB1;
    --secondary: #FFF8E1;
    --accent: #FFD700;
    --text: #424242;
    --text-light: #757575;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.1);
    --online: #4CAF50;
    --offline: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
    position: relative;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    filter: blur(3px);
    z-index: -1;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Start Screen */
.heart-container {
    margin-bottom: 20px;
}

.heart {
    font-size: 80px;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 4px 6px var(--shadow));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    color: var(--text);
    text-shadow: 2px 2px 4px var(--shadow);
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
    font-style: italic;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 350px;
}

.btn {
    background: var(--white);
    border: none;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    border: 2px solid var(--primary);
}

.btn-accent {
    background: var(--secondary);
    border: 2px solid var(--accent);
}

.btn .icon {
    font-size: 2rem;
}

.btn .text {
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
}

.btn small {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 2px;
}

/* Online Setup */
.online-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
}

.option-card {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--shadow);
    text-align: center;
}

.option-card h3 {
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.option-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.option-card input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-size: 1.5rem;
    text-align: center;
    font-family: inherit;
    margin-bottom: 15px;
    outline: none;
}

.divider {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 100px;
    height: 1px;
    background: var(--text-light);
    opacity: 0.3;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.room-code-display {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
    border: 3px solid var(--accent);
}

.code {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 10px;
    margin: 20px 0;
    font-family: monospace;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--secondary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Online Quiz Screen */
.online-header {
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    background: var(--white);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--shadow);
}

.player-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.player-card {
    flex: 1;
    text-align: center;
}

.player-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 10px;
    font-size: 0.9rem;
}

.player-card.opponent .player-avatar {
    background: var(--accent);
    color: var(--text);
}

.progress-bar.small {
    height: 8px;
    margin-bottom: 5px;
}

.opponent-fill {
    background: var(--accent) !important;
}

.vs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.connection-status {
    font-size: 0.75rem;
    margin-top: 5px;
    color: var(--online);
}

.sync-status {
    background: var(--white);
    padding: 10px 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
    animation: pulse 2s infinite;
}

.question-container {
    background: var(--white);
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px var(--shadow);
    width: 100%;
    max-width: 600px;
    text-align: center;
    margin-bottom: 20px;
}

.category-badge {
    display: inline-block;
    background: var(--secondary);
    color: var(--text);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 25px;
    line-height: 1.4;
    color: var(--text);
}

.answers-grid {
    display: grid;
    gap: 12px;
}

.answer-btn {
    background: var(--secondary);
    border: 2px solid transparent;
    padding: 15px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.answer-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--white);
    transform: translateX(5px);
}

.answer-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.answer-btn.correct {
    background: #C8E6C9;
    border-color: #4CAF50;
    animation: correct 0.5s ease;
}

.answer-btn.wrong {
    background: #FFCDD2;
    border-color: #F44336;
    animation: shake 0.5s ease;
}

.answer-btn.opponent-choice {
    border-color: var(--accent);
    border-width: 3px;
    position: relative;
}

.answer-btn.opponent-choice::after {
    content: '👈 Sie';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
}

@keyframes correct {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Chat Box */
.chat-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: calc(100% - 40px);
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    overflow: hidden;
    z-index: 100;
    transition: all 0.3s ease;
}

.chat-box.minimized .chat-body {
    display: none;
}

.chat-header {
    background: var(--primary);
    color: var(--white);
    padding: 15px 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: red;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.chat-body {
    height: 300px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f5f5f5;
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.3;
    word-wrap: break-word;
}

.chat-message.me {
    background: var(--primary);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.opponent {
    background: var(--white);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px var(--shadow);
}

.chat-message.system {
    background: var(--secondary);
    color: var(--text-light);
    align-self: center;
    font-size: 0.8rem;
    font-style: italic;
    max-width: 90%;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background: var(--white);
    border-top: 1px solid #eee;
}

.chat-input-area input {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 20px;
    background: #f5f5f5;
    outline: none;
    font-family: inherit;
}

.chat-input-area button {
    background: var(--primary);
    border: none;
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.1);
}

/* Results */
.final-scores {
    background: var(--secondary);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    width: 100%;
}

.score-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 1.2rem;
}

.score-row strong {
    color: var(--primary-dark);
    font-size: 1.5rem;
}

/* Timeline */
.section-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--text);
}

.timeline {
    width: 100%;
    max-width: 600px;
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.timeline-item {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px var(--shadow);
    position: relative;
    animation: slideIn 0.5s ease;
}

.timeline-item::before {
    content: '💕';
    position: absolute;
    left: -40px;
    top: 20px;
    font-size: 20px;
}

.timeline-month {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.timeline-title {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.timeline-desc {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Timeline Interaktiv */
.timeline-item {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.timeline-item:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 25px rgba(248, 187, 208, 0.4);
    border-left: 4px solid var(--primary-dark);
}

.timeline-item::after {
    content: '👆 Klicken für mehr';
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.75rem;
    color: var(--primary-dark);
    opacity: 0;
    transition: opacity 0.3s;
}

.timeline-item:hover::after {
    opacity: 1;
}

/* Timeline Modal */
.timeline-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.timeline-modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--white) 0%, var(--secondary) 100%);
    border-radius: 25px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
    border: 3px solid var(--primary);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-light);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-modal:hover {
    background: var(--primary);
    color: var(--white);
    transform: rotate(90deg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
    border-radius: 22px 22px 0 0;
}

.modal-month {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.modal-body {
    padding: 30px;
    text-align: center;
}

.modal-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.modal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 25px;
    text-align: left;
    background: rgba(255,255,255,0.6);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid var(--primary);
}

.modal-memory {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px var(--shadow);
    margin-top: 20px;
    border: 2px dashed var(--primary);
}

.modal-memory strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

#modal-moment-text {
    font-style: italic;
    color: var(--text-light);
    font-size: 1.05rem;
}

.modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Anpassungen */
@media (max-width: 600px) {
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-title {
        font-size: 1.8rem;
    }
    
    .modal-text {
        font-size: 1rem;
        padding: 15px;
    }
}

/* Utilities */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s ease;
    z-index: 10;
}

.back-btn:hover {
    transform: translateX(-5px);
}

.result-content {
    text-align: center;
    background: var(--white);
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 10px 30px var(--shadow);
    max-width: 500px;
    width: 100%;
}

.trophy {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .title { font-size: 2.5rem; }
    .question-container { padding: 20px; }
    .chat-box { 
        width: calc(100% - 40px); 
        right: 20px; 
        left: 20px;
    }
    .code { font-size: 2rem; }
    .player-status { flex-direction: column; gap: 10px; }
    .vs { transform: rotate(90deg); }
}