/*
 * 말 조립 홈런 (/grammar/modal/baseball.jsp, 2026-10-21) — 게임 js/ps2-modal-baseball.js 의 꾸밈. 틀의 꾸밈은 css/ps2-modal-arcade.css (.ga-*)
 *   판: 상황 줄(1단계 우리말 · 2 · 3단계 영어) + 만들 말의 틀(보이는 낱말 + 칠 칸 .mbb-slot). 칸: 지금 칠 칸 노랑 · 친 칸 초록 · 파울 빨강 · 고쳐 채운 칸 금색.
 */
#main .gi .ga--baseball { --ga-bg1: #0c1427; --ga-bg2: #1f3a63; --ga-glow: #fbbf24; --ga-halo: rgba(251, 191, 36, .22); --ga-win: #166534; --ga-hot: #f97316; }
#main .gi .ga--baseball .mbb-cv { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
#main .gi .ga--baseball .ga-q { min-height: 96px; gap: 6px; padding: 12px 16px; background: linear-gradient(160deg, #13213d 0%, #0c1427 70%); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .14); }
#main .gi .ga--baseball .mbb-ctx { display: grid; gap: 2px; }
#main .gi .ga--baseball .mbb-ctx__ko { font-size: 14.5px; line-height: 1.55; font-weight: 700; color: #fde68a; }
#main .gi .ga--baseball .mbb-ctx__en { font-size: 14px; line-height: 1.55; font-style: italic; color: rgba(255, 255, 255, .78); }
#main .gi .ga--baseball .ga-q .mbb-ask { margin: 0; font-size: clamp(16px, 2.1vw, 20px); line-height: 1.85; font-weight: 700; color: #e2e8f0; }
#main .gi .ga--baseball .mbb-slot { display: inline-block; min-width: 2.7em; padding: 0 .42em; margin: 0 .03em; border: 1.5px dashed rgba(255, 255, 255, .34); border-radius: 8px; background: rgba(255, 255, 255, .05);
    line-height: 1.45; text-align: center; color: #fff; vertical-align: baseline; transition: background .2s, border-color .2s, color .2s; }
#main .gi .ga--baseball .mbb-slot.is-now { border-style: solid; border-color: var(--ga-glow); color: var(--ga-glow); animation: mbb-now 1s ease-in-out infinite; }
#main .gi .ga--baseball .mbb-slot.is-ok { border: 1.5px solid #4ade80; background: rgba(74, 222, 128, .16); color: #bbf7d0; }
#main .gi .ga--baseball .mbb-slot.is-fix { border: 1.5px solid #fbbf24; background: rgba(251, 191, 36, .14); color: #fde68a; }
#main .gi .ga--baseball .mbb-slot.is-bad { border: 1.5px solid #f87171; background: rgba(239, 68, 68, .22); color: #fecaca; text-decoration: line-through; text-decoration-thickness: 2px; }
#main .gi .ga--baseball .mbb-slot.is-new { animation: mbb-pop .35s ease; }
@keyframes mbb-now { 50% { box-shadow: 0 0 0 3px rgba(251, 191, 36, .25); } }
@keyframes mbb-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
#main .gi .ga--baseball .ga-pad.mbb-swing { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 260px; height: 56px; padding: 0 22px; border: 0; border-radius: 16px; font-size: 19px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%); color: #fff; box-shadow: 0 12px 24px -12px rgba(234, 88, 12, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
#main .gi .ga--baseball .ga-pad.mbb-swing small { display: inline; margin: 0 0 0 2px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .85); }
#main .gi .ga--baseball .ga-pad.mbb-swing:active { transform: scale(.97); background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%); }
#main .gi .ga--baseball .mbb-swing__ico { font-size: 20px; }
#main .gi .ga--baseball .mbb-hr { padding: 3px 11px; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 800; white-space: nowrap; }
#main .gi .ga--baseball .mbb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* 카드 · 결과: 영어 상황 + 맞는 말(친 낱말에 표시) */
#main .gi .ga--baseball .mbb-full { display: grid; gap: 4px; }
#main .gi .ga--baseball .mbb-full__ctx { margin: 0; font-size: 13.5px; line-height: 1.5; font-style: italic; color: var(--ga-mute); }
#main .gi .ga--baseball .ga-card .ga-card__mine .mbb-sent { font-size: 14.5px; font-weight: 700; color: #7f1d1d; }

