/* Simple Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* body */
body {
    background:  #0D0F3F;
    color: #E8EBF7;
    font: 400 87.5%/1.5em;
    font-family: "Helvetica Neue",
        Arial,
        "Hiragino Kaku Gothic ProN",
        "Hiragino Sans",
        Meiryo,
        sans-serif;
    line-height: normal;
    }
/* ログイン画面 */
.login-card {
    background-color: #191970;
    color: #fff;
    /* border-radius: 1.5rem; */
    border-radius: 1rem;
    padding: 2rem;
    max-width: 400px;
    margin: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
      /* ここを追加 */
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
/* Googleでログイン */
.btn-mail-mental {
    /* 背景：半透明の淡いブルーで落ち着いた印象に */
    background: rgba(100, 180, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}
/* ホバー時はほんのり濃いめのブルーに */
.btn-mail-mental:hover {
    background: rgba(100, 180, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* 押下時は沈み込むように */
.btn-mail-mental:active {
    background: rgba(100, 180, 255, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}

.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(25, 25, 112, 0.25);
}
.footer {
    font-size: 0.8rem;
    margin-top: 2rem;
    color: #bbb;
}

/* 録音ボタン ---------------------------------------- */
.btn-record {
    background-color: #C8E6C9;  /* ミントグリーン */
    color: #0D0F3F;             /* 濃いネイビー */
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    padding: 0.75rem;
    transition: background-color 0.2s ease;
}
/* ホバーは少し深めのグリーンに */
.btn-record:hover,
.btn-record:focus {
    background-color: #AEDAAE;
    outline: none;
}
/* アクティブ時はさらに濃く */
.btn-record:active {
    background-color: #96C49C;
}
/* app画面 */
.app-card {
    background: #191970;
    color: #fff;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    /* 上部に 1.5rem の余白を追加 */
    padding-top: 1.5rem;
    /* 既存の padding や border はそのまま */
    margin-top: 1rem; /* お好みで調整 */
    margin-bottom: 1rem; /* お好みで調整 */
}
.gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0;
}

.gauge-label {
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 0.25rem;
    width: 100%;
}
.gauge-svg {
    display: block;
    margin: 0 auto;
}
#gauge-container {
    /* 横 150px × 縦 80px の枠内に半円を収める */
    position: relative;
}
#gauge-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* 総合メンタル指数 */
.progress {
    background: rgba(255,255,255,0.1);
    border-radius:0.75rem;
}
.progress-bar {
    font-weight:600;
    line-height:1.5rem;
}

/* ログイン画面 */
/* ===== ログイン画面：押しやすさ（統合版） ===== */
:root{
  --hv-gap: 14px;
  --hv-btn-h: 56px;
  --hv-radius: 14px;
}

/* 縦積み要素の間隔 */
.hv-stack{
  display:flex;
  flex-direction:column;
  gap: var(--hv-gap);
  width: 100%;
}

/* 入力欄も押しやすく */
.hv-input{
  height: 56px;
  border-radius: 12px;
  font-size: 18px;
  padding: 0 16px;
}

/* タブ（セグメント）：HTMLは .btn のままなのでここに当てる */
.hv-seg{
  display:flex;
  gap: 10px;
}
.hv-seg .btn{
  flex:1;
  height: 52px;
  border-radius: 12px !important;
  font-size: 18px;
  font-weight: 800;
}

/* 共通：ログイン系ボタン（Google/メール/登録） */
.btn-auth{
  width:100%;
  height: var(--hv-btn-h);
  padding: 0 18px;
  border-radius: var(--hv-radius);

  background: rgba(100, 180, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.30);

  font-size: 18px;
  font-weight: 700;
  line-height: 1;

  display:flex;
  align-items:center;
  justify-content:center;

  transition: background 0.2s, box-shadow 0.2s, transform 0.05s;
}
.btn-auth:hover{
  background: rgba(100, 180, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-auth:active{
  background: rgba(100, 180, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0,0,0,0.20);
  transform: translateY(1px);
}
.btn-auth:disabled{
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 登録ボタンは“枠線っぽく”したい場合の派生 */
.btn-auth--outline{
  background: transparent;
  border: 1px solid rgba(255,255,255,0.45);
}
.btn-auth--outline:hover{
  background: rgba(255,255,255,0.08);
}
.btn-auth--outline:active{
  background: rgba(255,255,255,0.12);
}

/* ===== プロっぽいヘッダー（余白の器 + 配置） ===== */
.hv-header{
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;

  /* 上の詰まりを解消（安全領域込み） */
  padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
  padding-left: 16px;
  padding-right: 16px;

  /* ロゴと本文の間に空気を作る */
  padding-bottom: 16px;
}

/* ロゴ：スマホ幅基準で必ず収める（オーバーフロー防止） */
.hv-logo{
  display: block;
  width: min(520px, 86vw);
  max-width: 86vw;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}


/* 右上の設定（⚙︎）：ヘッダー内に収めて“余白ある配置”に */
.hv-gear{
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 16px;

  width: 44px;
  height: 44px;
  border-radius: 14px;

  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;

  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.90);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);

  z-index: 10;
}

/* “触った感”は控えめに */
.hv-gear:hover{ background: rgba(255,255,255,0.14); }
.hv-gear:active{ transform: translateY(1px); }


/* 設定画面：上寄せで中央配置 + 上部に余白 */
.page-top{
  min-height: 100vh;
  display: flex;
  justify-content: center;     /* 横中央 */
  align-items: flex-start;      /* 上寄せ */
  padding:
    calc(env(safe-area-inset-top, 0px) + 28px)  /* 上だけ厚め */
    16px
    24px;
}

/* カードは横中央で幅を安定させる */
.app-card{
  width: min(520px, 100%);
  margin: 0 auto;
}

/* ===== login.php：ロゴをスマホ対応に戻す（最重要） ===== */
.logo{
  display: block;
  width: min(520px, 92vw);
  max-width: 92vw;
  height: auto;
  padding-top: 10px;
  margin: 0 auto 18px;
}

/* app.php：コンテンツ全体に“左右の余白”と最大幅 */
.hv-container{
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 0 14px;         /* ←ここが「ボタン左右の余白」 */
}

/* ついで：w-100ボタンが詰まって見えるのを軽く緩める */
.hv-container .w-100{
  border-radius: 14px;
}

/* 録音ボタン：角丸を確実に効かせる */
button.btn-record{
  border-radius: 16px !important;
  overflow: hidden; /* まれに内部が角丸をはみ出す対策 */
}
button.btn-record{
  min-height: 64px;
  padding: 16px 18px;
  font-size: 18px;
  font-weight: 800;
}

/* 横方向のはみ出しだけ封じる（縦スクロールは維持） */
#app{
  overflow-x: hidden;
}

/* login.php：レスポンシブラッパー（これで見切れ止まる） */
.hv-container-login{
  width: 100%;
  max-width: 520px;
  margin: 0 auto;

  /* iPhone SEでも確実に収める */
  padding-left: calc(env(safe-area-inset-left, 0px) + 14px);
  padding-right: calc(env(safe-area-inset-right, 0px) + 14px);
  box-sizing: border-box;
}

/* セグメント：小さい端末で見切れないように */
.hv-seg{
  display:flex;
  gap: 10px;
}

.hv-seg .hv-seg-btn{
  flex: 1 1 0;
  min-width: 0;              /* ←これが重要。省略されがち */
  height: 52px;
  border-radius: 12px;
  font-size: 17px;           /* 基本 */
  font-weight: 800;
  padding: 0 10px;           /* Bootstrapの太paddingを抑える */
  white-space: nowrap;       /* 改行させない */
}

/* iPhone SE級（~375px）ではさらに少しだけ詰める */
@media (max-width: 375px){
  .hv-seg{ gap: 8px; }
  .hv-seg .hv-seg-btn{
    font-size: 16px;
    padding: 0 8px;
    height: 50px;
  }
}

/* Googleボタン：横はみ出しを確実に防ぐ */
.hv-google{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  padding: 14px 14px;
  gap: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  white-space: nowrap;   /* 1行維持 */
  overflow: hidden;      /* はみ出しを隠す */
  text-overflow: ellipsis; /* 万一はみ出したら… */
}

/* 画像のせいで幅が押し広げられないように */
.hv-google img{
  flex: 0 0 auto;
}

/* iPhone SE級では少しだけ詰める */
@media (max-width: 375px){
  .hv-google{
    font-size: 16px;
    padding: 12px 12px;
  }
}

@media (max-width: 375px){
  .hv-container{ padding: 0 10px; }
}

/* settings.php のリンクを“ボタン見え”にする（下線 제거） */
a.btn-auth{
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
}
a.btn-auth:hover,
a.btn-auth:focus,
a.btn-auth:active{
  text-decoration: none !important;
}

/* outline版（btn-auth--outline が未定義ならこれで整う） */
a.btn-auth--outline{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.20);
  color: rgba(255,255,255,0.92);
}

/* 押下感を統一 */
a.btn-auth{
  border-radius: 14px;
  min-height: 56px;
  padding: 14px 16px;
}
a.btn-auth:active{
  transform: translateY(1px);
}

button.btn-auth{
  appearance: none;
  text-decoration: none;
  width: 100%;
}


/* 解約ゾーン：誤操作防止の“区切り” */
.hv-danger-zone{
  margin-top: 18px;                 /* 戻るボタンから距離 */
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.18);
}

