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

.hm-outer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

/* ---------- Header ---------- */
.hm-header {
  background: #1c8f4f;
  color: #fff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hm-instruction { font-size: 13px; font-weight: 600; }
.hm-header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hm-progress, .hm-score, .hm-life { font-size: 13px; font-weight: 700; }
.hm-home-btn {
  background: #ffb703; color: #4a3200; border: none; border-radius: 20px; padding: 6px 16px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}

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

/* ---------- Board ---------- */
.hm-board {
  min-height: 420px;
  padding: 26px 20px 30px;
  background: linear-gradient(180deg, #eaf9f0 0%, #ffffff 100%);
}

.hm-question-text {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #1c4e2e;
  margin-bottom: 18px;
  text-transform: capitalize;
}

.hm-object-area {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  min-height: 130px;
  background: #fff;
  border: 2px solid #cdeedb;
  border-radius: 14px;
  padding: 18px;
  max-width: 520px;
  margin: 0 auto 26px;
}

.hm-answers {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.hm-answer-btn {
  width: 66px; height: 66px;
  font-size: 26px; font-weight: 900;
  color: #1c4e2e;
  background: #fff;
  border: 3px solid #1c8f4f;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 0 #10693a;
  transition: transform .08s ease, box-shadow .08s ease;
}
.hm-answer-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #10693a; }
.hm-answer-btn:disabled { cursor: default; }
.hm-answer-correct { background: #2ecc71; color: #fff; border-color: #1f9c56; }
.hm-answer-wrong { background: #e74c3c; color: #fff; border-color: #b83326; }

.hm-feedback {
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.hm-feedback-correct { background: #d7f5df; color: #1c8f4f; }
.hm-feedback-wrong { background: #fde2e2; color: #c0392b; }

/* ---------- Result screen ---------- */
.hm-result {
  min-height: 420px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #1c4e2e; gap: 8px; padding: 20px;
}
.hm-result-icon { font-size: 56px; }
.hm-result h2 { margin: 0; font-size: 24px; }
.hm-result p { margin: 0 0 12px; font-size: 14px; opacity: .85; }
.hm-result-stats { display: flex; gap: 24px; margin-bottom: 18px; }
.hm-result-stats div { display: flex; flex-direction: column; align-items: center; }
.hm-result-stats span { font-size: 22px; font-weight: 800; }
.hm-result-stats small { font-size: 11px; opacity: .75; }
.hm-result-actions { display: flex; gap: 12px; }

.hm-btn {
  border: none; border-radius: 22px; padding: 10px 22px; font-size: 13px; font-weight: 800;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.hm-btn-primary { background: #2ecc71; color: #fff; }
.hm-btn-secondary { background: #eef4ef; color: #1c4e2e; }

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