

:root {
    --bg-body: #090d16;       
    --bg-card: rgba(30, 41, 59, 0.7); 
    --bg-input: rgba(15, 23, 42, 0.6);
    --text-title: #ffffff;    
    --text-body: #94a3b8;     
    --text-glow: #e2e8f0;
    
    
    --primary: #6366f1;       
    --primary-glow: rgba(99, 102, 241, 0.5);
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.5);
    
    --success: #10b981;       
    --success-bg: rgba(6, 78, 59, 0.8);    
    --success-border: #34d399;
    
    --error: #f43f5e;         
    --error-bg: rgba(76, 5, 25, 0.8);      
    --error-border: #fb7185;

    --radius-lg: 28px;
    --radius-md: 16px;
    --blur-glass: blur(16px);
}


html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

body {
    margin: 0;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-body);
    
    background-image: 
        radial-gradient(circle at 20% 20%, #1e1b4b 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, #062f4f 0%, transparent 50%);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}


.app-container {
    background-color: var(--bg-card);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    width: 100%;
    max-width: 390px;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), inset 0 1px 0px rgba(255,255,255,0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}


button, .card, textarea, .card-face {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
    user-select: none;
}

textarea { user-select: text !important; }


.panel-section {
    background-color: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.panel-header h3 {
    font-size: 15px;
    margin: 0;
    font-weight: 700;
    color: var(--text-title);
    letter-spacing: -0.3px;
}

.panel-section p {
    font-size: 12px;
    color: var(--text-body);
    margin: 0 0 12px 0;
}

textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-size: 13px;
    resize: none;
    outline: none;
    background-color: var(--bg-input);
    color: var(--text-title);
    transition: all 0.2s ease;
}

textarea:focus {
    border-color: var(--primary);
    background-color: rgba(15, 23, 42, 0.8);
}


.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 0 15px var(--primary-glow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 0 5px var(--primary-glow);
}

.btn-secondary {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-title);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-secondary:active { background-color: rgba(255, 255, 255, 0.15); }


.game-section {
    margin-top: 10px;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


.header-app { margin-bottom: 20px; }
.progress { color: var(--text-title); font-size: 12px; font-weight: 800; margin-bottom: 8px; text-align: center; letter-spacing: 1px; text-transform: uppercase; }
.progress-bar { background-color: rgba(15, 23, 42, 0.6); height: 8px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.05); }
.progress-fill { background: linear-gradient(90deg, var(--cyan), var(--primary)); height: 100%; width: 0%; box-shadow: 0 0 10px var(--cyan-glow); transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }


.card-container { perspective: 1200px; width: 100%; height: 210px; margin-bottom: 20px; }
.card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
.card.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 24px; display: flex; justify-content: center; align-items: center; padding: 24px; box-sizing: border-box; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4); }

.card-front {
    background-color: rgba(30, 41, 59, 0.9);
    color: var(--text-title);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.card-back {
    background-color: var(--success-bg);
    color: #a7f3d0;
    transform: rotateY(180deg);
    border: 2px solid var(--success-border);
    box-shadow: inset 0 0 20px rgba(52, 211, 153, 0.2);
}

.card-face p { font-size: 18px; font-weight: 600; text-align: center; margin: 0; line-height: 1.5; transition: opacity 0.2s ease; }


.controls { display: flex; gap: 12px; }
.btn { flex: 1; padding: 14px; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn:disabled { opacity: 0.05; transform: none !important; }

.btn-error { background-color: var(--error-bg); color: var(--error); border: 2px solid var(--error-border); }
.btn-error:not(:disabled):active { background-color: #700620; transform: scale(0.97); }

.btn-success { background-color: var(--success-bg); color: var(--success); border: 2px solid var(--success-border); }
.btn-success:not(:disabled):active { background-color: #044633; transform: scale(0.97); }


.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(5, 8, 16, 0.8); backdrop-filter: blur(12px); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-content { background-color: #1e293b; width: 85%; max-width: 330px; padding: 28px; border-radius: var(--radius-lg); text-align: center; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 30px 60px rgba(0,0,0,0.6); animation: popUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popUp { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-icon { font-size: 46px; margin-bottom: 6px; filter: drop-shadow(0 0 10px rgba(250,204,21,0.4)); }
.modal-content h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--text-title); }
.modal-subtitle { font-size: 13px; color: var(--text-body); margin: 4px 0 20px 0; }

.stats-container { display: flex; gap: 12px; margin-bottom: 18px; }
.stat-card { flex: 1; padding: 12px; border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; }
.box-success { background-color: var(--success-bg); border: 1px solid var(--success-border); color: #a7f3d0; }
.box-error { background-color: var(--error-bg); border: 1px solid var(--error-border); color: #fecdd3; }
.stat-num { font-size: 22px; font-weight: 800; }
.stat-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }

.score-badge { font-size: 15px; font-weight: 700; background-color: var(--bg-input); color: #34d399; padding: 10px 20px; border-radius: 30px; display: inline-block; margin-bottom: 24px; border: 1px solid rgba(52, 211, 153, 0.3); box-shadow: 0 0 15px rgba(52, 211, 153, 0.1); }

#copy-toast { display: block; font-size: 11px; color: var(--success); font-weight: 700; text-align: center; margin-top: 4px; }
.divider { border: 0; height: 1px; background: rgba(255,255,255,0.06); margin: 16px 0; }
.hidden { display: none !important; }