.hv-danger-zone__title{
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  opacity: .9;
  margin-bottom: 6px;
}

.hv-danger-zone__desc{
  font-size: 12px;
  opacity: .7;
  line-height: 1.4;
  margin-bottom: 10px;
}

/* 解約ボタンは“危険操作”として色味を変える（下線なし、通常ボタン見え） */
.btn-auth--danger{
  background: rgba(255, 90, 90, 0.14);
  border: 1px solid rgba(255, 90, 90, 0.40);
}
.btn-auth--danger:hover{
  background: rgba(255, 90, 90, 0.22);
}

/* ── プロンプトカード ───────────────────────── */
.prompt-card {
    position: relative;
    border-radius: 16px;
    padding: 2px; /* グラデーションボーダーの太さ */
    background: linear-gradient(
        135deg,
        #FFC4B2 0%,
        #FFD9C7 40%,
        rgba(255, 255, 255, 0.15) 100%
    );
    min-height: 100px;
}

.prompt-card::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 14px;
    background: rgba(10, 10, 60, 0.85);
    backdrop-filter: blur(12px);
    z-index: 0;
}

.prompt-card__inner {
    position: relative;
    z-index: 1;
    padding: 1rem 1.2rem;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

/* ヘッダー：ドット＋ラベル */
.prompt-card__header {
    display: flex;
    align-items: center;
    gap: 5px;
}

.prompt-card__dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFC4B2, #FFD9C7);
    opacity: 0.8;
}

