/* 放課後ゲーム部 共通設定 */
html[data-hg-motion="reduced"] *,
html[data-hg-motion="reduced"] *::before,
html[data-hg-motion="reduced"] *::after{
  animation-duration:.001ms!important;
  animation-iteration-count:1!important;
  transition-duration:.001ms!important;
  scroll-behavior:auto!important;
}
html[data-hg-motion="reduced"] .hit-fx,
html[data-hg-motion="reduced"] .spark-burst,
html[data-hg-motion="reduced"] .petal-burst,
html[data-hg-motion="reduced"] .impact-rays{
  display:none!important;
}
body.hg-settings-open{overflow:hidden!important}

.hg-settings-nav-btn{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  transform:translate(-50%,-50%)!important;
  z-index:20!important;
  width:42px!important;
  min-width:42px!important;
  height:42px!important;
  min-height:42px!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  border-radius:50%!important;
  border:2px solid rgba(255,255,255,.9)!important;
  background:rgba(255,255,255,.94)!important;
  color:#25354d!important;
  box-shadow:0 4px 12px rgba(0,0,0,.16)!important;
  font:900 20px/1 system-ui,-apple-system,sans-serif!important;
  cursor:pointer;
}
.top-nav{position:relative!important}

.hg-settings-backdrop{
  position:fixed;
  inset:0;
  z-index:10000;
  display:grid;
  place-items:center;
  padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom));
  background:rgba(7,17,31,.78);
  backdrop-filter:blur(6px);
  overflow:auto;
}
.hg-settings-modal{
  width:min(560px,100%);
  max-height:92dvh;
  overflow:auto;
  border-radius:26px;
  padding:18px;
  background:#fffdf8;
  color:#17213b;
  box-shadow:0 24px 70px rgba(0,0,0,.38);
  font-family:system-ui,-apple-system,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;
}
.hg-settings-head{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:start;
}
.hg-settings-head span{
  color:#167be8;
  font-size:10px;
  font-weight:1000;
  letter-spacing:.14em;
}
.hg-settings-head h2{
  margin:3px 0 5px;
  font-size:28px;
  line-height:1.1;
}
.hg-settings-head p{
  margin:0;
  color:#667085;
  font-size:12px;
  font-weight:700;
  line-height:1.55;
}
.hg-settings-close{
  width:42px;
  height:42px;
  border-radius:50%;
  border:1px solid #d6dee8;
  background:#fff;
  color:#43516a;
  font-size:27px;
  line-height:1;
}
.hg-settings-list{
  display:grid;
  gap:10px;
  margin-top:16px;
}
.hg-setting-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:14px;
  border:1px solid #e0e6ee;
  border-radius:18px;
  background:#f8fafc;
}
.hg-setting-copy strong{
  display:block;
  font-size:16px;
  line-height:1.2;
}
.hg-setting-copy span{
  display:block;
  margin-top:4px;
  color:#68758a;
  font-size:11px;
  font-weight:700;
  line-height:1.45;
}
.hg-setting-options{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  min-width:132px;
}
.hg-setting-choice{
  min-height:40px;
  padding:7px 10px;
  border:1px solid #cfd8e4;
  border-radius:12px;
  background:#fff;
  color:#58667d;
  font:900 12px/1 system-ui,-apple-system,sans-serif;
}
.hg-setting-choice.selected{
  border-color:#ffb21d;
  background:linear-gradient(180deg,#ffe766,#ffc22f);
  color:#302000;
  box-shadow:0 3px 0 #c07808;
}
.hg-setting-choice:disabled{opacity:.42}
.hg-settings-note{
  margin-top:12px;
  padding:10px 12px;
  border-radius:13px;
  background:#fff6df;
  color:#74591b;
  font-size:11px;
  font-weight:800;
  line-height:1.5;
}
.hg-settings-actions{
  display:grid;
  grid-template-columns:1fr 1.25fr;
  gap:8px;
  margin-top:14px;
}
.hg-settings-actions button{
  min-height:48px;
  border-radius:14px;
  font:900 14px/1 system-ui,-apple-system,sans-serif;
}
.hg-settings-reset{
  border:1px solid #d8e0e9;
  background:#fff;
  color:#526077;
}
.hg-settings-done{
  border:2px solid #fff0ae;
  background:linear-gradient(180deg,#ffe766,#ffbb22);
  color:#2d1c00;
  box-shadow:0 4px 0 #b96b08;
}
.home-settings-btn{
  width:100%;
  min-height:50px;
  padding:10px 18px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.92);
  background:rgba(22,123,232,.90);
  color:#fff;
  font:900 clamp(14px,4vw,18px)/1 system-ui,-apple-system,sans-serif;
  box-shadow:0 5px 0 rgba(7,70,142,.55),0 10px 20px rgba(0,0,0,.14);
}
.games-settings-btn{
  float:right;
  min-height:42px;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid #eadfcf;
  background:#fff;
  color:#17213b;
  font:900 13px/1 system-ui,-apple-system,sans-serif;
  box-shadow:0 6px 16px rgba(41,37,30,.08);
}
@media(max-width:430px){
  .hg-setting-card{grid-template-columns:1fr;gap:9px}
  .hg-setting-options{width:100%;min-width:0}
  .hg-settings-modal{padding:15px}
  .hg-settings-nav-btn{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important;font-size:18px!important}
}


/* Settings button: background top-right placement 2026-10-10 */
/*
  共通設定ボタンは上部ナビ中央ではなく、
  「ゲームをえらぶ」の下＝ゲーム背景エリア右上へ重ねる。
*/
.top-nav{
  position:relative!important;
}
.hg-settings-nav-btn{
  left:auto!important;
  right:10px!important;
  top:calc(100% + 10px)!important;
  transform:none!important;
  width:58px!important;
  min-width:58px!important;
  height:48px!important;
  min-height:48px!important;
  padding:0!important;
  border-radius:15px!important;
  border:1.5px solid rgba(255,255,255,.94)!important;
  background:rgba(255,255,255,.94)!important;
  color:#25354d!important;
  box-shadow:
    0 5px 14px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,.86)!important;
  font-size:21px!important;
  z-index:60!important;
}
.hg-settings-nav-btn:active{
  transform:translateY(2px)!important;
  box-shadow:
    0 2px 8px rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.82)!important;
}
@media(max-width:430px){
  .hg-settings-nav-btn{
    right:8px!important;
    top:calc(100% + 8px)!important;
    width:54px!important;
    min-width:54px!important;
    height:46px!important;
    min-height:46px!important;
    border-radius:14px!important;
    font-size:20px!important;
  }
}


