.site-share-button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.8);
  color: var(--ink-2);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.site-share-button:hover {
  border-color: rgba(169, 129, 71, 0.52);
  color: var(--gold);
}

.mf-page {
  max-width: 1120px;
}

.level-card-cover {
  width: 100%;
  height: 154px;
  margin: 18px 0 14px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center 18%;
  background: var(--paper-2);
  filter: saturate(0.92);
}

.mf-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 30px;
  align-items: center;
  margin: 32px 0 28px;
  padding: 46px 48px;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 20%, rgba(199, 165, 108, 0.28), transparent 30%),
    linear-gradient(135deg, #0a1922, #17313a);
  color: #f9f3e6;
  box-shadow: 0 28px 60px rgba(10, 25, 34, 0.16);
}

.mf-hero::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -90px;
  top: -100px;
  border: 28px solid rgba(226, 206, 170, 0.07);
  border-radius: 50%;
}

.mf-hero > div {
  position: relative;
  z-index: 1;
}

.mf-hero .eyebrow {
  color: #c7a56c;
}

.mf-hero h1 {
  max-width: 720px;
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 500;
  line-height: 1.12;
}

.mf-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(249, 243, 230, 0.68);
  font-size: 13px;
  line-height: 1.8;
}

.mf-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 23px;
}

.mf-hero-actions .btn-ghost {
  border-color: rgba(249, 243, 230, 0.28);
  color: #f9f3e6;
}

.mf-hero-mark {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  justify-self: end;
  border: 1px solid rgba(226, 206, 170, 0.22);
  border-radius: 50%;
  color: #c7a56c;
  font-family: var(--serif);
  font-size: 52px;
}

.mf-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mf-tool-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.76);
  color: var(--ink);
  transition: 180ms ease;
}

.mf-tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(169, 129, 71, 0.45);
  box-shadow: 0 18px 38px rgba(20, 31, 26, 0.08);
}

.mf-tool-card > b {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.mf-tool-card h3 {
  margin: 22px 0 8px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
}

.mf-tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.mf-tool-card span {
  margin-top: auto;
  padding-top: 18px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.mf-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mf-status-strip span,
.mf-rule-grid span,
.mf-vip-benefits span {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(169, 129, 71, 0.1);
  color: #78582f;
  font-size: 9px;
}

.mf-panel {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.72);
}

.mf-step {
  margin-bottom: 15px;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mf-level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.mf-level {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(248, 245, 238, 0.8);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mf-level.is-active {
  border-color: var(--gold);
  background: rgba(169, 129, 71, 0.1);
}

.mf-level b {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.mf-level span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.mf-field {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.mf-field > span {
  color: var(--muted);
  font-size: 10px;
}

.mf-field select,
.mf-range-fields input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
}

.mf-path {
  margin-top: 14px;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 15px;
}

.mf-access {
  display: inline-flex;
  margin-top: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 8.5px;
}

.mf-access.is-free {
  background: rgba(58, 111, 85, 0.1);
  color: #37644f;
}

.mf-access.is-vip {
  background: rgba(169, 129, 71, 0.12);
  color: #8a642d;
}

.mf-switch {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.mf-switch:first-of-type {
  border-top: 0;
}

.mf-switch b,
.mf-switch small {
  display: block;
}

.mf-switch b {
  font-size: 13px;
  font-weight: 500;
}

.mf-switch small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.mf-switch input {
  width: 40px;
  height: 22px;
  accent-color: var(--gold);
}

.mf-mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mf-mode-grid button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 245, 238, 0.8);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.mf-mode-grid button.is-active {
  border-color: var(--gold);
  background: var(--gold);
  color: white;
}

.mf-mode-grid button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.mf-note {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.mf-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(20, 35, 29, 0.06);
}

.mf-segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.mf-segmented button.is-active {
  background: #fffdf9;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(20, 31, 26, 0.08);
}

.mf-range-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}

.mf-range-fields label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 11px;
}

.mf-range-fields input {
  min-width: 0;
}

.mf-range-words label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.mf-summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 15px;
  padding: 15px;
  border-radius: 13px;
  background: rgba(169, 129, 71, 0.08);
  font-size: 11px;
}

.mf-summary span {
  color: var(--ink-2);
}

.mf-summary b {
  color: var(--gold);
  font-weight: 500;
}

.mf-wide {
  width: 100%;
  justify-content: center;
  margin-top: 18px;
}

.mf-practice-page {
  max-width: 840px;
}

.mf-practice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  color: var(--gold);
  font-size: 11px;
}

