/* Game stage styles (shared by every engine). */
.stage { position: relative; min-height: 440px; display: flex; flex-direction: column; }
.stage.is-full, .stage:fullscreen { position: fixed; inset: 0; z-index: 100; border-radius: 0; border: 0; box-shadow: none; min-height: 100%; height: 100%; width: 100%; background: var(--paper); }
.stage:fullscreen { position: relative; }
body.game-open { overflow: hidden; }
.g-start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 26px 18px; gap: 8px; background: var(--marigold-bg); }
.g-start .g-art { font-size: 3.4rem; line-height: 1; }
.g-start h2 { margin: 4px 0 0; }
.g-start p { margin: 0 auto; }
.g-levels { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 12px 0 4px; }
.g-levels button { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; border: 2px solid var(--ink); border-radius: 14px; background: var(--white); padding: 10px 16px; min-width: 112px; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.g-levels button[aria-pressed="true"] { background: var(--sun); }
.g-levels .stars { display: block; font-size: 1rem; letter-spacing: 2px; color: var(--marigold); }
.g-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 2px solid var(--ink); background: var(--white); }
.g-bar button { font: inherit; font-family: var(--font-head); font-weight: 600; border: 2px solid var(--ink); background: var(--white); border-radius: 999px; min-height: 44px; min-width: 44px; padding: 4px 12px; cursor: pointer; }
.g-progress { flex: 1; height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; }
.g-progress i { display: block; height: 100%; width: 0; background: var(--teal); transition: width 0.3s; }
.g-play { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; gap: 16px; overflow: auto; }
.g-prompt { display: flex; align-items: center; gap: 14px; }
.g-prompt .g-word { font-family: var(--font-head); font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 700; color: var(--coral); min-height: 1.2em; }
.g-prompt .say { width: 64px; height: 64px; } .g-prompt .say svg { width: 30px; height: 30px; }
.g-choices { display: grid; gap: 14px; width: 100%; max-width: 760px; grid-template-columns: repeat(3, 1fr); }
.g-choices.c4 { grid-template-columns: repeat(2, 1fr); max-width: 520px; }
.g-choices.c6 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 720px) { .g-choices.c4 { grid-template-columns: repeat(4, 1fr); max-width: 760px; } }
.g-choice { aspect-ratio: 1 / 1; border: 3px solid var(--ink); border-radius: 20px; background: var(--white); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: inherit; box-shadow: 3px 3px 0 var(--ink); padding: 6px; max-height: 190px; }
.g-choice:hover { background: var(--marigold-bg); }
.g-choice .gp { font-size: clamp(2.6rem, 8vw, 4.2rem); line-height: 1; }
.g-choice .gsw { width: 70%; height: 62%; border-radius: 14px; border: 3px solid var(--ink); }
.g-choice .gnum { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.4rem, 8vw, 4rem); color: var(--teal); }
.g-choice .glab { font-size: 0.95rem; color: var(--ink-soft); }
.g-choice.right { background: #D3F9D8; animation: pop 0.35s; }
.g-choice.wrong { background: #FFE3E3; animation: shake 0.35s; }
.g-choice.show { outline: 5px solid var(--teal); outline-offset: 3px; }
@keyframes pop { 50% { transform: scale(1.08); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.g-msg { min-height: 1.6em; font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; text-align: center; }
.g-end { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.g-end .big-stars { font-size: 3.2rem; letter-spacing: 6px; color: var(--marigold); }
/* Memory */
.m-grid { display: grid; gap: 12px; width: 100%; max-width: 820px; grid-template-columns: repeat(4, 1fr); }
.m-grid.p6 { grid-template-columns: repeat(4, 1fr); }
.m-grid.p8 { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 760px) { .m-grid.p6 { grid-template-columns: repeat(6, 1fr); } }
.m-card { aspect-ratio: 3 / 4; max-height: 150px; border: 3px solid var(--ink); border-radius: 16px; background: repeating-linear-gradient(45deg, #FFF 0 10px, #FFE8A3 10px 20px); cursor: pointer; font: inherit; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--white); box-shadow: 3px 3px 0 var(--ink); }
.m-card .back { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--ink); background: var(--white); border: 2px solid var(--ink); border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; }
.m-card.open, .m-card.done { background: var(--white); color: var(--ink); }
.m-card.done { background: #D3F9D8; cursor: default; }
.m-card .gp { font-size: clamp(2rem, 6vw, 3rem); }
.m-card .gsw { width: 70%; height: 55%; border-radius: 12px; border: 3px solid var(--ink); }
.m-card .gnum { font-family: var(--font-head); font-weight: 700; font-size: 2.4rem; color: var(--teal); }
.m-card .mw { font-family: var(--font-head); font-weight: 700; font-size: clamp(1rem, 3vw, 1.35rem); line-height: 1.1; text-align: center; overflow-wrap: anywhere; }

/* shared pictures */
.gtile { font-size: clamp(2rem, 6vw, 3.2rem); }
.gshape { width: 70%; height: 70%; }
/* Simón Dice */
.g-cmd { font-size: clamp(1.4rem, 4.5vw, 2.2rem); text-align: center; }
.g-no { font-size: 1.15rem; }
/* Bubble Pop */
.bp-play { justify-content: flex-start; }
.bp-sky { position: relative; flex: 1; width: 100%; min-height: 340px; overflow: hidden; background: linear-gradient(#E7F5FF, #FFF8EE); border: 2px solid var(--ink); border-radius: 20px; }
.bp-bubble { position: absolute; bottom: -110px; width: 92px; height: 92px; border-radius: 50%; border: 3px solid #4DABF7; background: radial-gradient(circle at 30% 30%, #fff, #D0EBFF 60%, #A5D8FF); display: grid; place-items: center; cursor: pointer; animation-name: rise; animation-timing-function: linear; animation-iteration-count: infinite; padding: 6px; }
.bp-bubble .gp { font-size: 2.4rem; } .bp-bubble .gnum { font-size: 2.2rem; } .bp-bubble .gsw { width: 56px; height: 56px; border-radius: 50%; }
.bp-bubble.popped { animation: popout 0.35s forwards; }
.bp-bubble.wrong { border-color: var(--coral); }
@keyframes rise { from { transform: translateY(0); } to { transform: translateY(-560px); } }
@keyframes popout { to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bp-bubble { animation: none !important; position: static; } .bp-sky { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; padding: 12px; } }
/* Color by Word */
.cb-wrap { width: 100%; max-width: 640px; }
.cb-svg { width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 16px; background: #fff; }
.cb-r { cursor: pointer; } .cb-r:focus { outline: none; } .cb-r:focus > * { stroke: var(--violet); stroke-width: 5; }
.cb-r.cb-wrong > * { stroke: var(--coral); stroke-width: 6; }
.cb-lab { font-family: var(--font-head); font-weight: 700; font-size: 17px; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 4px; pointer-events: none; }
.cb-pal { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cb-sw { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--ink); cursor: pointer; display: grid; place-items: center; font-family: var(--font-head); font-size: 1.4rem; color: #fff; text-shadow: 0 0 3px #000; }
.cb-sw.light { color: var(--ink); text-shadow: none; }
.cb-sw[aria-pressed="true"] { outline: 5px solid var(--sun); outline-offset: 3px; transform: scale(1.08); }
/* Speed Quiz */
.sq-top { display: flex; gap: 16px; font-family: var(--font-head); font-weight: 600; font-size: 1.3rem; }
.sq-score::before { content: "★ "; color: var(--marigold); }
.sq-card { width: 170px; height: 170px; border: 3px solid var(--ink); border-radius: 24px; background: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 4px 4px 0 var(--ink); }
.sq-card .gp { font-size: 5rem; }
.sq-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; max-width: 560px; }
.sq-btn { font: inherit; font-family: var(--font-head); font-weight: 600; font-size: 1.35rem; min-height: 64px; border: 3px solid var(--ink); border-radius: 16px; background: var(--white); cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.sq-btn.right { background: #D3F9D8; } .sq-btn.wrong { background: #FFE3E3; }
/* Spell It */
.sp-head { display: flex; align-items: center; gap: 16px; }
.sp-pic { display: flex; flex-direction: column; align-items: center; min-width: 90px; } .sp-pic .gp { font-size: 4rem; } .sp-pic .gsw { width: 80px; height: 64px; border-radius: 14px; border: 3px solid var(--ink); display: block; } .sp-pic .gnum { font-size: 3rem; }
.sp-slots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.sp-slot { width: 44px; height: 54px; border-bottom: 4px solid var(--ink); display: grid; place-items: center; font-family: var(--font-head); font-size: 2rem; font-weight: 700; }
.sp-slot.ghost { color: #CED4DA; } .sp-slot.filled { color: var(--teal); }
.sp-tiles { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 620px; }
.sp-tile { width: 54px; height: 58px; border: 3px solid var(--ink); border-radius: 12px; background: var(--sun); font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.sp-tile.used { visibility: hidden; } .sp-tile.wrong { background: #FFE3E3; animation: shake 0.35s; }
/* El or La */
.el-card { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--white); border: 3px solid var(--ink); border-radius: 24px; padding: 18px 30px; box-shadow: 4px 4px 0 var(--ink); }
.el-card .gp { font-size: 4.4rem; } .el-word { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; }
.el-row { display: flex; gap: 18px; }
.el-btn { width: 140px; height: 110px; border: 3px solid var(--ink); border-radius: 20px; cursor: pointer; font-family: var(--font-head); font-size: 2.6rem; box-shadow: 4px 4px 0 var(--ink); }
.el-el { background: #D0EBFF; } .el-la { background: #FFE8CC; }
.el-btn.right { outline: 6px solid #2F9E44; } .el-btn.wrong { outline: 6px solid var(--coral); }

/* Word Slash */
.ws-prompt { gap: 14px; } .ws-pic { display: grid; place-items: center; min-width: 80px; min-height: 70px; } .ws-pic .gp { font-size: 3.4rem; } .ws-pic .gnum { font-size: 2.6rem; } .ws-pic .gsw { width: 70px; height: 56px; border-radius: 14px; border: 3px solid var(--ink); display: block; }
.ws-sky { background: linear-gradient(#2B2D5C, #5B3FC4); }
.ws-word { position: absolute; bottom: -80px; min-width: 120px; padding: 10px 14px; border-radius: 999px; border: 3px solid var(--ink); background: #fff; font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; color: var(--ink); cursor: pointer; animation-name: rise; animation-timing-function: linear; animation-iteration-count: infinite; box-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }
.ws-word.wrong { background: #FFE3E3; }
.ws-word.slashed { animation: slash 0.45s forwards; background: var(--sun); }
@keyframes slash { 0% { transform: rotate(0) scale(1); opacity: 1; } 40% { transform: rotate(-12deg) scale(1.15); } 100% { transform: rotate(25deg) scale(0.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ws-word { animation: none !important; position: static; } .ws-sky { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; padding: 12px; } }
/* Sentence Builder */
.sb-head { display: flex; align-items: center; gap: 12px; max-width: 640px; } .sb-en { font-size: 1.25rem; font-weight: 700; }
.sb-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 60px; max-width: 680px; }
.sb-slot { min-width: 64px; padding: 6px 8px; border-bottom: 4px solid var(--ink); text-align: center; font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; }
.sb-slot.filled { color: var(--teal); }
.sb-tiles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 680px; }
.sb-tile { padding: 10px 14px; border: 3px solid var(--ink); border-radius: 12px; background: var(--sun); font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.sb-tile.used { visibility: hidden; } .sb-tile.wrong { background: #FFE3E3; animation: shake 0.35s; }
/* Syllable Builder */
.sy-tile { width: auto; min-width: 74px; padding: 0 14px; font-size: 1.6rem; }
.sy-slot { width: auto; min-width: 76px; padding: 0 10px; }
.sy-slots { gap: 10px; }
/* Say It */
.si-play { gap: 14px; }
.si-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.si-pic .gp { font-size: 5rem; } .si-pic .gsw { width: 96px; height: 96px; } .si-pic .gnum { font-size: 3.4rem; }
.si-word { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; min-height: 2.6rem; }
.si-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.si-rec.on { background: #FFE3E3; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.si-mine:disabled { opacity: .45; cursor: default; }
