* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #170d22;
  color: #fff;
  font-family: "Yu Gothic", "Meiryo", sans-serif;
}

.game-screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  padding: 36px;

  background-image:
    linear-gradient(rgba(25, 10, 35, 0.08), rgba(25, 10, 35, 0.22)),
    url("../img/bg/continue-main.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;


  border: 10px solid #241033;
}

.title-area {
  position: absolute;
  top: 48px;
  left: 56px;
  z-index: 3;
}

.title-area h1 {
  margin: 0;
  font-size: 54px;
  color: #fff;

  text-shadow:
    0 0 14px #f5b6e4,
    0 0 28px rgba(255,180,230,0.7),
    2px 2px 8px rgba(0,0,0,0.9);
}

.start-menu {
  position: absolute;
  left: 56px;
  top: 60px;
  z-index: 3;

  width: 250px;
  padding: 10px;
  border: 2px solid #d99bd0;
  border-radius: 12px;
  background: rgba(30, 15, 45, 0.65);
  backdrop-filter: blur(6px);

  max-height: calc(100vh - 215px);
  overflow-y: auto;
}

.start-menu a,
.start-menu .menu-item {
  display: block;
  padding: 10px 14px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 190, 230, 0.5);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  background: rgba(255, 210, 240, 0.08);
}

.start-menu a:last-child,
.start-menu .menu-item:last-child {
  margin-bottom: 0;
}

.start-menu a:hover {
  background: rgba(255, 170, 220, 0.3);
}

.menu-title {
  margin: 0 0 10px;
  padding: 4px 6px;
  color: #ffc5ec;
  font-size: 16px;
  text-align: center;
  text-shadow: 0 0 8px #000;
}

.menu-main {
  display: block;
  font-size: 15px;
  font-weight: bold;
}

.menu-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: normal;
  opacity: 0.85;
}

.counter-box {
  position: absolute;
  top: 56px;
  right: 56px;
  z-index: 3;

  width: 300px;
  padding: 20px;
  border: 2px solid #d99bd0;
  border-radius: 12px;
  background: rgba(25, 10, 35, 0.72);
  backdrop-filter: blur(6px);
  font-weight: bold;

  max-height: 260px;
  overflow-y: auto;

}

.counter-box p {
  margin: 0 0 12px;
  line-height: 1.55;
}


.message-window {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  z-index: 4;

  width: min(760px, 80%);
  padding: 24px 32px;
  border: 2px solid #d99bd0;
  border-radius: 14px;
  background: rgba(20, 10, 30, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 24px rgba(255, 160, 220, 0.25);
}

.message-window h2 {
  margin: 0 0 14px;
  color: #ffc5ec;
}

.message-window p {
  margin: 8px 0;
  font-size: 18px;
  line-height: 1.7;
}

.next-mark {
  position: absolute;
  right: 28px;
  bottom: 18px;
  color: #f4a6de;
  font-size: 24px;
}

/* スマホ縦 */
@media (max-width: 768px) and (orientation: portrait) {
  .game-screen {
    min-height: auto;
    padding: 0 20px 40px;
    overflow: visible;
    border: 8px solid #241033;

    display: flex;
    flex-direction: column;
    align-items: center;

    background: #170d22;
  }

  .game-screen::before {
    content: "";
    display: block;
    width: calc(100% + 40px);
    height: 100svh;
    margin: 0 -20px 24px;

    background-image:
      linear-gradient(rgba(20, 10, 30, 0.05), rgba(20, 10, 30, 0.2)),
      url("../img/bg/continue-main.jpg");
    background-size: auto 100%;
    background-position: center 20%;
    background-repeat: no-repeat;
  }

.game-screen::after {
  content: "Scroll ▼";

  position: absolute;
  top: calc(100svh - 72px);
  left: 50%;
  transform: translateX(-50%);

  padding: 10px 22px;
  border-radius: 999px;

  background: rgba(20, 10, 30, 0.72);
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.08em;

  box-shadow: 0 0 18px rgba(0,0,0,0.45);
  text-shadow: 0 0 6px rgba(0,0,0,0.8);

  animation: scroll-float 1.7s ease-in-out infinite;
  z-index: 6;
}

@keyframes scroll-float {
  0% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.75;
  }

  50% {
    transform: translateX(-50%) translateY(6px);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.75;
  }
}

  .title-area {
    position: absolute;
    top: 46px;
    left: 0;
    right: 0;
    z-index: 5;
    text-align: center;
    margin: 0;
  }

.title-area h1 {
  font-size: 42px;
  -webkit-text-stroke: 0;
}

  .counter-box {
    display: none;
  }

  .message-window {
    order: 1;
    position: static;
    transform: none;
    width: 100%;
    padding: 18px 22px;
    margin-bottom: 20px;
  }

  .start-menu {
    order: 2;
    position: static;
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
  }

  .start-menu a {
    padding: 13px 16px;
    margin-bottom: 10px;
    font-size: 15px;
  }
}

/* スマホ横 */
@media (max-width: 950px) and (orientation: landscape) {

  .omake-screen {
    background-position: center 45%;
}


   .menu-title {
  display: none;
}

   .menu-sub {
  display: none;
}

  .game-screen {
    min-height: 100vh;
    padding: 18px;
  }

  .title-area {
    top: 24px;
    left: 28px;
  }

  .title-area h1 {
    font-size: 38px;
  }

  .start-menu {
    top: 30px;
    left: 28px;
    width: 160px;
    padding: 7px;

    max-height: calc(100vh - 125px);
    overflow-y: auto;
  }

  .start-menu a {
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 12px;
  }

  .counter-box {
  top: 28px;
  right: 28px;
  width: 240px;
  padding: 12px;
  font-size: 12px;

  max-height: 170px;
  overflow-y: auto;  
}


.counter-box p {
  margin: 0 0 8px;
  line-height: 1.45;
}


  .message-window {
    left: auto;
    right: 28px;
    bottom: 18px;
    transform: none;
    width: 48%;
    padding: 12px 18px;
}

  .message-window h2 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .message-window p {
    font-size: 13px;
    line-height: 1.5;
  }

}