.mf-dictation-card,
.mf-game-card {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 20px 45px rgba(20, 31, 26, 0.08);
}

.mf-dictation-card img,
.mf-game-card > img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.mf-dictation-copy {
  padding: 25px;
  text-align: center;
}

.mf-dictation-card h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 42px;
  font-weight: 400;
}

.mf-dictation-card h1 small {
  color: var(--gold);
  font-family: sans-serif;
  font-size: 12px;
}

.mf-hidden-word {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 26px;
}

.mf-meaning {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 20px;
}

.mf-example {
  margin: 18px 0 0;
  color: var(--ink-2);
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.7;
}

.mf-translation {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.7;
}

.mf-practice-controls {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 9px;
  margin-top: 16px;
}

.mf-practice-controls .btn {
  justify-content: center;
}

.mf-letter-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  padding: 22px 16px 4px;
  font-family: Georgia, serif;
  font-size: 34px;
}

.mf-letter-slots span.is-missing {
  min-width: 24px;
  border-bottom: 2px solid var(--gold);
  color: var(--gold);
  text-align: center;
}

.mf-letter-slots span.is-space {
  width: 12px;
}

.mf-game-card > .mf-example,
.mf-game-card > .mf-translation {
  margin-left: 22px;
  margin-right: 22px;
}

.mf-game-card > .mf-translation {
  padding-bottom: 22px;
}

.mf-keyboard {
  margin-top: 15px;
  padding: 10px;
  border-radius: 17px;
  background: #eae2d3;
}

.mf-key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 5px;
}

.mf-key-row button {
  flex: 1;
  height: 40px;
  max-width: 58px;
  border-radius: 7px;
  background: #fffdf9;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(20, 31, 26, 0.15);
}

.mf-key-row .mf-key-delete {
  max-width: 110px;
}

.mf-result {
  max-width: 680px;
  margin: 70px auto;
  text-align: center;
}

.mf-result > strong {
  display: block;
  margin-top: 25px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 92px;
  line-height: 1;
}

.mf-result > span {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.mf-result h1 {
  margin: 24px 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.mf-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mf-result-stats b,
.mf-result-stats span {
  display: block;
}

.mf-result-stats b {
  font-family: Georgia, serif;
  font-size: 24px;
}

.mf-result-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.mf-result .mf-hero-actions {
  justify-content: center;
}

.mf-print-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 10px;
}

.mf-print-sheet {
  margin-top: 16px;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  color: #111;
}

.mf-print-sheet > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 2px solid #111;
}

.mf-print-sheet > header b,
.mf-print-sheet > header span {
  display: block;
}

.mf-print-sheet > header b {
  font-family: var(--serif);
  font-size: 22px;
}

.mf-print-sheet > header span,
.mf-print-sheet > header small {
  margin-top: 4px;
  color: #666;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.mf-print-sheet h1 {
  margin: 20px 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.mf-print-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.mf-print-sheet th,
.mf-print-sheet td {
  padding: 8px 7px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.mf-print-sheet th {
  background: #f3f0e9;
  font-weight: 500;
}

.mf-print-sheet footer {
  margin-top: 18px;
  color: #777;
  font-size: 8px;
  text-align: center;
}

.mf-record-list {
  display: grid;
  gap: 10px;
}

.mf-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.8);
}

.mf-record b,
.mf-record span {
  display: block;
}

.mf-record span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.mf-record strong {
  color: var(--gold);
  font-weight: 500;
}

.mf-favorite-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mf-favorite-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.82);
}

.mf-favorite-card > img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.mf-favorite-copy {
  padding: 17px 18px;
}

