/* =========================
   トップページ専用スタイル
   ========================= */

/* 背景（base.cssの #logicView を上書き） */
#logicView {
  background: url("/static/img/background.png") no-repeat center top;
  background-size: cover;
}

/* ヘッダー背景（トップ専用画像） */
.hero-img--top {
  background-image: url("/static/img/header.png");
}

/* ロゴ（位置とサイズ） */
.logo--top {
  top: 50px;
  width: 240px;
  height: 80px;
  background-image: url("/static/img/logo.png");
}

/* タイトル＆サブタイトル */
.top-title {
  margin: 8px 16px 2px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.top-sub {
  margin: 0 16px 12px;
  font-size: 14px;
  opacity: 0.9;
}

/* メインコンテンツ */
.main-content {
  padding: 8px 16px 96px; /* フッターと被らないように下に余白 */
  text-align: center;
}

/* =========================
   検索フォーム（横並び中央）
   ========================= */
.search-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 30px auto;
  text-align: center;
  width: 100%;
}

.search-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  max-width: 260px; /* 画面幅に収まるように制限 */
}

.search-form button {
  flex: 0 1 auto;
  height: 42px;
  padding: 0 18px;
  white-space: nowrap;
  font-size: 16px;
  font-weight: bold;
  color: #000;
  background: linear-gradient(to bottom, #ffffff 0%, #d9ebff 100%);
  border: 2px solid #d0e4ff;
  border-radius: 999px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-form button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) inset;
}

/* =========================
   人気のユーザー ボタン
   ========================= */
.ranking-wrapper {
  margin: 34px auto 0;
  text-align: center;
}

.gacha-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  background: linear-gradient(180deg, #FFB680 0%, #E67E22 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1.5px solid rgba(255, 255, 255, .7);
  box-shadow: 0 6px 14px rgba(230, 126, 34, .25);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}

.gacha-button:hover {
  filter: brightness(1.05);
}

.gacha-button:active {
  transform: translateY(1px);
}

/* =========================
   特商法リンクボタン
   ========================= */
.text-wrapper {
  margin: 30px 0 0;
  text-align: center;
}

.legal-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #99bdda;
  text-decoration: underline;
  cursor: pointer;
}

/* =========================
   特定商取引法モーダル
   ========================= */

/* モーダル背景 */
#legal-modal {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

#legal-modal.hidden {
  display: none;
}

/* モーダル本体（PCデフォルト） */
.legal-modal__content {
  background: #fff;
  width: 90%;
  max-width: 640px;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  text-align: left;
  position: relative;
  overflow-y: auto;
  max-height: 80vh;
}

/* タイトル */
.legal-modal__title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  border-bottom: 2px solid #2a7ae4;
  padding-bottom: 8px;
}

/* iframe */
#legal-iframe {
  width: 100%;
  height: 60vh;
  border: none;
  border-radius: 6px;
}

/* =========================
   スマホ全画面対応
   ========================= */
@media (max-width: 600px) {
  #legal-modal {
    padding: 0;
  }

  .legal-modal__content {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .legal-modal__title {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0;
    padding: 12px 44px 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    font-size: 18px;
  }

  .legal-modal__close {
    position: sticky;
    top: 0;
    align-self: flex-end;
    margin: 8px 10px 0 0;
    z-index: 3;
    font-size: 24px;
    color: #444;
  }

  #legal-iframe {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    border: none;
  }
}

/* PC拡大（デザイン統一） */
@media (min-width: 601px) {
  .legal-modal__content {
    width: min(96vw, 860px);
    max-height: 90vh;
    padding: 20px 24px;
    border-radius: 12px;
  }
  #legal-iframe {
    height: 70vh;
  }
}

/* =========================
   通知バッジ・フッター
   ========================= */
.notification-badge {
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border: 2px solid white;
  background-color: #ff3b30;
  border-radius: 50%;
  font-size: 11px;
  color: #fff;
  display: grid;
  place-items: center;
}

.footer a[href="/top.html"] img {
  filter: grayscale(0.1) contrast(1.35) brightness(0.7);
}

/* 右上の「戻る」ボタン（registerのOKボタン系の見た目） */
.legal-modal__back{
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background-color: #6192B5;   /* registerの青 */
  border: 1.5px solid #C7D1DC;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, background-color .2s ease, filter .2s ease;
}

.legal-modal__back:hover { background-color: #1c5dc0; }
.legal-modal__back:active { transform: translateY(1px); }

/* スマホ全画面時は安全領域に寄せつつ、常時見えるように */
@media (max-width: 600px){
  .legal-modal__back{
    position: sticky;       /* スクロールしても見える */
    top: calc(env(safe-area-inset-top) + 8px);
    right: 12px;
    align-self: flex-end;   /* 右上寄せ */
    margin: 8px 10px 0 0;   /* 余白 */
    z-index: 3;
  }
}

/* 右上の戻るボタンを非表示にする */
.legal-modal__back {
  display: none !important;
}
