* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #f2f4f8; }

.em-outer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  --theme: #1c8f4f;
  --theme-dark: #10693a;
  --theme-tint: #eaf9f0;
}

.em-container {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0,0,0,0.15);
}

/* ---------- Header ---------- */
.em-header {
  background: var(--theme);
  color: #fff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.em-title-block { display: flex; align-items: center; gap: 10px; }
.em-icon { font-size: 22px; }
.em-title { font-size: 15px; font-weight: 800; }
.em-instruction { font-size: 12px; opacity: .92; display: block; }
.em-header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.em-progress, .em-score, .em-life { font-size: 13px; font-weight: 700; }
.em-home-btn {
  background: #ffb703; color: #4a3200; border: none; border-radius: 20px; padding: 6px 16px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}

/* ---------- Loading / warning ---------- */
.em-loading, .em-warning {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; gap: 14px; color: #3a3a3a; min-height: 400px;
}
.em-spinner {
  width: 36px; height: 36px; border: 4px solid var(--theme-tint); border-top-color: var(--theme);
  border-radius: 50%; animation: em-spin 0.8s linear infinite;
}
@keyframes em-spin { to { transform: rotate(360deg); } }
.em-warning-icon { font-size: 40px; }

/* ---------- Board ---------- */
.em-board {
  min-height: 400px;
  padding: 30px 20px;
  background: linear-gradient(180deg, var(--theme-tint) 0%, #ffffff 100%);
  text-align: center;
}

.em-emoji { font-size: 64px; margin-bottom: 10px; }

.em-prompt {
  font-size: 22px;
  font-weight: 800;
  color: #2c2c2c;
  margin-bottom: 8px;
}

.em-clue {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 20px;
}

.em-answers {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 18px;
}
.em-answer-btn {
  min-width: 100px;
  padding: 14px 20px;
  font-size: 17px; font-weight: 800;
  color: #2c2c2c;
  background: #fff;
  border: 3px solid var(--theme);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--theme-dark);
  transition: transform .08s ease, box-shadow .08s ease;
}
.em-answer-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--theme-dark); }
.em-answer-btn:disabled { cursor: default; }
.em-answer-correct { background: #2ecc71; color: #fff; border-color: #1f9c56; }
.em-answer-wrong { background: #e74c3c; color: #fff; border-color: #b83326; }

.em-feedback {
  display: inline-block;
  font-weight: 800;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 10px;
}
.em-feedback-correct { background: #d7f5df; color: #1c8f4f; }
.em-feedback-wrong { background: #fde2e2; color: #c0392b; }

/* ---------- Result screen ---------- */
.em-result {
  min-height: 400px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #2c2c2c; gap: 8px; padding: 20px;
  background: linear-gradient(180deg, var(--theme-tint) 0%, #ffffff 100%);
}
.em-result-icon { font-size: 56px; }
.em-result h2 { margin: 0; font-size: 24px; }
.em-result p { margin: 0 0 12px; font-size: 14px; opacity: .8; }
.em-result-stats { display: flex; gap: 24px; margin-bottom: 18px; }
.em-result-stats div { display: flex; flex-direction: column; align-items: center; }
.em-result-stats span { font-size: 22px; font-weight: 800; }
.em-result-stats small { font-size: 11px; opacity: .7; }
.em-result-actions { display: flex; gap: 12px; }

.em-btn {
  border: none; border-radius: 22px; padding: 10px 22px; font-size: 13px; font-weight: 800;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.em-btn-primary { background: var(--theme);/* color: #fff;*/ }
.em-btn-secondary { background: #eef1f4; color: #333; }

/* ---------- Home confirm modal ---------- */
.em-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.em-modal {
  background: #fff; border-radius: 14px; padding: 24px; max-width: 320px; text-align: center;
}
.em-modal p { margin: 0 0 16px; font-weight: 700; color: #333; }
.em-modal-actions { display: flex; gap: 10px; justify-content: center; }
.em-modal .em-btn-secondary { background: #eee; color: #333; }

@media (max-width: 480px) {
  .em-instruction { display: none; }
  .em-answer-btn { min-width: 80px; padding: 12px 16px; font-size: 15px; }
  .em-emoji { font-size: 48px; }
  .em-prompt { font-size: 18px; }
}
