/* Midnight Hearts — integrated with HentaiAPK dark / teal theme */
body.mh-page #backtotop,
body.mh-page #subheader,
body.mh-page .hapk-header-search-btn,
body.mh-page #hapk-mobile-search { display: none !important; }
body.mh-page .wrapper-inside,
body.mh-page #main-site {
  background: #151922 !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}
body.mh-page #footer { margin-top: 0; }
body.mh-page .mh-page-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body.mh-page .mh-shell.hapk-profile-box,
body.mh-page .mh-shell.box {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
  box-shadow: none !important;
  background: transparent !important;
}
.mh-app {
  --ink: #edf1f5;
  --muted: #9aa3b2;
  --teal: #1bbc9b;
  --teal-soft: #86dfc1;
  --gold: #f1d18b;
  --rose: #e89ab0;
  --surface: #1b202b;
  --surface-2: #232936;
  --line: rgba(255, 255, 255, 0.08);
  --line-teal: rgba(27, 188, 155, 0.28);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 82% 12%, rgba(27, 188, 155, 0.12), transparent 52%),
    radial-gradient(ellipse at 18% 88%, rgba(232, 154, 176, 0.1), transparent 50%),
    var(--surface);
  min-height: calc(100vh - 60px);
  font-family: inherit;
  font-size: 14px;
}
.mh-app.is-fullscreen,
.mh-app:fullscreen,
.mh-app:-webkit-full-screen {
  min-height: 100vh;
  width: 100%;
  height: 100%;
  overflow: auto;
  background:
    radial-gradient(ellipse at 82% 12%, rgba(27, 188, 155, 0.14), transparent 52%),
    radial-gradient(ellipse at 18% 88%, rgba(232, 154, 176, 0.12), transparent 50%),
    #12161e;
}
.mh-app.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100000;
}
.mh-app .mh-icon.is-fullscreen-on {
  border-color: var(--teal);
  color: var(--teal-soft);
}
.mh-app *, .mh-app *::before, .mh-app *::after { box-sizing: border-box; }
.mh-app h1, .mh-app h2, .mh-app h3, .mh-app p { margin: 0; padding: 0; color: inherit; }
.mh-app h1, .mh-app h2 {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-transform: none;
}
.mh-app a { color: inherit; text-decoration: none; }
.mh-app button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  background: transparent;
}
.mh-app button:disabled { cursor: default; opacity: 0.4; }
.mh-app button:focus-visible,
.mh-app a:focus-visible { outline: 2px solid var(--teal-soft); outline-offset: 4px; }
.mh-app ::selection { background: #1bbc9b66; color: #fff; }

.mh-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--line-teal);
  background: linear-gradient(180deg, rgba(27, 188, 155, 0.08), transparent);
}
.mh-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
}
.mh-brand b { color: var(--teal-soft); font-weight: 700; }
.mh-brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.mh-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-teal);
  background: #152028;
  color: var(--teal);
  font-size: 22px;
  line-height: 1;
}
.mh-top-actions { display: flex; align-items: center; gap: 10px; }
.mh-save-status { color: var(--muted); font-size: 11px; margin-right: 6px; }
.mh-app .mh-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #c5ced9;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mh-app .mh-icon:hover { background: rgba(27, 188, 155, 0.12); color: #fff; border-color: var(--line-teal); }
.mh-app .mh-icon[aria-pressed="true"] { border-color: var(--teal); color: var(--teal-soft); }
.mh-fullscreen-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px !important;
  border: 1px solid var(--line-teal) !important;
  border-radius: 999px !important;
  background: rgba(27, 188, 155, 0.14) !important;
  color: #dff8ef !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.mh-fullscreen-btn:hover {
  background: rgba(27, 188, 155, 0.28) !important;
  color: #fff !important;
}
.mh-fullscreen-btn.is-fullscreen-on,
.mh-fullscreen-btn[aria-pressed="true"] {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: #102b27 !important;
}
.mh-fs-icon { font-size: 14px; line-height: 1; }
.mh-fs-label { font-size: 11px; text-transform: uppercase; }
.mh-account {
  padding: 9px 14px;
  border: 1px solid var(--line-teal);
  background: rgba(27, 188, 155, 0.1);
  border-radius: 999px;
  color: #dff8ef !important;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.mh-account:hover { background: rgba(27, 188, 155, 0.18); }

.mh-layout {
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px 36px 24px;
  display: grid;
  grid-template-columns: 220px minmax(340px, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.mh-eyebrow {
  color: var(--teal-soft);
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.6;
}
.mh-nav-heading { padding: 4px 0 22px 4px; }
.mh-nav-heading h2 { font-size: 22px; margin-top: 8px; color: #f4f7fb; line-height: 1.25; }
.mh-chapter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.mh-chapter-tab {
  flex: 1 1 calc(33.33% - 6px);
  min-width: 64px;
  padding: 8px 6px !important;
  border-radius: 9px !important;
  border: 1px solid var(--line) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #c5ced9 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.mh-chapter-tab.is-active {
  border-color: var(--line-teal) !important;
  background: rgba(27, 188, 155, 0.16) !important;
  color: #dff8ef !important;
}
.mh-chapter-tab.is-locked { opacity: 0.45; }
.mh-chapter-tab:not(:disabled):hover { border-color: var(--line-teal) !important; }
.mh-chapter-nav { padding-top: 4px; }
#mh-stage-list { display: flex; flex-direction: column; gap: 6px; position: relative; }
.mh-app .mh-stage {
  display: flex;
  gap: 12px;
  width: 100%;
  align-items: center;
  padding: 12px 10px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  position: relative;
}
.mh-app .mh-stage:not(:disabled):hover { background: rgba(255, 255, 255, 0.04); }
.mh-app .mh-stage:disabled { opacity: 0.55; }
.mh-app .mh-stage.is-current {
  background: linear-gradient(90deg, rgba(27, 188, 155, 0.16), rgba(35, 41, 54, 0.5));
  border-color: var(--line-teal);
}
.mh-stage-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #151922;
  color: #aeb8c6;
  font-size: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mh-stage.is-current .mh-stage-number {
  color: #102b27;
  border-color: var(--teal);
  background: var(--teal);
  font-weight: 700;
}
.mh-stage-copy strong { font-size: 12px; display: block; font-weight: 600; color: #e8eef5; line-height: 1.35; }
.mh-stage-copy small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.mh-stars { color: var(--gold); letter-spacing: 2px; }
.mh-stage-check { color: var(--teal-soft); margin-left: auto; font-size: 12px; }
.mh-chapter-prize {
  margin: 28px 4px 12px;
  padding: 20px 14px 16px;
  text-align: center;
  border: 1px solid var(--line-teal);
  background: linear-gradient(160deg, rgba(27, 188, 155, 0.1), #181d27);
  border-radius: 14px;
}
.mh-prize-icon {
  margin: 0 auto 12px;
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--teal-soft);
  border: 1px solid var(--line-teal);
  border-radius: 50%;
  background: #152028;
}
.mh-chapter-prize strong { font-size: 12px; font-weight: 600; color: #dff8ef; }
.mh-chapter-prize p { margin: 10px 0 14px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.mh-app .mh-small { font-size: 11px; line-height: 1.7; color: var(--muted); }
.mh-small a { color: var(--teal-soft); text-decoration: underline; }
.mh-app .mh-text-btn {
  display: block;
  color: #a5afbf;
  background: transparent;
  font-size: 12px;
  padding: 12px 0;
  margin: 0 auto;
}
.mh-app .mh-text-btn:hover { color: var(--teal-soft); }

.mh-main { min-width: 0; padding: 4px 0; }
.mh-main h1:focus { outline: none; }
.mh-companion {
  border: 1px solid var(--line-teal);
  border-radius: 18px;
  background: linear-gradient(165deg, #222936, #171c26);
  overflow: hidden;
  margin-top: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.mh-character-art {
  position: relative;
  height: 390px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(232, 154, 176, 0.18), transparent 65%),
    radial-gradient(ellipse at 70% 20%, rgba(27, 188, 155, 0.12), transparent 55%);
}
.mh-character-art::after {
  content: "";
  position: absolute;
  inset: 68% 0 0;
  background: linear-gradient(transparent, #171c26);
  pointer-events: none;
}
.mh-character-art img {
  position: absolute;
  width: 100%;
  height: 430px;
  object-fit: contain;
  object-position: center top;
  left: 0;
  top: 14px;
  filter: drop-shadow(0 0 28px rgba(232, 154, 176, 0.22));
}
.mh-moon-window {
  position: absolute;
  width: 200px;
  height: 290px;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  border: 1px solid rgba(134, 223, 193, 0.22);
  border-radius: 110px 110px 0 0;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(134, 223, 193, 0.12) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(134, 223, 193, 0.08) 50%, transparent 50.5%),
    radial-gradient(circle at 53% 30%, rgba(241, 209, 139, 0.14), transparent 60%);
}
.mh-moon-window::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 265px;
  border: 1px solid rgba(134, 223, 193, 0.1);
  border-radius: 100px 100px 0 0;
  left: 14px;
  top: 14px;
}
.mh-orbit {
  position: absolute;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(232, 154, 176, 0.12);
  border-radius: 50%;
  left: -20px;
  top: 36px;
}
.mh-orbit-two { transform: scale(0.86); border-color: rgba(27, 188, 155, 0.1); }
.mh-art-spark { position: absolute; color: var(--gold); font-size: 18px; }
.mh-art-spark.s1 { left: 20px; top: 70px; }
.mh-art-spark.s2 { right: 16px; top: 210px; font-size: 26px; color: var(--rose); }
.mh-art-caption {
  position: absolute;
  bottom: 12px;
  left: 22px;
  z-index: 1;
  letter-spacing: 0.18em;
  font-size: 9px;
  font-weight: 700;
  color: #b7c0cd;
}
.mh-character-info { padding: 10px 22px 22px; }
.mh-character-info .mh-eyebrow { font-size: 9px; color: var(--rose); }
.mh-character-info h2 { font-size: 34px; margin: 8px 0 14px; }
.mh-character-info h2 span { float: right; font-size: 22px; color: var(--teal-soft); padding-top: 6px; }
.mh-character-info p {
  font-style: italic;
  font-size: 15px;
  line-height: 1.7;
  color: #c9b3bd;
  min-height: 74px;
}
.mh-bond { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.mh-bond > span { font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
.mh-bond > div { height: 4px; background: rgba(255, 255, 255, 0.08); margin-top: 8px; border-radius: 5px; overflow: hidden; }
.mh-bond i { height: 100%; display: block; background: linear-gradient(90deg, var(--rose), var(--teal)); border-radius: 5px; transition: width 0.3s; }

.mh-lobby { position: relative; padding: 28px 16px 8px; min-height: 560px; overflow: hidden; }
.mh-lobby > * { position: relative; z-index: 1; }
.mh-live-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--rose);
  margin-right: 7px;
  vertical-align: middle;
  box-shadow: 0 0 10px rgba(232, 154, 176, 0.55);
}
.mh-lobby-moon {
  color: var(--teal-soft);
  font-size: 56px;
  line-height: 1;
  margin: 22px 0 8px;
  width: 72px;
  height: 64px;
  position: relative;
}
.mh-lobby-moon span { font-size: 16px; position: absolute; top: 10px; right: 0; color: var(--rose); }
.mh-lobby h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.1; margin-bottom: 18px; color: #fff; }
.mh-app h1 em { color: var(--rose); font-weight: 700; font-style: italic; }
.mh-lead { color: #aeb8c6 !important; font-size: 14px; line-height: 1.85; max-width: 420px; }
.mh-lobby-facts { display: flex; flex-wrap: wrap; gap: 16px; color: #c5ced9; font-size: 11px; margin: 22px 0; }
.mh-lobby-facts span + span::before { content: "·"; color: var(--teal); margin-right: 16px; }
.mh-app .mh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.mh-app .mh-btn:hover:not(:disabled) { transform: translateY(-1px); }
.mh-app .mh-primary {
  color: #102b27;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 6px 20px rgba(27, 188, 155, 0.22);
}
.mh-app .mh-primary:hover:not(:disabled) { background: #20d0ab; border-color: #20d0ab; }
.mh-app .mh-secondary {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e8eef5;
}
.mh-app .mh-secondary:hover:not(:disabled) { border-color: var(--line-teal); background: rgba(27, 188, 155, 0.1); }
.mh-app .mh-begin { display: flex; justify-content: space-between; width: 100%; max-width: 340px; min-height: 52px; }
.mh-begin span { font-size: 20px; font-weight: 400; }
.mh-lobby-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.mh-lobby-actions .mh-begin { max-width: 340px; }
.mh-lobby-actions .mh-secondary { min-width: 140px; }
.mh-entry-note { font-size: 11px; color: var(--muted) !important; margin-top: 12px !important; line-height: 1.7; max-width: 340px; }
.mh-lobby-progress {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 28px;
}
.mh-lobby-progress strong { display: block; color: #f4f7fb; font-size: 24px; font-weight: 700; }
.mh-lobby-progress small { font-size: 12px; margin-left: 4px; color: #6d7685; font-weight: 500; }
.mh-lobby-progress div > span { display: block; color: var(--muted); font-size: 10px; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em; }

.mh-board-heading { display: flex; align-items: center; justify-content: space-between; margin: 4px auto 18px; max-width: 460px; gap: 12px; }
.mh-board-heading h1 { font-size: 26px; margin-top: 6px; }
.mh-board-heading .mh-eyebrow { font-size: 9px; }
.mh-goals {
  display: grid;
  grid-template-columns: 1.35fr 1fr 66px;
  gap: 14px;
  align-items: center;
  max-width: 460px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #171c26;
}
.mh-goals > div > span { display: block; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 6px; }
.mh-goals strong { display: block; font-size: 17px; font-weight: 600; white-space: nowrap; }
.mh-goals strong b { font-weight: 600; }
.mh-goals small { color: #6d7685; font-size: 11px; }
.mh-goal-moons strong { color: var(--gold); }
.mh-goal-track { height: 3px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.mh-goal-track i { display: block; height: 100%; width: 0; background: var(--teal); transition: width 0.2s; }
.mh-goal-moons .mh-goal-track i { background: var(--gold); }
.mh-moves { text-align: center; border-left: 1px solid var(--line); padding-left: 12px; }
.mh-moves strong { font-size: 28px; color: var(--rose); font-weight: 700; }
.mh-board-frame {
  max-width: 460px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--line-teal);
  border-radius: 20px;
  background: linear-gradient(145deg, #24303a, #171c26);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), inset 0 0 0 4px #171c26;
}
.mh-board-rim {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: radial-gradient(ellipse at 45% 30%, #243040, #12161e);
  border-radius: 16px;
  overflow: hidden;
}
#mh-canvas { position: absolute; inset: 0; }
#mh-canvas canvas { display: block !important; width: 100% !important; height: 100% !important; }
.mh-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  touch-action: none;
}
.mh-app .mh-cell {
  min-width: 0;
  width: auto;
  height: auto;
  margin: 4px;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 0;
  outline-offset: 0;
}
.mh-app .mh-cell[aria-pressed="true"] {
  border-color: var(--teal-soft);
  box-shadow: 0 0 16px rgba(27, 188, 155, 0.28);
  background: rgba(27, 188, 155, 0.08);
}
.mh-app .mh-cell:focus-visible { outline: 2px solid var(--teal-soft); outline-offset: -3px; }
.mh-cell.is-hint { animation: mh-hint 1.4s ease-in-out infinite; }
@keyframes mh-hint {
  0%, 100% { border-color: rgba(27, 188, 155, 0.2); }
  50% { border-color: rgba(27, 188, 155, 0.85); background: rgba(27, 188, 155, 0.08); }
}
.mh-board-status {
  max-width: 460px;
  text-align: center;
  font-size: 11px;
  color: #b7c0cd;
  min-height: 34px;
  padding: 12px 0 8px;
  line-height: 1.5;
}
.mh-board-tools { display: flex; gap: 10px; max-width: 460px; margin: 4px auto 0; }
.mh-app .mh-ability {
  flex: 1;
  justify-content: flex-start;
  background: linear-gradient(125deg, #2a3844, #1c2430);
  border: 1px solid var(--line-teal);
  color: #dff8ef;
  text-align: left;
  padding: 11px 15px;
  font-size: 12px;
}
.mh-ability > span:first-child { font-size: 24px; color: var(--teal-soft); }
.mh-ability small { display: block; font-size: 9px; font-weight: 500; margin-top: 3px; color: #8fa3ad; }
.mh-app .mh-hint {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-size: 12px;
  color: #c5ced9;
}
.mh-board-note {
  text-align: center;
  max-width: 450px;
  margin: 14px auto 0 !important;
  color: #6d7685 !important;
  font-size: 10px;
  line-height: 1.7;
}

.mh-story-heading { padding: 4px 8px 20px; }
.mh-story-heading h1 { font-size: 30px; margin-top: 8px; }
.mh-story-card {
  padding: 26px 26px 22px;
  border: 1px solid rgba(232, 154, 176, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 90% 5%, rgba(232, 154, 176, 0.12), transparent 55%),
    linear-gradient(145deg, #252c3a, #181d27);
}
.mh-paper-ornament { display: block; font-size: 28px; color: var(--rose); margin-bottom: 18px; }
.mh-narration { font-size: 16px; line-height: 1.85; color: #d5d9e0 !important; }
.mh-story-speaker {
  margin: 22px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  font-weight: 700;
}
.mh-story-speaker img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 1px solid rgba(232, 154, 176, 0.45);
  border-radius: 50%;
}
.mh-story-line { font-style: italic; font-size: 18px; line-height: 1.65; color: #f0d8e2 !important; }
.mh-choice-caption {
  display: block;
  margin: 24px 0 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.mh-choices { display: flex; flex-direction: column; gap: 10px; }
.mh-app .mh-choices > button:not(.mh-btn) {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 11px;
  padding: 15px 14px;
  font-size: 13px;
  line-height: 1.55;
  background: #2a2030;
  color: #f0e4ea;
  border: 1px solid rgba(232, 154, 176, 0.28);
  border-radius: 12px;
}
.mh-app .mh-choices > button:hover {
  border-color: var(--rose);
  background: #3a2a3c;
}
.mh-choices button > span { color: var(--rose); font-size: 20px; flex-shrink: 0; }
.mh-choices button > b { margin-left: auto; color: #b7a0ac; font-weight: 500; }
.mh-choice-note { color: #6d7685 !important; font-size: 10px; line-height: 1.7; margin-top: 14px !important; }
.mh-story-reply {
  padding: 18px;
  background: #1c2430;
  border-radius: 12px;
  border: 1px solid var(--line-teal);
}
.mh-story-reply p { font-size: 15px; line-height: 1.75; margin-top: 8px; color: #dfe7ef; }

.mh-result, .mh-ending { padding: 24px 14px; text-align: center; }
.mh-result-symbol {
  font-size: 64px;
  color: var(--teal-soft);
  margin: 20px 0 4px;
  text-shadow: 0 0 40px rgba(27, 188, 155, 0.3);
}
.mh-result h1 { font-size: 40px; }
.mh-result-stars { color: var(--gold); font-size: 28px; letter-spacing: 10px; margin: 22px 0 14px; }
.mh-result-stars > span { color: #4a5360; }
.mh-result-score { font-size: 13px; color: #b7c0cd !important; margin: 16px 0 !important; }
.mh-result-score span { margin: 0 8px; color: #5c6572; }
.mh-result-reward {
  padding: 14px;
  color: #dff8ef !important;
  font-size: 13px;
  background: rgba(27, 188, 155, 0.1);
  border: 1px solid var(--line-teal);
  border-radius: 10px;
  line-height: 1.7;
  margin-bottom: 20px !important;
}
.mh-result-reward span { margin: 0 8px; }
.mh-result > .mh-btn { width: 100%; margin: 10px 0; }
.mh-result .mh-small { margin-bottom: 10px; }
.mh-ending-medal {
  font-size: 48px;
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(27, 188, 155, 0.45);
  border-radius: 50%;
  color: var(--teal-soft);
  position: relative;
  margin: 24px auto;
  background: radial-gradient(circle, rgba(27, 188, 155, 0.14), #171c26);
  box-shadow: 0 0 0 6px rgba(27, 188, 155, 0.08);
}
.mh-ending-medal span { position: absolute; font-size: 18px; bottom: 16px; right: 18px; color: var(--rose); }
.mh-ending h1 { font-size: 36px; margin-bottom: 18px; }
.mh-ending .mh-lead { margin: auto; max-width: none; }
.mh-ending-prize {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line-teal);
  border-radius: 12px;
  background: #1c2430;
  margin: 24px 0 18px;
}
.mh-ending-prize > span { font-size: 30px; color: var(--teal-soft); }
.mh-ending-prize strong { font-size: 14px; color: var(--teal-soft); }
.mh-ending-prize p { font-size: 11px; color: #aeb8c6; line-height: 1.7; margin-top: 5px; }
.mh-ending > .mh-btn { width: 100%; margin-bottom: 10px; }
.mh-ending > .mh-small { margin-top: 14px; }
.mh-text-link { display: inline-block; margin-top: 18px; font-size: 12px; color: var(--teal-soft) !important; }

.mh-app .mh-modal {
  color: var(--ink);
  background: radial-gradient(ellipse at 100% 0%, rgba(232, 154, 176, 0.12), transparent), #1d222d;
  border: 1px solid var(--line-teal);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  border-radius: 18px;
  padding: 32px;
  width: min(500px, calc(100vw - 32px));
  max-height: 90dvh;
  overflow: auto;
  font-family: inherit;
}
.mh-modal::backdrop { background: rgba(10, 14, 20, 0.78); backdrop-filter: blur(6px); }
.mh-app .mh-modal .mh-close { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; font-size: 20px; }
.mh-modal h2 { font-size: 30px; margin: 14px 0 18px; }
.mh-modal > p { font-size: 13px; color: #b7c0cd; line-height: 1.75; margin: 12px 0; }
.mh-dialogue-mini { display: flex; align-items: center; gap: 14px; }
.mh-dialogue-mini img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(232, 154, 176, 0.4);
}
.mh-dialogue-mini p { font-style: italic; font-size: 15px; line-height: 1.65; color: #e8d0da; }
.mh-modal-goals {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 11px;
}
.mh-modal-goals strong { display: block; font-size: 18px; color: var(--teal-soft); font-weight: 700; margin-bottom: 5px; }
.mh-modal > .mh-btn { width: 100%; margin-top: 10px; }
.mh-help-list { padding-left: 20px; color: #c5ced9; font-size: 13px; line-height: 1.75; }
.mh-help-list li { margin-bottom: 10px; }
.mh-muted { color: var(--muted) !important; }

.mh-footer {
  max-width: 1680px;
  margin: 0 auto;
  padding: 14px 36px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #6d7685;
  font-size: 11px;
}
.mh-footer a { color: var(--teal-soft); }
.mh-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100000;
  background: #232936;
  border: 1px solid var(--line-teal);
  padding: 12px 18px;
  color: #edf1f5;
  max-width: 90vw;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  line-height: 1.6;
}
.mh-error {
  padding: 14px;
  border: 1px solid rgba(232, 154, 176, 0.4);
  background: #2a2030;
  border-radius: 12px;
  margin-top: 14px;
}
.mh-error p { font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
.mh-engine-error { padding: 70px 24px !important; text-align: center; color: #e8b4c0 !important; }
.mh-loading {
  display: grid;
  place-content: center;
  min-height: 50vh;
  text-align: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}
.mh-loading > span { font-size: 56px; color: var(--teal-soft); }
.mh-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 1500px) {
  .mh-layout { padding-top: 36px; gap: 36px; }
  .mh-character-art { height: 430px; }
  .mh-character-art img { height: 470px; }
}
@media (max-width: 1150px) {
  .mh-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 22px; }
  .mh-companion { display: none; }
  .mh-save-status { display: none; }
  .mh-main { max-width: 540px; width: 100%; margin: auto; }
  .mh-lobby::after {
    content: "";
    position: absolute;
    inset: 0 -30px 0 38%;
    background: url('../harem/characters/luna-v1.webp') center top / contain no-repeat;
    opacity: 0.34;
    pointer-events: none;
    mask-image: linear-gradient(180deg, #000 40%, transparent 92%);
  }
  .mh-lobby h1 { font-size: 46px; }
}
@media (max-width: 700px) {
  .mh-topbar { padding: 12px 16px; gap: 8px; }
  .mh-brand { gap: 8px; font-size: 11px; }
  .mh-brand-mark { width: 34px; height: 34px; font-size: 18px; }
  .mh-brand small { font-size: 7px; }
  .mh-app .mh-top-actions .mh-icon { width: 30px; height: 30px; font-size: 14px; }
  .mh-fullscreen-btn { min-height: 30px; padding: 0 10px !important; }
  .mh-fs-label { font-size: 10px; }
  .mh-account { padding: 7px 10px; font-size: 10px; }
  .mh-layout { display: flex; flex-direction: column; padding: 16px 14px 20px; gap: 16px; }
  .mh-nav-heading { display: none; }
  .mh-chapter-prize { display: none; }
  #mh-map-home { display: none; }
  #mh-stage-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }
  .mh-app .mh-stage {
    padding: 8px 0;
    justify-content: center;
    gap: 0;
    border-radius: 10px;
    background: #171c26;
  }
  .mh-stage-copy { display: none; }
  .mh-stage-check { position: absolute; font-size: 8px; right: 5px; bottom: 5px; }
  .mh-stage-number { border: 0; background: transparent; width: 26px; height: 26px; }
  .mh-lobby { padding: 12px 6px 4px; min-height: 0; }
  .mh-lobby h1 { font-size: 40px; }
  .mh-begin { max-width: none !important; }
  .mh-entry-note { max-width: none; }
  .mh-board-heading h1 { font-size: 24px; }
  .mh-goals { grid-template-columns: 1.35fr 1fr 54px; gap: 10px; padding: 12px; }
  .mh-result h1 { font-size: 34px; }
  .mh-ending h1 { font-size: 32px; }
  .mh-story-card { padding: 20px 16px; }
  .mh-app .mh-modal { padding: 26px 18px; }
  .mh-footer { padding: 14px 16px; font-size: 10px; }
}
@media (max-width: 380px) {
  .mh-topbar { padding: 10px 12px; }
  .mh-brand { font-size: 10px; }
  .mh-layout { padding: 14px 10px 18px; }
  .mh-lobby h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .mh-app *, .mh-app *::before, .mh-app *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
