/* 4detki — five mobile play screens 1.45.0 */
.games-play-mobile-v5 {
  --g5-ink: #07113f;
  --g5-pink: #fa0061;
  --g5-blue: #075fbe;
  --g5-line: #d6e7f3;
  --g5-soft: #eef8fe;
  --g5-shadow: 0 14px 38px rgba(34, 85, 125, .13);
}

.g5-playbar,
.g5-pause,
.g5-menu,
.g5-head-actions,
.g5-hidden-room {
  display: none;
}

.g5-talk-controls {
  display: none;
}

@media (max-width: 720px) {
  html:has(body.games-play-mobile-v5) { background: #eaf6fd; }
  body.games-play-mobile-v5 {
    min-height: 100dvh;
    color: var(--g5-ink);
    background: linear-gradient(180deg, #f9fdff, #edf8fe);
    overflow-x: hidden;
  }

  .games-play-mobile-v5 .container { width: min(100% - 20px, 540px); }
  .games-play-mobile-v5 .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid #e2edf5;
    box-shadow: 0 4px 20px rgba(33, 85, 125, .07);
    backdrop-filter: blur(14px);
  }
  .games-play-mobile-v5 .site-header__inner { width: 100%; min-height: 70px; padding: 9px 13px; gap: 9px; }
  .games-play-mobile-v5 .brand { gap: 9px; color: var(--g5-ink); font-size: 1.32rem; font-weight: 900; letter-spacing: -.05em; }
  .games-play-mobile-v5 .brand > span:not(.brand__mark) { display: inline !important; }
  .games-play-mobile-v5 .brand__mark { width: 47px; height: 47px; border-radius: 13px; color: #fff; background: linear-gradient(145deg,#ff1672,#ec0055); box-shadow: 0 7px 15px rgba(244,0,91,.18); font-size: 1.9rem; }
  .games-play-mobile-v5 .main-nav,
  .games-play-mobile-v5 .catalog-nav { display: none !important; }

  .g5-head-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
  .g5-head-action { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px; gap: 5px; color: var(--g5-ink); background: #f4faff; border: 1px solid #dfebf4; border-radius: 12px; font: inherit; font-size: .82rem; font-weight: 800; text-decoration: none; }
  .g5-head-action b { font-size: 1.35rem; }
  .g5-head-action--search { font-size: 0; }

  .games-play-mobile-v5 .breadcrumbs,
  .games-play-mobile-v5 .mini-game-heading,
  .games-play-mobile-v5 .activity-nav,
  .games-play-mobile-v5 .mini-game-info,
  .games-play-mobile-v5 .games-section,
  .games-play-mobile-v5 .site-footer,
  .games-play-mobile-v5 .monkey-intro__heading,
  .games-play-mobile-v5 .monkey-quick-start { display: none !important; }

  .games-play-mobile-v5 .mini-game-hero,
  .games-play-mobile-v5 .monkey-intro { padding: 0 0 18px; background: transparent; }
  .games-play-mobile-v5 .mini-game-hero > .container,
  .games-play-mobile-v5 .monkey-intro > .container { width: 100%; }

  .g5-playbar {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 7px;
    min-height: 49px;
    width: min(100% - 20px, 540px);
    margin: 0 auto;
    border-bottom: 1px solid #e0ebf3;
  }
  .g5-playbar__back { display: flex; min-width: 0; align-items: center; gap: 7px; color: var(--g5-ink); font-size: 1.05rem; font-weight: 900; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .g5-playbar__back::before { content: "‹"; flex: none; font-size: 2rem; font-weight: 500; line-height: .7; }
  .g5-playbar button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--g5-ink); background: #f4faff; border: 1px solid #d7e7f3; border-radius: 50%; font: inherit; font-size: 1.15rem; }

  .games-play-mobile-v5 .mini-game-shell,
  .games-play-mobile-v5 .monkey-game {
    width: min(100% - 16px, 540px);
    margin: 0 auto;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .games-play-mobile-v5 .mini-game-toolbar {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 7px 2px;
    border: 0;
    background: transparent;
  }
  .games-play-mobile-v5 .mini-game-toolbar__stats { display: flex; width: 100%; gap: 7px; justify-content: space-between; }
  .games-play-mobile-v5 .mini-game-stat { flex: 1; min-height: 39px; display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; color: var(--g5-ink); background: rgba(255,255,255,.92); border: 1px solid #dbeaf4; border-radius: 11px; font-size: .78rem; box-shadow: 0 4px 14px rgba(37,83,119,.05); }
  .games-play-mobile-v5 .mini-game-stat strong { margin-left: 4px; font-size: .92rem; }
  .games-play-mobile-v5 .mini-game-toolbar__actions { width: 100%; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .games-play-mobile-v5 .mini-game-levels { display: flex; flex: 1 0 auto; gap: 6px; }
  .games-play-mobile-v5 .mini-game-levels button,
  .games-play-mobile-v5 .mini-game-button { min-height: 38px; padding: 7px 11px; color: #0e4d90; background: #f4faff; border: 1px solid #d7e7f3; border-radius: 10px; font-size: .72rem; white-space: nowrap; }
  .games-play-mobile-v5 .mini-game-levels button[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg,#1689f0,#0764c6); border-color: transparent; }

  .games-play-mobile-v5 .mini-game-canvas { padding: 7px; overflow: hidden; background: #eaf6fd; border: 1px solid #d7e7f3; border-radius: 15px; box-shadow: var(--g5-shadow); }
  .games-play-mobile-v5 .mini-game-status { margin: 7px 0; min-height: 37px; padding: 8px 12px; color: #155194; background: rgba(255,255,255,.85); border: 1px solid #d8e8f3; border-radius: 10px; font-size: .79rem; text-align: center; }
  .games-play-mobile-v5 .mini-game-finish { position: fixed; z-index: 125; right: 10px; bottom: 10px; left: 10px; max-width: 520px; margin: auto; border-radius: 20px; box-shadow: 0 22px 70px rgba(5,30,70,.28); }

  /* Talking monkey: keep all original hit zones and voice logic over the richer scene. */
  .games-play-mobile-v5 .monkey-game { display: block; }
  .games-play-mobile-v5 .monkey-game__stage-wrap { padding: 0; background: transparent; }
  .games-play-mobile-v5 .monkey-game__topbar { display: none; }
  .games-play-mobile-v5 .monkey-needs { display: none; }
  .games-play-mobile-v5 .monkey-need { min-width: 0; padding: 5px 8px; border-radius: 9px; background: rgba(255,255,255,.88); }
  .games-play-mobile-v5 .monkey-need:nth-child(3) { display: none; }
  .games-play-mobile-v5 .monkey-need div { font-size: .68rem; }
  .games-play-mobile-v5 .monkey-stage { width: 100%; min-height: 0; aspect-ratio: 4 / 3; border: 1px solid #d3e6f3; border-radius: 15px; background: url('/assets/images/games/play-v5/talking.webp') center / cover no-repeat; box-shadow: var(--g5-shadow); }
  .games-play-mobile-v5 .monkey-stage__sun,
  .games-play-mobile-v5 .monkey-stage__leaf,
  .games-play-mobile-v5 .monkey-stage__ground,
  .games-play-mobile-v5 .monkey-character picture,
  .games-play-mobile-v5 .monkey-reaction-sprite { visibility: hidden; }
  .games-play-mobile-v5 .monkey-character { width: 56%; height: 88%; left: 3%; top: 5%; bottom: auto; }
  .games-play-mobile-v5 .monkey-speech { top: 11%; right: 4%; left: auto; width: 46%; max-width: 46%; padding: 9px 11px; color: var(--g5-ink); background: transparent; box-shadow: none; font-size: .88rem; text-align: center; }
  .games-play-mobile-v5 .monkey-stage__hint { display: none; }
  .games-play-mobile-v5 .monkey-panel { display: none; }
  .g5-talk-controls { display: grid; grid-template-columns: 106px minmax(0,1fr); gap: 8px; margin-top: 9px; padding: 9px; background: #fff; border: 1px solid var(--g5-line); border-radius: 15px; box-shadow: var(--g5-shadow); }
  .g5-talk-controls .monkey-talk-button { grid-column: 1; grid-row: 1; width: 106px; min-height: 106px; padding: 8px; color: #fff; background: linear-gradient(145deg,#ff1470,#ee0057); border: 5px solid #fff; outline: 2px solid #f7c2d6; border-radius: 50%; box-shadow: 0 10px 25px rgba(244,0,91,.23); font: inherit; font-size: .72rem; font-weight: 850; }
  .g5-talk-controls .monkey-talk-button__icon { display: block; margin-bottom: 3px; font-size: 1.3rem; }
  .g5-talk-controls__side { grid-column: 2; min-width: 0; }
  .g5-talk-controls .monkey-game__friendship { display: flex; min-height: 34px; align-items: center; justify-content: center; gap: 5px; margin-bottom: 6px; color: #7045bb; background: #f7f1ff; border-radius: 9px; font-size: .75rem; }
  .g5-talk-controls .monkey-snacks { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
  .g5-talk-controls .monkey-snacks button { min-width: 0; min-height: 65px; padding: 5px 2px; color: #0d4e90; background: #f3f9fd; border: 1px solid #d7e7f3; border-radius: 10px; font: inherit; font-size: .62rem; }
  .g5-talk-controls .monkey-snacks span { display: block; font-size: 1.35rem; }
  .g5-talk-controls .monkey-snacks strong { display: block; overflow: hidden; text-overflow: ellipsis; }
  .g5-talk-controls .monkey-replay-button { grid-column: 1 / -1; min-height: 42px; color: #0b569d; background: #eef8fe; border: 1px solid #d7e7f3; border-radius: 10px; font: inherit; font-weight: 800; }
  .g5-talk-controls .monkey-status { grid-column: 1 / -1; min-height: 34px; margin: 0; color: #155194; font-size: .73rem; line-height: 1.25; text-align: center; }

  /* Puzzle */
  .games-play-mobile-v5 .puzzle-layout { display: block; }
  .games-play-mobile-v5 .puzzle-guide { display: none; }
  .games-play-mobile-v5 .puzzle-board { width: 100%; max-width: none; aspect-ratio: 1; padding: 3px; gap: 3px; border-radius: 12px; background: #d4e8f4; box-shadow: none; }
  .games-play-mobile-v5 .puzzle-tile { border-radius: 7px; background-image: url('/assets/images/games/play-v5/puzzle.webp') !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.8); }
  .games-play-mobile-v5 .puzzle-tile.is-selected { box-shadow: inset 0 0 0 4px #fff, 0 0 0 3px var(--g5-pink); }

  /* Differences: the two original interactive scenes crop one approved illustration. */
  .games-play-mobile-v5 .difference-wrap { max-width: none; }
  .games-play-mobile-v5 .difference-scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .games-play-mobile-v5 .difference-scene { width: 100%; aspect-ratio: 2 / 3; min-height: 0; border: 0; border-radius: 10px; background-image: url('/assets/images/games/play-v5/differences.webp') !important; background-size: 200% 100% !important; background-repeat: no-repeat !important; box-shadow: none; }
  .games-play-mobile-v5 .difference-scene:first-child { background-position: left center !important; }
  .games-play-mobile-v5 .difference-scene:last-child { background-position: right center !important; }
  .games-play-mobile-v5 .difference-scene__label,
  .games-play-mobile-v5 .difference-scene__window,
  .games-play-mobile-v5 .difference-scene__shelf,
  .games-play-mobile-v5 .difference-scene__monkey { display: none; }
  .games-play-mobile-v5 .difference-hotspot { width: 15%; height: 20%; color: transparent; background: transparent; border: 0; }
  .games-play-mobile-v5 .difference-hotspot::after { border-color: transparent; }
  .games-play-mobile-v5 .difference-hotspot.is-found::after { border: 4px solid #18b958; background: rgba(255,255,255,.1); }
  .games-play-mobile-v5 .difference-hotspot.is-hint::before { color: var(--g5-pink); }
  .games-play-mobile-v5 .difference-hotspot[data-difference="sky"] { top: 3%; left: 8%; right: auto; }
  .games-play-mobile-v5 .difference-hotspot[data-difference="window"] { top: 22%; right: 25%; left: auto; }
  .games-play-mobile-v5 .difference-hotspot[data-difference="badge"] { top: auto; bottom: 2%; left: 6%; }
  .games-play-mobile-v5 .difference-hotspot[data-difference="ball"] { right: 8%; bottom: 3%; }
  .games-play-mobile-v5 .difference-hotspot[data-difference="flower"] { top: 54%; right: 10%; bottom: auto; left: auto; }
  .games-play-mobile-v5 .difference-hint { display: none; }

  /* Memory */
  .games-play-mobile-v5 .memory-wrap { max-width: none; }
  .games-play-mobile-v5 .memory-board { gap: 7px; }
  .games-play-mobile-v5 .memory-card { min-height: 77px; border-radius: 11px; }
  .games-play-mobile-v5 .memory-card__front { color: #fff; background: linear-gradient(145deg,#ff86b2,#f14687); border: 3px solid #ffadd0; font-size: 0; }
  .games-play-mobile-v5 .memory-card__front::after { content: "4"; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.24); font-size: 1.55rem; font-weight: 950; }
  .games-play-mobile-v5 .memory-card__back { color: var(--g5-ink); background: #fff; border: 2px solid #55cf80; font-size: 1.85rem; }

  /* The fifth screen becomes the promised find-three-items game on mobile. */
  .games-play-mobile-v5 [data-monkey-mini-game="room"] .room-layout,
  .games-play-mobile-v5 [data-monkey-mini-game="room"] > .mini-game-toolbar { display: none; }
  .g5-hidden-room { display: block; }
  .g5-hidden-room__tasks { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 7px; }
  .g5-hidden-room__task { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 7px; color: var(--g5-ink); background: #fff; border: 1px solid #d6e7f3; border-radius: 10px; font-size: .71rem; font-weight: 800; }
  .g5-hidden-room__task b { font-size: 1.25rem; }
  .g5-hidden-room__task.is-found { color: #0a8d45; border-color: #4bd27f; }
  .g5-hidden-room__stage { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: url('/assets/images/games/play-v5/room.webp') center / cover no-repeat; border-radius: 11px; }
  .g5-hidden-room__object { position: absolute; width: 20%; height: 24%; border: 0; border-radius: 50%; color: transparent; background: transparent; }
  .g5-hidden-room__object::after { position: absolute; inset: 0; display: none; place-items: center; content: "✓"; color: #fff; background: rgba(28,190,92,.82); border: 4px solid #fff; border-radius: 50%; font-size: 1.6rem; box-shadow: 0 4px 18px rgba(3,80,39,.25); }
  .g5-hidden-room__object.is-found::after,
  .g5-hidden-room__object.is-hint::after { display: grid; }
  .g5-hidden-room__object.is-hint::after { content: "?"; color: var(--g5-pink); background: rgba(255,255,255,.82); border-color: var(--g5-pink); animation: g5-pulse .9s ease-in-out infinite alternate; }
  .g5-hidden-room__object[data-object="crown"] { left: 30%; bottom: 0; }
  .g5-hidden-room__object[data-object="glasses"] { left: 51%; bottom: 0; }
  .g5-hidden-room__object[data-object="star"] { right: 1%; bottom: 1%; }
  .g5-hidden-room__hint { width: 100%; min-height: 48px; margin-top: 8px; color: var(--g5-pink); background: #fff; border: 2px solid var(--g5-pink); border-radius: 12px; font: inherit; font-weight: 850; }

  .g5-pause,
  .g5-menu { position: fixed; inset: 0; z-index: 150; background: rgba(6,21,52,.45); backdrop-filter: blur(6px); }
  .g5-pause.is-open,
  .g5-menu.is-open { display: grid; place-items: center; }
  .g5-pause__panel,
  .g5-menu__panel { width: min(calc(100% - 24px), 380px); padding: 22px; color: var(--g5-ink); background: #fff; border-radius: 22px; box-shadow: 0 24px 70px rgba(4,24,62,.3); }
  .g5-pause__panel { text-align: center; }
  .g5-pause__panel h2 { margin: 0 0 6px; }
  .g5-pause__panel p { margin: 0 0 16px; color: #315b8c; }
  .g5-pause__panel button,
  .g5-pause__panel a { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 49px; margin-top: 8px; color: #fff; background: linear-gradient(135deg,#ff0c69,#f00056); border: 0; border-radius: 12px; font: inherit; font-weight: 850; text-decoration: none; }
  .g5-pause__panel a { color: #0b559d; background: #eef8fe; }
  .g5-menu__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .g5-menu__close { width: 40px; height: 40px; border: 0; border-radius: 11px; background: #eff7fc; font-size: 1.3rem; }
  .g5-menu nav { display: grid; gap: 6px; }
  .g5-menu nav a { display: flex; align-items: center; min-height: 46px; padding: 0 12px; color: var(--g5-ink); background: #f5faff; border-radius: 10px; font-weight: 750; text-decoration: none; }

  body.g5-paused main { pointer-events: none; filter: saturate(.7); }
  body.g5-muted .g5-playbar__sound { color: #8296aa; }
}

@keyframes g5-pulse { to { transform: scale(1.1); } }

@media (max-width: 390px) {
  .games-play-mobile-v5 .brand { font-size: 1.16rem; }
  .games-play-mobile-v5 .brand__mark { width: 43px; height: 43px; }
  .g5-head-action { min-width: 40px; padding-inline: 7px; }
  .g5-head-action span:last-child { display: none; }
  .games-play-mobile-v5 .memory-card { min-height: 65px; }
}

@media (orientation: landscape) and (max-height: 540px) and (max-width: 960px) {
  .games-play-mobile-v5 .site-header { display: none; }
  .g5-playbar { min-height: 43px; }
  .games-play-mobile-v5 .monkey-game__stage-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 8px; }
  .games-play-mobile-v5 .monkey-stage { width: 100%; }
  .g5-talk-controls { min-height: 0; margin-top: 0; }
  .games-play-mobile-v5 .difference-scenes { grid-template-columns: 1fr 1fr; }
  .games-play-mobile-v5 .mini-game-canvas { max-height: calc(100dvh - 100px); overflow-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .games-play-mobile-v5 *,
  .games-play-mobile-v5 *::before,
  .games-play-mobile-v5 *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