.prompt-card__dot:nth-child(2) { opacity: 0.5; }
.prompt-card__dot:nth-child(3) { opacity: 0.3; }

.prompt-card__label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: #FFC4B2;
    opacity: 0.75;
    margin-left: 4px;
    text-transform: uppercase;
}

/* 本文：フェードイン */
.prompt-card__text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #FFF1E6;
    font-weight: 400;
    letter-spacing: 0.03em;
    white-space: pre-line; /* ★ これだけ追加 */
    animation: promptFadeIn 0.6s ease forwards;
}

@keyframes promptFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rec-btn:disabled {
    cursor: default;
    opacity: 1;
}

.timer.active {
    opacity: 1;
    font-size: 20px;
    font-weight: 700;
    color: #60a5fa;
}


.waveform {
  height: 108px;
  min-height: 108px;
  max-height: 108px;
  overflow: hidden;
  align-items: center;
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    black 9%,
    black 91%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    black 9%,
    black 91%,
    transparent 100%
  );
}

.waveform-bar {
  transform-origin: center center;
  max-height: 96px;
}

.waveform.active {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(96, 235, 255, 0.20), transparent 62%),
    radial-gradient(ellipse at 22% 48%, rgba(45, 212, 191, 0.18), transparent 56%),
    radial-gradient(ellipse at 78% 52%, rgba(255, 142, 205, 0.16), transparent 56%),
    linear-gradient(90deg, rgba(45, 212, 191, 0.08), rgba(124, 106, 247, 0.16), rgba(255, 196, 178, 0.10));

  box-shadow:
    inset 0 0 28px rgba(255,255,255,0.05),
    0 0 36px rgba(96,235,255,0.13),
    0 0 48px rgba(167,139,250,0.08);
}

/* 小さい端末では少し詰める */
@media (max-width: 375px) {
  .waveform {
    width: min(96vw, 420px);
    height: 96px;
    gap: 2.8px;
    padding: 0 10px;
  }

  .waveform-bar {
    width: 3px;
    min-width: 3px;
  }
}
