.m3j-game .m3j-score-value,
.m3j-game .m3j-hud-stars {
  display: grid;
  justify-items: center;
  min-width: 0;
  overflow: hidden;
}

.m3j-game .m3j-score-value strong {
  width: 100%;
  max-width: none;
  overflow: visible;
  font-size: clamp(15px, 4vw, 23px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.m3j-game .match3-goals>header{display:flex!important;align-items:center;justify-content:space-between}
.m3j-game .match3-goals>header>[data-match3-stars]{
  display:block;min-width:4.5em;color:#fde68a;font-size:clamp(13px,3.7vw,17px);
  letter-spacing:.06em;line-height:1;text-align:right;text-shadow:0 0 14px rgba(245,158,11,.42)
}

.m3j-game .m3j-hud-stars { gap: 1px; }
.m3j-game .m3j-hud-stars strong {
  color: #fde68a;
  font-size: clamp(9px, 2.6vw, 13px);
  letter-spacing: -.08em;
  line-height: 1;
  text-shadow: 0 0 12px rgba(245, 158, 11, .42);
}

.m3j-game [data-match3-time] {
  display: inline-block;
  min-width: 4.2ch;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Desktop Journey cockpit: the board stays central while live information sits beside it. */
@media (min-width: 901px) {
  .match3-game-page.m3j-game {
    width: min(100%, 1080px);
    max-width: 1080px;
    padding-inline: 22px;
  }

  .m3j-game .match3-game-shell {
    display: grid;
    grid-template-columns: minmax(0, 650px) minmax(245px, 285px);
    grid-template-rows: auto auto 1fr auto;
    align-items: start;
    justify-content: center;
    column-gap: clamp(18px, 2.2vw, 30px);
    row-gap: 10px;
    padding: 16px 20px 18px;
  }

  .m3j-game .m3j-play-nav {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    margin: 0;
  }

  .m3j-game .match3-board-wrap {
    grid-column: 1;
    grid-row: 2 / 4;
    width: min(100%, 620px);
    margin: 0 0 0 30px;
  }

  .m3j-game .match3-touch-hint {
    grid-column: 1;
    grid-row: 4;
    margin: 0 0 0 30px;
  }

  .m3j-game .match3-hud,
  .m3j-game .match3-goals {
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--m3j-level-accent, #f472b6) 24%, #ffffff12);
    background:
      radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--m3j-level-accent, #f472b6) 18%, transparent), transparent 38%),
      linear-gradient(155deg, rgba(24, 17, 43, .92), rgba(6, 13, 27, .94));
    box-shadow: inset 0 1px rgba(255,255,255,.08), 0 18px 42px rgba(0,0,0,.32);
    backdrop-filter: blur(16px) saturate(1.15);
  }

  .m3j-game .match3-hud {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(98px, 1.45fr) minmax(54px, .76fr) minmax(54px, .76fr) 34px;
    align-items: center;
    gap: 5px;
    padding: 6px;
    border-radius: 18px;
  }

  .m3j-game .match3-hud > div,
  .m3j-game .match3-hud > .m3j-hud-audio {
    min-height: 64px;
    padding: 7px 4px;
    border-color: rgba(255,255,255,.09);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  }

  .m3j-game .match3-hud > .m3j-score-value {
    background: linear-gradient(145deg, rgba(236,72,153,.17), rgba(124,58,237,.07));
  }

  .m3j-game .match3-hud > .m3j-hud-moves {
    background: linear-gradient(145deg, rgba(251,191,36,.17), rgba(245,158,11,.045));
    box-shadow: inset 0 1px rgba(254,240,138,.12);
  }

  .m3j-game .match3-hud > .m3j-hud-time {
    padding-inline: 2px;
    background: linear-gradient(145deg, rgba(34,211,238,.16), rgba(59,130,246,.045));
    box-shadow: inset 0 1px rgba(165,243,252,.12);
  }

  .m3j-game .match3-hud small { font-size: 7px; }
  .m3j-game .match3-hud strong { font-size: 19px; }
  .m3j-game .match3-hud > .m3j-hud-primary strong {
    font-size: clamp(23px, 2vw, 27px);
    line-height: .95;
  }

  .m3j-game .match3-hud > .m3j-hud-time strong {
    font-size: clamp(18px, 1.35vw, 20px);
  }

  .m3j-game .match3-hud > .m3j-hud-audio {
    width: 34px;
    min-width: 34px;
    min-height: 38px;
    padding: 3px;
    align-self: center;
    border-radius: 12px;
  }

  .m3j-game .m3j-hud-audio small { display: none; }
  .m3j-game .m3j-hud-audio strong { font-size: 15px; }
  .m3j-game .m3j-hud-stars strong { font-size: 12px; }

  .m3j-game .match3-goals {
    grid-column: 2;
    grid-row: 3;
    display: grid !important;
    align-content: start;
    gap: 9px !important;
    padding: 11px !important;
    border-radius: 22px !important;
  }

  .m3j-game .match3-goals > header {
    display: flex !important;
    padding: 1px 2px 7px !important;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .m3j-game .match3-goals > header span {
    color: #fbcfe8;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .15em;
  }

  .m3j-game .match3-goals > header strong {
    color: #fde68a;
    text-shadow: 0 0 14px rgba(245,158,11,.45);
  }

  .m3j-game .m3j-objective-chips {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .m3j-game .m3j-objective-chips > span {
    display: grid;
    min-width: 0 !important;
    min-height: 52px !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    padding: 7px !important;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 15px !important;
    background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  }

  .m3j-game .m3j-objective-chips > span > b {
    display: block !important;
    overflow: hidden;
    color: #dbeafe;
    font-size: 7px !important;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .m3j-game .m3j-objective-chips > span > small {
    right: 5px;
    bottom: 5px;
  }

  .m3j-game .m3j-objective-piece,
  .m3j-game .m3j-objective-chips .m3j-color-key {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
  }

  .m3j-game .m3j-star-track {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .m3j-game .m3j-star-track > [data-match3-goal] {
    min-height: 40px;
    border: 1px solid rgba(251,191,36,.13) !important;
    border-radius: 12px !important;
    background: linear-gradient(90deg, rgba(245,158,11,.08), rgba(255,255,255,.025)) !important;
  }

  .m3j-game .m3j-star-track > [data-match3-goal] > span { font-size: 11px; }
  .m3j-game .m3j-star-track > [data-match3-goal] > b { font-size: 8px !important; }
}

@media (max-width: 900px) {
  .m3j-game .m3j-score-value strong { font-size: clamp(15px, 4.8vw, 20px); }
  .m3j-game .m3j-hud-primary strong { font-size: clamp(19px, 5.8vw, 25px); }
}
