:root {
    --primary: #4a90e2;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --prescription-font: 'Courier New', Courier, monospace;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

/* --- VÁLASZTÓ KÉPERNYŐ --- */
#deck-selector {
    width: 100%;
    max-width: 800px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.deck-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.deck-btn {
    background-color: var(--primary);
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    min-width: 150px;
}

.deck-btn:hover { background-color: #357abd; transform: translateY(-2px); }

/* --- TANULÓ TÉR --- */
#study-section {
    width: 100%; max-width: 800px; perspective: 1500px;
    display: none; flex-direction: column; align-items: center; height: 85vh;
}

.top-bar {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; padding: 0 5px;
}

.status-text { font-weight: bold; color: #555; }

.btn-undo-small, .btn-menu {
    background-color: #ddd; color: #333; padding: 8px 15px; font-size: 0.9rem;
    border: none; border-radius: 20px; cursor: pointer;
}
.btn-undo-small:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-menu { background-color: #666; color: white; }

/* Kártya */
.card-container {
    width: 100%; flex-grow: 1; position: relative;
    transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer; margin-bottom: 15px;
}
.card-container.flipped { transform: rotateY(180deg); }

.card-face {
    position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
    display: flex; flex-direction: column; background: var(--card-bg);
    border-radius: 12px; border: 1px solid #ccc; box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Vény */
.card-front { background-color: #fdfbf7; color: #000; }
.prescription-layout {
    width: 100%; height: 100%; padding: 20px 30px; box-sizing: border-box;
    font-family: var(--prescription-font); font-size: 1.1rem; text-align: left;
    overflow-y: auto; display: flex; flex-direction: column; justify-content: center;
}
.rp-header { font-weight: bold; font-size: 1.4rem; margin-bottom: 15px; }
.ingredient-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; border-bottom: 1px dotted #ccc; }
.ingredient-name { font-weight: 600; }
.ingredient-qty { white-space: nowrap; padding-left: 10px; }
.instruction-row { margin-top: 15px; font-style: italic; }

/* Hátlap */
.card-back { transform: rotateY(180deg); background-color: #fff; color: var(--text-color); }
.card-content-scroll {
    width: 100%; height: 100%; overflow-y: auto; padding: 25px;
    box-sizing: border-box; font-size: 1.1rem; line-height: 1.6; white-space: pre-wrap; text-align: left;
}

/* Vezérlők */
.controls { display: flex; gap: 30px; width: 100%; justify-content: center; height: 80px; flex-shrink: 0; }
.btn-circle {
    width: 70px; height: 70px; border-radius: 50%; font-size: 30px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); border: 4px solid white; cursor: pointer;
}
.btn-x { background-color: var(--danger); color: white; }
.btn-check { background-color: var(--success); color: white; }
.btn-circle:active { transform: scale(0.95); }

.motivation-bar { margin-top: 10px; min-height: 20px; font-size: 0.9rem; color: #888; font-style: italic; text-align: center; transition: opacity 0.5s; }

/* Összefoglaló */
.summary-screen {
    display: none; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; height: 100%; background: white; border-radius: 12px; padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); text-align: center;
}
.summary-stats { display: flex; gap: 20px; margin: 20px 0; font-size: 1.2rem; }
.stat-box { padding: 15px; border-radius: 8px; background: #f9f9f9; min-width: 100px; }
.stat-val { display: block; font-size: 2rem; font-weight: bold; }

.btn-restart { background-color: var(--primary); color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; margin: 5px; }
.btn-retry-missed { background-color: var(--danger); color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; margin: 5px; }