/* きゅるきゅる淘汰理論 ― 思考の海 */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* 本文は端末の標準フォント。目立つ文字は あずきフォントの画像（img/text） */
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  font-weight: 500;
  color: #1a2a6c;
  line-height: 1.85;
  /* 下に行くほど深くなる海 */
  background:
    url("img/umi.png") top center / max(100%, 1740px) auto no-repeat,
    linear-gradient(#183f67 0, #183f67 1250px, #10306b 2600px, #0a1a40 3600px, #050d24 100%);
  background-color: #0a1a40;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
/* あずきフォントの文字画像 */
img.t { display: inline-block; vertical-align: middle; height: auto; }

main {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ===== ウィンドウ（ゲームと同じ） ===== */
.win {
  background: #fff;
  border: 2px solid #1a2a6c;
  box-shadow: 6px 6px 0 #7a3a62;
  margin: 0 0 28px;
}
.win-bar {
  background: #ff86ad;
  color: #fff;
  font-size: 14px;
  padding: 2px 8px;
  border-bottom: 2px solid #1a2a6c;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.win-bar i {
  font-style: normal;
  background: #fff;
  color: #1a2a6c;
  border: 1px solid #1a2a6c;
  width: 16px; height: 16px;
  line-height: 13px;
  text-align: center;
  font-size: 12px;
}
.win-body { padding: 16px 18px; }
.win-body p { margin: 0 0 .9em; }
.win-body p:last-child { margin-bottom: 0; }


/* ===== 背景の泡と魚 ===== */
.sea { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bubbles span {
  position: absolute;
  bottom: -20px;
  border: 1.5px solid rgba(255,255,255,.7);
  border-radius: 50%;
  animation: rise linear infinite;
}
@keyframes rise {
  to { transform: translate(var(--sway, 10px), -110vh); opacity: 0; }
}
.school { position: absolute; left: 0; width: 100%; height: 120px; }
.school-a { top: 18vh; }
.school-b { top: 62vh; opacity: .55; }
/* ドット絵の魚はくっきり拡大 */
.deba { image-rendering: pixelated; max-width: none; }
.school .deba {
  position: absolute;
  width: 46px; height: 30px;
  animation: swim linear infinite;
}
@keyframes swim {
  from { transform: translateX(110vw); }
  to   { transform: translateX(-20vw); }
}
@keyframes swim-rev {
  from { transform: translateX(-20vw) scaleX(-1); }
  to   { transform: translateX(110vw) scaleX(-1); }
}

.depth {
  position: fixed;
  right: 10px; top: 50%;
  z-index: 3;
  font-size: 12px;
  color: #fff;
  background: rgba(10, 26, 64, .55);
  padding: 2px 8px;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  letter-spacing: .1em;
}

/* ===== 水面 ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
}
.hero-logo { width: min(420px, 92%); position: relative; z-index: 2; margin-top: -90px; }
.hero-ruru { width: min(330px, 78%); }
@keyframes float { 50% { transform: translateY(-8px); } }
.genre {
  color: #fff;
  background: #1a2a6c;
  padding: 2px 14px;
  margin: 10px 0 0;
}
.scroll-hint {
  color: #fff;
  font-size: 14px;
  margin-top: 26px;
  animation: float 2s ease-in-out infinite;
}

/* ===== ストーリー ===== */
.story { padding-top: 40px; }
.msg { border-color: #ff86ad; box-shadow: 6px 6px 0 #1a2a6c; }
.msg .line { color: #1747c9; font-size: 22px; font-weight: 700; }
.text { font-size: 15px; }
.ends {
  text-align: center;
  color: #ff5f95;
  border-top: 2px dashed #ffc2d6;
  padding-top: 10px;
}
.mask { background: #1a2a6c; color: #1a2a6c; padding: 0 2px; }

.choices { position: relative; height: 220px; margin-bottom: 10px; }
.choice { position: absolute; width: 150px; font-size: 14px; box-shadow: 4px 4px 0 #7a3a62; }
.choice .win-body { text-align: center; padding: 18px 8px; background: #ffe6ef; }
.choice .win-bar { background: #9aa3c8; font-size: 12px; }
.c1 { left: 0;   top: 10px; }
.c2 { right: 0;  top: 0; }
.c3 { left: 32%; top: 110px; }

.c1, .c2, .c3, .c4, .c5 { animation: bob 5s ease-in-out infinite; }
.c2 { animation-delay: -1.5s; }
.c3 { animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* ===== 図鑑 ===== */
.sec-title {
  text-align: center;
  font-weight: normal;
  color: #fff;
  font-size: 20px;
  margin: 60px 0 24px;
}
.sec-title::before, .sec-title::after { content: " ≋ "; color: #8fe8e0; }

.card {
  background: #f4fbff;
  border: 2px solid #1a2a6c;
  box-shadow: 6px 6px 0 #0a1a40;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1fr;
}
.card-img {
  background: repeating-linear-gradient(0deg, #dff5ff 0 18px, #d2efff 18px 36px);
  border-bottom: 2px solid #1a2a6c;
  display: grid; place-items: center;
  padding: 16px;
}
.card-img img { height: 360px; width: auto; }
.card-img.ore span {
  width: 120px; height: 180px;
  background: #1a2a6c; color: #fff;
  font-size: 56px;
  display: grid; place-items: center;
  border-radius: 60px 60px 8px 8px;
}
.card-body { padding: 16px 18px 20px; font-size: 15px; }
.card-body p { margin: 0 0 .8em; }
.kana { color: #ff86ad; font-size: 12px; margin: 0 !important; letter-spacing: .2em; }
.card h3 { margin: 0 0 10px; font-size: 26px; line-height: 1.3; }
.card dl {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  margin: 0 0 14px;
  border-top: 1px solid #b7cbe8;
  font-size: 14px;
}
.card dt, .card dd { margin: 0; padding: 5px 0; border-bottom: 1px solid #b7cbe8; }
.card dt { color: #5a6aa0; }
.card s { color: #8a95bb; }
.quote {
  background: #fff;
  border-left: 4px solid #ff86ad;
  padding: 8px 12px;
  color: #1747c9;
  font-weight: 700;
}

/* ===== あそぶ ===== */
.play { padding-top: 30px; }
.choices.deep { height: 150px; }
.c4 { left: 8%; top: 0; }
.c5 { right: 4%; top: 46px; animation-delay: -2.5s; }
.soon { text-align: center; color: #ff5f95; }
.dl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  padding: 12px 16px;
  background: #ff86ad;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #1a2a6c;
  box-shadow: 4px 4px 0 #1a2a6c;
}
.dl em { font-style: normal; font-size: 12px; font-weight: 500; }
.dl.off { background: #c9cfe0; color: #5a6aa0; box-shadow: 4px 4px 0 #8a95bb; pointer-events: none; }
.note { font-size: 12px; color: #5a6aa0; margin-top: 16px !important; }

/* ===== 水槽 ===== */
.tank-wrap { padding-top: 120px; text-align: center; }
.tank {
  position: relative;
  height: 200px;
  border: 3px solid #b9d8ff;
  outline: 6px solid #0a1a40;
  background: linear-gradient(#2fb8d8, #1a6aa8);
  overflow: hidden;
}
.tank::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background: repeating-radial-gradient(circle at 10px 26px, #f0e3c0 0 6px, #d8c79a 6px 9px);
}
.tank-fish .deba {
  position: absolute;
  width: 46px; height: 30px;
  animation: wander ease-in-out infinite alternate;
}
@keyframes wander {
  from { transform: translate(0, 0); }
  to   { transform: translate(var(--dx), var(--dy)); }
}
.tank-label {
  display: inline-block;
  margin: 14px 0 0;
  padding: 2px 14px;
  background: #fff;
  color: #1a2a6c;
  font-size: 13px;
  border: 1px solid #1a2a6c;
}

footer {
  text-align: center;
  color: #6b7fb8;
  font-size: 12px;
  padding: 60px 0 10px;
}

/* ===== PC：窓を外に散らす ===== */
@media (min-width: 900px) {
  .choices { height: 0; margin: 0; }
  .c1 { left: -230px; top: 40px; }
  .c2 { right: -230px; top: -40px; left: auto; }
  .c3 { right: -200px; top: 260px; left: auto; }
  .choices.deep { height: 0; }
  .c4 { left: -220px; top: 60px; }
  .c5 { right: -220px; top: 160px; }
  .card { grid-template-columns: 200px 1fr; }
  .card-img { border-bottom: 0; border-right: 2px solid #1a2a6c; }
  .card-img img { height: 400px; }
}

/* 動きを減らす設定の端末（main.js が html に .still を付ける）：
   横切る大きな動きはやめて、その場でゆっくり漂うだけにする */
.still .school .deba {
  left: var(--x);
  animation-name: drift !important;
  animation-duration: 7s !important;
  animation-timing-function: ease-in-out;
  animation-direction: alternate;
}
.still .school .deba.rev { animation-name: drift-rev !important; }
.still .bubbles span {
  bottom: var(--y);
  animation-name: bubble-still;
  animation-duration: 6s !important;
  animation-timing-function: ease-in-out;
  animation-direction: alternate;
}
@keyframes drift     { from { transform: translate(0, 0); }             to { transform: translate(-14px, 4px); } }
@keyframes drift-rev { from { transform: translate(0, 0) scaleX(-1); }  to { transform: translate(14px, 4px) scaleX(-1); } }
@keyframes bubble-still { from { transform: translateY(0); opacity: .9; } to { transform: translateY(-16px); opacity: .5; } }