.mf-favorite-copy small {
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.mf-favorite-copy h2 {
  margin: 8px 0 4px;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 400;
}

.mf-favorite-copy h2 span {
  color: var(--gold);
  font-family: sans-serif;
  font-size: 10px;
}

.mf-favorite-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.mf-favorite-actions {
  display: flex;
  border-top: 1px solid var(--line);
}

.mf-favorite-actions button {
  flex: 1;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.mf-favorite-actions button + button {
  border-left: 1px solid var(--line);
}

.mf-invite-card,
.mf-account-card {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 25px;
  border: 1px solid rgba(169, 129, 71, 0.3);
  border-radius: 21px;
  background:
    radial-gradient(circle at 95% 5%, rgba(169, 129, 71, 0.16), transparent 35%),
    rgba(255, 253, 249, 0.86);
}

.mf-invite-balance small,
.mf-invite-balance strong,
.mf-invite-balance span {
  display: block;
}

.mf-invite-balance small {
  color: var(--muted);
  font-size: 9px;
}

.mf-invite-balance strong {
  margin: 5px 0;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 400;
}

.mf-invite-balance span {
  color: var(--muted);
  font-size: 9px;
}

.mf-invite-id {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
}

.mf-invite-id span {
  color: var(--muted);
  font-size: 9px;
}

.mf-invite-id b {
  margin-left: auto;
  font-family: Georgia, serif;
  font-size: 17px;
  letter-spacing: 0.12em;
}

.mf-invite-id button {
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.mf-invite-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
}

.mf-invite-stats b,
.mf-invite-stats span {
  display: block;
}

.mf-invite-stats b {
  font-family: Georgia, serif;
  font-size: 23px;
}

.mf-invite-stats span {
  color: var(--muted);
  font-size: 8px;
}

.mf-rule-grid,
.mf-vip-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.mf-panel details {
  border-top: 1px solid var(--line);
}

.mf-panel summary {
  padding: 13px 0;
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
}

.mf-panel details p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.mf-account-card {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.mf-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--night);
  color: #e6c78e;
  font-family: var(--serif);
  font-size: 20px;
}

.mf-account-card small,
.mf-account-card h2,
.mf-account-card span {
  display: block;
}

.mf-account-card small {
  color: var(--gold);
  font-size: 8px;
}

.mf-account-card h2 {
  margin: 5px 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.mf-account-card span {
  color: var(--muted);
  font-size: 9px;
}

.mf-status-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mf-status-cards a {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 249, 0.76);
  color: var(--ink);
  text-align: center;
}

.mf-status-cards b,
.mf-status-cards span {
  display: block;
}

.mf-status-cards b {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 26px;
}

.mf-status-cards span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.mf-modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 18, 24, 0.54);
}

.mf-modal {
  position: relative;
  width: min(100%, 460px);
  padding: 30px;
  border-radius: 22px;
  background: #f8f5ee;
  box-shadow: 0 30px 80px rgba(5, 15, 20, 0.3);
}

.mf-modal h2 {
  margin: 14px 0 10px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.mf-modal p,
.mf-modal small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.mf-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffdf9;
  color: var(--ink);
  cursor: pointer;
}

.mf-modal-action {
  width: 100%;
  justify-content: center;
  margin: 16px 0 12px;
}

.rich-favorite,
.drawer-favorite {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(169, 129, 71, 0.36);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.drawer-favorite {
  margin-top: 10px;
}

#wordPop:has(.rich-favorite) .rich-close {
  right: 10px;
}

.rich-favorite.is-saved,
.drawer-favorite.is-saved {
  background: rgba(169, 129, 71, 0.13);
}

@media (max-width: 860px) {
  .mf-hero {
    grid-template-columns: 1fr;
    padding: 32px 26px;
  }

  .mf-hero-mark {
    display: none;
  }

  .mf-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mf-level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mf-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mf-favorite-grid {
    grid-template-columns: 1fr;
  }

  .site-share-button {
    display: none;
  }
}

@media (max-width: 560px) {
  .mf-tool-grid,
  .mf-status-cards {
    grid-template-columns: 1fr;
  }

  .mf-tool-card {
    min-height: 160px;
  }

  .mf-range-fields,
  .mf-summary,
  .mf-print-actions,
  .mf-account-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .mf-account-card {
    display: flex;
  }

  .mf-practice-controls {
    grid-template-columns: 1fr;
  }

  .mf-key-row {
    gap: 3px;
  }

  .mf-key-row button {
    height: 36px;
    min-width: 0;
  }

  .mf-print-sheet {
    padding: 20px 12px;
  }
}

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: white !important;
  }

  .site-header,
  .site-footer,
  .reading-progress,
  .page-wrap > .breadcrumb,
  .mf-hero,
  .no-print,
  #toTop,
  #wordPop,
  .drawer-shell,
  .toast {
    display: none !important;
  }

  .app,
  .page-wrap,
  .mf-page {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .mf-print-sheet {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .mf-print-sheet tr {
    break-inside: avoid;
  }
}
