/* GENERATED by scripts/bump-version.sh from the @import list in assets/css/main.css.
   Do not edit: change the source files and run the script. One request instead of 18. */

/* ---- fonts.css ---- */
/**
 * Self-hosted DM Sans + Syne (SIL OFL). Do not load fonts from Google.
 * Latin + latin-ext only — enough for EN / LB / DE / FR on this hub.
 */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("/assets/fonts/syne-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("/assets/fonts/syne-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- tokens.css ---- */
/**
 * Design tokens — single source for colors, type, radii.
 * Games may override locally; prefer these variables in shared UI.
 */

:root {
  --mg-bg0: #f3f7fb;
  --mg-bg1: #e7eef6;
  --mg-surface: #ffffff;
  --mg-surface-strong: #f7fafc;
  --mg-ink: #152033;
  --mg-muted: #5b6b7c;
  --mg-accent: #0f7a6a;
  --mg-accent-ink: #ffffff;
  --mg-line: rgba(21, 32, 51, 0.12);
  --mg-danger: #c0392b;
  --mg-ok: #1f8a4c;
  --mg-radius: 1.1rem;
  --mg-font: "DM Sans", system-ui, sans-serif;
  --mg-display: "Syne", "DM Sans", system-ui, sans-serif;
  --mg-shadow: 0 10px 28px rgba(21, 32, 51, 0.08);
  --mg-overlay-scrim: rgba(21, 32, 51, 0.45);
  --mg-bp-md: 640px;
}

/* ---- base.css ---- */
/**
 * Global reset and document defaults.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Disable double-tap zoom; pinch zoom still allowed where the browser permits it */
  touch-action: manipulation;
  /* Let pull-to-refresh own the top overscroll instead of Safari rubber-band */
  overscroll-behavior-y: contain;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--mg-font);
  color: var(--mg-ink);
  touch-action: manipulation;
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(15, 122, 106, 0.12), transparent 55%),
    radial-gradient(70% 50% at 100% 10%, rgba(70, 120, 200, 0.1), transparent 50%),
    linear-gradient(180deg, var(--mg-bg0), var(--mg-bg1));
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* ---- layout.css ---- */
/**
 * Page shell, typography blocks, responsive grids.
 */

