:root {
  --bg-main: #070712;
  --bg-panel: rgba(10, 10, 25, 0.9);
  --accent: #ff82c6;
  --accent-soft: rgba(255, 130, 198, 0.15);
  --text-main: #f7f7ff;
  --text-sub: #a7a7c8;
}

/* こより画面の中だけに効くようにスコープする */
#screen-koyori-game * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* セクション本体：表示/非表示は app.css の .screen / .screen.active に任せる */
#screen-koyori-game {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;

  /* こよりCGをそのまま全面表示 */
  background-color: #000;
  background-image: url("./koyori_bg1.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: var(--text-main);
  min-height: 100vh;
  position: relative;
}

/* ===== ゲーム本体（UI） ===== */

#screen-koyori-game .game-container {
  width: 100%;
  max-width: 420px;
  padding: 16px;
  position: relative;
  z-index: 2; /* エフェクトより前面 */

  /* ここで中央寄せする（セクションには display を書かない） */
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

#screen-koyori-game header {
  text-align: center;
  margin-bottom: 8px;
}

#screen-koyori-game .title-main {
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  margin: 0;
}

#screen-koyori-game .title-sub {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin: 4px 0 0;
}

#screen-koyori-game .panel {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  padding: 12px;
}

/* メインメッセージ（通常時） */
#screen-koyori-game #message {
  min-height: 2.2em;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-sub);
}

/* 数字パネル */
#screen-koyori-game .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}

#screen-koyori-game .cell {
  position: relative;
  width: 100%;
  padding-top: 100%;
  border-radius: 10px;

  background: rgba(0, 0, 0, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(1px);

  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.1s ease,
    border-color 0.1s ease,
    background 0.1s ease;
}

#screen-koyori-game .cell-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  color: rgba(255, 255, 255, 0.78);
  font-size: 1.5rem;
  font-weight: 600;
}

#screen-koyori-game .cell:active:not(.cell-correct):not(.cell-disabled) {
  transform: scale(0.97);
}

#screen-koyori-game .cell-correct {
  background: transparent;
  border-color: rgba(255, 130, 198, 0.85);
}

#screen-koyori-game .cell-disabled {
  opacity: 0.45;
  cursor: default;
}

/* スタートボタン行 */
#screen-koyori-game .controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

#screen-koyori-game .btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

#screen-koyori-game .btn-main {
  background: linear-gradient(135deg, #ff6bd4, #ffc46b);
  color: #1c0414;
  box-shadow: 0 6px 16px rgba(255, 120, 220, 0.55);
}


#screen-koyori-game .btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#screen-koyori-game .hidden {
  display: none !important;
}

/* ===== こよりプロローグ ===== */

#screen-koyori-prologue {
  background: #000;
  position: relative;
}

/* こより立ち絵：画面全体基準（10%小さく） */
#screen-koyori-prologue .koyori-stand {
  position: fixed;
  left: 50%;
  bottom: 0;

  height: 90vh; /* 10%小さく */
  width: auto;

  transform: translateX(-50%);
  object-fit: contain;

  z-index: 5;          /* 背景より上、台詞より下 */
  pointer-events: none;
  user-select: none;
}



/* ===== 全画面ハートエフェクト（画像ベース） ===== */


/* 中心基準のラッパー */
#screen-koyori-game .heart-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}


/* ===== タイマー：バーだけ表示 ===== */
#screen-koyori-game .ui-timer__row {
  display: none !important; /* TIME と 数字 を消す */
}

/* 上の行が消える分、余白も詰める */
#screen-koyori-game .ui-timer {
  padding: 0 !important;
  margin: 0 0 8px 0 !important; /* ここは好みで 0〜12px */
}

/* バーの高さを少しだけ太くしたいなら（任意） */
#screen-koyori-game .ui-timer__track {
  margin: 0 !important;
  height: 8px;              /* 好みで */
  border-radius: 999px;
  overflow: hidden;
}
#screen-koyori-game .ui-timer__bar {
  height: 100%;
}


/* 台詞ウィンドウ：画面下1/4固定 */
#koyoriPrologueTextWindow{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 25vh;
  min-height: 25vh;
  max-height: 25vh;

  padding: 14px 16px;
  box-sizing: border-box;

  background: rgba(0,0,0,0.35);
  border-top: 1px solid rgba(255,130,198,0.5);
  z-index: 5;

  display: flex;
  align-items: flex-start;
}

#koyoriPrologueTextWindowContent{
  width: 100%;
  overflow-y: auto; /* 文字が多いときは中だけスクロール */
  line-height: 1.55;
}

/* ===== こよりプロローグ：レイヤーを安定させる ===== */

#screen-koyori-prologue{
  position: relative;
  min-height: 100vh;
  background: #000;
}

/* ===== こより立ち絵：画面全体基準 ===== */
#screen-koyori-prologue .koyori-stand {
  position: fixed;
  left: 50%;
  bottom: 0;

  /* ★ 画面全体基準で高さを決める */
  height: 100vh;
  width: auto;

  transform: translateX(-50%);
  object-fit: contain;

  z-index: 5;          /* 背景より上、台詞より下 */
  pointer-events: none;
  user-select: none;
}

/* 台詞ウィンドウ：立ち絵より上、少し透ける */
#screen-koyori-prologue #koyoriPrologueTextWindow{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 25vh;
  padding: 14px 16px;
  box-sizing: border-box;

  background: rgba(0,0,0,0.80); /* ←透けさせたいなら 0.75〜0.85 */
  border-top: 1px solid rgba(255,130,198,0.5);
  z-index: 3;                   /* ←立ち絵より上 */

  display: flex;
  align-items: flex-start;
}

#screen-koyori-prologue #koyoriPrologueTextWindowContent{
  width: 100%;
  overflow-y: auto;
  line-height: 1.55;
}


