/* 未来古事記 — 共通の試練 UI。すべて .mg- 内へ限定 */
.mg-game{--mg-ink:#071421;--mg-deep:#0b1d2b;--mg-gold:#e5c082;--mg-gold-dim:#aa8b57;--mg-blue:#85c6cf;--mg-white:#eef0e9;--mg-muted:#adc0c7;box-sizing:border-box;position:relative;isolation:isolate;width:min(100%,920px);margin:0 auto;padding:clamp(18px,4vw,42px);color:var(--mg-white);font-family:"Noto Sans JP","Yu Gothic",Meiryo,sans-serif;background:radial-gradient(ellipse at 15% 0%,#18425388,transparent 60%),radial-gradient(ellipse at 100% 100%,#9a613223,transparent 50%),var(--mg-ink);border:1px solid #d1ac6244;border-radius:22px;box-shadow:0 22px 90px #0008;overflow:hidden;text-align:left;font-size:15px;line-height:1.75}
.mg-game *{box-sizing:border-box}.mg-game:before{content:"";position:absolute;z-index:-1;inset:9px;border:1px solid #bfa06018;border-radius:15px;pointer-events:none}.mg-game button{font:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.mg-game button:focus-visible{outline:3px solid #bceafb;outline-offset:4px}.mg-game button:disabled{cursor:default;opacity:.44}.mg-game h2,.mg-game h3,.mg-game p{margin:0}.mg-game h2{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-weight:500;font-size:clamp(24px,4vw,36px);letter-spacing:.1em;line-height:1.45;color:#f5e8cf}.mg-header{margin-bottom:25px}.mg-header>p:not(.mg-eyebrow){margin-top:12px;font-size:14px;color:#c1ced0;line-height:1.95;max-width:750px}.mg-header .mg-instructions{font-size:13px;color:#9eb3bf}.mg-eyebrow{font-size:10px;letter-spacing:.24em;color:var(--mg-gold);display:flex;justify-content:space-between;align-items:center;margin-bottom:10px!important}.mg-eyebrow span{font-size:22px;font-family:Georgia,serif;letter-spacing:0;opacity:.65}.mg-game-body{min-width:0}.mg-button{color:var(--mg-white);background:linear-gradient(145deg,#254251,#132b3a);border:1px solid #c0d2cd3d;border-radius:8px;min-height:44px;padding:10px 19px;font-weight:500;cursor:pointer;transition:background .18s,box-shadow .18s,transform .18s;line-height:1.5}.mg-button:not(:disabled):hover{background:linear-gradient(145deg,#345969,#1a3e51);box-shadow:0 0 25px #77d3dd19}.mg-button:not(:disabled):active{transform:translateY(1px)}.mg-button small{font-size:11px;opacity:.66;margin-left:5px}.mg-inline{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:19px}.mg-status{text-align:center;color:var(--mg-muted);font-size:13px;margin:14px 0 23px;padding:10px;background:#ffffff05;border-block:1px solid #acc4ca12}.mg-status strong{font-weight:600;color:var(--mg-gold)}.mg-message{color:#f2dba9;font-size:13px;min-height:25px;text-align:center;margin-top:15px;line-height:1.8}.mg-hint{padding:15px 19px;border:1px solid #bd975246;border-radius:8px;background:#b98a2410;margin:18px 0}.mg-hint b{font-size:11px;letter-spacing:.13em;color:var(--mg-gold)}.mg-hint p{font-size:13px;margin-top:7px;color:#d4d8cb;overflow-wrap:anywhere}.mg-tools{display:flex;flex-wrap:wrap;gap:9px;border-top:1px solid #b1c7cd22;padding-top:20px;margin-top:23px}.mg-tools .mg-button{font-size:12px;min-height:40px;padding:9px 13px;background:#ffffff04;color:#b1c6cd}.mg-tools .mg-button:last-child{margin-left:auto}.mg-result{display:flex;gap:18px;align-items:center;margin-top:20px;padding:21px;border:1px solid #dfbd7770;background:linear-gradient(110deg,#bc984525,#55a8b014);border-radius:12px}.mg-result>span{color:var(--mg-gold);font-size:38px}.mg-result>div{flex:1}.mg-result p{font-size:11px;color:#d5c29a;letter-spacing:.14em}.mg-result h3{font-family:"Yu Mincho",serif;font-size:19px;color:#f6e7c8;font-weight:500}.mg-result small{font-size:12px;color:var(--mg-gold)}.mg-result .mg-button{background:linear-gradient(140deg,#e9cc94,#bc9658);color:#182732;font-weight:700;border-color:#e9cc94}.mg-loss{border-color:#bd827366;background:#58312725}.mg-loss .mg-button{background:#734d42;color:#fff;border-color:#ab7963}.mg-won .mg-game-body{opacity:.65}
/* 記憶札 */
.mg-memory{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;max-width:690px;margin:auto}.mg-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:145px;padding:17px 9px;border:1px solid #ad905554;border-radius:9px;color:#cbbb95;background:repeating-linear-gradient(135deg,#ffffff03 0,#ffffff03 1px,transparent 1px,transparent 12px),linear-gradient(145deg,#183542,#0a1b29);cursor:pointer;overflow:hidden;transition:background .2s,border-color .2s}.mg-card:after{content:"";position:absolute;inset:6px;border:1px solid #c4a46623;border-radius:4px;pointer-events:none}.mg-card-emblem{font-family:"Yu Mincho",serif;font-size:36px;line-height:1.3;color:#bb9c6288}.mg-card-word{font-size:13px;line-height:1.6;margin-top:8px;overflow-wrap:anywhere}.mg-card-word small{font-size:11px;color:#8fc4ce}.mg-card-no{position:absolute;bottom:8px;right:11px;font-size:9px;opacity:.5}.mg-card.mg-open{background:radial-gradient(circle at 50% 0%,#447485,#1b3547);border-color:#e4c78e}.mg-card.mg-open .mg-card-emblem{color:#eac98e}.mg-card.mg-open .mg-card-word{color:#fbf3e5}.mg-card.mg-matched{opacity:1!important;background:linear-gradient(145deg,#675235,#263d40);border-color:#ae9959}.mg-card.mg-matched:before{content:"✓";position:absolute;top:9px;right:11px;color:#f7d68a;font-size:12px}
/* 物語の順序 */
.mg-order-track{display:grid;gap:8px;max-width:680px;margin:auto}.mg-order-slot{display:flex;align-items:center;gap:17px;border:1px dashed #81a5b52d;border-radius:7px;padding:11px 15px;min-height:54px;background:#081a2799;color:#67808c;font-size:13px}.mg-order-slot b{font-family:Georgia,serif;color:#668696;font-size:19px;font-weight:400}.mg-order-slot.mg-filled{border-style:solid;border-color:#c5a25945;color:#e4d9bf;background:linear-gradient(110deg,#c9a45610,#31545b15)}.mg-filled b{color:#d8b775}.mg-choices{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;margin:21px 0}.mg-choices .mg-button{font-size:13px;max-width:100%;text-wrap:pretty;text-align:left}
/* 光の管 */
.mg-circuit-shell{position:relative;max-width:450px;margin:31px auto 37px;padding:0 19px}.mg-circuit{display:grid;grid-template-columns:repeat(var(--mg-n),minmax(0,1fr));gap:5px;border:1px solid #88b5bb3b;padding:9px;border-radius:11px;background:#020d16;box-shadow:inset 0 0 45px #4b95961c}.mg-pipe{aspect-ratio:1;min-width:0;position:relative;padding:0;border:1px solid #375360;border-radius:4px;background:linear-gradient(140deg,#1b3441,#0b202d);cursor:pointer;overflow:hidden}.mg-pipe svg{display:block;width:100%;height:100%}.mg-pipe-shadow path{fill:none;stroke:#071019;stroke-width:20;stroke-linecap:round}.mg-pipe-line path{fill:none;stroke:#6b8893;stroke-width:9;stroke-linecap:round}.mg-pipe-line.mg-lit path{stroke:#edcc83;filter:drop-shadow(0 0 5px #edcd8688)}.mg-pipe-center{fill:#c7d8d8;stroke:#10212b;stroke-width:2}.mg-powered{border-color:#b8975888}.mg-source,.mg-sink{position:absolute;font-size:11px;color:#e2c480;letter-spacing:.04em;left:19px;top:-23px}.mg-sink{left:auto;right:19px;top:auto;bottom:-26px}.mg-sink.mg-left{left:19px;right:auto}.mg-pipe-guide{position:absolute;inset:0;pointer-events:none}.mg-pipe-guide .mg-pipe-shadow,.mg-pipe-guide .mg-pipe-center{display:none}.mg-pipe-guide .mg-pipe-line path{stroke:#e9bd53;stroke-width:2;stroke-dasharray:4 4;opacity:.8}
/* 迷路 */
.mg-map{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;max-width:550px;margin:auto;background:#0b1b24;padding:9px;border:1px solid #83998d44;border-radius:12px;box-shadow:0 0 50px #497c6d16}.mg-cell{position:relative;aspect-ratio:1;min-height:0;min-width:0;background:linear-gradient(140deg,#233d3e,#122c33);border:1px solid #59797a2d;border-radius:5px;color:#83c8d0;font-size:clamp(17px,4vw,26px)!important;cursor:pointer;display:grid;place-items:center;padding:0!important;line-height:1!important}.mg-cell.mg-rock{opacity:1!important;color:#52616a;background:repeating-linear-gradient(150deg,#1a242b 0,#1a242b 6px,#25313a 7px,#25313a 8px);border-color:#263946}.mg-cell.mg-danger{color:#e8a288;background:radial-gradient(circle,#ab4e332f,#1f2028);font-size:13px!important}.mg-cell.mg-gate{color:#f0d294;border:1px solid #cbaf6999;font-size:16px!important}.mg-cell.mg-player{color:#fff3d1;border-color:#f5d086;background:radial-gradient(circle,#bea2638c,#243f4788);box-shadow:0 0 19px #eec67533}.mg-player span{text-shadow:0 0 10px #ffeba2}.mg-cell.mg-waypoint{outline:2px solid #d6c378;outline-offset:-3px}.mg-map-legend{text-align:center;color:#8faeb5;font-size:11px;margin:10px 0}.mg-map-legend span{color:#cf9382}.mg-dpad{width:160px;max-width:100%;margin:18px auto 0;text-align:center}.mg-dpad>div{display:flex;gap:5px;margin-top:5px}.mg-dpad .mg-button{width:50px;height:45px;padding:5px;font-size:21px;font-weight:400}
/* 共鳴 */
.mg-beats{display:flex;justify-content:center;gap:12px;margin-bottom:20px}.mg-beats span{display:grid;place-items:center;width:26px;height:26px;border:1px solid #72969e44;color:#748d9c;border-radius:50%;font-size:10px}.mg-beats .mg-current{border-color:#eac181;color:#f3ddad;box-shadow:0 0 15px #d4ba6026}.mg-beats .mg-hit{background:#cdb06a;color:#182630;border-color:#e4cda0}.mg-beats .mg-miss{color:#b08880;border-color:#a5756555;background:#7a4e4420}.mg-rhythm-sky{height:135px;position:relative;display:grid;place-items:center;overflow:hidden}.mg-rhythm-ring{position:absolute;width:124px;height:124px;border:1px solid #bcb1823b;border-radius:50%;box-shadow:0 0 0 16px #a7cccd06,0 0 0 34px #a7cccd05,0 0 60px #75bcc22b;background:radial-gradient(circle,#d1b78216,transparent 70%)}.mg-rhythm-ring:after{content:"";position:absolute;inset:13px;border:1px solid #c9c4a824;border-radius:50%}.mg-rhythm-symbol{font-family:"Yu Mincho",serif;position:relative;font-size:47px;color:#edd6a6;opacity:.85}.mg-beat-lane{position:relative;height:66px;margin:27px 14px 12px;border-block:1px solid #9cb6bd38;background:linear-gradient(90deg,#2a4e5522,transparent,#2a4e5522);overflow:visible}.mg-beat-zone{position:absolute;left:50%;transform:translateX(-50%);height:100%;background:linear-gradient(90deg,#cca34b10,#dbb35338,#cca34b10);border-inline:1px solid #e4c58c70}.mg-beat-zone:after{content:"";position:absolute;left:50%;height:100%;width:1px;background:#e1c18444}.mg-beat-cursor{position:absolute;z-index:2;top:11px;width:9px;height:42px;background:#cbeff2;border-radius:20px;box-shadow:0 0 12px #c5eef9;transform:translateX(-50%)}.mg-beat-lane i{position:absolute;font-size:10px;font-style:normal;color:#988e75;bottom:-25px;text-align:center;inset-inline:0}.mg-rhythm-feedback{text-align:center;margin-top:33px!important;min-height:27px;color:#d6c59e;font-size:13px}.mg-type-rhythm .mg-inline .mg-button:first-child{min-width:175px;min-height:54px;background:linear-gradient(140deg,#a78851,#735e3b);color:#fff5df;border-color:#dcc49899}
/* 調和 */
.mg-rules{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-bottom:14px}.mg-rules p{padding:10px 14px;border:1px solid #aa9d6d3d;border-radius:6px;background:#b5954610;font-size:13px;color:#ded0ae}.mg-balance{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:26px;max-width:540px;margin:auto}.mg-vessel{text-align:center;min-width:0}.mg-vessel h3{font-size:14px;font-weight:500;letter-spacing:.12em;color:#b5d4d9;margin-bottom:17px;overflow-wrap:anywhere}.mg-vessel-body{display:flex;flex-direction:column-reverse;gap:5px;height:212px;border:1px solid #7bb5b955;border-radius:7px 7px 25px 25px;padding:14px 17px;background:linear-gradient(90deg,#152b34,#244d5640,#152b34);box-shadow:inset 0 -14px 26px #0002;overflow:hidden}.mg-vessel-body i{display:block;flex:1;background:#a6c2c908;border:1px solid #a6c2c914;border-radius:2px}.mg-vessel-body i.mg-full{background:linear-gradient(90deg,#648f83,#dcca87,#70a292);border-color:#dce3b778;box-shadow:0 0 10px #c4dab126}.mg-amount{display:block;font:32px/1.4 Georgia,serif;color:#e0c88f;margin-top:9px}.mg-vessel .mg-inline{margin-top:8px;gap:7px}.mg-vessel .mg-button{width:45px;height:44px;padding:5px;font-size:20px}
/* 連環封印 */
.mg-seal-target{text-align:center;color:#9cb0bb;font-size:13px;margin-bottom:30px}.mg-seal-target strong{display:block;font-family:Georgia,serif;font-size:28px;letter-spacing:.1em;color:#efce95;font-weight:400}.mg-seals{display:flex;justify-content:center;gap:22px;margin:15px 0 29px}.mg-dial{isolation:isolate;position:relative;width:155px;aspect-ratio:1;border:1px solid #af965858;border-radius:50%;background:radial-gradient(circle at 50% 42%,#244955,#0d2330 70%);color:#9ebec7;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px;box-shadow:0 0 27px #304c4622}.mg-dial:after{content:"";position:absolute;inset:10px;border:1px solid #b8a35b3a;border-radius:50%;pointer-events:none}.mg-dial-ring{position:absolute;inset:0;pointer-events:none;transition:transform .3s}.mg-dial-ring:after{content:"◆";position:absolute;top:0;left:calc(50% - 7px);width:14px;font-size:13px;line-height:13px;color:#d6bb76}.mg-dial small{font-size:11px;color:#9eb5be;letter-spacing:.1em}.mg-dial strong{font:44px/1.25 Georgia,serif;color:#e3d1a4;font-weight:400}.mg-dial>span:last-child{font-size:11px}.mg-dial.mg-aligned{border-color:#dfc580;background:radial-gradient(circle,#ad875333,#1c333d 75%)}.mg-dial.mg-next-dial{outline:2px dashed #ecd394;outline-offset:5px}.mg-link-note{text-align:center;font-size:12px;color:#849da8}
/* 予兆戦 */
.mg-duel-bars{display:grid;grid-template-columns:1fr 1fr;gap:35px;margin-top:20px}.mg-duel-bars>div{min-width:0}.mg-duel-bars span{font-size:12px;color:#b6cbd0;display:flex;justify-content:space-between;gap:8px}.mg-duel-bars b{font-weight:400;color:#d7bd86;white-space:nowrap}.mg-duel-bars progress{width:100%;height:8px;border:0;display:block;margin-top:9px;border-radius:20px;overflow:hidden;accent-color:#d1bf8c;background:#182f3b}.mg-duel-bars progress::-webkit-progress-bar{background:#182f3b}.mg-duel-bars progress::-webkit-progress-value{background:linear-gradient(90deg,#6ea8a3,#c8d7b0)}.mg-duel-bars>div:last-child progress::-webkit-progress-value{background:linear-gradient(90deg,#8c706d,#ceaa81)}.mg-shadow-stage{display:flex;align-items:center;justify-content:center;gap:34px;min-height:185px;padding:23px 0}.mg-shadow-glyph{position:relative;display:grid;place-items:center;width:115px;height:135px;font-family:"Yu Mincho",serif;font-size:57px;color:#c6bda387;text-shadow:0 0 18px #d6be83;flex-shrink:0;background:radial-gradient(ellipse,#56667f33,transparent 70%)}.mg-shadow-glyph:before,.mg-shadow-glyph:after{content:"";position:absolute;inset:18px;border:1px solid #abbbca34;transform:rotate(45deg)}.mg-shadow-glyph:after{transform:rotate(60deg);border-color:#bbaa7433}.mg-forecast small{color:#d8b981;letter-spacing:.07em;font-size:11px}.mg-forecast h3{font-family:"Yu Mincho",serif;color:#e7dbbf;font-weight:400;font-size:22px;margin:5px 0}.mg-forecast p{font-size:12px;color:#9eb5c2}.mg-duel-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.mg-duel-actions .mg-button{padding:15px 8px;text-align:center}.mg-duel-actions b{font-size:16px;font-weight:500;color:#eedbbb}.mg-duel-actions small{display:block;margin:7px 0 0;font-size:11px;opacity:.8;color:#aac6ca;line-height:1.6}.mg-combat-log{margin:17px 0 0;padding:0;list-style:none;font-size:12px;color:#8da9b4;line-height:1.9;min-height:24px}.mg-combat-log li:last-child{color:#c9d2c5}.mg-combat-log li:before{content:"· ";color:#caac6f}
@media(max-width:600px){.mg-game{padding:20px 17px;border-radius:15px;font-size:14px}.mg-header{margin-bottom:19px}.mg-header>p:not(.mg-eyebrow){font-size:13px}.mg-memory{gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}.mg-card{min-height:122px;padding:13px 8px}.mg-card-emblem{font-size:28px}.mg-card-word{font-size:12px}.mg-result{flex-wrap:wrap;gap:11px;padding:17px}.mg-result>span{font-size:29px}.mg-result .mg-button{width:100%}.mg-result h3{font-size:17px}.mg-balance{gap:12px}.mg-vessel-body{padding:12px 9px;height:190px}.mg-vessel .mg-inline{gap:4px}.mg-vessel .mg-button{width:36px;min-width:0}.mg-seals{gap:13px}.mg-dial{width:31%;padding:8px}.mg-dial strong{font-size:35px}.mg-dial small,.mg-dial>span:last-child{font-size:10px}.mg-dial:after{inset:6px}.mg-map{gap:4px;padding:6px}.mg-tools{gap:7px}.mg-tools .mg-button{padding:8px 10px}.mg-status{font-size:12px;padding:9px 6px;line-height:1.9}.mg-rules{gap:6px}.mg-rules p{font-size:12px;padding:9px 10px;width:100%;text-align:center}.mg-duel-bars{gap:16px}.mg-shadow-stage{gap:14px;min-height:165px}.mg-shadow-glyph{width:83px;font-size:45px;height:110px}.mg-shadow-glyph:before,.mg-shadow-glyph:after{inset:17px 10px}.mg-forecast h3{font-size:18px}.mg-forecast p{font-size:11px}.mg-duel-actions{gap:7px}.mg-duel-actions .mg-button{padding:13px 5px}.mg-duel-actions b{font-size:14px}.mg-duel-actions small{font-size:10px}.mg-beats{gap:8px}.mg-beats span{width:23px;height:23px}}
@media(max-width:360px){.mg-game{padding:17px 12px}.mg-header h2{font-size:23px}.mg-card{min-height:114px}.mg-card-word{font-size:11px}.mg-tools .mg-button{font-size:11px;padding:8px}.mg-tools .mg-button:last-child{margin-left:0}.mg-vessel h3{font-size:12px}.mg-vessel .mg-button{width:32px;padding:2px}.mg-dial strong{font-size:29px}.mg-dial{padding:7px}.mg-dial>span:last-child{font-size:9px}.mg-dial-ring:after{font-size:10px}.mg-shadow-stage{gap:8px}.mg-shadow-glyph{width:64px}.mg-forecast h3{font-size:16px}.mg-duel-bars span{font-size:10px}.mg-map-legend{font-size:10px}.mg-beats{gap:5px}}
@media(prefers-reduced-motion:reduce){.mg-game *{transition:none!important;animation:none!important;scroll-behavior:auto!important}.mg-beat-cursor{box-shadow:none}}
.mg-result .mg-button:not(:disabled):hover,.mg-result .mg-button:focus-visible{background:linear-gradient(140deg,#f5dfb4,#d6ae6d);color:#14232c;box-shadow:0 0 25px #e3c17d30}.mg-loss .mg-button:not(:disabled):hover,.mg-loss .mg-button:focus-visible{background:#95634f;color:#fff}