/* 로비 그림: 판 · 투수 · 틀린 공(to take)은 지나가고 맞는 공(taking)을 쳐서 안타 */
#main .gi .ga--baseball .mbb-hero { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(#170f3a 0%, #3b2463 24%, #c2410c 34%, #1d6b3c 36%, #14532d 100%); }
#main .gi .ga--baseball .mbb-hero__lights { position: absolute; inset: 0; background: radial-gradient(40% 30% at 8% 4%, rgba(255, 214, 150, .5), transparent 70%), radial-gradient(40% 30% at 92% 4%, rgba(255, 214, 150, .5), transparent 70%); }
#main .gi .ga--baseball .mbb-hero__stand { position: absolute; left: 0; right: 0; top: 22%; height: 13%;
    background: radial-gradient(circle, rgba(253, 230, 138, .65) 0 1.2px, transparent 1.6px) 0 0 / 9px 7px, linear-gradient(#1c1230, #3b2547); }
#main .gi .ga--baseball .mbb-hero__field { position: absolute; left: 0; right: 0; bottom: 0; height: 64%; background: linear-gradient(#2e8b47, #14532d); }
#main .gi .ga--baseball .mbb-hero__field::after { content: ''; position: absolute; left: 14%; right: 14%; top: 18%; bottom: 0; background: linear-gradient(#b97a4a, #8a5531); clip-path: polygon(50% 0, 100% 52%, 50% 100%, 0 52%); opacity: .9; }
#main .gi .ga--baseball .mbb-hero__mound { position: absolute; left: 50%; top: 52%; width: 16%; height: 6%; margin-left: -8%; border-radius: 50%; background: #b97a4a; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
#main .gi .ga--baseball .mbb-hero__board { position: absolute; left: 50%; top: 6%; transform: translateX(-50%); padding: 5px 12px; border-radius: 12px; white-space: nowrap; background: rgba(2, 6, 23, .82);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .35); color: #e2e8f0; font-size: 13px; font-weight: 800; }
#main .gi .ga--baseball .mbb-hero__slot { display: inline-block; min-width: 3.4em; min-height: 1.45em; vertical-align: -0.38em; line-height: 1.3; padding: 0 5px; border: 1.5px dashed rgba(255, 255, 255, .4); border-radius: 6px; font-style: normal; text-align: center;
    animation: mbb-hslot 6s ease-in-out infinite; }
#main .gi .ga--baseball .mbb-hero__slot.is-empty { min-width: 2.4em; animation: none; }
#main .gi .ga--baseball .mbb-hero__pitcher { position: absolute; left: 50%; top: 40%; width: 12px; height: 26px; margin-left: -6px; border-radius: 6px 6px 3px 3px; background: #f8fafc; box-shadow: 0 0 0 1px rgba(15, 23, 42, .5); }
#main .gi .ga--baseball .mbb-hero__pitcher::before { content: ''; position: absolute; left: 1px; top: -10px; width: 10px; height: 10px; border-radius: 50%; background: #1d4ed8; }
#main .gi .ga--baseball .mbb-hero__ball { position: absolute; left: 50%; top: 40%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; opacity: 0;
    background: radial-gradient(circle at 35% 30%, #fff 0 30%, #e2e8f0 70%, #94a3b8 100%); box-shadow: inset 4px 0 0 -2px #dc2626, inset -4px 0 0 -2px #dc2626; }
#main .gi .ga--baseball .mbb-hero__ball b { position: absolute; left: 50%; bottom: 120%; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: rgba(2, 6, 23, .85);
    box-shadow: inset 0 0 0 1px #fbbf24; color: #fff; font-size: 12px; font-weight: 800; }
#main .gi .ga--baseball .mbb-hero__ball--bad { animation: mbb-hb-bad 6s linear infinite; }
#main .gi .ga--baseball .mbb-hero__ball--ok { animation: mbb-hb-ok 6s linear infinite; }
#main .gi .ga--baseball .mbb-hero__call { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); color: #86efac; font-size: 22px; font-weight: 900; text-shadow: 0 2px 0 rgba(2, 6, 23, .7); opacity: 0;
    animation: mbb-hcall 6s ease-out infinite; }
