:root {
    --bg-dark: #050505;
    --card-bg: rgba(18, 18, 24, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --primary: #fff;
    --accent: #7c3aed;
    /* Fialová */
    --accent-glow: rgba(124, 58, 237, 0.5);
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --font: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--primary);
    font-family: var(--font);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}


/* --- POZADÍ --- */

#snow-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.snowflake {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.4;
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(110vh);
    }
}


/* --- HLAVNÍ LAYOUT --- */

.layout-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


/* Glass Panel (Karta) */

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.card {
    width: 100%;
    max-width: 800px;
    height: 85vh;
    /* Na PC ne přes celou výšku */
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}


/* --- HEADER --- */

.header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.brand h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-hard {
    background: #dc2626;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
}

.subtitle {
    color: #a1a1aa;
    font-size: 13px;
    margin-top: 5px;
}

.btn-rules {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #d4d4d8;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    gap: 8px;
    align-items: center;
    transition: 0.2s;
}

.btn-rules:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}


/* STATS */

.stats-bar {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-group {
    display: flex;
    flex-direction: column;
}

.stat-group .label {
    font-size: 10px;
    text-transform: uppercase;
    color: #71717a;
    font-weight: 700;
}

.stat-group .val {
    font-size: 18px;
    font-weight: 700;
}

.progress-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 15px var(--accent-glow);
}


/* --- GAME AREA --- */

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.q-tag {
    display: inline-block;
    background: var(--accent);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.q-text {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 30px;
}

.scenario-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--yellow);
    padding: 20px;
    color: #fcd34d;
    font-style: italic;
    margin-bottom: 25px;
    border-radius: 0 10px 10px 0;
    font-size: 18px;
}


/* Inputs */

.options-grid {
    display: grid;
    gap: 12px;
}

.btn-opt {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    color: #e4e4e7;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
}

.btn-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-opt.selected {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--accent);
    color: white;
}

.text-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    color: white;
    font-size: 18px;
}

.text-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}


/* Feedback */

.feedback {
    margin-top: 25px;
    padding: 20px;
    border-radius: 12px;
    animation: fadeIn 0.3s;
    line-height: 1.6;
}

.feedback.correct {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--green);
    color: #6ee7b7;
}

.feedback.wrong {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--red);
    color: #fca5a5;
}


/* Footer */

.footer-controls {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border);
}

.btn-main {
    width: 100%;
    padding: 18px;
    background: white;
    color: black;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-main:hover {
    background: #f4f4f5;
}

.btn-main:active {
    transform: scale(0.98);
}


/* --- MODAL (RULES) --- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.modal-window {
    width: 90%;
    max-width: 900px;
    height: 90vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    color: #d4d4d8;
    line-height: 1.7;
    font-size: 15px;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}


/* Rules Styling */

.rules-section h2 {
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin: 30px 0 15px 0;
    font-size: 22px;
}

.rules-section ul {
    margin-left: 20px;
}

.rules-section li {
    margin-bottom: 8px;
}

.rules-section strong {
    color: white;
}

.example-box {
    background: #111;
    border-left: 3px solid var(--yellow);
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
}

.good {
    color: var(--green);
    display: block;
    margin-top: 5px;
}

.bad {
    color: var(--red);
    display: block;
    margin-top: 5px;
}


/* End Screen */

.overlay-screen {
    position: absolute;
    inset: 0;
    background: var(--card-bg);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
}

.end-content {
    text-align: center;
}

.icon-trophy {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.result-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 30px 0;
}

.res-item {
    display: flex;
    flex-direction: column;
}

.res-item .lbl {
    font-size: 12px;
    text-transform: uppercase;
    color: #71717a;
}

.res-item .num {
    font-size: 32px;
    font-weight: 800;
}

.res-item.green .num {
    color: var(--green);
}

.res-item.red .num {
    color: var(--red);
}

.btn-restart {
    background: transparent;
    border: 1px solid var(--border);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.2s;
}

.btn-restart:hover {
    background: white;
    color: black;
}


/* --- RESPONZIVITA (MOBIL) --- */

@media (max-width: 768px) {
    .layout-wrapper {
        padding: 0;
    }
    .card {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    .header {
        padding: 15px 20px;
    }
    .brand h1 {
        font-size: 20px;
    }
    .content-area {
        padding: 20px;
    }
    .q-text {
        font-size: 18px;
    }
    /* Modal na mobilu přes celou obrazovku */
    .modal-window {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    .modal-body {
        padding: 20px;
    }
}


/* Utils */

.hidden {
    display: none !important;
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Scrollbar */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}