/* ==========================================================================
   CSS Design System - German Verb Conjugation Game
   ========================================================================== */

/* Variables */
:root {
    --bg-main: radial-gradient(circle at 50% 50%, #131526 0%, #070913 100%);
    --bg-card: rgba(20, 24, 45, 0.65);
    --border-glass: rgba(255, 255, 255, 0.06);
    
    --color-text-primary: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    
    --accent-regular: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    --accent-regular-glow: rgba(14, 165, 233, 0.4);
    --accent-irregular: linear-gradient(135deg, #d946ef 0%, #8b5cf6 100%);
    --accent-irregular-glow: rgba(139, 92, 246, 0.4);
    
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.15);
    --color-success-border: rgba(16, 185, 129, 0.4);
    --color-success-glow: rgba(16, 185, 129, 0.3);
    
    --color-error: #ef4444;
    --color-error-bg: rgba(239, 68, 68, 0.15);
    --color-error-border: rgba(239, 68, 68, 0.4);
    --color-error-glow: rgba(239, 68, 68, 0.3);

    --font-outfit: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --shadow-glow: 0 0 25px rgba(0, 0, 0, 0.4);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-inter);
    background: var(--bg-main);
    color: var(--color-text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    min-height: 750px;
    padding: 2rem;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   1. Home Screen (Entry Path Select)
   -------------------------------------------------------------------------- */
.home-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.logo-text {
    font-family: var(--font-outfit);
    font-weight: 800;
    font-size: 3.5rem;
    letter-spacing: 2px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.logo-text span {
    background: linear-gradient(135deg, #0ea5e9 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
}

/* Entry Cards Container */
.entry-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 960px;
    margin: 0 auto;
}

.entry-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-glow);
}

.entry-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: var(--transition-smooth);
}

.regular-card::before {
    background: var(--accent-regular);
}

.irregular-card::before {
    background: var(--accent-irregular);
}

.entry-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15);
}

.regular-card:hover {
    box-shadow: 0 15px 35px var(--accent-regular-glow);
}

.irregular-card:hover {
    box-shadow: 0 15px 35px var(--accent-irregular-glow);
}

/* Badges & Icons */
.card-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.premium-badge {
    background: rgba(167, 139, 250, 0.15);
    color: #c084fc;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.5s ease;
}

.entry-card:hover .card-icon {
    transform: scale(1.15) rotate(5deg);
}

.entry-card h2 {
    font-family: var(--font-outfit);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card-desc {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    min-height: 45px;
}

/* Card details list */
.card-details {
    list-style: none;
    text-align: left;
    width: 100%;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.card-details li {
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 1.25rem;
}

.card-details li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #a78bfa;
}

.regular-card .card-details li::before {
    color: #38bdf8;
}

/* Buttons */
.btn {
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1.8rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-regular);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--accent-irregular);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.home-footer {
    text-align: center;
    margin-top: 4.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   2. Game Screen (Main Gameplay Area)
   -------------------------------------------------------------------------- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1.5rem;
}

.btn-back {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.game-meta {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 0 2rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 450px;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.progress-bar-bg {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    flex-grow: 1;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8 0%, #a78bfa 100%);
    width: 0%;
    border-radius: 50px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 50px;
    text-align: right;
}

.lives-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lives-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.hearts-display {
    display: flex;
    gap: 0.25rem;
}

.heart {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.heart.lost {
    opacity: 0.2;
    transform: scale(0.8);
}

/* Main Layout Grid */
.game-main {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 2.5rem;
    align-items: stretch;
}

/* Visual Panel */
.visual-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-glow);
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(7, 9, 19, 0.95));
    padding: 2.5rem 1.75rem 1.75rem 1.75rem;
    text-align: left;
}

.image-overlay h2 {
    font-family: var(--font-outfit);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: white;
}

.image-overlay p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-top: 0.25rem;
}

/* Exercise Panel */
.exercise-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-glow);
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.help-hint {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

kbd {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: monospace;
    font-size: 0.75rem;
}

/* Conjugation Form Rows */
.conjugation-rows {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.conjugation-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    transition: var(--transition-smooth);
}

.conjugation-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.pronoun {
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}

.sentence-area {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.sentence-area span {
    color: var(--color-text-primary);
}

/* Input Styles */
.input-conjugation {
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(7, 9, 19, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    text-align: center;
    width: 140px;
    outline: none;
    transition: var(--transition-smooth);
    margin: 0 0.25rem;
}

.input-conjugation:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Input feedback classes */
.input-conjugation.correct {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success);
    box-shadow: 0 0 12px var(--color-success-glow);
    pointer-events: none; /* Lock input when correct */
}

.input-conjugation.error {
    background: var(--color-error-bg);
    border-color: var(--color-error-border);
    color: var(--color-error);
    box-shadow: 0 0 12px var(--color-error-glow);
}

/* Row wrapper highlight */
.conjugation-row.correct-row {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.03);
}

/* --------------------------------------------------------------------------
   3. Modal Overlays
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 9, 19, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0f1224;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 3rem;
    width: 90%;
    max-width: 580px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-emoji {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.modal-content h2 {
    font-family: var(--font-outfit);
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.modal-content p {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Victory specifics */
.card-reward {
    margin-bottom: 2rem;
    text-align: left;
}

.card-reward h3 {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reward-cards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.reward-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-outfit);
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.reward-badge .emoji {
    font-size: 1.1rem;
}

.btn-large {
    width: 100%;
    justify-content: center;
    padding: 0.9rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.btn-danger {
    background: var(--color-error);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--border-glass);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* --------------------------------------------------------------------------
   4. Animations
   -------------------------------------------------------------------------- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-6px); }
    30%, 60%, 90% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes success-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.success-pop {
    animation: success-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Responsiveness */
@media (max-width: 900px) {
    .app-container {
        padding: 1rem;
    }
    
    .game-main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .image-wrapper {
        min-height: 240px;
    }
    
    .logo-text {
        font-size: 2.5rem;
    }
    
    .entry-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .game-header {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .game-meta {
        order: 3;
        width: 100%;
        padding: 0;
    }
}
