* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container { max-width: 800px; margin: 0 auto; }
.hidden { display: none !important; }

.header { text-align: center; color: #fff; margin-bottom: 24px; }
.header h1 { font-size: 2.2em; text-shadow: 2px 2px 4px rgba(0,0,0,.3); }
.header p { font-size: 1.1em; opacity: .92; margin-top: 8px; }

.card {
  background: #fff; border-radius: 20px; padding: 26px; margin-bottom: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.card-title { color: #667eea; margin-bottom: 16px; }

.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; border: none; padding: 14px 36px; font-size: 17px;
  border-radius: 50px; cursor: pointer; transition: transform .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(102,126,234,.4); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-secondary { background: #6c757d; }
.btn-sm { padding: 10px 24px; font-size: 15px; }
.btn-link { background: none; border: none; color: #fff; font-size: 15px; cursor: pointer; padding: 6px; }
.btn-group { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; color: #555; font-weight: bold; }
.form-group input, .form-group select {
  width: 100%; padding: 14px; border: 2px solid #e0e0e0; border-radius: 12px;
  font-size: 16px; transition: border-color .3s;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #667eea; }
.hint { margin-top: 16px; text-align: center; color: #888; font-size: .92em; }
.hint a, .footer a { color: #5a5ae6; }
.muted { color: #999; }

.profile { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; }
.profile-info h2 { color: #667eea; margin-bottom: 6px; }
.stats { display: flex; gap: 16px; }
.stat-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff;
  padding: 13px 22px; border-radius: 15px; text-align: center; min-width: 90px;
}
.stat-box .number { font-size: 1.7em; font-weight: bold; }
.stat-box .label { font-size: .82em; opacity: .92; }

.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.subject-btn {
  background: #fff; border: 3px solid #e8e8f5; padding: 20px 10px; border-radius: 15px;
  cursor: pointer; transition: all .25s; font-size: 15px; font-family: inherit;
}
.subject-btn:hover { border-color: #667eea; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,.1); }
.subject-btn .emoji { font-size: 1.9em; display: block; margin-bottom: 8px; }
.subject-btn .name { font-weight: bold; color: #333; }
.subject-btn .sub { display: block; font-size: .78em; color: #999; margin-top: 4px; }

.menu-btn {
  display: block; width: 100%; text-align: left; background: #f8f9fc; border: 2px solid #e8e8f5;
  padding: 18px 22px; border-radius: 15px; cursor: pointer; font-size: 17px;
  font-family: inherit; margin-bottom: 12px; transition: all .2s;
}
.menu-btn:hover { border-color: #667eea; background: #f0f2ff; }

.task-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.task-meta { color: #fff; font-weight: bold; background: rgba(0,0,0,.18); padding: 6px 14px; border-radius: 20px; }
.progress-bar { background: rgba(255,255,255,.35); height: 10px; border-radius: 5px; margin-bottom: 18px; overflow: hidden; }
.progress-fill { background: #fff; height: 100%; width: 0; transition: width .3s; border-radius: 5px; }

.timer-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.timer-track { flex: 1; background: #e8e8ef; height: 8px; border-radius: 4px; overflow: hidden; }
.timer-fill { background: linear-gradient(90deg, #4bbf6b, #2fa352); height: 100%; width: 100%; transition: width 1s linear; }
.timer-fill.urgent { background: linear-gradient(90deg, #e66a6a, #d43f3f); }
.timer-num { font-weight: bold; color: #667eea; min-width: 46px; text-align: right; }

.task-card { background: #f8f9fc; padding: 22px; border-radius: 15px; margin-bottom: 16px; }
.task-question { font-size: 1.25em; line-height: 1.55; margin-bottom: 18px; }

.options { display: grid; gap: 10px; }
.option-btn {
  background: #fff; border: 2px solid #ddd; border-radius: 12px; padding: 13px 16px;
  font-size: 1.02em; font-family: inherit; cursor: pointer; text-align: left; transition: all .2s;
}
.option-btn:hover { border-color: #667eea; background: #f4f5ff; }
.option-btn.selected { border-color: #667eea; background: #eef0ff; }
.option-btn.correct { border-color: #3ca55c; background: #e3f7e8; font-weight: bold; }
.option-btn.incorrect { border-color: #d43f3f; background: #fdeaea; }
.option-btn:disabled { cursor: default; }

.result { margin-top: 16px; padding: 14px; border-radius: 12px; text-align: center; font-size: 1.05em; }
.result.correct { background: #e3f7e8; color: #217a3c; }
.result.incorrect { background: #fdeaea; color: #a33030; }

.summary-card { text-align: center; }
.summary-icon { font-size: 3.2em; margin-bottom: 10px; }
.summary-card h2 { color: #667eea; margin-bottom: 18px; }
.summary-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }

.modal {
  position: fixed; inset: 0; background: rgba(30,30,60,.55); display: flex;
  align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-box { max-width: 420px; width: 100%; }
.modal-box h3 { color: #667eea; margin-bottom: 8px; }
.modal-box input {
  width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 10px;
  font-size: 15px; margin: 12px 0;
}

.footer { text-align: center; color: rgba(255,255,255,.85); font-size: .9em; margin: 30px 0 10px; }
.footer .muted { color: rgba(255,255,255,.6); }
.footer a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.how-it-works .steps { padding-left: 20px; line-height: 1.6; color: #555; }
.how-it-works .steps li { margin-bottom: 8px; }
.how-it-works .steps li { margin-bottom: 8px; }
.method-text { line-height: 1.65; color: #555; }
.method-text h3 { color: #667eea; margin: 16px 0 6px; }
.method-text p { margin-bottom: 8px; }

.table { width: 100%; border-collapse: collapse; font-size: .95em; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #eee; }
.table th { color: #667eea; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .82em; font-weight: bold; }
.badge.ok { background: #e3f7e8; color: #217a3c; }
.badge.fail { background: #fdeaea; color: #a33030; }
.badge.skip { background: #f2f2f7; color: #777; }

@media (max-width: 560px) {
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .header h1 { font-size: 1.7em; }
  .stats { flex-wrap: wrap; }
}