.disabled-link {
  opacity: 0.55;
  cursor: default;
}

.disabled-link:hover {
  background: rgba(255, 210, 240, 0.08);
}



.back-button {
  background: linear-gradient(
    rgba(255, 120, 190, 0.35),
    rgba(255, 120, 190, 0.18)
  ) !important;

  border: 1px solid rgba(255, 180, 230, 0.9) !important;

  box-shadow:
    0 0 12px rgba(255, 140, 210, 0.35);
}

.back-button:hover {
  background: linear-gradient(
    rgba(255, 150, 210, 0.5),
    rgba(255, 150, 210, 0.25)
  ) !important;
}


.next-mark {
  border: none;
  background: transparent;
  cursor: pointer;

  animation: next-blink 1.2s infinite;
}

.next-mark:hover {
  transform: scale(1.2);
}

@keyframes next-blink {
  0% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.35;
  }
}

/* セーブデータ風メニュー */
.save-menu {
  width: 330px;
}

.save-data {
  margin-bottom: 10px;
  border: 1px solid rgba(255, 190, 230, 0.55);
  border-radius: 10px;
  background: rgba(255, 210, 240, 0.08);
  overflow: hidden;
}

.save-data summary {
  display: block;
  position: relative;
  padding: 12px 42px 12px 14px;
  cursor: pointer;
  list-style: none;
}

.save-data summary::-webkit-details-marker {
  display: none;
}

.save-data summary::after {
  content: "▼";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #ffc5ec;
  font-size: 15px;
}

.save-data[open] summary::after {
  content: "▲";
}

.save-number {
  display: block;
  font-size: 15px;
  font-weight: bold;
}

.save-title {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.9;
}

.save-detail {
  padding: 0 14px 14px;
  border-top: 1px dashed rgba(255, 190, 230, 0.45);
}

.save-name {
  margin: 12px 0 8px;
  color: #ffd6f2;
  font-size: 14px;
  font-weight: bold;
}

.save-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.7;
  opacity: 0.92;
}

.save-button {
  display: block;
  padding: 12px 14px;
  border: 1px solid rgba(255, 190, 230, 0.75);
  border-radius: 9px;
  background: rgba(255, 120, 190, 0.28);
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

.save-button:hover {
  background: rgba(255, 150, 210, 0.42);
}

/* スマホ縦ではセーブデータを見やすく広げる */
@media (max-width: 768px) and (orientation: portrait) {
  .save-menu {
    width: 100%;
  }

  .save-data summary {
    padding: 14px 44px 14px 16px;
  }

  .save-number {
    font-size: 16px;
  }

  .save-title {
    font-size: 14px;
  }

  .save-text {
    font-size: 14px;
  }
}

/* スマホ横は少しコンパクトに */
@media (max-width: 950px) and (orientation: landscape) {
  .save-menu {
    width: 220px;
  }

  .save-data summary {
    padding: 9px 34px 9px 10px;
  }

  .save-number {
    font-size: 12px;
  }

  .save-title,
  .save-name,
  .save-text {
    font-size: 11px;
  }

  .save-button {
    padding: 9px 10px;
    font-size: 12px;
  }
}

/* PC：セーブデータ欄とメッセージウィンドウが被らないようにする */
@media (min-width: 951px) {
  .message-window {
    left: auto;
    right: 56px;
    transform: none;

    width: min(760px, calc(100% - 560px));
  }
}

/* スマホ横：セーブデータ一覧を詰めて、TOPへ戻るまで見えるようにする */
@media (max-width: 950px) and (orientation: landscape) {
  .start-menu.save-menu {
    top: 18px;
    left: 20px;
    width: 230px;

    max-height: calc(100svh - 36px);
    padding: 8px;

    overflow-y: auto;
  }

  .save-data {
    margin-bottom: 7px;
  }

  .save-data summary {
    padding: 8px 34px 8px 10px;
  }

  .save-number {
    font-size: 12px;
    line-height: 1.35;
  }

  .save-title {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.35;
  }

  .back-button {
    padding: 9px 10px !important;
    margin-top: 6px;
    font-size: 12px;
  }

  .message-window {
    right: 24px;
    bottom: 18px;
    width: 46%;
  }
}

/* ページ内スクロールをなめらかにする */
html {
  scroll-behavior: smooth;
}

/* PCでは本物のScrollボタンは非表示 */
.scroll-button {
  display: none;
}

/* スマホ縦：CSSのScroll表示を消して、押せるScrollボタンにする */
@media (max-width: 768px) and (orientation: portrait) {
  .game-screen::after {
    content: none !important;
    display: none !important;
  }

  .game-screen::before {
    pointer-events: none;
  }

  .scroll-button {
    position: absolute;
    top: calc(100svh - 72px);
    left: 50%;
    transform: translateX(-50%);

    display: inline-block;
    padding: 10px 22px;
    border-radius: 999px;

    background: rgba(20, 10, 30, 0.72);
    color: #fff;
    text-decoration: none;

    font-size: 15px;
    letter-spacing: 0.08em;

    box-shadow: 0 0 18px rgba(0,0,0,0.45);
    text-shadow: 0 0 6px rgba(0,0,0,0.8);

    animation: scroll-float 1.7s ease-in-out infinite;
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
  }

  .scroll-button:hover {
    background: rgba(40, 20, 55, 0.82);
  }

  #menu-start {
    scroll-margin-top: 20px;
  }
}

