/* Shared layout for Mini games. */
.stage { position: relative; }
#cv { position: absolute; inset: 0; display: block; touch-action: none; }
.mini-root { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 10px; overflow: hidden; }
.stat.low .value { color: #E03131; }
.mprompt { font-size: clamp(26px, 7vw, 46px); font-weight: 900; color: #062A5F; text-align: center; line-height: 1.15; min-height: 1.2em; }
.msub { font-size: 16px; font-weight: 700; color: #3D5B8C; text-align: center; min-height: 1.3em; }
.mrow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 560px; }
.mbtn { font: inherit; font-weight: 900; font-size: clamp(18px, 5vw, 26px); min-width: 72px; min-height: 64px; padding: 8px 16px; border-radius: 16px; border: 3px solid #0B4DA2; background: #fff; color: #0B4DA2; cursor: pointer; box-shadow: 0 4px 0 #C9DAF5; touch-action: manipulation; }
.mbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #C9DAF5; }
.mbtn.solid { background: #0B4DA2; color: #fff; box-shadow: 0 4px 0 #062A5F; }
.mbtn.good { background: #2F9E44; border-color: #2F9E44; color: #fff; }
.mbtn.bad { background: #E03131; border-color: #E03131; color: #fff; }
.mbtn:disabled { opacity: .45; cursor: default; }
.mgrid { --cols: 3; --gap: 6px; --cell: min(calc((100vw - 32px - (var(--cols) - 1) * var(--gap)) / var(--cols)), calc((100vh - 240px - (var(--rows, var(--cols)) - 1) * var(--gap)) / var(--rows, var(--cols))), 110px); display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); gap: var(--gap); }
.mcell { font: inherit; width: var(--cell); height: var(--cell); border-radius: 12px; border: 2px solid #C9DAF5; background: #fff; color: #062A5F; font-weight: 900; font-size: calc(var(--cell) * .45); display: grid; place-items: center; cursor: pointer; padding: 0; touch-action: manipulation; transition: background .12s, transform .12s; }
.mcell:active { transform: scale(.96); }
.mcell.on { background: #0B4DA2; color: #fff; border-color: #0B4DA2; }
.mcell.hl { background: #FFD43B; border-color: #FAB005; }
.mcell.ok { background: #D3F9D8; border-color: #2F9E44; }
.mcell.no { background: #FFE3E3; border-color: #E03131; }
.mcell.dim { opacity: .35; }
.mcell:disabled { cursor: default; }
.mcell:focus-visible, .mbtn:focus-visible { outline: 4px solid #FFC107; outline-offset: 2px; }
.mpads { display: grid; grid-template-columns: repeat(2, var(--pad)); gap: 14px; --pad: min(calc((100vw - 60px) / 2), calc((100vh - 260px) / 2), 180px); }
.mpad { width: var(--pad); height: var(--pad); border-radius: 26px; border: 4px solid rgba(0,0,0,.12); cursor: pointer; opacity: .55; transition: opacity .1s, transform .1s; touch-action: manipulation; font: inherit; font-size: 28px; font-weight: 900; color: rgba(255,255,255,.85); }
.mpad.lit { opacity: 1; transform: scale(1.04); box-shadow: 0 0 0 6px #fff, 0 0 30px rgba(255,255,255,.9); }
.mgrid.c4 .mcell { border-radius: 50%; }
.mcell.p1 { background: #E03131; border-color: #C92A2A; }
.mcell.p2 { background: #FFD43B; border-color: #FAB005; }
.mtubes { gap: 8px; max-width: 640px; }
.mtube { font: inherit; width: clamp(40px, 10vw, 58px); height: calc(clamp(40px, 10vw, 58px) * 3.6); display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; padding: 6px 0; border: 3px solid #0B4DA2; border-top: 0; border-radius: 0 0 26px 26px; background: rgba(230,240,255,.6); cursor: pointer; touch-action: manipulation; transition: transform .12s; }
.mtube.sel { transform: translateY(-10px); border-color: #FAB005; }
.mball { width: 78%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset -3px -3px 0 rgba(0,0,0,.18); }
.mboard { background: #2F9E44; padding: 6px; border-radius: 14px; }
.mboard .mcell { background: #40C057; border-color: #2B8A3E; }
.mboard .mcell.hint::after { content: ''; width: 22%; height: 22%; border-radius: 50%; background: rgba(255,255,255,.55); }
.mdisc { width: 80%; height: 80%; border-radius: 50%; box-shadow: inset -3px -3px 0 rgba(0,0,0,.2); }
.mdisc.b { background: #212529; } .mdisc.w { background: #fff; }
.mhist { display: flex; flex-direction: column; gap: 4px; max-height: 36vh; overflow-y: auto; }
.mcode { display: flex; align-items: center; gap: 6px; justify-content: center; }
.mcode.cur { padding: 6px 10px; border: 2px dashed #0B4DA2; border-radius: 14px; }
.mpeg { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #C9DAF5; background: #fff; }
.mcode.cur .mpeg { width: 34px; height: 34px; }
.mfb { font-weight: 900; color: #062A5F; min-width: 70px; font-size: 14px; }
.mswatch { min-width: 56px; color: #fff; border-color: rgba(0,0,0,.2); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.mpile { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 420px; min-height: 90px; }
.mstick { width: 10px; height: 80px; border-radius: 5px; background: linear-gradient(#E03131 0 14px, #E9C46A 14px); }
.mclock { width: min(52vw, 34vh, 240px); height: auto; }
.mword { letter-spacing: .14em; }
.mmix { align-items: center; }
.mchip, .mpick { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: #062A5F; text-transform: capitalize; }
.mpick { font-size: 18px; }
.mdot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #C9DAF5; flex: none; }
.mop { font-size: 28px; font-weight: 900; color: #0B4DA2; }