/* Settings button compact height fix 2026-10-10 */
.hg-settings-nav-btn{
  right:10px!important;
  top:calc(100% + 6px)!important;
  width:50px!important;
  min-width:50px!important;
  height:36px!important;
  min-height:36px!important;
  border-radius:12px!important;
  font-size:18px!important;
  box-shadow:
    0 3px 9px rgba(0,0,0,.15),
    inset 0 1px 0 rgba(255,255,255,.86)!important;
}
@media(max-width:430px){
  .hg-settings-nav-btn{
    right:8px!important;
    top:calc(100% + 5px)!important;
    width:48px!important;
    min-width:48px!important;
    height:34px!important;
    min-height:34px!important;
    border-radius:11px!important;
    font-size:17px!important;
  }
}


/* Unified three-button game nav 2026-10-10 */
/* 戻る / ゲームをえらぶ / 設定 を全ゲームで1段に統一 */
.top-nav{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px!important;
  align-items:center!important;
  gap:7px!important;
  width:100%!important;
}
.top-nav > button:not(.hg-settings-nav-btn){
  width:100%!important;
  min-width:0!important;
  min-height:42px!important;
  height:42px!important;
  padding:7px 8px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:16px!important;
  font-size:clamp(11px,3.15vw,13px)!important;
  line-height:1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  box-sizing:border-box!important;
}
.hg-settings-nav-btn{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  justify-self:stretch!important;
  align-self:stretch!important;
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  padding:0!important;
  border-radius:13px!important;
  font-size:19px!important;
  line-height:1!important;
  box-sizing:border-box!important;
  box-shadow:0 3px 9px rgba(0,0,0,.14),inset 0 1px 0 rgba(255,255,255,.86)!important;
}
.hg-settings-nav-btn:active{
  transform:translateY(1px)!important;
}
.screen-play .top-nav{
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px!important;
}
.screen-play .top-nav > button:not(.hg-settings-nav-btn),
.screen-play .hg-settings-nav-btn{
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
}
.screen-play .hg-settings-nav-btn{
  width:40px!important;
  min-width:40px!important;
  max-width:40px!important;
  border-radius:11px!important;
  font-size:17px!important;
}
.screen-play .top-nav > button:not(.hg-settings-nav-btn){
  border-radius:13px!important;
  font-size:clamp(10px,2.8vw,12px)!important;
  padding:5px 6px!important;
}
@media(max-width:380px){
  .top-nav{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px!important;
    gap:6px!important;
  }
  .top-nav > button:not(.hg-settings-nav-btn){
    height:40px!important;
    min-height:40px!important;
    font-size:11px!important;
    padding:6px 5px!important;
  }
  .hg-settings-nav-btn{
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    border-radius:12px!important;
    font-size:18px!important;
  }
  .screen-play .top-nav{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 36px!important;
  }
  .screen-play .hg-settings-nav-btn{
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
  }
}

/* Sticky game navigation / 2026-10-11
   Header remains in normal layout flow. Do not change button sizes,
   screen-play rows, game logic, or the behavior of back/home/settings. */
.top-nav{
  position:sticky!important;
  top:0!important;
  z-index:60!important;
  isolation:isolate;
  border-radius:16px;
  background:rgba(225,231,244,.10);
  -webkit-backdrop-filter:blur(9px);
  backdrop-filter:blur(9px);
}
