:root { --bg-main: #0f172a; --bg-surface: #1e293b; --text-main: #e2e8f0; --text-muted: #94a3b8; --accent-blue: #38bdf8; --accent-green: #22c55e; --error-red: #ef4444; --border-soft: #334155; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; }
body { background-color: var(--bg-main); color: var(--text-main); min-height: 100vh; }
.app-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.container { flex: 1; width: 90%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 0; }
.logo { font-size: clamp(2.5rem, 6vw, 3.5rem); font-weight: 700; letter-spacing: -1px; text-align: center; margin-bottom: 10px; }
.accent-cyan { color: var(--accent-blue); }
.accent-purple { color: var(--accent-green); }
.subtitle, .greeting { text-align: center; font-size: 1.1rem; color: var(--text-muted); margin-bottom: 30px; }
.section-title { font-size: clamp(1.5rem, 4vw, 1.8rem); color: var(--text-main); margin-bottom: 20px; text-align: center; border-bottom: 2px solid var(--border-soft); padding-bottom: 10px; }
.screen { display: none; flex-direction: column; align-items: center; width: 100%; animation: smoothFade 0.3s ease-in-out; }
.screen.active { display: flex; }
@keyframes smoothFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.input-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; width: 100%; }
input[type="text"] { padding: 12px 20px; font-size: 1.1rem; background: var(--bg-surface); border: 2px solid var(--border-soft); color: var(--text-main); border-radius: 6px; outline: none; transition: border-color 0.2s; width: 100%; max-width: 300px; }
input[type="text"]:focus { border-color: var(--accent-blue); }
button { cursor: pointer; font-family: inherit; transition: background 0.2s, border-color 0.2s, color 0.2s; border-radius: 6px; white-space: nowrap; }
#login-btn, .primary-btn { padding: 12px 30px; font-size: 1.1rem; background: var(--accent-blue); color: var(--bg-main); border: none; font-weight: 600; }
#login-btn:hover, .primary-btn:hover { background: #7dd3fc; }
.secondary-btn, .nav-back { padding: 10px 20px; font-size: 1rem; background: transparent; color: var(--text-muted); border: 1px solid var(--border-soft); }
.secondary-btn:hover, .nav-back:hover { color: var(--text-main); border-color: var(--text-muted); background: var(--bg-surface); }
.action-row, .history-action-row { display: flex; gap: 15px; margin-top: 30px; flex-wrap: wrap; justify-content: center; width: 100%; }
.menu-grid { display: flex; flex-direction: column; gap: 15px; width: 100%; max-width: 400px; margin-top: 20px; }
.menu-btn { padding: 18px; font-size: 1.2rem; background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-soft); }
.menu-btn:hover { border-color: var(--accent-blue); }
#nav-practice { background: var(--accent-blue); color: var(--bg-main); border: none; font-weight: 600; }
#nav-practice:hover { background: #7dd3fc; }
.content-panel { background: var(--bg-surface); padding: clamp(15px, 5vw, 30px); border-radius: 8px; border: 1px solid var(--border-soft); width: 100%; max-width: 650px; margin-bottom: 20px; }
.instructions { list-style-position: inside; line-height: 2; font-size: 1.1rem; color: var(--text-main); }
.instructions strong { color: var(--accent-blue); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; width: 100%; max-width: 750px; margin-bottom: 30px; }
.lesson-btn { padding: 15px 10px; font-size: 1.1rem; background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border-soft); }
.lesson-btn:hover { color: var(--accent-blue); border-color: var(--accent-blue); background: rgba(56, 189, 248, 0.05); }
.test-header { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 20px; padding: 0 5px; flex-wrap: wrap; gap: 15px; }
#current-lesson-title { font-size: 1.5rem; color: var(--text-main); font-weight: 600; }
.stats { display: flex; gap: 20px; font-size: 1.2rem; color: var(--text-muted); }
.typing-box { position: relative; width: 100%; background: var(--bg-surface); padding: clamp(20px, 5vw, 35px); border-radius: 8px; border: 1px solid var(--border-soft); cursor: text; min-height: 220px; overflow: hidden; }
.progress-bar { position: absolute; top: 0; left: 0; height: 4px; background-color: var(--accent-green); width: 0%; transition: width 0.1s linear; }
.text-display { font-size: clamp(1.2rem, 4vw, 1.6rem); line-height: 1.6; color: var(--text-muted); user-select: none; }
.text-display span { transition: color 0.05s; }
.text-display span.correct { color: var(--text-main); }
.text-display span.incorrect { color: var(--error-red); background-color: rgba(239, 68, 68, 0.15); border-radius: 3px; }
.text-display span.active { color: var(--text-main); border-left: 2px solid var(--accent-blue); }
.input-field { position: absolute; opacity: 0; z-index: -999; }
.score-history-panel { max-height: 250px; overflow-y: auto; }
.score-history-panel::-webkit-scrollbar { width: 6px; }
.score-history-panel::-webkit-scrollbar-track { background: var(--bg-main); }
.score-history-panel::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }
.score-list { list-style: none; }
.score-list li { padding: 15px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; color: var(--text-muted); font-size: 1.1rem; }
.delete-btn { color: var(--error-red); border-color: var(--border-soft); transition: all 0.2s ease; }
.delete-btn:hover { background-color: rgba(239, 68, 68, 0.15); border-color: var(--error-red); color: var(--error-red); }
.certificate-panel-holder { display: none; width: 100%; max-width: 650px; margin-top: 20px; overflow-x: auto; }
.certificate-panel { min-width: 550px; background-color: #ffffff !important; padding: 20px; text-align: center; box-shadow: 0 15px 35px rgba(0,0,0,0.6); }
.cert-border { position: relative; overflow: hidden; border: 6px solid #0f172a; outline: 2px solid #0f172a; outline-offset: -12px; padding: 50px 40px; background-color: #ffffff !important; }
.cert-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 15rem; font-weight: 900; color: rgba(15, 23, 42, 0.03); z-index: 0; pointer-events: none; user-select: none; }
.cert-content { position: relative; z-index: 1; }
.cert-content h3 { color: #1e293b; font-size: 1.2rem; letter-spacing: 4px; text-transform: uppercase; margin-bottom: 25px; font-family: 'Georgia', serif; font-weight: 900; }
.cert-display-name { color: #0f172a; font-size: 3.5rem; margin: 15px 0; font-family: 'Georgia', serif; font-style: italic; font-weight: 900; border-bottom: 2px solid #64748b; display: inline-block; padding: 0 40px 10px 40px; }
.cert-content p { font-family: 'Georgia', serif; font-size: 1.2rem; color: #0f172a; line-height: 1.5; font-weight: bold; }
.cert-lesson-name { font-size: 1.8rem; color: #0284c7; margin: 15px 0 25px 0; font-family: 'Georgia', serif; font-style: italic; font-weight: 900; }
.cert-stats { display: flex; justify-content: center; gap: 25px; margin-bottom: 20px; font-family: 'Georgia', serif; color: #0f172a; }
.cert-stats p { font-size: 1.1rem; }
.cert-stats strong { font-size: 1.3rem; color: #0284c7; }
.cert-bottom-section { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 50px; padding: 0 10px; }
.cert-signature-block { text-align: center; width: 200px; }
.cert-signature { font-family: 'Brush Script MT', 'Lucida Handwriting', cursive; font-size: 2.2rem; color: #0f172a; margin-bottom: 5px; }
.cert-line { border-bottom: 2px solid #64748b; margin-bottom: 5px; }
.cert-signature-block p { font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; font-size: 0.8rem; color: #64748b; text-transform: uppercase; letter-spacing: 1px; }
.cert-digital-stamp { border: 3px solid #0284c7; padding: 10px 15px; color: #0284c7; font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; font-size: 1.1rem; font-weight: 900; text-align: center; text-transform: uppercase; letter-spacing: 2px; transform: rotate(-5deg); background: #ffffff; }
.cert-digital-stamp span { display: block; font-size: 0.65rem; margin-top: 4px; color: #0f172a; letter-spacing: 1px; }
.tutorial-panel { max-width: 800px; }
.tutorial-layout { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.tutorial-text { flex: 1 1 350px; }
.tutorial-text h3 { font-size: 1.3rem; color: var(--text-main); margin-bottom: 10px; }
.tutorial-text p { color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.tutorial-text .instructions { line-height: 1.8; }
.tutorial-visual { flex: 1 1 300px; display: flex; justify-content: center; }
.tutorial-img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border-soft); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.chapter-dropdown { padding: 12px 20px; font-size: 1.1rem; background: var(--bg-surface); border: 2px solid var(--border-soft); color: var(--accent-blue); font-weight: bold; border-radius: 6px; outline: none; width: 100%; max-width: 400px; margin-bottom: 25px; cursor: pointer; transition: border-color 0.2s; }
.chapter-dropdown:focus { border-color: var(--accent-blue); }
.chapter-dropdown option { background: var(--bg-main); color: var(--text-main); }
.main-footer { width: 100%; background-color: var(--bg-surface); border-top: 1px solid var(--border-soft); padding: 12px 20px; margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-content { text-align: center; max-width: 600px; }
.footer-brand { font-size: 1.2rem; font-weight: 700; color: var(--text-main); letter-spacing: 2px; margin-bottom: 5px; }
.footer-copyright { font-size: 0.8rem; color: #475569; }
