* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: #07060d;
  color: #ffe9a8;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
#cab {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: env(safe-area-inset-top) 8px calc(8px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 0%, #1d1836 0%, #07060d 70%);
}
#screen-wrap {
  position: relative;
  line-height: 0;
  border: 3px solid #2b2540;
  border-radius: 6px;
  box-shadow: 0 0 0 2px #060510, 0 14px 46px rgba(0,0,0,.85), 0 0 90px rgba(110,70,220,.26);
  background: #000;
}
#screen {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,.16) 0px,
    rgba(0,0,0,.16) 1px,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0) 4px);
  mix-blend-mode: multiply;
  opacity: .32;
}
body.no-crt #scanlines { display: none; }

#boot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* 上はキービジュアルを見せ、下だけ落として文字を読ませる */
  background: linear-gradient(to bottom,
    rgba(6,5,14,0) 0%,
    rgba(6,5,14,.06) 54%,
    rgba(6,5,14,.55) 70%,
    rgba(6,5,14,.94) 84%);
  line-height: 1.5;
  text-align: center;
}
#boot.hide { display: none; }
.boot-inner { padding: 12px 14px 14px; width: 100%; }
.boot-logo {
  font-size: clamp(18px, 4.2vw, 28px);
  font-weight: 900;
  letter-spacing: .06em;
  color: #ffd23c;
  text-shadow: 2px 2px 0 #b01e10, 4px 4px 0 rgba(0,0,0,.6);
}
.boot-sub {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: .18em;
  color: #a79ddb;
}
#boot-btn {
  margin-top: 10px;
  padding: 12px 26px;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .1em;
  color: #1a1008;
  background: linear-gradient(#ffe07a, #eda21c);
  border: 2px solid #7a4a08;
  border-radius: 4px;
  box-shadow: 0 4px 0 #7a4a08;
  cursor: pointer;
}
#boot-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a4a08; }
.boot-copy {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
  color: #ff9ec4;
  text-shadow: 1px 1px 2px rgba(0,0,0,.9);
}
.boot-links {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.boot-link-btn {
  font: inherit;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #cfe9ff;
  background: linear-gradient(#1b3350, #122438);
  border: 2px solid #4fa8e0;
  border-radius: 4px;
  box-shadow: 0 3px 0 #15486e;
  cursor: pointer;
}
.boot-link-btn:hover { background: linear-gradient(#24466c, #17304a); }
.boot-link-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #15486e; }
.boot-link-btn:focus-visible { outline: 2px solid #ffd23c; outline-offset: 2px; }
.boot-op {
  display: inline-block;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #ffe9a8;
  text-decoration: none;
  background: linear-gradient(#3a1b52, #241038);
  border: 2px solid #ff6b57;
  border-radius: 4px;
  box-shadow: 0 3px 0 #6e1e18;
}
.boot-op:hover { background: linear-gradient(#4d2469, #31164a); }
.boot-op:active { transform: translateY(2px); box-shadow: 0 1px 0 #6e1e18; }
.boot-op:focus-visible { outline: 2px solid #ffd23c; outline-offset: 2px; }
.boot-note { margin-top: 10px; font-size: 9.5px; color: #8a82c0; }
.boot-credit {
  margin-top: 9px;
  font-size: 9px;
  line-height: 1.7;
  color: #9a92cc;
}

#pad { display: none; width: 100%; max-width: 520px; justify-content: space-between; gap: 12px; }
.pad-side { display: flex; gap: 8px; }
.pbtn {
  font: inherit;
  font-weight: 900;
  font-size: 17px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  color: #2a1a06;
  border: 2px solid rgba(0,0,0,.45);
  box-shadow: 0 4px 0 rgba(0,0,0,.5);
  background: #cfc6e8;
}
.pbtn.a { background: #ff6b57; }
.pbtn.b { background: #67c9ff; }
.pbtn.c { background: #ffd23c; }
.pbtn.dir { background: #9b93c9; }
.pbtn.pressed { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.5); filter: brightness(1.25); }
body.touch #pad { display: flex; }