.mg-shell {
  width: min(100% - 1.5rem, 42rem);
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

.mg-brand {
  font-family: var(--mg-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.4rem;
  color: var(--mg-ink);
}

.mg-lead {
  margin: 0 0 0.35rem;
  color: var(--mg-muted);
  font-size: 1rem;
  line-height: 1.45;
  max-width: 28rem;
}

/* Deploy/cache check (hub only) — bump via scripts/bump-version.sh */
.mg-version {
  margin: 0 0 1.35rem;
  color: var(--mg-muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.mg-status {
  margin: 0 0 1rem;
  color: var(--mg-muted);
  font-size: 0.95rem;
}

.mg-status--error {
  color: var(--mg-danger);
}

.mg-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.mg-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  color: var(--mg-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.mg-back:hover {
  color: var(--mg-ink);
}

@media (min-width: 640px) {
  .mg-shell {
    width: min(100% - 2rem, 52rem);
    padding-top: 2rem;
  }

  .mg-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- components/buttons.css ---- */
/**
 * Buttons and text actions.
 */

.mg-btn {
  appearance: none;
  border: 0;
  border-radius: 0.75rem;
  font: inherit;
  font-weight: 700;
  min-height: 2.85rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.mg-btn--primary {
  background: var(--mg-accent);
  color: var(--mg-accent-ink);
}

/* Highscore saved — keep primary weight, switch to success green. */
.mg-btn--saved {
  background: var(--mg-ok);
  color: #fff;
}

.mg-btn--ghost {
  background: transparent;
  color: var(--mg-ink);
  border: 1px solid var(--mg-line);
}

/* Anchor styled as button (e.g. back to hub) */
.mg-btn--link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mg-more {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mg-accent);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 2.5rem;
  padding: 0.25rem 0.35rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.mg-actions {
  display: grid;
  gap: 0.55rem;
}

.mg-actions--spaced {
  margin-top: 1rem;
}

/* ---- components/forms.css ---- */
/**
 * Form fields used in save-score and similar overlays.
 */

.mg-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.mg-field label {
  font-size: 0.85rem;
  color: var(--mg-muted);
}

.mg-field input {
  appearance: none;
  border: 1px solid var(--mg-line);
  border-radius: 0.7rem;
  background: var(--mg-surface-strong);
  color: var(--mg-ink);
  font: inherit;
  padding: 0.75rem 0.85rem;
  min-height: 2.75rem;
}

.mg-field input:focus {
  outline: 2px solid var(--mg-accent);
  outline-offset: 1px;
}

.mg-field[hidden] {
  display: none !important;
}

.mg-field__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--mg-muted);
  line-height: 1.35;
}

/* ---- components/tiles.css ---- */
/**
 * Dashboard game tiles (title, preview, score summary).
 */

.mg-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--mg-line);
  border-radius: var(--mg-radius);
  background: var(--mg-surface);
  box-shadow: var(--mg-shadow);
  padding: 1rem;
  gap: 0.75rem;
}

.mg-tile__heading {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.mg-tile__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.mg-tile__title {
  font-family: var(--mg-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  min-width: 0;
}

.mg-tile__attempts {
  margin: 0;
  color: var(--mg-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.mg-tile__version {
  flex-shrink: 0;
  color: var(--mg-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.mg-tile__preview-link {
  display: block;
  /* Match preview.jpg (~800×533); overflow clips square JPG corners to this radius */
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--mg-line);
  aspect-ratio: 3 / 2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mg-tile__preview-link:active {
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .mg-tile__preview-link:hover {
    box-shadow: 0 0 0 2px rgba(15, 122, 106, 0.25);
  }
}

.mg-tile__preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mg-tile__scores-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mg-tile__scores-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mg-accent);
  font-weight: 700;
}

/* Game in its test phase: blurred preview + "Coming soon"; the test PIN opens it (see includes/releases.php). */
.mg-tile--soon {
  opacity: 0.97;
}

.mg-tile__soon {
  position: relative;
  width: 100%;
  padding: 0;
  background: var(--mg-surface, #fff);
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.mg-tile__preview--blur {
  filter: blur(11px) saturate(0.85);
  /* scale hides the soft, transparent edge a blur leaves around the image */
  transform: scale(1.12);
}

.mg-tile__soon-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--mg-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(40, 24, 70, 0.55);
  background: rgba(40, 24, 70, 0.28);
}

.mg-tile__soon-label::before {
  content: "🔒";
  font-size: 1.1rem;
}

/* ---- components/champions.css ---- */
/**
 * Cross-game champions board (above game tiles).
 */

.mg-champions-host {
  margin: 0 0 1.15rem;
}

.mg-champions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border: 1px solid var(--mg-line);
  border-radius: var(--mg-radius);
  background: var(--mg-surface);
  box-shadow: var(--mg-shadow);
  padding: 1rem;
}

.mg-champions__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.mg-champions__titles {
  min-width: 0;
}

.mg-champions__title {
  font-family: var(--mg-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--mg-ink);
}

.mg-champions__blurb {
  margin: 0;
  font-size: 0.82rem;
  color: var(--mg-muted);
  line-height: 1.35;
}

/* Champions: same split as tiles — total tries under name, Top‑1 under points. */
.mg-champions .mg-scores__who .mg-scores__meta--attempts {
  display: block;
}

.mg-champions .mg-scores__meta--score {
  display: block;
  max-width: 11rem;
}

.mg-overlay .mg-scores--champions .mg-scores__who .mg-scores__meta--attempts {
  display: block;
}

.mg-overlay .mg-scores--champions .mg-scores__meta--score {
  display: block;
  max-width: 11rem;
}

/* ---- components/scores.css ---- */
/**
 * Highscore lists (tile top-3 and full leaderboard popup).
 */

.mg-scores {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.mg-scores li {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.92rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--mg-line);
}

.mg-scores li:first-child {
  border-top: 0;
}

.mg-scores__rank {
  color: var(--mg-accent);
  font-weight: 700;
  padding-top: 0.05rem;
}

.mg-scores__who {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.mg-scores__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.mg-scores__meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mg-muted);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.mg-scores__meta--score {
  display: none;
  text-align: right;
}

.mg-scores__score-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.mg-scores__score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.mg-scores__empty {
  color: var(--mg-muted);
  font-size: 0.9rem;
  margin: 0;
}

.mg-scores--scroll {
  max-height: min(55vh, 26rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.mg-scores__gap {
  display: flex !important;
  justify-content: center;
  align-items: center;
  grid-template-columns: none !important;
  border-top: 0 !important;
  padding: 0.15rem 0 0.35rem !important;
  color: var(--mg-muted);
  letter-spacing: 0.35em;
  font-size: 1.1rem;
  font-weight: 700;
}

.mg-scores__row--you {
  background: rgba(255, 140, 105, 0.14);
  border-radius: 0.45rem;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
  margin: 0 -0.15rem;
}

.mg-game-best {
  margin: -0.35rem 0 0.95rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mg-ink, #2a3f55);
}

.mg-game-best[hidden] {
  display: none !important;
}

/* Tile lists: Level / Combo / Extra under the score; tries under the name. */
.mg-tile .mg-scores__who .mg-scores__meta--stats {
  display: none;
}

.mg-tile .mg-scores__who .mg-scores__meta--attempts {
  display: block;
}

.mg-tile .mg-scores__meta--score {
  display: block;
  max-width: 9.5rem;
}

/* Popup: stats under the name; hide score-side duplicate. */
.mg-overlay .mg-scores__meta--score {
  display: none;
}

.mg-overlay .mg-scores__who .mg-scores__meta--stats {
  display: block;
}

/* ---- components/hud-pulse.css ---- */
/**
 * Shared HUD feedback: sale-sticker burst for level-up / combo / extra.
 * Overlay scales freely — source pill layout stays put.
 */

/* Dim source while the floating burst is up (box size unchanged). */
.mg-hud-bump-source {
  opacity: 0.28;
  transition: opacity 0.12s ease;
}

.mg-hud-burst {
  position: fixed;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 4.6rem;
  min-height: 4.6rem;
  padding: 0.85rem 1rem;
  margin: 0;
  border: 0;
  pointer-events: none;
  font-family: inherit;
  font-size: clamp(0.95rem, 3.6vw, 1.2rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  color: #1a1a1a;
  /* 16-point starburst — Sonderangebot / sale sticker */
  clip-path: polygon(
    50% 0%,
    56% 10%,
    68% 2%,
    70% 14%,
    84% 10%,
    80% 22%,
    96% 25%,
    86% 35%,
    100% 42%,
    88% 50%,
    100% 58%,
    86% 65%,
    96% 75%,
    80% 78%,
    84% 90%,
    70% 86%,
    68% 98%,
    56% 90%,
    50% 100%,
    44% 90%,
    32% 98%,
    30% 86%,
    16% 90%,
    20% 78%,
    4% 75%,
    14% 65%,
    0% 58%,
    12% 50%,
    0% 42%,
    14% 35%,
    4% 25%,
    20% 22%,
    16% 10%,
    30% 14%,
    32% 2%,
    44% 10%
  );
  transform: translate(-50%, -50%) scale(0.55) rotate(-8deg);
  animation: mg-hud-burst 0.88s cubic-bezier(0.2, 1.35, 0.32, 1) forwards;
  will-change: transform, opacity;
}

.mg-hud-burst--level {
  color: #3a2400;
  background: #ffc43a;
  box-shadow: 0 6px 22px rgba(180, 110, 0, 0.38);
}

.mg-hud-burst--combo {
  color: #3a0508;
  background: #ff4d5e;
  box-shadow: 0 6px 22px rgba(180, 30, 50, 0.4);
}

.mg-hud-burst--extra {
  color: #062a1a;
  background: #3de08a;
  box-shadow: 0 6px 22px rgba(20, 140, 80, 0.38);
}

@keyframes mg-hud-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45) rotate(-12deg);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.72) rotate(5deg);
  }
  42% {
    transform: translate(-50%, -50%) scale(1.48) rotate(-4deg);
  }
  68% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.58) rotate(2deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mg-hud-burst {
    animation: none;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.35) rotate(0deg);
  }

  .mg-hud-bump-source {
    transition: none;
  }
}

/* ---- components/overlay.css ---- */
/**
 * Modal overlay + panel (dashboard highscores, in-game save).
 * In-game save (#gameOverOverlay) docks to the bottom so a centre
 * "Tap to continue" cannot land on name / Save after hit-freeze.
 */

.mg-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  background: var(--mg-overlay-scrim);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Game-over save sheet: bottom dock (thumb zone; clear of centre continue tap). */
#gameOverOverlay.mg-overlay {
  align-items: flex-end;
  padding-top: max(2.5rem, env(safe-area-inset-top, 0px));
}

#gameOverOverlay .mg-panel {
  width: min(100%, 24rem);
  margin: 0;
  border-radius: var(--mg-radius) var(--mg-radius) 0 0;
  animation: mg-sheet-up 0.28s ease-out;
}

@keyframes mg-sheet-up {
  from {
    transform: translateY(12%);
    opacity: 0.85;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.mg-panel {
  width: min(100%, 24rem);
  margin: 0.5rem 0;
  max-height: none;
  border-radius: var(--mg-radius);
  border: 1px solid var(--mg-line);
  background: var(--mg-surface);
  color: var(--mg-ink);
  padding: 1.25rem;
  box-shadow: 0 18px 50px rgba(21, 32, 51, 0.18);
}

.mg-panel--wide {
  width: min(100%, 28rem);
}

.mg-panel h2 {
  font-family: var(--mg-display);
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
}

.mg-panel p {
  margin: 0 0 1rem;
  color: var(--mg-muted);
  line-height: 1.4;
}

/* ---- components/hit-freeze.css ---- */
/**
 * Collision freeze overlay — flash + funny line, tap to open save sheet.
 * Stays up briefly after the continue tap (see hit-freeze.js) so the same
 * gesture cannot click-through into the game-over form.
 */

.mg-hit-freeze {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  background: rgba(18, 24, 36, 0.42);
  border-radius: inherit;
}

.mg-hit-freeze[hidden] {
  display: none !important;
}

.mg-hit-freeze--flash {
  animation: mg-hit-flash 0.55s ease-out;
}

@keyframes mg-hit-flash {
  0% {
    background: rgba(255, 72, 72, 0.78);
  }
  35% {
    background: rgba(255, 160, 90, 0.45);
  }
  100% {
    background: rgba(18, 24, 36, 0.42);
  }
}

.mg-hit-freeze__msg {
  margin: 0;
  max-width: 16rem;
  font-family: var(--mg-display);
  font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.mg-hit-freeze__hint {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
}

/* ---- components/test-pin.css ---- */
/**
 * Soft test PIN gate overlay (assets/js/test-pin-gate.js).
 * Sits over the playfield / start overlay while a game is in test lock.
 */

.mg-test-pin {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.25rem;
  border-radius: 1.35rem;
  background: rgba(35, 64, 86, 0.42);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(2px);
}

.mg-test-pin[hidden] {
  display: none !important;
}

.mg-test-pin > p {
  margin: 0;
  font-family: var(--mg-display, "Syne", sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.mg-test-pin__form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  width: min(100%, 14rem);
}

.mg-test-pin__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.mg-test-pin__input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.92);
  color: #234056;
  font-family: var(--mg-display, "Syne", sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
}

.mg-test-pin__input:focus {
  outline: 2px solid #38b2ac;
  outline-offset: 2px;
}

.mg-test-pin__error {
  margin: 0;
  font-family: var(--mg-sans, "DM Sans", sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffe0e0;
  text-shadow: none;
}

.mg-test-pin__error[hidden] {
  display: none !important;
}

/* ---- components/messages.css ---- */
/**
 * Inline feedback messages.
 */

.mg-msg {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.mg-msg--error {
  color: var(--mg-danger);
}

.mg-msg--ok {
  color: var(--mg-ok);
}

/* ---- components/pull-refresh.css ---- */
/**
 * Pull-to-refresh indicator (Home Screen / Safari).
 */

.mg-pull-refresh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 10000;
  background: linear-gradient(
    180deg,
    rgba(243, 247, 251, 0.96),
    rgba(243, 247, 251, 0.72)
  );
  transition: height 0.12s ease-out;
}

.mg-pull-refresh__label {
  margin: 0 0 0.55rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--mg-font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mg-muted);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--mg-line);
}

.mg-pull-refresh.is-ready .mg-pull-refresh__label {
  color: var(--mg-accent);
  border-color: rgba(15, 122, 106, 0.35);
}

.mg-pull-refresh.is-busy .mg-pull-refresh__label {
  color: var(--mg-ink);
}

/* ---- components/push.css ---- */
/**
 * Hub notifications (Web Push) control.
 */

.mg-hub-tools {
  margin: -0.85rem 0 1rem;
}

.mg-text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mg-accent);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.25rem 0;
  min-height: 2.25rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.mg-text-btn:hover {
  color: var(--mg-ink);
}

.mg-panel__lead {
  margin: 0 0 0.85rem;
  color: var(--mg-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.mg-push-prefs {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.mg-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--mg-ink);
  cursor: pointer;
}

.mg-check input {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--mg-accent);
}

/* ---- components/install-banner.css ---- */
/**
 * Soft PWA install banner (hub, mobile).
 */

.mg-install {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  z-index: 35;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem 0.75rem;
  align-items: start;
  padding: 0.85rem 0.9rem;
  border-radius: var(--mg-radius);
  border: 1px solid var(--mg-line);
  background: var(--mg-surface);
  box-shadow: var(--mg-shadow);
  color: var(--mg-ink);
}

.mg-install[hidden] {
  display: none !important;
}

.mg-install__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  object-fit: cover;
  background: var(--mg-bg1);
}

.mg-install__copy {
  min-width: 0;
}

.mg-install__title {
  margin: 0 0 0.2rem;
  font-family: var(--mg-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.mg-install__body {
  margin: 0;
  color: var(--mg-muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.mg-install__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mg-muted);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  cursor: pointer;
  min-height: 2rem;
}

.mg-install__close:hover {
  color: var(--mg-ink);
}

.mg-install__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mg-install__actions .mg-btn {
  flex: 1 1 auto;
  min-width: 7rem;
  min-height: 2.5rem;
  font-size: 0.92rem;
}

@media (min-width: 901px) {
  .mg-install {
    left: auto;
    right: 1.25rem;
    bottom: 1.25rem;
    width: min(22rem, calc(100vw - 2.5rem));
  }
}

/* ---- components/legal.css ---- */
/**
 * Footer links + long-form legal / privacy pages.
 */

.mg-legal-footer {
  width: min(100% - 1.5rem, 42rem);
  margin: 1.5rem auto 0;
  padding: 1rem 0 1.75rem;
  border-top: 1px solid var(--mg-line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.82rem;
  color: var(--mg-muted);
}

.mg-legal-footer a {
  color: var(--mg-muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.mg-legal-footer a:hover {
  color: var(--mg-ink);
}

.mg-legal-footer a[aria-current="page"] {
  color: var(--mg-ink);
  text-decoration: none;
  font-weight: 600;
}

.mg-prose {
  max-width: 36rem;
}

.mg-prose h1 {
  font-family: var(--mg-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.mg-prose h2 {
  font-family: var(--mg-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 1.6rem 0 0.45rem;
}

.mg-prose p,
.mg-prose li {
  color: var(--mg-ink);
  font-size: 0.98rem;
  line-height: 1.55;
}

.mg-prose p {
  margin: 0 0 0.85rem;
}

.mg-prose ul {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
}

.mg-prose .mg-muted {
  color: var(--mg-muted);
  font-size: 0.88rem;
}

.mg-email a {
  color: var(--mg-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@media (min-width: 640px) {
  .mg-legal-footer {
    width: min(100% - 2rem, 52rem);
  }
}
