/* UESHO GAMES — SFC メニュー風 (2026-10-24)
   1 ドット = var(--px) (3px / 狭い画面は 2px)。画像は原寸で作り、整数倍で出す。
   文字は PixelMplus12 の整数倍 (24 / 36 / 72px)。外部の読み込みなし。 */
@font-face {
  font-family: "PixelMplus";
  src: url("../fonts/PixelMplus12-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --px: 3px;
  --blue1: #2c3c9c;
  --blue2: #0c1458;
  --white: #f8f8f8;
  --gold: #f8d048;
  --gray: #a8a8c8;
  --night1: #05061a;
  --night2: #1a1650;
  --fs: 24px;
  --fs-h: 36px;
  --font: "PixelMplus", "MS Gothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", monospace;
  --shadow: 2px 2px 0 #000;
}
@media (max-width: 599.98px) {
  :root { --px: 2px; --fs-h: 36px; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(8 * var(--px)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night1);
  color: var(--white);
  font: var(--fs) / 1.8 var(--font);
  text-shadow: var(--shadow);
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; image-rendering: pixelated; }
a { color: var(--gold); text-underline-offset: 4px; }
a:hover { color: #fff; }
h1, h2 { font-weight: normal; line-height: 1.4; margin: 0; }
p { margin: 0 0 .6em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: var(--px) dashed var(--gold); outline-offset: var(--px); }
.skip { position: fixed; left: 8px; top: -100px; z-index: 500; background: #000; color: var(--gold); padding: 4px 12px; }
.skip:focus { top: 8px; }

/* ---- 背景 (多重スクロール) ---- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--night1); }
.layer {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(100% + 480 * var(--px));
  background-repeat: repeat-x; background-position: left bottom;
  background-size: calc(480 * var(--px)) calc(270 * var(--px));
  image-rendering: pixelated; will-change: transform;
}
.layer.far { background-image: url(sky_far.png); }
.layer.mid { background-image: url(sky_mid.png); }
.layer.near { background-image: url(sky_near.png); }
.stars { position: absolute; inset: 0; }
.star {
  position: absolute; width: calc(8 * var(--px)); height: calc(8 * var(--px));
  background: url(star.png) 0 0 / calc(32 * var(--px)) calc(8 * var(--px)) no-repeat;
  image-rendering: pixelated; animation: twinkle 1.2s steps(4) infinite;
}
@keyframes twinkle { to { background-position: calc(-32 * var(--px)) 0; } }

/* ---- 走査線 ---- */
.scan {
  position: fixed; inset: 0; z-index: 400; pointer-events: none; opacity: .12;
  background: linear-gradient(#000 50%, transparent 50%) 0 0 / 100% calc(2 * var(--px));
}
html.scan-off .scan { display: none; }

/* ---- 窓 (9 スライス + 青グラデ) ---- */
.win {
  position: relative;
  border: calc(8 * var(--px)) solid transparent;
  border-image-source: url(window.png);
  border-image-slice: 8;
  border-image-width: calc(8 * var(--px));
  border-image-repeat: stretch;
  background: linear-gradient(var(--blue1), var(--blue2));
  padding: calc(1 * var(--px)) calc(3 * var(--px)) calc(2 * var(--px));
  /* 角を 2 ドット丸める (縁の画像の透明な角に地が出ないように) */
  --c1: var(--px); --c2: calc(2 * var(--px));
  clip-path: polygon(var(--c2) 0, calc(100% - var(--c2)) 0, calc(100% - var(--c2)) var(--c1), calc(100% - var(--c1)) var(--c1),
    calc(100% - var(--c1)) var(--c2), 100% var(--c2), 100% calc(100% - var(--c2)), calc(100% - var(--c1)) calc(100% - var(--c2)),
    calc(100% - var(--c1)) calc(100% - var(--c1)), calc(100% - var(--c2)) calc(100% - var(--c1)), calc(100% - var(--c2)) 100%,
    var(--c2) 100%, var(--c2) calc(100% - var(--c1)), var(--c1) calc(100% - var(--c1)), var(--c1) calc(100% - var(--c2)),
    0 calc(100% - var(--c2)), 0 var(--c2), var(--c1) var(--c2), var(--c1) var(--c1), var(--c2) var(--c1));
}
.win.gold, .slot.is-sel { border-image-source: url(window_gold.png); }
.win > :last-child { margin-bottom: 0; }
.win .sec { margin-top: calc(1 * var(--px)); }

.sec {
  font-size: var(--fs-h); color: var(--gold); margin: 0 0 calc(3 * var(--px)); padding-bottom: calc(10 * var(--px));
  background: url(divider.png) repeat-x left bottom / calc(64 * var(--px)) calc(8 * var(--px));
  image-rendering: pixelated;
}

/* ---- ヘッダー / メニュー ---- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 calc(6 * var(--px));
  max-width: 1120px; margin: calc(4 * var(--px)) auto 0; width: calc(100% - 2 * calc(4 * var(--px)));
  padding-top: 0; padding-bottom: 0; line-height: 1.4;
}
.brand { font-size: var(--fs-h); color: var(--gold); text-decoration: none; padding: calc(2 * var(--px)) 0; margin-right: auto; }
.brand:hover { color: #fff; }
.cmd { display: flex; flex-wrap: wrap; }
.cmd a, .hand-item {
  position: relative; display: block; color: var(--white); text-decoration: none;
  padding: calc(2 * var(--px)) calc(3 * var(--px)) calc(2 * var(--px)) calc(19 * var(--px));
}
.cmd a::before, .slot .hand {
  content: ""; position: absolute; left: calc(2 * var(--px)); top: 50%; margin-top: calc(-8 * var(--px));
  width: calc(16 * var(--px)); height: calc(16 * var(--px));
  background: url(hand.png) 0 0 / 100% 100% no-repeat; image-rendering: pixelated;
  animation: hand .6s steps(1) infinite; opacity: 0;
}
@keyframes hand { 0% { background-image: url(hand.png); } 50% { background-image: url(hand_2.png); } }
.cmd a:hover, .cmd a:focus-visible, .cmd a.is-sel { color: var(--gold); outline: none; }
.cmd a:hover::before, .cmd a:focus-visible::before, .cmd a.is-sel::before { opacity: 1; }
.settings { display: flex; gap: calc(2 * var(--px)); flex-wrap: wrap; width: 100%; justify-content: flex-end; padding: 0 0 calc(2 * var(--px)); }
html:not(.js) .settings { display: none; }

/* ---- ボタン ---- */
.btn {
  display: inline-block; font: inherit; font-size: var(--fs); line-height: 1.4; cursor: pointer; text-decoration: none;
  color: var(--white); text-shadow: var(--shadow);
  padding: var(--px) calc(4 * var(--px));
  background: linear-gradient(var(--blue1), var(--blue2));
  border: var(--px) solid var(--gray); box-shadow: 0 0 0 var(--px) #000;
  margin: var(--px);
}
.btn:hover, .btn:focus-visible { color: var(--gold); border-color: var(--white); }
.btn:active { transform: translate(var(--px), var(--px)); }
.btn.primary, .btn[aria-pressed="true"] { color: var(--gold); }
.btn.sm { padding: 0 calc(3 * var(--px)); }
.btn.steam { border-color: var(--gold); }
.btns, .row { display: flex; flex-wrap: wrap; gap: calc(2 * var(--px)); }

/* ---- レイアウト ---- */
main { width: calc(100% - 2 * calc(4 * var(--px))); max-width: 1120px; margin: 0 auto; padding: calc(4 * var(--px)) 0 calc(8 * var(--px)); }
main > * + * { margin-top: calc(6 * var(--px)); }
.foot { text-align: center; color: var(--gray); padding: calc(4 * var(--px)) 16px calc(10 * var(--px)); line-height: 1.6; }
.foot p { margin: 4px 0; }

.frame { display: block; border: var(--px) solid var(--gray); box-shadow: 0 0 0 var(--px) #000; background: #000; }
.frame img, .frame video { width: 100%; }

/* ---- トップ ---- */
.hero { text-align: center; padding-top: calc(6 * var(--px)); }
.hero-logo, .title-logo {
  width: calc(var(--w) * var(--px)); max-width: 100%; height: auto; margin: 0 auto calc(5 * var(--px));
  image-rendering: pixelated;
}
.lead { display: inline-block; max-width: 100%; margin: 0; }
.games .sec { text-align: left; }
.hint { color: var(--gray); margin: 0 0 calc(3 * var(--px)); }
@media (hover: none) { .hint { display: none; } }
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(5 * var(--px)); }
.slot {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: calc(4 * var(--px));
  padding: calc(3 * var(--px)) calc(3 * var(--px)) calc(3 * var(--px)) calc(20 * var(--px)); cursor: pointer;
}
.slot .hand { left: calc(1 * var(--px)); }
.slot.is-sel .hand { opacity: 1; }
.slot .thumb { align-self: start; aspect-ratio: 16 / 9; overflow: hidden; margin: var(--px); }
.slot .thumb img { height: 100%; object-fit: cover; }
.slot .info { min-width: 0; }
.slot .no { color: var(--gray); margin: 0; line-height: 1.4; }
.stat { margin: 0 0 calc(2 * var(--px)); }
.stat > div { display: grid; grid-template-columns: calc(34 * var(--px)) minmax(0, 1fr); gap: 0 calc(2 * var(--px)); line-height: 1.5; }
.stat dt { color: var(--gray); }
.stat dd { margin: 0; min-width: 0; }
.stat h2 { font-size: var(--fs-h); line-height: 1.3; }
.slot-link { color: var(--white); text-decoration: none; }
.slot.is-sel .slot-link { color: var(--gold); }
.slot-link::after { content: ""; position: absolute; inset: calc(-8 * var(--px)); z-index: 1; }
.st.coming { color: var(--gold); }
.tagline { color: #d8d8ec; margin-bottom: calc(1 * var(--px)); line-height: 1.6; }
.slot .btn { position: relative; z-index: 2; }
.contact .mail { font-size: var(--fs-h); }
.contact p { margin-bottom: .3em; }

/* ---- 作品ページ ---- */
.crumb { margin: 0; }
.game-head { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: calc(5 * var(--px)); align-items: stretch; }
.key { padding: calc(2 * var(--px)); }
.key img { width: 100%; }
.head-info { display: flex; flex-direction: column; justify-content: center; padding: calc(3 * var(--px)); }
.head-info h1 { font-size: var(--fs-h); line-height: 1.3; color: var(--gold); margin: 0 0 .3em; }
.head-info .icon { width: calc(24 * var(--px)); height: calc(24 * var(--px)); margin-bottom: calc(2 * var(--px)); image-rendering: auto; }
.head-info .tag { color: #d8d8ec; margin: 0 0 .4em; }
.head-info .badge { color: var(--gray); margin: 0 0 calc(2 * var(--px)); }
.head-info .badge.coming { color: var(--gold); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: calc(5 * var(--px)); align-items: start; }
.col-main { display: grid; gap: calc(5 * var(--px)); min-width: 0; }
.type { margin-bottom: .8em; }
.feats { list-style: none; padding: 0; margin: 0; }
.feats li { position: relative; padding-left: calc(8 * var(--px)); margin: .3em 0; }
.feats li::before { content: "◆"; position: absolute; left: 0; color: var(--gold); }
.facts { width: 100%; border-collapse: collapse; }
.facts th, .facts td { text-align: left; padding: 4px 6px 4px 0; vertical-align: top; border-bottom: var(--px) dotted #4858b8; font-weight: normal; line-height: 1.5; }
.facts th { color: var(--gray); width: 42%; }
.facts td { overflow-wrap: anywhere; }
aside .btn, aside .btns { margin-top: calc(3 * var(--px)); }
.media .frame { margin: var(--px); }
.trailer { width: 100%; background: #000; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(3 * var(--px)); }
.gallery.phone { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.shot { display: block; padding: 0; cursor: zoom-in; }
.shot img { width: 100%; }
.shot:hover, .shot:focus-visible { border-image-source: url(window_gold.png); outline: none; }
.logos { display: flex; flex-wrap: wrap; gap: calc(4 * var(--px)); }
.logo-dl { padding: calc(2 * var(--px)); max-width: 100%; }
.logo-dl img { max-width: min(100%, 420px); }
.win > h1 { font-size: var(--fs-h); color: var(--gold); margin-bottom: .3em; }

/* ---- スクリーンショットの拡大 ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 8, .8); padding: calc(4 * var(--px)); animation: lbin .2s steps(4);
}
@keyframes lbin { from { opacity: 0; } }
.lightbox .win { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; cursor: zoom-out; padding: calc(2 * var(--px)); }
.lightbox img { max-width: 100%; max-height: calc(100vh - 44 * var(--px)); width: auto; object-fit: contain; }
.lightbox p { margin: calc(1 * var(--px)) 0 0; color: var(--gray); line-height: 1.4; }

/* ---- タイトル画面 ---- */
.title { display: none; }
html.title-on .title { display: flex; }
html.title-on header.top, html.title-on main, html.title-on .foot { visibility: hidden; }
html.title-on { overflow: hidden; }
.title {
  position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; text-align: center;
  background: #000; animation: reveal 2s steps(16) forwards; cursor: pointer;
}
@keyframes reveal { 0% { background-color: #000; } 100% { background-color: rgba(0, 0, 0, 0); } }
.title-inner { padding: 16px; }
.title-logo { margin-bottom: calc(10 * var(--px)); opacity: 0; animation: drop 1.4s steps(18) 1.2s forwards; }
@keyframes drop { from { transform: translateY(-50vh); opacity: 1; } to { transform: none; opacity: 1; } }
.press {
  font: inherit; font-size: var(--fs-h); color: var(--white); background: none; border: 0; cursor: pointer; padding: 8px 16px;
  letter-spacing: .1em; opacity: 0; animation: blink 1.1s steps(1) 2.8s infinite;
}
.press:focus-visible { outline: none; color: var(--gold); }
@keyframes blink { 0% { opacity: 1; } 55% { opacity: 0; } }
.tap, .copy { margin: 0; color: var(--gray); }
.tap { display: none; }
@media (hover: none) { .tap { display: block; } }
.copy { margin-top: calc(12 * var(--px)); opacity: 0; animation: fadein .5s steps(4) 3s forwards; }
@keyframes fadein { to { opacity: 1; } }
.title-skip {
  position: absolute; right: 16px; bottom: 16px; font: inherit; font-size: var(--fs); background: none; border: 0;
  color: var(--gray); text-decoration: underline; cursor: pointer; padding: 4px 8px;
}
.title-skip:hover { color: var(--white); }
.curtain {
  position: absolute; left: 0; right: 0; top: 50%; height: 0; transform: translateY(-50%); pointer-events: none;
  border: 0 solid transparent; background: linear-gradient(var(--blue1), var(--blue2)); overflow: hidden;
  box-shadow: 0 calc(-1 * var(--px)) 0 var(--white), 0 var(--px) 0 var(--white), 0 calc(-2 * var(--px)) 0 #000, 0 calc(2 * var(--px)) 0 #000;
}
.title.opening { animation: none; background: transparent; }
.title.opening .title-inner, .title.opening .title-skip { opacity: 0; }
.title.opening .curtain { animation: curtain .6s steps(10) forwards; }
@keyframes curtain { to { height: 100%; } }
.title.leaving { animation: none; background: transparent; opacity: 0; transition: opacity .35s steps(5); }
.title.leaving .curtain { height: 100%; }

/* ---- 狭い画面 ---- */
@media (max-width: 760px) {
  .game-head, .cols { grid-template-columns: minmax(0, 1fr); }
  .gallery, .gallery.phone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599.98px) {
  .slot { grid-template-columns: minmax(0, 1fr); gap: calc(3 * var(--px)); }
  .slot .hand { top: calc(6 * var(--px)); margin-top: 0; }
  .stat > div { grid-template-columns: calc(50 * var(--px)) minmax(0, 1fr); }
  .top { gap: 0; }
  .brand { width: 100%; text-align: center; margin: 0; }
  .cmd { width: 100%; justify-content: center; }
  .settings { justify-content: center; }
  .hero-logo, .title-logo { width: 100%; }
}
/* 手のカーソルは、スマホではタップした項目に出る (JS が is-sel を付ける) */

/* ---- 動きを減らす ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .star, .slot .hand, .cmd a::before { animation: none; }
  .title, .title * { animation: none !important; }
  .title-logo, .press, .copy { opacity: 1; }
}
