:root{--bg-primary: #0f172a;--bg-card: #1e293b;--bg-card-hover: #334155;--text-main: #f8fafc;--text-muted: #94a3b8;--accent: #38bdf8;--accent-green: #22c55e;--border: #334155}*{box-sizing:border-box;margin:0;padding:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}body{background-color:var(--bg-primary);color:var(--text-main);min-height:100vh}.app-shell{max-width:900px;margin:0 auto;padding:2rem 1rem}.app-header{text-align:center;margin-bottom:2.5rem}.app-header h1{font-size:2.2rem;font-weight:700;letter-spacing:-.025em}.app-header p{color:var(--text-muted);margin-top:.25rem}.topic-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1.25rem}.topic-card{background:var(--bg-card);border:1px solid var(--border);border-radius:12px;padding:1.25rem;cursor:pointer;transition:transform .2s,border-color .2s;display:flex;flex-direction:column}.topic-card:hover{transform:translateY(-2px);border-color:var(--accent)}.topic-icon{font-size:2rem;margin-bottom:.5rem}.topic-card h3{font-size:1.15rem;margin-bottom:.35rem}.topic-desc{font-size:.875rem;color:var(--text-muted);flex-grow:1;margin-bottom:1rem;line-height:1.4}.topic-meta{display:flex;justify-content:space-between;font-size:.75rem;color:var(--text-muted);margin-bottom:.5rem}.progress-bar-bg{height:4px;background:var(--border);border-radius:2px;overflow:hidden}.progress-bar-fill{height:100%;background:var(--accent-green);transition:width .3s ease}.btn-text-reset{background:none;border:none;color:#ef4444;font-size:.75rem;margin-top:.5rem;cursor:pointer;text-align:left}.card-perspective{perspective:1000px;width:100%;max-width:480px;height:300px;margin:1.5rem auto}.card-inner{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .6s cubic-bezier(.4,0,.2,1);cursor:pointer}.card-inner.is-flipped{transform:rotateY(180deg)}.card-face{position:absolute;width:100%;height:100%;backface-visibility:hidden;border-radius:16px;border:1px solid var(--border);background:var(--bg-card);padding:1.5rem;display:flex;flex-direction:column;justify-content:space-between}.card-back{transform:rotateY(180deg);border-color:var(--accent)}.badge{font-size:.75rem;padding:.2rem .5rem;border-radius:4px;font-weight:600}.badge-en{background:#334155;color:#cbd5e1}.badge-pt{background:#0284c7;color:#fff}.card-header{display:flex;justify-content:space-between;align-items:center}.mastered-tag{font-size:.75rem;color:var(--accent-green);font-weight:700}.card-body{text-align:center}.card-body h2{font-size:1.75rem;font-weight:600;margin-bottom:.5rem}.hint{font-size:.85rem;color:var(--text-muted)}.context-note{font-size:.8rem;color:var(--text-muted)}.card-actions{display:flex;gap:.5rem}.btn{padding:.5rem 1rem;border-radius:8px;border:none;font-weight:500;cursor:pointer;transition:opacity .2s}.btn:hover{opacity:.9}.btn:disabled{opacity:.4;cursor:not-allowed}.btn:disabled:hover{opacity:.4}.btn-primary{background:var(--accent);color:#0f172a}.btn-secondary{background:var(--border);color:var(--text-main)}.btn-master{background:var(--border);color:var(--text-main);flex:1}.btn-master.active{background:var(--accent-green);color:#fff}.viewer-container{display:flex;flex-direction:column}.viewer-header{display:flex;justify-content:space-between;align-items:center}.viewer-header-actions{display:flex;gap:.5rem}.trophy-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172ad9;display:flex;align-items:center;justify-content:center;padding:1rem;z-index:100}.trophy-modal{background:var(--bg-card);border:1px solid var(--border);border-radius:16px;padding:2rem;text-align:center;max-width:420px;width:100%}.trophy-photo{max-width:100%;max-height:60vh;object-fit:contain;border-radius:12px;margin-bottom:1rem}.trophy-icon-fallback{font-size:5rem;margin-bottom:1rem}.trophy-modal h2{margin-bottom:.25rem}.trophy-modal p{color:var(--text-muted);margin-bottom:1.5rem}.viewer-title{text-align:center}.progress-counter{font-size:.85rem;color:var(--text-muted)}.viewer-controls{display:flex;justify-content:center;gap:1rem;margin-top:1rem}.topic-footer-info{display:flex;justify-content:space-between;align-items:center;margin-top:2rem;font-size:.85rem;color:var(--text-muted)}.btn-link{background:none;border:none;color:#ef4444;cursor:pointer}
