/* 퀘스트 패널 내부 전용: 전역 메뉴나 기존 탐험 스타일은 변경하지 않는다. */
.mg-game{--mg-ink:#1A1714;--mg-muted:#6B645B;--mg-line:#DFD2C1;color:var(--mg-ink);font-family:inherit}
.mg-game *{box-sizing:border-box}
.mg-game [hidden]{display:none!important}
.mg-game img{display:block;object-fit:contain;user-select:none}
.mg-game button,.mg-game input{font:inherit;touch-action:manipulation}
.mg-game button{cursor:pointer}
.mg-game button:disabled{cursor:default}
.mg-game button:focus-visible,.mg-game input:focus-visible{outline:3px solid #A63F00;outline-offset:4px}
.mg-heading{margin-bottom:14px}
.mg-tag{display:inline-block;font-size:10px;line-height:1.6;color:var(--mg-muted);border-radius:20px;background:#EDE5D9;padding:5px 9px}
.mg-heading h3{font-size:25px;letter-spacing:-.8px;line-height:1.3;margin:12px 0 8px;word-break:keep-all}
.mg-heading p{font-size:13px;line-height:1.7;color:var(--mg-muted);margin:0;word-break:keep-all}
.mg-preview{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:0 0 14px}
.mg-preview button{display:flex;gap:9px;align-items:center;justify-content:space-between;border:1px solid #C6AE8D;border-radius:10px;background:#FFF9EF;color:#644324;padding:10px 12px;min-height:44px;font-size:12px;font-weight:700}
.mg-preview button:disabled{background:#EDE6DB;color:#70614E;border-color:#D6C8B5}
.mg-preview>span{font-size:10px;line-height:1.6;color:var(--mg-muted)}
.mg-previewing .mg-preview>span{font-weight:700;color:#9C4200}
.mg-objective{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:7px 14px;padding:11px 12px;margin:12px 0 0;background:#EDF0DF;color:#42552E;font-size:12px;font-weight:700;border-radius:12px;line-height:1.6}
.mg-model-note{margin:12px 0 0;padding:10px 12px;background:#FFF6E7;border-left:3px solid #E77D2C;border-radius:0 9px 9px 0;font-size:12px;line-height:1.7;color:#67431F;min-height:42px;word-break:keep-all}
/* 목표는 고정하고, 가상 가격에 해당하는 코인만 짧게 위아래 움직인다. */
.mg-price-stage{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:12px;padding:12px 14px 18px;border-radius:20px;background:#F0E8DB}
.mg-price-item{text-align:center;min-width:0}
.mg-price-item>small{font-size:11px;display:block;color:#645644;margin:5px 0 3px}
.mg-price-item>strong{display:block;font-size:34px;line-height:1.2;font-weight:900;letter-spacing:-1px}
.mg-coin{width:65px;height:72px;margin:25px auto;filter:drop-shadow(0 5px 3px #A7937533)}
.mg-market{border-left:1px solid #DCCDB9;padding-left:12px}
.mg-price-track{height:122px;position:relative}
.mg-price-track .mg-coin{position:relative;z-index:1;margin:0 auto;top:25px;transform:translateY(var(--mg-shift,0));transition:transform .45s cubic-bezier(.2,.7,.3,1)}
.mg-target-line{position:absolute;left:0;right:0;top:61px;border-top:1px dashed #B29B7C}
.mg-track-high,.mg-track-low{position:absolute;right:0;font-size:9px;font-weight:700;color:#78644C}
.mg-track-high{top:3px}.mg-track-low{bottom:3px}
.mg-price-caption{display:block;font-size:10px;line-height:1.5;color:#78644C;margin-top:5px;min-height:15px}
.mg-price-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}
.mg-price-controls button{min-height:65px;padding:9px 5px;background:#FFFCF6;border:1px solid var(--mg-line);border-radius:13px;font-size:18px;font-weight:700;color:var(--mg-ink)}
.mg-price-controls button small{display:block;font-size:11px;font-weight:600;line-height:1.5;margin-bottom:4px}
.mg-price-controls button[aria-pressed=true]{background:#201A15;color:#FFF8EF;border-color:#201A15}
.mg-price-controls button:disabled{opacity:.65}
/* 지갑 양옆에 출발·도착 위치를 두고, 실제 코인 애셋이 그 사이를 이동한다. */
.mg-wallet-stage{position:relative;display:grid;grid-template-columns:1fr 1.55fr 1fr;align-items:center;gap:5px;background:#F0E8DB;padding:20px 8px 35px;border-radius:20px;overflow:hidden}
.mg-wallet{display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0}
.mg-wallet .mg-wallet-art{width:82px;height:90px;max-width:100%;filter:drop-shadow(0 5px 3px #78523D22);margin-bottom:5px}
.mg-wallet>span{font-size:10px;color:#78644C}
.mg-wallet>strong{display:block;font-size:34px;font-weight:900;letter-spacing:-1px;line-height:1.3}
.mg-wallet>strong small{font-size:13px;margin-left:3px;font-weight:700}
.mg-wallet-caption{position:absolute;bottom:12px;left:0;right:0;text-align:center;font-size:10px;color:#78644C}
.mg-flow-end{display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center;min-width:0}
.mg-flow-end>small{font-size:10px;line-height:1.5;color:#78644C;white-space:nowrap}
.mg-flow-end>img{width:35px;height:39px;opacity:.65}
.mg-flow-end>strong{font-size:13px;line-height:1.4;color:#6C4B2A}
.mg-moving-token{position:absolute;top:56px;left:15%;width:34px;opacity:0;pointer-events:none;z-index:2;transform:translateX(-50%)}
.mg-moving-token>img{width:34px;height:38px;filter:drop-shadow(0 3px 3px #78523D44)}
.mg-moving-token>b{display:block;margin:2px -4px 0;border-radius:8px;background:#FFFCF4;text-align:center;color:#8A3F07;font-size:10px;line-height:1.6}
.mg-wallet-stage[data-motion=receive] .mg-moving-token{animation:mg-receive .45s ease-in-out both}
.mg-wallet-stage[data-motion=send] .mg-moving-token{animation:mg-send .45s ease-in-out both}
@keyframes mg-receive{0%{left:15%;opacity:1;transform:translate(-50%,0) scale(1)}80%{opacity:1}100%{left:50%;opacity:0;transform:translate(-50%,12px) scale(.65)}}
@keyframes mg-send{0%{left:50%;opacity:1;transform:translate(-50%,12px) scale(.65)}20%{opacity:1}100%{left:85%;opacity:0;transform:translate(-50%,0) scale(1)}}
.mg-flow-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.mg-flow-actions button{min-height:50px;border-radius:13px;border:1px solid #C79A73;background:#FFDFC1;color:#65340D;padding:12px 8px;font-size:14px;font-weight:700}
.mg-flow-actions button:disabled{border-color:#DED4C5;background:#EEE8DF;color:#756D62}
.mg-flow-equation{margin-top:12px;text-align:center;font-size:12px;line-height:1.8;color:#5B5043}
.mg-flow-equation span{font-weight:700;margin:0 4px;color:#AA4C06}
/* 체결된 비율을 왼쪽부터 채우고, 해당 가격 줄에 코인이 도착한다. */
.mg-orderbook{background:#FFF9F1;border:1px solid #DDCEBB;border-radius:16px;overflow:hidden}
.mg-book-header,.mg-book-row{display:grid;grid-template-columns:1.15fr .8fr 1fr;gap:5px;align-items:center;padding:12px 15px}
.mg-book-header{background:#EAE2D6;font-size:10px;color:#6C5C47}
.mg-book-row{--mg-filled:0;position:relative;isolation:isolate;border-top:1px solid #E7DDCF;background:#FFFCF6;font-size:14px;min-height:58px}
.mg-book-row::before{content:"";position:absolute;inset:0;z-index:-1;background:#FFE0BD;transform:scaleX(var(--mg-filled));transform-origin:left;transition:transform .45s ease}
.mg-book-row b{font-size:17px}
.mg-book-row b small{font-weight:400;font-size:10px}
.mg-book-row>span{color:#796447;font-size:12px}
.mg-book-row>strong{display:flex;align-items:center;gap:4px;color:#A14506;font-size:13px}
.mg-fill-coin{display:block;width:23px;height:26px;opacity:0;transform:translateX(-18px);transition:transform .45s ease,opacity .3s ease}
.mg-fill-coin.mg-filled{opacity:1;transform:translateX(0)}
.mg-fill-coin>img{width:23px;height:26px}
.mg-quantity{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:13px;margin:18px 0 0}
.mg-quantity>button{min-height:44px;width:44px;border-radius:12px;background:#FFFCF6;border:1px solid #CDBBA4;font-size:23px;color:#5B4228}
.mg-quantity>button:disabled{color:#A79B8B;background:#EDE7DD;border-color:#DED4C5}
.mg-quantity label{font-size:11px;color:#716047}
.mg-quantity label>strong{float:right;font-size:15px;color:#9E4300}
.mg-quantity input{display:block;width:100%;margin:0;height:44px;accent-color:#D95700;cursor:pointer}
.mg-fill-summary{display:grid;grid-template-columns:1fr 20px 1fr;align-items:center;text-align:center;gap:6px;padding:16px 10px;margin-top:12px;border-radius:15px;background:#EEEADB}
.mg-fill-summary>div>small{display:block;font-size:10px;color:#746342;margin-bottom:6px}
.mg-fill-summary strong{display:block;font-size:26px;line-height:1.3;font-weight:900;letter-spacing:-.8px}
.mg-fill-summary strong small{font-size:10px;letter-spacing:0;font-weight:400}
.mg-fill-summary>span{color:#9B8761}
.mg-calculation{font-size:11px;line-height:1.6;margin:11px 0 0;text-align:center;color:#6D5B42;overflow-wrap:anywhere}
.mg-question{border-top:1px solid var(--mg-line);margin-top:23px;padding-top:22px}
.mg-section-label{font-size:10px;font-weight:700;color:#9C4200;letter-spacing:.6px}
.mg-question h3{font-size:21px;line-height:1.4;letter-spacing:-.5px;margin:9px 0 15px;word-break:keep-all;outline:none}
.mg-answers{display:grid;gap:9px}
.mg-answers button{background:#FFFCF6;border:1px solid var(--mg-line);border-radius:13px;min-height:50px;padding:12px 15px;font-size:14px;text-align:left;color:var(--mg-ink);line-height:1.5}
.mg-answers button[aria-pressed=true]{border-color:#C65A0A;background:#FFE4C8}
.mg-answers button:disabled{opacity:1}
.mg-feedback{margin:13px 0 0;padding:13px 15px;border-radius:12px;background:#ECE5D9;font-size:12px;line-height:1.7;color:#69583E;min-height:48px}
.mg-feedback.mg-correct{background:#E1EDD1;color:#355229}
@media(max-width:440px){
  .mg-heading h3{font-size:22px}.mg-heading p{font-size:12px}.mg-tag{font-size:9px}
  .mg-price-stage{padding:10px 9px 16px;gap:8px}.mg-market{padding-left:8px}
  .mg-price-item>strong{font-size:30px}.mg-price-item>small{font-size:10px}.mg-price-caption{font-size:9px}
  .mg-price-controls{gap:6px}.mg-price-controls button{font-size:16px;min-height:62px}.mg-price-controls button small{font-size:10px}
  .mg-objective{font-size:11px;gap:7px 9px}.mg-model-note{font-size:11px}
  .mg-flow-end>small{font-size:9px}.mg-flow-actions{gap:8px}.mg-flow-actions button{font-size:12px}.mg-flow-equation{font-size:11px}
  .mg-book-header,.mg-book-row{padding:11px 9px}.mg-book-header{font-size:9px}.mg-book-row b{font-size:16px}.mg-book-row>strong{font-size:12px;gap:3px}
  .mg-quantity{gap:9px}.mg-fill-summary{padding:15px 7px;gap:3px}.mg-fill-summary>div>small{font-size:9px}.mg-fill-summary strong{font-size:23px}.mg-calculation{font-size:10px}
  .mg-question h3{font-size:19px}.mg-answers button{font-size:13px;padding:12px}.mg-feedback{font-size:11px;padding:12px}
}
@media(prefers-reduced-motion:reduce){.mg-game *,.mg-game *::before{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
