/* ===== TalkSea° style.css (v2) ===== */

:root {
  --sea:        #72a9b7;  /* 背景の海 */
  --sky:        #8ccbe0;  /* ロゴの水色 */
  --foam:       #f3f9fb;  /* チャット面 (薄い青白) */
  --chat-bg:    #e3f0f4;  /* チャット中の無地の背景 */
  --paper:      #fbf6e4;  /* 紙のクリーム */
  --cream:      #f3e6b0;  /* くらげの色 */
  --crab:       #d93a26;  /* カニの赤 */
  --crab-dark:  #a82616;
  --ink:        #1f2a52;  /* 輪郭の紺 */
  --brown:      #6f4310;  /* ロゴの茶 */

  /* 背景タイル1枚分の大きさ (wallpaper.png = 1800 x 1269 の半分。12組が不規則に散らばっている) */
  --tile-w: 900px;
  --tile-h: 634.5px;

  --font-display: "Kaisei Decol", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body:    "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
}

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

[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--sea);
  transition: background-color 0.4s ease;
  -webkit-text-size-adjust: 100%;
}

/* チャット中は、模様のない目に優しい薄い青の無地に切り替える */
body[data-screen="chat"],
body[data-screen="lounge"] { background-color: var(--chat-bg); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

button, textarea { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--paper);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--ink);
}

/* ===== 背景: 模様がゆっくり斜め(右上)へ流れる ===== */
.sea {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0s;
}

/* 1タイル分(横1枚・縦1枚)ぴったり動いて元に戻るので、つなぎ目なく繰り返せる */
.sea-tiles {
  position: absolute;
  top: -24px;
  right: -24px;
  left: calc(var(--tile-w) * -1 - 24px);
  bottom: calc(var(--tile-h) * -1 - 24px);
  background: url("wallpaper.png?v=20261104h") 0 0 / var(--tile-w) var(--tile-h) repeat;
  will-change: transform;
  animation:
    drift 80s linear infinite,                 /* 斜めに流れる */
    bob 9s ease-in-out infinite alternate;     /* ふわふわ揺れる */
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--tile-w), calc(var(--tile-h) * -1), 0); }
}

@keyframes bob {
  from { translate: -12px 8px; }
  to   { translate: 12px -8px; }
}

/* チャット画面では背景を消して、動きも止める */
body[data-screen="chat"] .sea,
body[data-screen="lounge"] .sea {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
body[data-screen="chat"] .sea-tiles,
body[data-screen="lounge"] .sea-tiles { animation-play-state: paused; }

/* ===== 画面切り替え ===== */
.screen { display: none; position: relative; z-index: 1; }

body[data-screen="home"]     #screen-home,
body[data-screen="matching"] #screen-matching { display: flex; }
body[data-screen="chat"]     #screen-chat     { display: flex; }
body[data-screen="lounge"]   #screen-lounge   { display: flex; }

.screen-center {
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}

/* ===== 真ん中の白い半透明カード (後ろの動きが透けて見える) ===== */
.card {
  width: min(100%, 560px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 28px 24px 26px;
  /* 半透明の白 + ぼかし: 後ろでゆっくり動く模様がうっすら透けて見える */
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 28px;
  /* ほんのり影で、ふわっと浮かせる */
  box-shadow:
    0 12px 32px rgba(31, 42, 82, 0.18),
    0 2px 6px rgba(31, 42, 82, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* すりガラスに対応していないブラウザでは、読みやすいように白を濃くする */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(255, 255, 255, 0.9); }
}

.card-narrow { width: min(100%, 420px); gap: 22px; }

/* ===== トップ ===== */
.logo-frame {
  width: 100%;
  aspect-ratio: 1312 / 312;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--ink);
  background: var(--sky);
}

.logo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tagline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 4.6vw, 1.4rem);
  line-height: 1.6;
  color: var(--brown);
}

.note {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #3b4a73;
}

/* ===== 年齢確認のチェック (チェックするまで開始ボタンは押せない) ===== */
.age-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.age-check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--crab);
  cursor: pointer;
}

.btn-big:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  animation: none;
  box-shadow: 0 7px 0 var(--ink);
}

.btn-big:disabled:hover  { background: var(--crab); }
.btn-big:disabled:active { transform: none; box-shadow: 0 7px 0 var(--ink); background: var(--crab); }

