/* 放課後ゲーム部 / トップ専用の更新履歴。既存ゲームUIとは独立。 */
.hg-history-home-btn{
  width:100%;min-height:37px;border:1px solid rgba(255,255,255,.68);
  border-radius:999px;padding:8px 12px;background:rgba(16,38,66,.78);
  color:#fff;font:inherit;font-size:13px;font-weight:950;letter-spacing:.03em;
  text-shadow:0 1px 2px #173149;box-shadow:0 5px 14px rgba(0,0,0,.21);
  cursor:pointer;
}
.hg-history-home-btn:active{transform:translateY(2px)}
.hg-history-home-btn:focus-visible,.hg-history-overlay button:focus-visible,.hg-history-overlay a:focus-visible{
  outline:3px solid #fcba34;outline-offset:2px;
}
@media(max-height:700px){
  .home-page .hero-action-wrap{gap:8px}
  .hg-history-home-btn{min-height:33px;padding:6px 10px;font-size:12px}
}
@media(max-height:570px){
  .home-page .hero-action-wrap{gap:6px;top:72%}
  .hg-history-home-btn{min-height:29px;padding:4px 8px}
}
.hg-history-overlay[hidden]{display:none}
.hg-history-overlay{
  position:fixed;z-index:2300;inset:0;display:flex;align-items:center;justify-content:center;
  padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right))
          max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  background:rgba(9,18,35,.83);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
}
.hg-history-modal{
  width:min(680px,100%);max-height:100%;min-height:0;display:flex;flex-direction:column;
  border:2px solid rgba(255,255,255,.86);border-radius:21px;
  background:#fffdfa;color:#23314d;
  overflow:hidden;box-shadow:0 22px 60px rgba(0,0,0,.44);
}
.hg-history-head{
  flex:0 0 auto;display:flex;justify-content:space-between;align-items:start;gap:10px;
  padding:15px 14px 10px;
  background:linear-gradient(130deg,#fdf3d8,#fffefc 62%,#e9f5ff);
}
.hg-history-eyebrow{color:#a8731d;font-size:10px;font-weight:1000;letter-spacing:.15em}
.hg-history-head h2{font-size:clamp(20px,4.7vw,26px);margin:3px 0 0;font-weight:1000;line-height:1.18}
.hg-history-subhead{font-size:11px;font-weight:750;line-height:1.5;color:#66738a;margin:5px 0 0}
.hg-history-close{
  width:42px;height:42px;flex:0 0 auto;display:grid;place-items:center;border-radius:50%;
  background:#fff;border:1px solid #d9e3ee;color:#354966;font-size:27px;cursor:pointer;
}
.hg-history-toolbar{flex:0 0 auto;padding:0 12px 10px;background:#fffdfa;border-bottom:1px solid #e9e2d7}
.hg-history-filters{display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:4px 2px}
.hg-history-filters::-webkit-scrollbar{display:none}
.hg-history-tab{
  flex:0 0 auto;min-height:33px;border:1px solid #dee4eb;border-radius:999px;
  padding:6px 10px;background:#fff;color:#53647f;font:inherit;font-size:11px;font-weight:950;
  cursor:pointer;white-space:nowrap;
}
.hg-history-tab[aria-pressed="true"]{
  background:#1e7fd1;border-color:#1e7fd1;color:#fff;box-shadow:0 3px 9px rgba(19,107,181,.19);
}
.hg-history-stats{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:5px 2px 0;font-size:10px;color:#65718a;font-weight:800}
.hg-history-stats strong{font-size:14px;color:#18294b}
.hg-history-scroll{padding:10px 12px 18px;overflow-y:auto;min-height:0;flex:1 1 auto;overscroll-behavior:contain}
.hg-history-intro{margin:0 0 11px;font-size:11px;color:#687588;line-height:1.6;font-weight:750}
.hg-history-day{margin:15px 1px 7px;color:#455675;font-size:12px;font-weight:1000;display:flex;gap:9px;align-items:center}
.hg-history-day:first-of-type{margin-top:6px}
.hg-history-day::after{content:"";height:1px;background:#dfe4ea;flex:1}
.hg-history-list{display:grid;gap:9px}
.hg-history-card{
  position:relative;overflow:hidden;border:1px solid #e0e7ef;border-radius:15px;
  background:#fff;padding:11px 12px;box-shadow:0 3px 10px rgba(41,53,76,.04);
}
.hg-history-card.major{
  border:2px solid #e5a13e;
  background:linear-gradient(145deg,#fffdfa,#fff3dc);
  box-shadow:0 4px 15px rgba(176,107,25,.13);
  padding-left:15px;
}
.hg-history-card.major::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:5px;
  background:linear-gradient(#ffcf56,#f08020);
}
.hg-history-meta{display:flex;justify-content:space-between;align-items:start;gap:8px}
.hg-history-time{font-size:10px;color:#65748b;font-variant-numeric:tabular-nums;font-weight:800}
.hg-history-badges{display:flex;justify-content:flex-end;gap:4px;flex-wrap:wrap}
.hg-history-badge{
  display:inline-block;padding:3px 6px;border-radius:99px;background:#eaf3ff;
  color:#3162a3;font-size:9px;font-weight:1000;white-space:nowrap;
}
.hg-history-badge.major{background:linear-gradient(125deg,#ffad38,#ed7c23);color:#fff}
.hg-history-badge.latest{background:#3056ba;color:#fff}
.hg-history-card h3{font-size:clamp(14px,3.6vw,17px);line-height:1.35;font-weight:1000;margin:7px 0}
.hg-history-card.major h3{color:#754513}
.hg-history-changes{border-top:1px dashed #e6e9ee;margin:7px 0 0;padding:7px 0 0;display:grid;gap:3px;list-style:none;font-size:11px;line-height:1.55;font-weight:740;color:#455570}
.hg-history-changes li{padding-left:11px;position:relative}
.hg-history-changes li::before{content:"・";position:absolute;left:0}
.hg-history-empty{border:1px dashed #b6c6db;border-radius:14px;padding:26px 12px;text-align:center;color:#647489;font-weight:800}
body.hg-history-open{overflow:hidden}
@media(max-width:450px){
  .hg-history-head{padding:12px 11px 8px}
  .hg-history-toolbar{padding:0 9px 8px}
  .hg-history-scroll{padding:9px}
  .hg-history-tab{min-height:32px;padding:6px 9px;font-size:10px}
  .hg-history-card{padding:10px}
}
@media(prefers-reduced-motion:reduce){.hg-history-overlay{backdrop-filter:none;-webkit-backdrop-filter:none}}

/* Home tools row: settings and history side by side */
.home-page .home-tools-row{
  width:100%;min-width:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.home-page .home-tools-row .home-settings-btn,
.home-page .home-tools-row .hg-history-home-btn{
  width:100%;min-width:0;min-height:49px;
  padding:9px 5px;border:2px solid rgba(255,255,255,.94);
  border-radius:999px;
  font:900 clamp(12px,3.4vw,16px)/1.25 system-ui,-apple-system,sans-serif;
  cursor:pointer;white-space:nowrap;
}
.home-page .home-tools-row .hg-history-home-btn{
  background:rgba(15,40,73,.93);
  color:#fff6d8;text-shadow:0 1px 2px #173149;
  box-shadow:0 5px 0 rgba(2,23,50,.58),0 10px 20px rgba(0,0,0,.15);
}
@media(max-height:700px){
 .home-page .home-tools-row .home-settings-btn,
 .home-page .home-tools-row .hg-history-home-btn{min-height:42px;padding:7px 4px;font-size:12px}
}
@media(max-width:360px){.home-page .home-tools-row{gap:5px}}
