/* Scoped classroom game styles. The host's teacher/video visuals are untouched. */
.mathura-mini-games {
  --mg-ink: #513b50;
  --mg-muted: #826d69;
  --mg-line: #ead8ba;
  --mg-paper: #fffdf5;
  --mg-coral: #df5873;
  --mg-green: #41856f;
  width: 100%;
  color: var(--mg-ink);
  font-family: "Nunito", "Noto Sans Devanagari", sans-serif;
}
.mathura-mini-games * { box-sizing: border-box; }
.mathura-mini-games button { font: inherit; color: inherit; }
.mathura-mini-games button:focus-visible { outline: 3px solid #785467; outline-offset: 3px; }
.mg-shell {
  width: 100%;
  min-width: 0;
  padding: clamp(15px, 3vw, 25px);
  overflow: hidden;
  border: 2px solid #b9ddd5;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 95% 3%, #e2f4e8 0, transparent 34%),
    linear-gradient(145deg, #fffdf5, #fff8e9);
  box-shadow: 0 10px 24px #79542b12;
  animation: mg-arrive .32s ease-out both;
}
.mg-topline { display:flex; align-items:center; gap:9px; min-height:36px; color:#8a776a; font-size:.74rem; font-weight:1000; letter-spacing:.07em; }
.mg-class-mark { display:grid; place-items:center; width:32px; height:32px; border-radius:11px; background:#e7f3dc; }
.mg-class-mark svg { width:25px; height:25px; }
.mg-reset { margin-left:auto; border:1px solid #e7d8bf; border-radius:999px; min-height:37px; padding:7px 13px; background:#fffaf0; color:#806b5f!important; cursor:pointer; font-size:.78rem!important; font-weight:900!important; letter-spacing:0!important; transition:background .16s, transform .16s; }
.mg-reset:hover { transform:translateY(-1px); background:#ffefcf; }
.mg-header { display:flex; justify-content:space-between; align-items:end; gap:16px; margin:17px 0 0; }
.mg-heading { min-width:0; }
.mg-kicker,.mg-prompt-label { margin:0 0 4px; color:#ae7967; font-size:.65rem; font-weight:1000; letter-spacing:.14em; }
.mg-heading h2 { margin:0; color:#5c464a; font:800 clamp(1.55rem,4vw,2.1rem)/1.08 "Baloo 2","Noto Sans Devanagari",sans-serif; letter-spacing:-.02em; }
.mg-subtitle { margin:2px 0 0; color:#b45d73; font:700 1rem/1.5 "Noto Sans Devanagari","Baloo 2",sans-serif; }
.mg-progress-box { flex:0 0 154px; display:grid; gap:7px; align-self:center; }
.mg-round { color:#94795f; text-align:right; font-size:.65rem; letter-spacing:.12em; font-weight:1000; }
.mg-progress-track { height:8px; overflow:hidden; border-radius:99px; background:#efdfbf; }
.mg-progress-track span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#65ad91,#e7ad51); transition:width .3s ease; }
.mg-intro { margin:12px 0 17px; max-width:650px; color:#77666a; font-size:.89rem; line-height:1.5; }
.mg-play { min-width:0; }
.mg-scene { position:relative; overflow:hidden; border:1px solid #c5dfbe; border-radius:18px; background:#d9f0de; }
.mg-scene svg { display:block; width:100%; height:auto; }
.mg-scene>svg { height:clamp(180px,32vw,300px); }
.mg-jumper { position:absolute; width:clamp(38px,8vw,62px); transform:translate(-50%,-100%); pointer-events:none; z-index:3; }
.mg-jump-zone { position:absolute; width:100%; left:0; border:0; cursor:pointer; background:transparent; text-align:left; }
.mg-zone-river { top:26%; height:43%; }
.mg-zone-bank { bottom:0; height:28%; min-height:48px; text-align:right; }
.mg-jump-zone span { display:inline-grid; margin:0 4%; padding:2px 8px; background:#fff9eae8; border:2px dashed #468f80; border-radius:12px; color:#84516b; font:700 clamp(.95rem,3vw,1.3rem)/1.2 "Noto Sans Devanagari",sans-serif; }
.mg-jump-zone small { display:block; margin-top:2px; font:800 clamp(.62rem,2vw,.85rem) "Nunito",sans-serif; color:#3e7263; }
.mg-jump-zone:hover:not(:disabled) span { background:#fff1bf; border-color:#c48b3e; }
.mg-jump-zone:disabled { cursor:default; }
.mg-scene-tags { position:absolute; inset:auto 10px 10px; display:flex; justify-content:space-between; pointer-events:none; }
.mg-scene-tags span { padding:5px 9px; border:1px solid #ffffffbc; border-radius:10px; background:#fffdf0e8; color:#6b7660; font-size:.59rem; font-weight:1000; letter-spacing:.08em; }
.mg-scene-tags b { display:block; color:#ae5470; font:700 .91rem "Noto Sans Devanagari",sans-serif; letter-spacing:0; }
.mg-task { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:14px 0 11px; padding:12px 15px; border:1px solid #eddbbc; border-radius:16px; background:#fff9e9; }
.mg-prompt-label { margin-bottom:3px; font-size:.59rem; }
.mg-call { margin:0; color:#b54f6d; font:700 clamp(1.6rem,4vw,2.1rem)/1.25 "Noto Sans Devanagari",sans-serif; }
.mg-instruction { margin:2px 0 0; color:#675458; font:800 .95rem/1.35 "Baloo 2","Noto Sans Devanagari",sans-serif; }
.mg-listen { display:inline-flex; align-items:center; justify-content:center; gap:7px; flex:none; min-height:41px; padding:7px 12px; border:1px solid #b9dccc; border-radius:12px; background:#e8f5e9; color:#397965!important; cursor:pointer; font:700 .96rem "Noto Sans Devanagari",sans-serif!important; }
.mg-listen span { display:grid; place-items:center; width:19px; height:19px; border-radius:50%; background:#c6e6d5; font:900 .75rem "Nunito",sans-serif; }
.mg-listen:hover { background:#d9eedf; }
.mg-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.mg-choice { display:flex; align-items:center; justify-content:flex-start; gap:10px; min-width:0; min-height:73px; padding:10px 14px; border:2px solid #ead7b8; border-radius:16px; background:#fffef8; box-shadow:0 3px 0 #e8d7b9; text-align:left; cursor:pointer; transition:transform .16s,background .16s,border-color .16s; }
.mg-choice:hover:not(:disabled) { transform:translateY(-2px); background:#fff5db; border-color:#e3bf71; }
.mg-choice:disabled { cursor:default; opacity:.75; }
.mg-choice>span:not(.mg-choice-mark):not(.mg-choice-picture) { color:#ae526b; font:700 1.27rem "Noto Sans Devanagari",sans-serif; }
.mg-choice small { margin-left:auto; color:#8c7669; font-size:.75rem; font-weight:900; }
.mg-choice-mark { display:grid; place-items:center; flex:none; width:38px; height:38px; border-radius:13px; background:#dff2ef; color:#4097a0; }
.mg-choice-mark svg { width:25px; height:25px; }.mg-bank-mark { background:#e6f0d9; color:#6b9b69; }
.mg-feedback { min-height:27px; margin:11px 2px 0; color:#827177; font-size:.83rem; font-weight:900; line-height:1.45; }
.mg-feedback.is-success { color:#39785e; }.mg-feedback.is-retry { color:#b16452; }
.mg-memory-intro { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.mg-pair-count { display:flex; align-items:baseline; gap:4px; color:#bd5573; font:800 1.25rem "Baloo 2",sans-serif; }
.mg-pair-count small { color:#8e7770; font:800 .68rem "Nunito",sans-serif; }
.mg-word-replays { display:flex; gap:7px; flex-wrap:wrap; margin:8px 0 11px; }
.mg-word-replays:empty { display:none; }
.mg-word-replays .mg-listen { min-height:34px; padding:4px 9px; font-size:.83rem!important; }
.mg-memory-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; max-width:620px; margin:0 auto; perspective:900px; }
.mg-memory-card { min-width:0; aspect-ratio:1.18; padding:0; border:0; border-radius:14px; background:transparent; cursor:pointer; perspective:700px; }
.mg-memory-card:disabled { cursor:default; }
.mg-card-inner { position:relative; display:block; width:100%; height:100%; transform-style:preserve-3d; transition:transform .4s cubic-bezier(.2,.75,.3,1); }
.mg-memory-card.is-flipped .mg-card-inner { transform:rotateY(180deg); }
.mg-card-back,.mg-card-front { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; overflow:hidden; padding:5px; border:2px solid #e4d2ae; border-radius:14px; backface-visibility:hidden; }
.mg-card-back { background:#e9f0d9; box-shadow:inset 0 -4px 0 #d3dfc0; color:#6b8168; font-size:.59rem; font-weight:1000; }
.mg-card-back svg { width:min(65%,58px); height:55%; }
.mg-card-front { transform:rotateY(180deg); border-color:#e7c9bd; background:#fffaf1; box-shadow:0 3px 0 #e5d1b5; }
.mg-memory-card.is-matched .mg-card-front { background:#e8f5e7; border-color:#91c6a4; }
.mg-card-front svg { width:min(72%,75px); max-height:60%; }
.mg-card-word { color:#a94f6a; font:700 clamp(1rem,4vw,1.45rem) "Noto Sans Devanagari",sans-serif; }
.mg-card-caption { color:#8b776d; font-size:.63rem; font-weight:900; }
.mg-parrot-stage { position:relative; display:grid; grid-template-columns:.78fr 1.22fr; align-items:center; gap:7px; min-height:188px; padding:11px 14px 24px; border:1px solid #d6e5bf; border-radius:19px; background:linear-gradient(145deg,#eaf4d9,#f8f2d4); }
.mg-parrot-art { position:relative; display:grid; place-items:center; min-width:0; }
.mg-parrot-art svg { width:min(100%,172px); height:auto; overflow:visible; }
.mg-parrot-speech { position:absolute; top:0; right:0; padding:5px 8px; border:1px solid #eadbbd; border-radius:12px 12px 12px 3px; background:#fffdf0; color:#a95167; font:800 .88rem "Baloo 2",sans-serif; }
.mg-parrot-art.is-happy svg { animation:mg-bob .36s ease-in-out 2 alternate; }
.mg-picnic-table { display:flex; align-items:center; gap:11px; min-width:0; padding:10px; border:1px solid #e9d6ac; border-radius:16px; background:#fffdf2; box-shadow:0 4px 0 #eadab8; }
.mg-request-art { display:flex; flex:none; flex-direction:column; align-items:center; justify-content:center; width:92px; height:103px; border-radius:14px; background:#e5f3ec; }
.mg-request-art svg { width:69px; height:62px; transition:transform .3s; }
.mg-request-art.is-served svg { transform:scale(1.12) translateY(-2px); }
.mg-request-art span { color:#75846b; font-size:.59rem; font-weight:900; }
.mg-request-copy h3 { margin:1px 0 3px; color:#684c4f; font:800 1.15rem "Baloo 2",sans-serif; }
.mg-request-copy>p:last-child { margin:0; color:#87736d; font-size:.72rem; line-height:1.35; }
.mg-feast-meter { position:absolute; right:14px; bottom:8px; display:flex; gap:5px; }
.mg-feast-meter span { width:17px; height:7px; border:1px solid #92b797; border-radius:99px; background:#fff9e8; }
.mg-feast-meter span.is-filled { background:#64a77c; border-color:#64a77c; }
.mg-picnic-task { margin-top:12px; margin-bottom:10px; padding:8px 12px; }
.mg-word-actions .mg-choice { justify-content:center; flex-wrap:wrap; gap:2px 8px; min-height:66px; padding:6px; }
.mg-choice-picture { display:flex; align-items:center; justify-content:center; width:39px; height:39px; border-radius:12px; background:#e4f1e8; }
.mg-choice-picture svg { width:34px; height:32px; }
.mg-word-actions .mg-choice small { margin-left:0; }
.mg-sentence-scene { display:flex; align-items:center; gap:12px; min-height:98px; padding:10px 13px; border:1px solid #e9d8b7; border-radius:16px; background:#fff7df; }
.mg-sentence-picture { display:grid; place-items:center; flex:none; width:76px; height:76px; border-radius:16px; background:#e6f2e8; }
.mg-sentence-picture svg { width:65px; height:60px; }
.mg-sentence-hint { margin:0 0 5px; color:#624e52; font:800 1rem "Baloo 2",sans-serif; }
.mg-sentence-scene .mg-listen { min-height:32px; padding:3px 9px; }
.mg-built-sentence { margin:13px 0 10px; padding:10px; border:2px dashed #d8c7ab; border-radius:15px; background:#fffdf6; }
.mg-answer-label { display:block; margin-bottom:8px; color:#9b806b; font-size:.57rem; font-weight:1000; letter-spacing:.13em; }
.mg-built-tiles { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-height:47px; }
.mg-empty-slot { color:#a28d80; font-size:.77rem; font-weight:800; }
.mg-built-tile,.mg-word-tile { min-height:43px; padding:5px 12px; border:2px solid #dbb6bf; border-radius:12px; background:#fff0ef; color:#a64c6c!important; cursor:pointer; font:700 1.12rem "Noto Sans Devanagari",sans-serif!important; box-shadow:0 3px 0 #edcfca; }
.mg-built-tile { display:flex; align-items:center; gap:7px; background:#e7f3e5; border-color:#bbd9b8; color:#3c795f!important; }
.mg-built-tile span { font:900 .8rem "Nunito",sans-serif; }
.mg-tile-tray { display:flex; justify-content:center; flex-wrap:wrap; gap:9px; padding:2px 0 11px; }
.mg-word-tile:not(:disabled):hover,.mg-built-tile:hover { transform:translateY(-2px); }
.mg-word-tile.is-used,.mg-word-tile:disabled { opacity:.42; cursor:default; }
.mg-sentence-controls { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.mg-primary-button,.mg-soft-button { min-height:42px; padding:8px 14px; border:0; border-radius:12px; cursor:pointer; font-weight:1000!important; transition:transform .15s,filter .15s; }
.mg-primary-button { background:#d94d71; color:#fff!important; box-shadow:0 4px 0 #aa365b; }
.mg-primary-button:hover:not(:disabled) { transform:translateY(-2px); filter:saturate(1.08); }
.mg-soft-button { border:1px solid #e5d4b4; background:#f5ebd5; color:#786352!important; }
.mg-soft-button:disabled,.mg-primary-button:disabled { opacity:.48; cursor:not-allowed; }
.mg-next { display:block; margin:10px 0 0 auto; }
.mg-finale { display:flex; flex-direction:column; align-items:center; text-align:center; padding:9px 10px 4px; animation:mg-arrive .36s ease-out both; }
.mg-celebration-art { width:144px; height:105px; }
.mg-celebration-art svg { display:block; width:100%; height:100%; }
.mg-finale .mg-kicker { margin:5px 0 0; }
.mg-finale h3 { margin:2px 0 1px; color:#5b464a; font:800 2rem "Baloo 2",sans-serif; }
.mg-finale>p:not(.mg-kicker):not(.mg-replay-note) { margin:0; color:#806b67; font-size:.9rem; }
.mg-score { display:flex; align-items:center; gap:8px; margin:12px 0 14px; padding:9px 17px; border:1px solid #e6d3a9; border-radius:16px; background:#fff3cf; color:#806b5f; text-align:left; }
.mg-score strong { color:#c14d68; font:800 2rem "Baloo 2",sans-serif; }
.mg-score span { font-size:.69rem; font-weight:900; line-height:1.1; }
.mg-score small { display:block; color:#997e6b; }
.mg-replay { min-width:145px; }
.mg-replay-note { margin:11px 0 0; color:#a18b7a; font-size:.7rem; }
@keyframes mg-arrive { from { opacity:.5; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@keyframes mg-bob { from { transform:translateY(0); } to { transform:translateY(-4px); } }
@media (max-width: 560px) {
  .mg-shell { padding:13px; border-radius:18px; }
  .mg-header { align-items:center; gap:8px; }
  .mg-progress-box { flex-basis:105px; }
  .mg-round { font-size:.57rem; }
  .mg-intro { margin:9px 0 13px; font-size:.82rem; }
  .mg-scene-tags span { padding:4px 6px; font-size:.48rem; }
  .mg-scene-tags b { font-size:.78rem; }
  .mg-task { padding:10px; }
  .mg-choice { gap:7px; min-height:65px; padding:8px; }
  .mg-choice small { font-size:.66rem; }
  .mg-memory-grid { gap:7px; }
  .mg-memory-card { aspect-ratio:.98; }
  .mg-card-back,.mg-card-front { border-radius:11px; }
  .mg-card-word { font-size:clamp(.85rem,4vw,1.15rem); }
  .mg-parrot-stage { grid-template-columns:.68fr 1.32fr; gap:5px; padding:8px 8px 22px; min-height:156px; }
  .mg-parrot-art svg { width:100%; }
  .mg-parrot-speech { top:0; right:-3px; padding:3px 6px; font-size:.72rem; }
  .mg-picnic-table { gap:7px; padding:7px; }
  .mg-request-art { width:66px; height:82px; }
  .mg-request-art svg { width:57px; height:54px; }
  .mg-request-copy h3 { font-size:1rem; }
  .mg-request-copy>p:last-child { font-size:.64rem; }
  .mg-feast-meter { right:9px; bottom:7px; }
  .mg-feast-meter span { width:14px; }
  .mg-sentence-scene { min-height:84px; padding:8px; }
  .mg-sentence-picture { width:63px; height:63px; }
  .mg-sentence-picture svg { width:56px; }
  .mg-sentence-hint { font-size:.91rem; }
  .mg-sentence-controls { justify-content:stretch; }
  .mg-sentence-controls button { flex:1; padding:7px; font-size:.77rem!important; }
  .mg-feedback { font-size:.77rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mathura-mini-games *, .mathura-mini-games *::before, .mathura-mini-games *::after {
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}
