/* Ex & N ミニゲーム（/tools/games/）の見た目。サイト共通の style.css・corp.css のあとに読む。 */
:root{
  --gm-bg:#0a0f24;--gm-bg2:#121a3a;--gm-panel:#172048;--gm-line:#2c3a78;
  --gm-text:#eef2ff;--gm-muted:#a9b4dc;--gm-ex:#a9defa;--gm-n:#ffe21a;--gm-pink:#ff9db0;--gm-green:#9be8a8;
  --gm-font:'M PLUS Rounded 1c','Hiragino Maru Gothic ProN','Noto Sans JP','Yu Gothic UI',sans-serif;
}
body{background:var(--gm-bg);}
html.gm-lock,html.gm-lock body{overflow:hidden;}
.gm-main{background:
    radial-gradient(90% 50% at 50% 0%,#1d2a66 0%,rgba(29,42,102,0) 70%),
    repeating-linear-gradient(0deg,rgba(255,255,255,.025) 0 1px,transparent 1px 4px),var(--gm-bg);
  color:var(--gm-text);font-family:var(--gm-font);line-height:1.75;overflow-x:clip;padding:18px 0 34px;}
.gm-main [hidden]{display:none!important;}
.gm-main a{color:var(--gm-ex);}
.gm-main button{font-family:inherit;}
.gm-main :focus-visible{outline:3px solid var(--gm-n);outline-offset:2px;border-radius:8px;}
.gm-wrap{max-width:880px;margin:0 auto;padding:0 16px;}
.gm-crumb{margin:0 0 4px;font-size:13px;}
.gm-crumb a{display:inline-flex;align-items:center;min-height:36px;}
.gm-h1{margin:0;font-size:clamp(24px,6.4vw,38px);font-weight:800;line-height:1.3;letter-spacing:.02em;color:var(--gm-n);text-shadow:0 3px 0 #b3541e,0 6px 18px rgba(255,226,26,.25);text-wrap:balance;}
.gm-lead{margin:8px 0 16px;font-size:15px;color:var(--gm-muted);max-width:44em;}

/* ---------- ゲームの枠 ---------- */
.gm-stagebox{display:flex;justify-content:center;}
.gm-stage{position:relative;width:var(--gm-w,360px);max-width:100%;background:#05060f;border-radius:14px;box-shadow:0 0 0 3px var(--gm-line),0 0 0 6px #0d1330,0 18px 50px rgba(0,0,0,.5);overflow:hidden;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;}
.gm-screen{position:relative;line-height:0;}
.gm-screen canvas{display:block;margin:0 auto;image-rendering:pixelated;image-rendering:crisp-edges;image-rendering:pixelated;background:#05060f;}
.gm-stage.gm-playing,.gm-stage.gm-playing canvas{touch-action:none;}
.gm-stage.gm-playing canvas{cursor:crosshair;}
.gm-stage.gm-full{position:fixed;inset:0;z-index:1000;width:auto;max-width:none;border-radius:0;box-shadow:none;display:flex;flex-direction:column;align-items:center;justify-content:center;}
.gm-stage.gm-full .gm-under{width:var(--gm-w,360px);max-width:100%;}
.gm-ov{position:absolute;inset:0;line-height:1.6;display:flex;flex-direction:column;align-items:center;text-align:center;color:#fff;}
.gm-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:6px 16px;border-radius:12px;border:2px solid #5a6cc0;background:#1b2658;color:#fff!important;font-size:15px;font-weight:700;text-decoration:none;cursor:pointer;box-shadow:0 3px 0 #0b1030;transition:transform .08s;}
.gm-btn:active{transform:translateY(2px);box-shadow:0 1px 0 #0b1030;}
.gm-btn-main{background:linear-gradient(180deg,#ffe95c,#ffc21a);border-color:#fff3a8;color:#3a2500!important;font-size:18px;min-width:168px;box-shadow:0 4px 0 #a86a00;}

/* タイトル */
.gm-ov-title{justify-content:flex-end;padding:0 12px 5%;gap:8px;background:linear-gradient(180deg,rgba(5,6,15,0) 30%,rgba(5,6,15,.72) 78%);}
.gm-tt-duo{position:relative;display:flex;align-items:flex-end;justify-content:center;gap:2px;height:31%;min-height:0;margin-bottom:2px;}
.gm-tt-duo img{display:block;height:100%;width:auto;filter:drop-shadow(0 6px 0 rgba(0,0,0,.35));-webkit-user-drag:none;animation:gmBob 2.4s ease-in-out infinite;}
.gm-tt-duo img.n{height:76%;animation-delay:-.9s;}
@keyframes gmBob{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-8px) rotate(2deg)}}
.gm-tt-name{margin:0;font-size:20px;font-weight:800;color:var(--gm-n);text-shadow:0 2px 0 #05060f;}
.gm-tt-best{margin:0;font-size:14px;color:var(--gm-pink);font-weight:700;}
.gm-tt-best b{color:#fff;font-size:17px;margin-left:4px;font-variant-numeric:tabular-nums;}
.gm-tt-btns{display:flex;flex-direction:column;gap:8px;align-items:center;}

/* 一時停止 */
.gm-ov-pause{justify-content:center;gap:12px;background:rgba(5,6,15,.78);}
.gm-ov-pause p{margin:0;font-size:22px;font-weight:800;color:var(--gm-n);}

/* ゲームオーバー */
.gm-ov-over{background:rgba(7,9,26,.94);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;-webkit-user-select:text;user-select:text;display:block;}
.gm-over-in{padding:14px 12px 20px;max-width:420px;margin:0 auto;animation:gmIn .35s ease-out both;}
@keyframes gmIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.gm-over-h{margin:0;font-size:22px;font-weight:800;letter-spacing:.08em;color:var(--gm-pink);}
.gm-over-duo{display:flex;align-items:flex-end;justify-content:center;gap:6px;margin:8px 0 2px;}
.gm-ch{display:block;width:auto;flex:none;}
.gm-ch-n{height:62px;}.gm-ch-ex{height:84px;}
.gm-bubble{position:relative;flex:1;min-width:0;padding:8px 10px;border-radius:14px;background:#fff;color:#1b2142;font-size:13.5px;line-height:1.5;text-align:left;margin-bottom:14px;}
.gm-bubble b{display:inline-block;margin-right:6px;padding:0 7px;border-radius:999px;font-size:11.5px;background:var(--gm-ex);color:#0f3550;}
.gm-bubble.who-n b{background:var(--gm-n);color:#4a3600;}
.gm-bubble::after{content:"";position:absolute;bottom:-6px;right:16px;width:12px;height:12px;background:#fff;transform:rotate(45deg);}
.gm-bubble.who-n::after{right:auto;left:16px;}
.gm-over-score{margin:6px 0 0;line-height:1.2;}
.gm-over-score span{display:block;font-size:12px;letter-spacing:.2em;color:var(--gm-ex);}
.gm-over-score strong{font-size:44px;font-weight:800;color:#fff;font-variant-numeric:tabular-nums;text-shadow:0 3px 0 #2c3a78;}
.gm-over-best{margin:0 0 10px;font-size:13.5px;color:var(--gm-muted);}
.gm-over-best em{font-style:normal;font-weight:800;color:var(--gm-n);}
.gm-over-btns{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-bottom:12px;}
.gm-card{display:block;width:100%;height:auto;aspect-ratio:800/420;border-radius:10px;border:1px solid var(--gm-line);background:#0b1030;}
.gm-share{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:10px;}
.gm-share .gm-btn{padding:4px 6px;font-size:13px;min-width:0;line-height:1.2;}
.gm-msg{min-height:1.5em;margin:6px 0 0;font-size:13px;color:var(--gm-n);font-weight:700;}
.gm-tip,.gm-girl{margin:6px 0 0;padding:8px 10px;border-radius:10px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);font-size:12.5px;line-height:1.6;color:#d5dcff;text-align:left;}
.gm-girl{display:flex;align-items:center;gap:8px;}
.gm-girl img{height:56px;width:auto;flex:none;}
.gm-over-links{margin:8px 0 0;font-size:14px;}
.gm-over-links a{display:inline-flex;align-items:center;min-height:44px;padding:0 8px;}

/* 画面の下：ひとことと操作ボタン */
.gm-under{background:#0b1030;line-height:1.4;}
.gm-talk{display:flex;align-items:center;gap:6px;height:24px;padding:0 8px;font-size:12.5px;color:#fff;opacity:0;transition:opacity .25s;white-space:nowrap;overflow:hidden;}
.gm-talk.on{opacity:1;}
.gm-talk b{flex:none;padding:0 7px;border-radius:999px;font-size:11px;line-height:17px;background:var(--gm-ex);color:#0f3550;}
.gm-talk.who-n b{background:var(--gm-n);color:#4a3600;}
.gm-talk.who-girl b{background:#e7e2ff;color:#3a2f7a;}
.gm-talk span{overflow:hidden;text-overflow:ellipsis;}
.gm-pad{display:flex;align-items:center;gap:6px;height:48px;padding:0 6px 4px;}
.gm-pb{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:4px;height:40px;min-width:44px;padding:0 8px;border-radius:10px;border:1px solid #3a4a94;background:#172048;color:#dfe6ff;font-size:11.5px;font-weight:700;cursor:pointer;touch-action:manipulation;}
.gm-pb svg{width:18px;height:18px;flex:none;}
.gm-pb[aria-pressed="true"]{background:#2c3f9a;border-color:#9fb2ff;color:#fff;}
.gm-pb[aria-pressed="false"]{color:#8b96c4;}
.gm-pb .off{display:none;}
.gm-pb[aria-pressed="false"] .on{display:none;}
.gm-pb[aria-pressed="false"] .off{display:inline;}
#btnExit{display:none;}
.gm-stage.gm-full #btnExit{display:inline-flex;}
.gm-bomb{margin-left:auto;min-width:84px;height:42px;border-radius:21px;border:2px solid #ffb39c;background:linear-gradient(180deg,#ff7a4d,#e23d1a);color:#fff;font-size:14px;letter-spacing:.06em;box-shadow:0 3px 0 #7a1c08;touch-action:none;}
.gm-bomb:active{transform:translateY(2px);box-shadow:0 1px 0 #7a1c08;}
.gm-sr{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}

/* ---------- 説明 ---------- */
.gm-sec{margin:26px auto 0;max-width:720px;padding:16px 18px;border-radius:16px;background:var(--gm-panel);border:1px solid var(--gm-line);}
.gm-sec h2{margin:0 0 8px;font-size:19px;color:var(--gm-n);}
.gm-sec ul{margin:0;padding-left:1.2em;}
.gm-sec li{margin:4px 0;font-size:14.5px;}
.gm-keys{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:12px 0 0;font-size:14px;}
.gm-keys dt{font-weight:700;color:var(--gm-ex);}
.gm-keys dd{margin:0;color:#dfe6ff;}
.gm-items{display:flex;flex-wrap:wrap;gap:6px 14px;margin:12px 0 0;padding:0;list-style:none;font-size:13.5px;}
.gm-items li{margin:0;}
.gm-items b{display:inline-block;min-width:22px;margin-right:5px;padding:0 5px;border-radius:5px;text-align:center;color:#05060f;font-size:12px;}
.gm-more{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin:22px auto 0;max-width:720px;}
.gm-more a{display:block;padding:12px 14px;border-radius:14px;background:var(--gm-bg2);border:1px solid var(--gm-line);text-decoration:none;color:#fff;font-weight:700;font-size:15px;}
.gm-more a small{display:block;font-weight:400;font-size:12.5px;color:var(--gm-muted);line-height:1.5;margin-top:2px;}
.gm-more a:hover{border-color:var(--gm-n);}

/* ---------- 一覧（ハブ） ---------- */
.gm-hero{display:flex;align-items:flex-end;gap:10px;margin-bottom:6px;}
.gm-hero-txt{flex:1;min-width:0;}
.gm-hero-duo{flex:none;display:flex;align-items:flex-end;height:clamp(84px,24vw,150px);}
.gm-hero-duo img{display:block;height:100%;width:auto;animation:gmBob 2.6s ease-in-out infinite;}
.gm-hero-duo img.n{height:74%;animation-delay:-1s;}
.gm-hero-duo img.girl{height:112%;animation-delay:-1.6s;}
.gm-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;margin-top:14px;}
.gm-cardx{display:flex;flex-direction:column;border-radius:18px;background:var(--gm-panel);border:2px solid var(--gm-line);overflow:hidden;box-shadow:0 10px 30px rgba(0,0,0,.35);transition:transform .15s,border-color .15s;}
.gm-cardx:hover{transform:translateY(-3px);border-color:var(--gm-n);}
.gm-cardx canvas{display:block;width:100%;height:auto;aspect-ratio:180/120;image-rendering:pixelated;image-rendering:crisp-edges;image-rendering:pixelated;background:#05060f;}
.gm-cardx-in{display:flex;flex-direction:column;gap:6px;padding:12px 14px 14px;flex:1;}
.gm-cardx h2{margin:0;font-size:19px;color:var(--gm-n);line-height:1.35;}
.gm-cardx .genre{font-size:11.5px;color:var(--gm-green);font-weight:700;letter-spacing:.06em;}
.gm-cardx p{margin:0;font-size:14px;color:#d5dcff;flex:1;}
.gm-cardx .best{font-size:13px;color:var(--gm-pink);font-weight:700;}
.gm-cardx .best b{color:#fff;font-size:16px;margin-left:4px;font-variant-numeric:tabular-nums;}
.gm-cardx .gm-btn{align-self:stretch;}

.gm-footer{text-align:center;padding:18px 20px 22px;font-size:13px;color:var(--gm-muted);border-top:1px solid var(--gm-line);background:var(--gm-bg);font-family:var(--gm-font);line-height:2.2;}
.gm-footer a{display:inline-flex;align-items:center;min-height:44px;padding:0 6px;color:var(--gm-ex);}

@media (prefers-reduced-motion: reduce){
  .gm-tt-duo img,.gm-hero-duo img,.gm-over-in{animation:none;}
  .gm-cardx,.gm-btn{transition:none;}
}

@media (max-width:719px){.gm-stagebox{margin:0 -16px;}.gm-stage{border-radius:0;}}
.gm-hero{flex-wrap:wrap;}.gm-hero-txt{flex:1 1 300px;}.gm-hero-duo{margin:0 auto;}
.gm-stage{scroll-margin-top:76px;}
.gm-note{margin-top:18px;font-size:13.5px;}
/* OGP の絵を撮るときだけ（?og=1） */
body.gm-og .topbar,body.gm-og .site-header,body.gm-og .gm-footer,body.gm-og .gm-cardx p,body.gm-og .gm-cardx .best,body.gm-og .gm-cardx .gm-btn,body.gm-og .gm-cardx .genre,body.gm-og .gm-note{display:none;}
body.gm-og .gm-main{width:1200px;height:630px;padding:26px 0 0;box-sizing:border-box;overflow:hidden;}
body.gm-og .gm-wrap{max-width:1120px;}
body.gm-og .gm-h1{font-size:66px;}
body.gm-og .gm-lead{font-size:23px;max-width:none;}
body.gm-og .gm-hero-duo{height:236px;margin:0;}
body.gm-og .gm-hero-duo img{animation:none;}
body.gm-og .gm-cards{grid-template-columns:repeat(3,1fr);gap:22px;margin-top:6px;}
body.gm-og .gm-cardx h2{font-size:23px;text-align:center;}
body.gm-og .gm-cardx canvas{aspect-ratio:180/104;object-fit:cover;}
.gm-cardx .gm-cardx-img{display:block;width:100%;height:auto;aspect-ratio:1200/630;object-fit:cover;background:#05060f;}