/* ===== 大ボタン（ゆっくり揺れる） ===== */
.btn-big {
  width: min(100%, 360px);
  min-height: 78px;
  padding: 12px 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--crab);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 7px 0 var(--ink);
  cursor: pointer;
  animation: btn-bob 3.4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}

.btn-big:hover  { background: #e5452f; }

.btn-big:active {
  animation: none;
  transform: translateY(5px);
  box-shadow: 0 2px 0 var(--ink);
  background: var(--crab-dark);
}

@keyframes btn-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ===== サブボタン ===== */
.btn-sub {
  min-height: 46px;
  padding: 8px 26px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-sub:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* ===== マッチング中 ===== */
.bubbles {
  position: relative;
  width: 120px;
  height: 150px;
}

.bubbles span {
  position: absolute;
  bottom: 0;
  display: block;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  animation: rise 2.8s ease-in infinite;
  opacity: 0;
}

.bubbles span:nth-child(1) { left: 14px; width: 26px; height: 26px; animation-delay: 0s; }
.bubbles span:nth-child(2) { left: 62px; width: 36px; height: 36px; animation-delay: 0.7s; }
.bubbles span:nth-child(3) { left: 36px; width: 20px; height: 20px; animation-delay: 1.4s; }
.bubbles span:nth-child(4) { left: 88px; width: 22px; height: 22px; animation-delay: 2.0s; }

@keyframes rise {
  0%   { transform: translateY(0) translateX(0);       opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-150px) translateX(8px); opacity: 0; }
}

.matching-text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  color: var(--brown);
}

/* 待機中の文言: 切り替わるたびにふわっと表示 (文字数が違っても枠が上下に動かないよう高さを確保) */
.matching-text {
  min-height: 3.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matching-text.swap { animation: text-swap 0.6s ease both; }

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

/* ===== チャット (無地の背景の上に表示) ===== */
#screen-chat,
#screen-lounge {
  height: 100dvh;
  justify-content: center;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  height: 100%;
  background: var(--foam);
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
  overflow: hidden;
}

.chat-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--sky);
  border-bottom: 3px solid var(--ink);
}

.chat-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--brown);
}

.btn-leave {
  min-height: 40px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: var(--crab);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.btn-leave:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* 会話を下から積み上げる (少ないときは下に寄り、増えると上へ流れる) */
.messages > :first-child { margin-top: auto; }

/* 吹き出し */
.msg {
  max-width: 78%;
  padding: 9px 14px;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  border: 2px solid var(--ink);
}

.msg.me {
  align-self: flex-end;
  background: var(--cream);
  border-radius: 18px 18px 4px 18px;
}

.msg.them {
  align-self: flex-start;
  background: #fff;
  border-radius: 18px 18px 18px 4px;
}

.msg.system {
  align-self: center;
  max-width: 92%;
  padding: 4px 14px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--brown);
  background: transparent;
  border: 2px dashed rgba(31, 42, 82, 0.45);
  border-radius: 999px;
}

/* 終了バナー */
.chat-ended {
  flex: none;
  padding: 14px;
  text-align: center;
  background: var(--paper);
  border-top: 3px solid var(--ink);
}

.chat-ended p {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brown);
}

.chat-ended-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn-next {
  min-height: 46px;
  padding: 8px 26px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: var(--crab);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.btn-next:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* 入力欄 */
.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 3px solid var(--ink);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  max-height: 140px;
  padding: 12px 14px;
  font-size: 16px; /* iOSの自動ズーム防止 */
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 18px;
  resize: none;
}

.composer textarea::placeholder { color: rgba(31, 42, 82, 0.5); }

