/*
  せいざを さがそう だけの みため
  （いろなどの きほんは ../common/common.css に ある）
  この ゲームは がめん いっぱいの よぞらの うえに、ボタンや わくを かさねて おく。
*/

:root {
  --color-night: #03040f; /* よぞらの いろ（よみこむ まで みえる いろ） */
  --color-glass: rgba(10, 14, 50, 0.6);
}

/*
  ゆびで そらを うごかす ので、ページの スクロールや ブラウザの かくだいは とめる。
  （ゆびの うごきは main.js が うけとる）
*/
html,
body.sky-page {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.sky-page {
  min-height: 0;
  background: var(--color-night);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.sky {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* せいざの なまえ */
.labels {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 13px;
  color: rgba(190, 220, 255, 0.85);
  text-shadow: 0 0 6px #000;
  white-space: nowrap;
}

.label.is-target {
  font-size: 16px;
  color: var(--color-yellow);
}

/* ヒントの やじるし */
.arrow {
  position: fixed;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  pointer-events: none;
  filter: drop-shadow(0 0 8px var(--color-yellow));
}

/* ===== あそんでいる ときの うえの ぶぶん ===== */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 14px 0;
  pointer-events: none; /* そらを さわれる ように する（ボタンだけ おせる） */
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-back {
  padding: 8px 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  pointer-events: auto;
}

.pill {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(10, 14, 50, 0.55);
  font-size: 0.85rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.question {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: var(--color-glass);
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.question p {
  margin: 0;
}

.question-main {
  font-size: 1.25rem;
  line-height: 1.4;
}

.question-sub {
  min-height: 1.4em;
  margin-top: 2px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
  word-break: keep-all; /* ことばの とちゅうで おりかえさない */
}

.question-sub.is-good {
  color: var(--color-yellow);
}

.question-sub.is-miss {
  color: #9fdcff;
}

/* したの ボタン */
.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 14px calc(16px + env(safe-area-inset-bottom));
}

.bottom .btn {
  min-height: 48px;
  padding: 8px 16px;
  font-size: 1rem;
}

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle.is-on {
  border-color: transparent;
  background: rgba(47, 188, 245, 0.85);
}

/* ===== せってい・けっかの わく ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow-y: auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 40%, rgba(3, 4, 15, 0.2), rgba(3, 4, 15, 0.75));
  touch-action: pan-y; /* わくが ながい ときは たてに スクロール できる */
}

.overlay-back {
  align-self: center;
  width: 100%;
  max-width: 400px;
  padding: 6px 0;
}

.sky-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  flex-shrink: 0;
  padding: 18px;
  border-radius: 22px;
  text-align: center;
}

.sky-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.3;
}

.setup-desc {
  margin: -6px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-sub);
}

/* モード・むずかしさを えらぶ ボタン */
.mode-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.level-list {
  display: grid;
  gap: 8px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 3px solid var(--color-line);
  border-radius: 14px;
  background: #f8f7ff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.mode-list .choice {
  justify-content: center;
  padding: 10px 6px;
  text-align: center;
}

.choice.is-on {
  border-color: var(--color-main);
  background: #fff3ec;
}

.choice:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.choice small {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-sub);
}

.stars {
  flex: none;
  min-width: 52px;
  color: #f5b800;
}

.stars-off {
  color: #dcdaf0;
}

.start-button {
  width: 100%;
}

.credit {
  margin: 0;
  font-size: 0.6rem;
  font-weight: 700;
  color: #9a98b8;
}

/* けっか */
.result-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.result-list span {
  font-size: 1.6rem;
}

.result-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* きょうしつへの ボタン（こどもが おしたく なる みため） */
.studio-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: 3px dashed #c9c5ee;
  border-radius: var(--radius-medium);
  background: #faf9ff;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.studio-button:hover {
  border-color: var(--color-accent);
  background: #eef9ff;
}

.studio-button-main {
  font-size: 1.05rem;
  color: var(--color-text);
}

.studio-button-sub {
  font-size: 0.85rem;
  color: var(--color-accent-dark);
}

/* さいしょの がめんでは ちいさめに する */
.studio-button--small {
  padding: 8px 10px;
}

.studio-button--small .studio-button-main {
  font-size: 0.9rem;
}

.studio-button--small .studio-button-sub {
  font-size: 0.78rem;
}

/* ===== たかさが ひくい スマホ ===== */
@media (max-height: 700px) {
  .sky-panel {
    gap: 9px;
    padding: 14px 14px 12px;
  }

  .sky-title {
    font-size: 1.4rem;
  }

  .choice {
    padding: 6px 10px;
  }

  .mode-list .choice {
    padding: 6px;
  }

  .start-button {
    min-height: 46px;
  }
}

@media (max-height: 600px) {
  .level-list .choice small {
    display: none;
  }

  .studio-button--small .studio-button-sub {
    display: none;
  }
}

@media (max-width: 380px) {
  .bottom .btn {
    padding: 8px 12px;
    font-size: 0.92rem;
  }
}