#main .gi .ga--baseball .mbb-hero__bat { position: absolute; left: 30%; bottom: 25%; width: 30%; height: 8px; border-radius: 4px 8px 8px 4px; transform-origin: 0 50%; transform: rotate(-70deg);
    background: linear-gradient(90deg, #7c4a21 0 14%, #f8e3b8 30%, #c08a52 100%); animation: mbb-hbat 6s ease-in-out infinite; }
#main .gi .ga--baseball .mbb-hero__pop { position: absolute; right: 12%; top: 22%; color: #fde68a; font-size: 26px; font-weight: 900; text-shadow: 0 2px 0 rgba(2, 6, 23, .7); opacity: 0; animation: mbb-hpop 6s ease-out infinite; }
@keyframes mbb-hb-bad { 0%, 4% { top: 40%; left: 50%; transform: scale(.3); opacity: 0; } 7% { opacity: 1; } 30% { top: 72%; left: 55%; transform: scale(1); opacity: 1; } 36%, 100% { top: 84%; left: 56%; transform: scale(1.05); opacity: 0; } }
@keyframes mbb-hb-ok { 0%, 42% { top: 40%; left: 50%; transform: scale(.3); opacity: 0; } 45% { opacity: 1; } 64% { top: 72%; left: 55%; transform: scale(1); opacity: 1; } 80% { top: 10%; left: 80%; transform: scale(.45); opacity: 1; } 88%, 100% { top: 2%; left: 86%; transform: scale(.3); opacity: 0; } }
@keyframes mbb-hbat { 0%, 60% { transform: rotate(-70deg); } 64% { transform: rotate(8deg); } 72% { transform: rotate(150deg) scaleX(.6); } 84%, 100% { transform: rotate(-70deg); } }
@keyframes mbb-hcall { 0%, 30% { opacity: 0; transform: translateX(-50%) scale(.7); } 34% { opacity: 1; transform: translateX(-50%) scale(1.1); } 42%, 100% { opacity: 0; transform: translateX(-50%) scale(1); } }
@keyframes mbb-hpop { 0%, 64% { opacity: 0; transform: scale(.6); } 68% { opacity: 1; transform: scale(1.15); } 84% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; } }
@keyframes mbb-hslot { 0%, 64% { color: transparent; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .4); } 67%, 95% { color: #bbf7d0; background: rgba(74, 222, 128, .2); border-color: #4ade80; } 100% { color: transparent; } }

@media (max-width: 760px) {
    #main .gi .ga--baseball .ga-q { min-height: 110px; padding: 10px 12px; }
    #main .gi .ga--baseball .ga-q .mbb-ask { font-size: 16px; line-height: 1.8; }
    #main .gi .ga--baseball .mbb-ctx__ko, #main .gi .ga--baseball .mbb-ctx__en { font-size: 13.5px; }
    #main .gi .ga--baseball .mbb-slot { min-width: 2.3em; }
    #main .gi .ga--baseball .ga-pad.mbb-swing { flex: 1 1 100%; min-width: 0; height: 54px; }
    #main .gi .ga--baseball .mbb-hero__board { font-size: 11.5px; }
    #main .gi .ga--baseball .ga-card { padding: 12px 13px; }
    #main .gi .ga--baseball .ga-card .ga-sent { font-size: 15.5px; line-height: 1.45; }
    #main .gi .ga--baseball .mbb-full__ctx { font-size: 12.5px; }
    #main .gi .ga--baseball .ga-card__ko { font-size: 13px; }
    #main .gi .ga--baseball .ga-card__why { padding: 8px 10px; font-size: 13.5px; line-height: 1.55; }
    #main .gi .ga--baseball .ga-card__mine, #main .gi .ga--baseball .ga-card .ga-card__mine .mbb-sent { font-size: 12.5px; }
    #main .gi .ga--baseball .ga-card__row { margin-top: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    #main .gi .ga--baseball .mbb-hero * { animation: none !important; }
    #main .gi .ga--baseball .mbb-hero__ball--ok { opacity: 1; top: 66%; left: 55%; }
    #main .gi .ga--baseball .mbb-slot.is-now, #main .gi .ga--baseball .mbb-slot.is-new { animation: none; }
}