.btn-send {
  flex: none;
  min-width: 68px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: var(--crab);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.btn-send:active   { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 小さい画面 ===== */
@media (max-width: 600px) {
  :root {
    --tile-w: 640px;
    --tile-h: 451.2px;
  }

  .card { padding: 18px 16px 18px; gap: 14px; }
  .screen-center { padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .btn-big { min-height: 66px; font-size: 1.45rem; }

  .chat-panel { border-left: 0; border-right: 0; }

  .msg { max-width: 84%; }
}

/* ===== 同意文言・フッター ===== */
.consent {
  margin: -6px 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #3b4a73;
}

.consent a,
.legal a {
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.copy {
  margin: 10px 0 0;
  padding: 1px 14px;
  font-size: 0.75rem;
  color: #3b4a73;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
}

/* ===== 広告スペース (レスポンシブ) =====
   ・空のあいだは「仮のグレーの枠」が出ます (位置確認用)。
   ・広告コードを <aside> に貼ると、グレーの枠は自動で消えます。
   ・高さは --ad-h で変更できます (例: 300x250 の広告なら 250px)。
   ・本番で空のときに何も見せたくない場合は、下の「.ad-slot:empty」2つのブロックを削除してください
     (場所だけは確保されたままです)。 */
.ad-slot {
  --ad-h: 90px;
  width: min(100%, 728px);
  min-height: var(--ad-h);
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;       /* 広告が横にはみ出して画面が揺れないように */
}

/* 仮のグレー背景 (広告コードが入るまで) */
.ad-slot:empty {
  background: rgba(176, 184, 194, 0.65);
  border: 2px dashed rgba(255, 255, 255, 0.9);
  border-radius: 14px;
}

.ad-slot:empty::after {
  content: "広告スペース";
  font-size: 0.8rem;
  font-weight: 700;
  color: #4a5566;
}

/* 広告コードが入ったときだけ「広告」の表示が出ます */
.ad-slot:not(:empty)::before {
  content: "広告";
  align-self: flex-start;
  margin-bottom: 2px;
  font-size: 0.7rem;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 1px 0 rgba(31, 42, 82, 0.6);
}

/* チャット中の広告: 細い帯 (320x50)。会話の邪魔にならないよう小さめ */
.ad-slot-chat {
  --ad-h: 50px;
  flex: none;
  width: 100%;
  margin: 0;
  padding: 2px 0;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}
.ad-slot-chat:empty { border-radius: 0; border-width: 0 0 3px; border-style: solid; border-color: var(--ink); }
.ad-slot-chat:not(:empty)::before { color: #5a6a8a; text-shadow: none; margin-left: 8px; }
/* スマホを横向きにしたときや、キーボードで画面が低いときは、チャットの広告をかくします */
@media (max-height: 480px) { .ad-slot-chat { display: none; } }

@media (max-width: 600px) {
  .ad-slot { --ad-h: 100px; }
  .ad-slot-chat { --ad-h: 50px; }   /* スマホは 320x100 前後の広告に合わせる */
}

/* ===== 画面最下部のリンク ===== */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
  margin-top: 10px;
  padding: 2px 14px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
}

.footer-links a,
.link-btn {
  padding: 3px 2px;
  font: inherit;
  font-size: 0.78rem;
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ===== お問い合わせフォーム ===== */
.contact-dialog {
  width: min(92vw, 520px);
  max-height: 92dvh;
  padding: 0;
  overflow: auto;
  font-family: var(--font-body);
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(31, 42, 82, 0.3);
}

.contact-dialog::backdrop {
  background: rgba(31, 42, 82, 0.45);
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px 20px;
}

.contact-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--brown);
}

.contact-lead {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #3b4a73;
}

.field { display: flex; flex-direction: column; gap: 4px; }

.field label { font-size: 0.85rem; font-weight: 700; }

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 16px; /* iOSの自動ズーム防止 */
  line-height: 1.5;
  color: var(--ink);
  background: var(--foam);
  border: 2px solid var(--ink);
  border-radius: 14px;
}

.field textarea { resize: vertical; min-height: 120px; }

.field .is-invalid { border-color: var(--crab); background: #fff1ee; }

/* スパム対策のおとり欄 (画面の外に出す。display:none だと見抜かれやすいため) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-status {
  min-height: 1.5em;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.contact-status.is-error { color: var(--crab-dark); }
.contact-status.is-ok    { color: #1f6b3a; }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.contact-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 利用規約・プライバシーポリシーのページ ===== */
body.legal-page {
  height: auto;
  min-height: 100%;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
  background-color: var(--chat-bg);
}

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 24px 30px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
}

.legal-back {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.legal h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.4;
  color: var(--brown);
}

.legal .updated {
  margin: 0 0 20px;
  font-size: 0.85rem;
  color: #3b4a73;
}

.legal h2 {
  margin: 28px 0 8px;
  padding-left: 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  border-left: 6px solid var(--crab);
}

.legal p,
.legal li {
  font-size: 0.95rem;
  line-height: 1.85;
}

.legal p { margin: 0 0 10px; }

.legal ul,
.legal ol {
  margin: 0 0 10px;
  padding-left: 1.5em;
}

.legal li { margin-bottom: 4px; }

/* 運営者がご自身で書き換える箇所 */
.legal .todo {
  padding: 0 4px;
  background: #fff3a3;
  border-radius: 4px;
}

/* ===== 動きを減らす設定 (背景も止める) ===== */
@media (prefers-reduced-motion: reduce) {
  .sea-tiles { animation: none; }
  .matching-text.swap { animation: none; }
  .btn-big { animation: none; }
  .bubbles span { animation: none; opacity: 1; }
  .bubbles span:nth-child(1) { bottom: 10px; }
  .bubbles span:nth-child(2) { bottom: 50px; }
  .bubbles span:nth-child(3) { bottom: 90px; }
  .bubbles span:nth-child(4) { bottom: 30px; }
  body, .sea { transition: none; }
}

/* ===== 待合室 ===== */
.lounge-tag {
  margin-left: 8px;
  padding: 2px 10px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  vertical-align: 3px;
}

.lounge-banner {
  flex: none;
  margin: 0;
  padding: 8px 14px;
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

/* AIの吹き出し (人間のお相手と区別できるよう、色とバッジを変える) */
.msg.ai {
  align-self: flex-start;
  background: #e8f6fb;
  border-radius: 18px 18px 18px 4px;
}

.msg.ai::before {
  content: "AI";
  display: inline-block;
  margin-right: 6px;
  padding: 0 7px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  vertical-align: 1px;
}

.msg.pending { opacity: 0.6; }

/* AIが入力中 */
.msg.typing { display: flex; align-items: center; gap: 5px; min-height: 40px; }
.msg.typing::before { margin-right: 2px; }
.msg.typing i {
  width: 7px; height: 7px;
  background: var(--ink);
  border-radius: 50%;
  animation: typing 1.1s ease-in-out infinite;
}
.msg.typing i:nth-child(3) { animation-delay: 0.15s; }
.msg.typing i:nth-child(4) { animation-delay: 0.3s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* 「待合室に入りますか？」 */
.lounge-offer { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lounge-offer-note { margin: 0; font-size: 0.85rem; line-height: 1.7; color: #3b4a73; }
.lounge-offer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* 画像のドラッグ保存をしにくくする (簡易的なものです。完全には防げません) */
img { -webkit-user-drag: none; user-select: none; }

@media (prefers-reduced-motion: reduce) {
  .msg.typing i { animation: none; opacity: 0.6; }
}

/* 画面の高さが低いとき(小さめのスマホ・ノートPCなど)は、トップ画面がスクロールなしで収まるよう、すきまを詰める */
@media (max-height: 840px) {
  .screen-center { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  #screen-home .card { gap: 11px; padding: 16px 20px; }
  #screen-home .btn-big { min-height: 62px; }
  #screen-home .note br { display: none; }
}
@media (max-height: 700px) {
  .screen-center { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  #screen-home .card { gap: 7px; padding: 12px 16px; }
  #screen-home .tagline { font-size: 1.05rem; line-height: 1.45; }
  #screen-home .age-check { padding: 6px 18px; }
  #screen-home .btn-big { min-height: 54px; font-size: 1.3rem; }
  #screen-home .ad-slot { margin-top: 8px; }
  #screen-home .footer-links { margin-top: 6px; }
  #screen-home .copy { margin-top: 6px; }
}

/* 著作権の注意 (赤い1行。タップすると「よくある質問」の説明へ) */
.warn-line {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--crab-dark);
  text-decoration: none;
}
.warn-line:hover { text-decoration: underline; text-underline-offset: 2px; }

/* 診断表示(?debug=1)の改行を表示する */
#matching-text { white-space: pre-line; }

/* ===== Xでシェアして友達を呼ぶ (インテントURLのリンク) ===== */
.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 22px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 #0e1530;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-share:hover  { background: #2b3a73; }
.btn-share:active { transform: translateY(2px); box-shadow: 0 1px 0 #0e1530; }
.btn-share .x-icon { flex: none; }
#screen-home .btn-share { margin-top: 12px; }
.chat-ended .btn-share { margin-top: 12px; }
@media (max-height: 640px) {
  .btn-share { min-height: 38px; padding: 5px 18px; font-size: 0.82rem; }
  #screen-home .btn-share { margin-top: 8px; }
}

/* プライバシーポリシーの小見出し (外部送信規律の各サービス名) */
.legal .legal-sub {
  margin: 18px 0 6px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--brown);
}
