body { background-color: #f8fafc; margin: 0; font-family: 'Inter', sans-serif; }
.regex-container { max-width: 1000px; margin: 15px auto; padding: 10px 20px; text-align: center; }
.regex-header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.btn-back { text-decoration: none; color: #f97316; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.btn-back:hover { color: #ea580c; }
.btn-help { background: none; border: none; color: #64748b; font-weight: 600; font-size: 0.95rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.regex-title-area { margin-bottom: 10px; }
.regex-title { font-size: 1.8rem; color: #1e293b; font-weight: 800; margin: 0; }
.regex-title span { color: #f97316; font-weight: 300; display: block; font-size: 1.1rem; margin-top: 2px; text-transform: uppercase; letter-spacing: 2px; }
.regex-stats { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 16px; padding: 12px 20px; margin-bottom: 15px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); display: flex; justify-content: space-around; align-items: center; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-item .label { font-size: 0.8rem; font-weight: 700; color: #64748b; margin-bottom: 4px; }
.stat-item .value { font-size: 1.4rem; font-weight: 800; color: #1e293b; }
.stat-item .value.text-orange { color: #f97316; }
.stat-item .value.text-red { color: #ef4444; }
.regex-arena { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 15px; }
.glass-panel { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 16px; padding: 15px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); }
.panel-subtitle { margin: 0 0 10px 0; color: #1e293b; font-size: 1.05rem; font-weight: 700; text-align: left; }
.text-panel { display: flex; flex-direction: column; height: 350px; box-sizing: border-box; }
.regex-display { flex-grow: 1; background: #0f172a; border-radius: 12px; padding: 15px; overflow-y: auto; font-family: 'Consolas', 'Courier New', monospace; font-size: 1.1rem; color: #cbd5e1; text-align: left; line-height: 1.6; white-space: pre-wrap; }
.regex-match { background: #f97316; color: white; padding: 0 4px; border-radius: 4px; font-weight: bold; }
.question-panel { display: flex; flex-direction: column; height: 350px; box-sizing: border-box; text-align: left; }
.question-box { background: #fff7ed; border: 1px dashed #fdba74; border-radius: 8px; padding: 12px; margin-bottom: 15px; display: flex; align-items: flex-start; gap: 8px; }
.question-badge { background: #f97316; color: white; font-size: 0.65rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; margin-top: 2px; }
.question-text { margin: 0; font-weight: 700; color: #9a3412; font-size: 0.95rem; }
.choices-grid { display: grid; grid-template-columns: 1fr; gap: 8px; flex-grow: 1; }
.choice-btn { background: white; border: 2px solid #e2e8f0; color: #1e293b; font-size: 0.95rem; font-family: 'Consolas', monospace; border-radius: 8px; font-weight: 700; cursor: pointer; transition: all 0.2s; padding: 10px; text-align: left; }
.choice-btn:hover { border-color: #f97316; background: #fff7ed; transform: translateY(-1px); }
.choice-btn.correct { background: #ecfdf5 !important; border-color: #10b981 !important; color: #047857 !important; }
.choice-btn.wrong { background: #fef2f2 !important; border-color: #ef4444 !important; color: #b91c1c !important; animation: shake 0.4s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.result-rank-box { color: #9a3412; background: #ffedd5; border-color: #fdba74; font-size: 1.4rem; font-weight: 800; margin: 20px 0; padding: 15px; border-radius: 10px; border: 2px dashed #fdba74; text-align: center; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(5px); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-overlay.show { display: flex; animation: fadeIn 0.3s ease-out; }
.glass-panel-modal { background: rgba(255, 255, 255, 0.96); padding: 40px 30px; border-radius: 20px; text-align: center; max-width: 420px; width: 90%; position: relative; }
.modal-close-x { position: absolute; top: 15px; right: 20px; background: none; border: none; font-size: 26px; font-weight: 700; color: #94a3b8; cursor: pointer; }
.btn-restart { background: #f97316; color: white; border: none; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.btn-share { background: #e2e8f0; color: #334155; border: none; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.modal-actions { display: flex; gap: 15px; justify-content: center; margin-top: 15px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 800px) { .regex-arena { grid-template-columns: 1fr; } .text-panel, .question-panel { height: auto; min-height: 250px; } }
