:root {
  --primary-color: #2b579a;
  --bg-color: #f4f6f9;
  --card-bg: #ffffff;
  --text-color: #2c3e50;
  --success-color: #27ae60;
  --error-color: #e74c3c;
}

body {
  margin: 0; padding: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh;
  -webkit-user-select: none; user-select: none;
}

.app-container {
  width: 100%; max-width: 500px;
  background: var(--card-bg);
  padding: 25px; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.screen { transition: all 0.2s ease; }
.hidden { display: none !important; }

h1 { font-size: 22px; text-align: center; color: var(--primary-color); margin-bottom: 5px; }
h2 { text-align: center; font-size: 24px; margin-top: 10px; }
.subtitle { text-align: center; color: #7f8c8d; font-size: 13px; margin-bottom: 25px; }

.menu-section {
  background: #f8f9fa; padding: 12px;
  border-radius: 12px; margin-bottom: 15px;
}
.menu-section h3 { margin-top: 0; color: #34495e; font-size: 15px; }

.menu-section button {
  width: 100%; padding: 14px;
  background-color: white; border: 2px solid #dcdde1;
  border-radius: 8px; font-size: 14px; font-weight: bold;
  color: var(--text-color); cursor: pointer;
  margin-bottom: 8px; text-align: left;
}
.menu-section button:active { background-color: #f1f2f6; }

.btn-exam { background-color: rgb(248, 211, 109) !important; border-color: #fcd28e !important; text-align: center !important; }

.question-box {
  background: #edf2f7; padding: 20px;
  border-radius: 12px; font-size: 16px;
  line-height: 1.6; margin: 15px 0;
  position: relative; font-weight: 500;
}
.q-badge {
  position: absolute; top: -10px; left: 15px;
  background: var(--primary-color); color: white;
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
}

.num-input-box {
  display: inline-block; background: #fff;
  border: 3px solid #cbd5e0; border-radius: 8px;
  min-width: 55px; height: 42px; font-size: 22px;
  text-align: center; line-height: 42px;
  vertical-align: middle; margin: 0 4px; cursor: pointer;
}
.num-input-box.active {
  border-color: var(--primary-color);
  background-color: #ebf8ff;
}

.digital-clock-box {
  display: inline-block; background: #222; color: #00ff00;
  font-family: 'Courier New', Courier, monospace;
  font-size: 32px; font-weight: bold; padding: 10px 25px;
  border-radius: 6px; border: 4px solid #444;
  box-shadow: inset 0 0 10px rgba(0,250,0,0.5);
  letter-spacing: 2px;
}

.option-btn {
  width: 100%; padding: 14px; margin-bottom: 10px;
  background: #fff; border: 2px solid #cbd5e0;
  border-radius: 8px; font-size: 15px; text-align: left;
  color: var(--text-color); font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.option-btn:active { background: #e2e8f0; }

#submit-btn {
  width: 100%; padding: 14px;
  background-color: var(--primary-color); color: white;
  text-align: center; border: none; border-radius: 8px;
  font-size: 16px; font-weight: bold; margin-top: 10px;
}

.feedback-box {
  padding: 15px; border-radius: 8px;
  margin-top: 15px; font-size: 15px; line-height: 1.5;
}
.feedback-title { font-size: 17px; font-weight: bold; margin-bottom: 5px; }
.feedback-explain { font-size: 14px; color: #4a5568; margin-top: 5px; border-top: 1px dashed #cbd5e0; padding-top: 8px;}
.correct { background-color: #d4edda; color: var(--success-color); }
.wrong { background-color: #f8d7da; color: var(--error-color); }

.keyboard-container {
  margin-top: 15px; background: #e2e8f0;
  padding: 10px; border-radius: 12px;
}
.key-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.key-row:last-child { margin-bottom: 0; }
.key-btn {
  width: 31%; padding: 12px 0; font-size: 20px;
  background: white; border: none; border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); text-align: center;
}
.key-btn:active { background: #cbd5e0; }
.btn-del { background: #fab1a0; color: #c0392b; font-size: 15px; }
.btn-ok { background: #55efc4; color: #00b894; font-size: 15px; }

.quiz-header { display: flex; justify-content: space-between; font-weight: bold; }
#timer { background: #ffeaa7; padding: 2px 8px; border-radius: 4px; color: #d63031; }

.progress-bar-container { width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; margin-top: 6px; overflow: hidden;}
#progress-bar { width: 0%; height: 100%; background: var(--primary-color); transition: width 0.2s; }

.result-card { background: #f8f9fa; padding: 15px; border-radius: 12px; margin: 20px 0; font-size: 16px;}
.score-board { text-align: center; margin-top: 20px; font-size: 14px;}
.btn-clear { background: none; border: none; color: #95a5a6; text-decoration: underline; font-size: 12px;}
.btn-home { background: #7f8c8d; color: white; border: none; text-align: center; width: 100%; padding: 12px; border-radius: 8px; font-size: 16px;}