:root {
  --bg-main: #070712;
  --accent: #a3f7ff;
  --text-main: #f7f7ff;
  --text-sub: #a7a7c8;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  background-color: #000;
  background-image: url("chloe_bg1.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}


.hidden {
  display: none !important;
}

/* ===== クロエプロローグ ===== */
#screen-chloe-prologue {
  background: #000;
  position: relative;
}

#screen-chloe-prologue .chloe-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;
}

/* 画面を暗くする黒レイヤー（最終段階） */
.dark-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease-out;
  z-index: 2;
}

.dark-overlay.show {
  opacity: 1;
}

.game-wrapper {
  width: 100%;
  max-width: none;
  padding: 16px 0 32px;
  position: relative;
  z-index: 3;
  min-height: 100vh;            /* 画面高さに合わせる */
  display: flex;                 /* 中央寄せ準備 */
  align-items: center;           /* 縦中央 */
  justify-content: center;       /* 横中央（パネルを中央） */
}

.panel {
  background: transparent;
  border-radius: 16px;
  padding: 16px 14px 20px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 12px;
  text-align: center;
  opacity: 0.75;
  margin-bottom: 16px;
}

.status-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  font-size: 12px;
  margin-bottom: 8px;
  gap: 8px;
}

.status-label {
  opacity: 0.8;
}

.status-value {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* バーエリア */
.tap-area {
  margin-top: 8px;
  padding: 24px 0 18px;
  border-radius: 14px;
  background: transparent;
  border: none;
  position: relative;
  overflow: visible;
  touch-action: manipulation;
}

/* バー上のテキスト */
.tap-instruction {
  width: 92%;
  margin: 0 auto 6px;
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  text-shadow:
    0 0 4px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.8);
}

/* スタート後に出現 */
.panel.play-started .tap-instruction {
  opacity: 1;
  transform: translateY(0);
}

/* 横ゲージ本体 */
.gauge {
  position: relative;
  width: 96vw;
  margin: 0 auto;
  height: 20px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
}

/* プレイヤー＆クロヱ側バー */
.gauge-bar {
  height: 100%;
  transition: width 0.06s linear;
}

.player-bar {
  background: linear-gradient(
    90deg,
    rgba(196, 235, 255, 0.9),
    rgba(175, 215, 255, 0.7)
  );
}

.cpu-bar {
  background: linear-gradient(
    90deg,
    rgba(132, 55, 141, 0.9),
    rgba(67, 43, 138, 0.9)
  );
}

/* 真ん中の境界線 */
.gauge-center-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.8),
    0 0 16px rgba(159, 248, 255, 0.7);
}

/* ラベル */
.gauge-label-row {
  margin-top: 6px;
  width: 92%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}

.gauge-label-left {
  opacity: 0.9;
}
.gauge-label-right {
  opacity: 0.9;
  text-align: right;
}


/* ボタン類 */
.controls {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.btn-main {
  background: var(--accent);
  color: #031014;
}

.btn-secondary,
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.note {
  margin-top: 8px;
  font-size: 10px;
  opacity: 0.65;
  text-align: center;
}

/* 簡易テキストボックス */
.dialogue-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(5, 6, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 12px;
  line-height: 1.6;
}

/* スタート後、UIを消す（バー＋指示だけ残す） */
.panel.play-started .ui-header,
.panel.play-started .controls,
.panel.play-started .note,
.panel.play-started .dialogue-box {
  display: none;
}

/* 白フラッシュ */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.35s linear;
}

.flash-overlay.visible {
  opacity: 1;
}

/* ゲームオーバー時テキストウィンドウ */
.text-window {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18vh;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  z-index: 5;
}

.text-window-inner {
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  border-top: 1px solid rgba(163, 247, 255, 0.5);
  padding: 12px 16px;
  display: flex;
  align-items: center;
}

.text-window-inner p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.7;
}
