/* モダンなUIデザイン - 少年サッカードリル */

/* カスタムプロパティ（CSS変数） - サッカー芝生テーマ v2 */
:root {
  --primary-color: #0d9488;          /* ティールグリーン - 芝生・爽やか */
  --primary-hover: #0f766e;
  --primary-light: rgba(13, 148, 136, 0.08);
  --secondary-color: #0891b2;        /* シアンアクセント */
  --accent-color: #f59e0b;           /* アンバー - ボールの黄色 */
  --success-color: #10b981;
  --danger-color: #ef4444;
  --background-color: #f1f5f9;       /* スレート50 */
  --surface-color: #ffffff;
  --surface-elevated: #ffffff;
  --text-primary: #0f172a;           /* スレート900 */
  --text-secondary: #475569;         /* スレート600 */
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.08), 0 4px 10px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 40px -10px rgb(0 0 0 / 0.1);
  --radius-sm: 0.5rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* モバイル: sticky 検索バーをサイトヘッダー直下に固定（ヘッダー z-index より上に視認できるよう top をずらす） */
  --site-header-sticky-offset: 3.15rem;
}

/* リセットとベーススタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
}

/* アクセシビリティ: キーボード操作を考慮したフォーカススタイル */
/* 通常のボタンと入力欄は標準のフォーカススタイルを使用 */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* 検索ボタンはより目立つフォーカススタイル */
#search-button:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, var(--background-color) 0%, #e2e8f0 100%);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* メインコンテナ */
main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding: 0.75rem 1rem 0;
}

/* 共通サイトヘッダー */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  color: #fff;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 45%, #115e59 100%);
  box-shadow: 0 4px 24px rgba(15, 118, 110, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 120% at 0% 0%, rgba(255, 255, 255, 0.14) 0%, transparent 55%),
    radial-gradient(circle at 100% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 45%);
  pointer-events: none;
}

.site-header__inner {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ログイン中表示・ハンバーガー・ナビをまとめて右側に寄せる（チップだけ中央に浮かない） */
.site-header__end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  flex: 1;
  min-width: 0;
  margin-left: auto;
}

.site-header__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.site-header__lang a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.12);
}
.site-header__lang a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.site-header__lang a.is-active {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.2);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: var(--radius-lg);
  padding: 0.28rem 0.45rem 0.28rem 0.2rem;
  margin: -0.28rem 0;
  transition: var(--transition);
  flex-shrink: 0;
}

.site-header__brand:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.site-header__brand-mark {
  font-size: 1.2rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.site-header__brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.site-header__title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.site-header__freshness {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.9;
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  margin-top: 0.12rem;
  white-space: nowrap;
}

/* ログイン / 同期（/auth/status と連動。メインナビからアカウントは外しチップで誘導） */
.site-header__auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: min(14rem, 42vw);
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  transition: var(--transition);
}

.site-header__auth-chip:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.site-header__auth-chip--guest {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

.site-header__auth-chip--signed-in {
  background: rgba(255, 255, 255, 0.2);
}

.site-header__auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.site-header__auth-label {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.site-header__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
}

.site-header__menu-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.site-header__menu-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.site-header__menu-icon {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.site-header__nav {
  display: block;
}

.site-header__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.72rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.site-header__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.site-header__link.is-active {
  color: #0f766e;
  background: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-sm);
}

.site-header__link.nav-with-badge {
  position: relative;
  padding-right: 1.1rem;
}

/* ヘッダー「練習記録・メモ」: 横並びが狭い幅では略称。フル説明は title / aria-label */
.site-header__link--notes-nav .nav-notes-link__short {
  display: none;
}
.site-header__link--notes-nav .nav-notes-link__long {
  display: inline;
}

@media (max-width: 960px) and (min-width: 769px) {
  .site-header__link--notes-nav .nav-notes-link__short {
    display: inline;
  }
  .site-header__link--notes-nav .nav-notes-link__long {
    display: none;
  }
}

/* タブコンテナ - カード風 */
.tab-container {
  width: 100%;
  max-width: 1400px;
  margin: 0.5rem auto 1.25rem;
  background: var(--surface-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

/* ホーム: 主な機能（折りたたみ・検索を優先） */
.home-features {
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.home-features__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.home-features__summary::-webkit-details-marker {
  display: none;
}

.home-features__summary:hover {
  color: var(--primary-hover);
}

.home-features__icon {
  flex-shrink: 0;
  font-size: 0.55rem;
  transition: transform 0.2s ease;
}

.home-features[open] .home-features__icon {
  transform: rotate(180deg);
}

.home-features__body {
  padding: 0 1.15rem 0.65rem;
}

.home-features__lead {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 500;
  color: var(--text-muted);
}

.home-features__list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .home-features__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.home-features__item {
  margin: 0;
  min-width: 0;
}

.home-features__term {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.home-features__term a {
  color: var(--primary-color);
  text-decoration: none;
}

.home-features__term a:hover {
  text-decoration: underline;
}

.home-features__desc {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 400;
  color: var(--text-secondary);
}

/* ホーム上部: SEO 用の短文（.content-wrapper は横 flex + min-height 用のため使わない） */
.home-seo-intro {
  display: block;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 0.45rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface-color);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.home-seo-intro__lead {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .home-seo-intro {
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.7rem;
  }

  .home-seo-intro__lead {
    font-size: 0.78rem;
  }
}

/* 全体のレイアウト */
.content-wrapper {
  display: flex;
  min-height: calc(100vh - 160px);
  background: var(--surface-color);
  padding-bottom: 0;
  width: 100% !important;
  max-width: none !important;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* サイドペイン - Google風2段構成 */
.search-container {
  width: 260px;
  flex-shrink: 0;
  padding: 1rem;
  margin: 0;
  background: linear-gradient(180deg, #fafafa 0%, #f8fafc 100%);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: var(--transition);
  position: sticky;
  top: 0;
  z-index: 2;
  align-self: stretch;
  max-height: 100vh;
  overflow-y: auto;
}

/* 検索バー（常に表示・Above the Fold） */
.search-primary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  position: relative;
}

/* 検索履歴ドロップダウン */
.search-history-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.search-history-dropdown.hidden {
  display: none;
}

.search-history-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
}

.search-history-row:last-child {
  border-bottom: none;
}

.search-history-item {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.85rem;
  text-align: left;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.search-history-item:hover,
.search-history-item:focus {
  background: var(--primary-light);
}

.search-history-item:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

.search-history-delete {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin-right: 0.25rem;
  border: none;
  background: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.search-history-delete:hover {
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.1);
}

.search-history-delete:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

/* 検索欄＋右端ショートカット（プレースホルダーが切れないように kbd を分離） */
.search-primary-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  flex: 1;
  min-width: 0;
  padding: 0 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-color);
  transition: var(--transition);
  position: relative;
}

.search-primary-field:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.search-primary-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  padding: 0.6rem 0;
  border-radius: 0;
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
  color: var(--text-primary);
}

.search-primary-input:focus {
  outline: none;
}

.search-primary-input:focus-visible {
  outline: none;
}

.search-primary-input::placeholder {
  color: var(--text-muted);
}

.search-primary-kbd {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--border-subtle);
  color: var(--text-muted);
}

.search-primary-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-spring);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.search-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
}

.search-primary-btn:active {
  transform: translateY(0);
}

/* 詳細条件 - 折りたたみ */
.search-details {
  margin-top: 0.75rem;
}

.search-details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  list-style: none;
  user-select: none;
}

.search-details-toggle::-webkit-details-marker {
  display: none;
}

.search-details-toggle:hover {
  color: var(--primary-hover);
}

.search-details-icon {
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.search-details[open] .search-details-icon {
  transform: rotate(180deg);
}

.search-details-content {
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-container h2,
.search-container h3 {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0.75rem 0 0.25rem 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.search-container h2:first-child,
.search-container h3:first-child {
  margin-top: 0;
}

.search-container .search-details-content h2:first-child {
  margin-top: 0;
}

.search-container h2::before,
.search-container h3::before {
  content: '';
  width: 3px;
  height: 12px;
  background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
}

/* フォームグループ */
.form-group {
  margin-bottom: 0.35rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label,
.search-details-content label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

/* フォーム要素 - 詳細条件内のselect */
.search-details-content select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-primary);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.6rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.25rem;
  appearance: none;
}

.search-details-content select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* 検索ボタン フォーカス（アクセシビリティ） */
#search-button:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

/* 汎用ボタン（フォールバック） */
button {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: inherit;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:active {
  transform: translateY(0);
}

/* メインコンテンツ */
.main-content {
  flex-grow: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  background: var(--surface-color);
  margin-bottom: 80px;
  min-width: 0 !important;
  position: relative;
  z-index: 1;
}

/* 検索プロンプト - 空状態デザイン */
.search-prompt {
  text-align: center;
  padding: 4rem 2rem 6rem 2rem;
  color: var(--text-secondary);
  display: none;
  max-width: 400px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.6;
}

.search-prompt::before {
  content: '⚽';
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.4;
  filter: grayscale(0.2);
}

/* ローディングインジケーター - モダン */
.loading-indicator {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.loading-indicator.hidden {
  display: none;
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-indicator p {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

/* エラーメッセージ */
.error-message {
  background-color: #fef2f2;
  border: 1px solid var(--danger-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  color: var(--danger-color);
  text-align: center;
}

.error-message.hidden {
  display: none;
}

.error-message p {
  margin: 0;
  font-weight: 500;
}

.error-message .error-details {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* フィードバック送信成功メッセージ */
.response-message {
  background-color: #f0fdf4;
  border: 1px solid var(--success-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  color: var(--success-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s ease-out;
}

.response-message.hidden {
  display: none;
}

.response-message p {
  margin: 0;
  font-weight: 500;
}

.response-message button {
  background: none;
  border: none;
  color: var(--success-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.response-message button:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* カードコンテナ */
.card-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  padding-bottom: 6rem; /* フッターの高さ分のマージンを追加 */
  width: 100%;
  max-width: 100%;
  align-items: stretch;
  justify-items: stretch;
}

/* カード */
.card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-spring);
  position: relative;
  overflow: hidden;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 400px;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0.9;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(13, 148, 136, 0.2);
}

.card strong {
    display: block;
    font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card .info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--background-color);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  min-width: 0;
}

.card .info div {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: var(--surface-color);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card .info div::before {
  content: '';
  font-size: 0.8rem;
}

/* ビデオコンテナ */
.video-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--background-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.video-container iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}

/* モバイル: 一覧はサムネ+タップで iframe を読み込む（初期表示の負荷軽減） */
.video-thumb-facade {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: manipulation;
}

.video-thumb-facade__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  min-width: 0;
}

.video-thumb-facade__play {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.72);
  color: #fff;
  font-size: 1.15rem;
  line-height: 3.25rem;
  text-align: center;
  pointer-events: none;
}

.video-thumb-facade__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.75));
  pointer-events: none;
}

.card .info-duration--prominent {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-color);
}

/* ページネーション - モダン */
.pagination {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  box-shadow: 0 -4px 20px rgb(0 0 0 / 0.06);
  z-index: 1000;
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.pagination #video-count {
  text-align: center;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.pagination .pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.pagination #page-info {
  text-align: center;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pagination button {
  width: auto;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--surface-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--background-color);
}

/* TAB2 - 分割コンテナ */
.split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0 6rem 0; /* 下部にフッター分のマージンを追加 */
}

.left-half, .right-half {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.left-half p, .right-half p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* フィードバックフォーム */
.feedback-form {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 80px; /* フッターの高さ分のマージンを追加 */
}

.feedback-form form {
    display: flex;
    flex-direction: column;
  gap: 0.75rem;
}

.feedback-form label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
    display: block;
}

.feedback-form input,
.feedback-form textarea,
.feedback-form select {
    width: 100%;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-primary);
}

.feedback-form input:focus,
.feedback-form textarea:focus,
.feedback-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.feedback-form textarea {
  resize: vertical;
  min-height: 100px;
}

.feedback-form button {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
    cursor: pointer;
  transition: var(--transition);
  margin-top: 0.75rem;
}

.feedback-form button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* 右半分のリスト */
.right-half ul {
  list-style: none;
  padding: 0;
}

.right-half li {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: var(--background-color);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-color);
  transition: var(--transition);
}

.right-half li:hover {
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.right-half a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.right-half a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* About ページ（紹介 → チャンネル → フィードバック） */
.about-page {
  margin: 1.5rem 0 6rem;
}

.about-page__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.about-panel {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.about-panel p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-panel h2 {
  margin-top: 0;
}

.about-channels ul {
  list-style: none;
  padding: 0;
}

.about-channels li {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: var(--background-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.about-channels li:hover {
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.about-channels a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.about-channels a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.about-feedback .feedback-form {
  margin-bottom: 0;
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

/* ユーティリティクラス */

/* レスポンシブデザイン */
@media (max-width: 1024px) {
  .content-wrapper {
    flex-direction: column;
  }
  
  .search-container {
    width: 100%;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    max-height: none;
  }
  
  /* タブレット: 検索バーを横並びで省スペース化 */
  .search-primary {
    flex-direction: row;
    gap: 0.5rem;
    padding-bottom: 1rem;
  }
  
  .search-primary-field {
    flex: 1;
    min-width: 0;
  }
  
  .search-primary-btn {
    flex-shrink: 0;
    width: auto;
    padding: 0.6rem 1.25rem;
  }
  
  .card-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
  
  .split-container {
    grid-template-columns: 1fr;
  }

  .about-page__top {
    grid-template-columns: 1fr;
  }
}

/* モバイル: タッチ操作の最適化（300ms遅延解消・タップ領域） */
@media (max-width: 768px) {
  .search-primary-input,
  .search-primary-btn,
  .pagination button,
  .search-history-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(13, 148, 136, 0.2);
  }

  .search-primary-btn,
  .pagination button {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  main {
    padding: 0.65rem 0.5rem 0;
  }
  
  .tab-container {
    margin: 0.75rem 0;
    border-radius: var(--radius-lg);
    width: 100%;
  }
  
  .main-content {
    padding: 0.5rem;
    margin-bottom: 80px;
  }
  
  .card-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding-bottom: 6rem;
  }
  
  /* モバイル: 検索バーを常に表示・スティッキー（ヘッダー直下に固定） */
  .search-container {
    padding: 0.75rem 1rem;
    margin-left: 0;
    width: 100%;
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + var(--site-header-sticky-offset));
    z-index: 100;
    background: var(--surface-color);
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
  }
  
  .search-primary {
    flex-direction: row;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
  }
  
  .search-primary-field {
    padding: 0 0.65rem;
  }

  .search-primary-input {
    padding: 0.65rem 0;
    font-size: 16px; /* iOSズーム防止 */
  }
  
  .search-primary-btn {
    flex-shrink: 0;
    width: auto;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }
  
  .home-features__summary {
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
  }

  .home-features__body {
    padding: 0 0.85rem 0.55rem;
  }

  .home-features__lead {
    font-size: 0.75rem;
  }

  .home-features__term {
    font-size: 0.8125rem;
  }

  .home-features__desc {
    font-size: 0.78rem;
  }

  /* モバイル: 詳細条件内の入力の可読性/タップ領域を改善 */
  .search-details-content select {
    font-size: 16px;
    padding: 0.6rem 0.8rem;
  }

  .feedback-form input,
  .feedback-form textarea,
  .feedback-form select {
    font-size: 16px;
    padding: 0.75rem 1rem;
  }

  .feedback-form button,
  .pagination button,
  button {
    padding: 0.75rem 1rem;
  }

  .site-header__inner {
    padding: 0.5rem 0.75rem;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .site-header__auth-chip {
    max-width: min(9rem, 36vw);
    font-size: 0.65rem;
    padding: 0.25rem 0.45rem;
  }

  .site-header__menu-btn {
    display: inline-flex;
    flex-shrink: 0;
  }

  .site-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #115e59 0%, #0f766e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-lg);
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
  }

  body.site-header-nav-open .site-header__nav {
    max-height: 320px;
    opacity: 1;
    pointer-events: auto;
  }

  .site-header__list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0.75rem 0.85rem;
    gap: 0.25rem;
  }

  .site-header__link {
    justify-content: flex-start;
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
  }

  .site-header__title {
    font-size: 0.85rem;
  }

  /* 2カラム系ページのモバイル余白最適化（about/privacy等） */
  .split-container {
    gap: 1rem;
    margin: 1rem 0 4rem 0;
  }

  .about-page {
    margin: 1rem 0 4rem;
  }

  .about-page__top {
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .left-half,
  .right-half,
  .about-panel,
  .feedback-form {
    padding: 1rem;
  }

  /* 表示崩れ回避（長いURL/文字列） */
  a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .card .info {
    grid-template-columns: 1fr; /* 情報ブロックを縦並びに */
    gap: 0.5rem;
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .search-details-content h2 {
    font-size: 0.75rem;
  }

  .form-group label {
    font-size: 0.85rem;
  }

  .card {
    padding: 1rem;
  }

  .pagination #video-count {
    font-size: 0.85rem;
  }
}

/* ローディングアニメーション */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* プライバシーポリシーページ用スタイル */
.content-wrapper .privacy-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.content-wrapper .privacy-section h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.content-wrapper .privacy-section h2:first-child {
  margin-top: 0;
}

.content-wrapper .privacy-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.content-wrapper .privacy-section ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.content-wrapper .privacy-section li {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.content-wrapper .privacy-section a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.content-wrapper .privacy-section a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* フッター用スタイル */
footer {
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  margin-top: 2rem;
  position: relative;
  z-index: 10;
  clear: both;
}

footer p {
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.footer-youtube-notice {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 42rem;
  margin-inline: auto;
  line-height: 1.5;
}

.about-youtube-notice {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ナビバッジ（お気に入り追加直後） */
.nav-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  background: var(--accent-color);
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* カード: お気に入り + YouTube */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  width: 100%;
  align-items: stretch;
}

.card-favorite-btn {
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.card-favorite-btn:hover {
  border-color: rgba(180, 83, 9, 0.45);
  color: var(--text-primary);
}

.card-favorite-btn.is-favorite {
  color: #b45309;
  background: #fffbeb;
  border-color: #fcd34d;
}

.card-youtube-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
}

.card-youtube-link:hover {
  border-color: var(--primary-color);
  background: rgba(13, 148, 136, 0.06);
  color: var(--primary-hover);
  text-decoration: none;
}

/* パスワード: 表示切替（data-password-enhanced を site-header.js がラップ） */
.password-field-group .password-field-wrap,
.password-field-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.password-field__input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.password-field__toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.password-field__toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.password-field__toggle:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.password-field__toggle svg {
  display: block;
  pointer-events: none;
}

/* is-visible = 平文表示中 → 目線アイコン（隠す操作） */
.password-field-wrap.is-visible .password-field__icon-masked {
  display: none;
}

.password-field-wrap:not(.is-visible) .password-field__icon-plain {
  display: none;
}

/* 記録（試合結果/気づき）印刷最適化 */
@media print {
  #record-input-section {
    display: none !important;
  }

  .record-actions {
    display: none !important;
  }

  .record-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}


/* ユーティリティ: 単体 class="hidden" 用（アカウント・その他） */
.hidden {
  display: none !important;
}

/* アカウント（ニックネームログイン）
   .content-wrapper はホーム用に flex 横並びのため、単独ページでは縦に積む */
.content-wrapper.account-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
  box-sizing: border-box;
  min-height: auto;
}

.account-page__header {
  width: 100%;
  margin-bottom: 0.25rem;
}

.account-page__title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  word-break: keep-all;
  width: 100%;
}

.account-value-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted, #5c6470);
  line-height: 1.5;
}

.account-value-list li + li {
  margin-top: 0.25rem;
}

.about-account-note {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--primary-color);
  background: var(--background-color);
  border-radius: var(--radius-md);
}

.about-account-note__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
}

.about-account-note p {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.about-account-note__list {
  margin: 0 0 0.5rem;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted, #5c6470);
}

.about-account-note__list li + li {
  margin-top: 0.2rem;
}

.about-account-note a {
  font-size: 0.9rem;
  font-weight: 600;
}

.account-page__lead {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.65;
  width: 100%;
  font-size: 0.95rem;
}

.account-section {
  width: 100%;
}

/* 認証カード */
.account-card {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 1.25rem 1.25rem 1.5rem;
}

.account-card--auth {
  padding-top: 1rem;
}

/* タブ */
.account-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.2rem;
  margin: 0 0 1.25rem;
  background: rgba(13, 148, 136, 0.08);
  border-radius: var(--radius-lg);
}

.account-tabs__btn {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.account-tabs__btn:hover {
  color: var(--text-primary);
}

.account-tabs__btn.is-active {
  background: var(--surface-color);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.account-tabs__btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.account-tab-panel.hidden {
  display: none !important;
}

.account-tab-panel {
  animation: accountFadeIn 0.2s ease;
}

@keyframes accountFadeIn {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

/* フォーム */
.account-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0;
}

.account-form--compact {
  gap: 0.55rem;
}

.account-form label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.account-form input {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* パスワード表示切替（data-password-enhanced）をアカウントフォーム内でも横並びに */
.account-form .password-field-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.account-form .password-field__input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.account-form .password-field__toggle {
  min-height: 2.75rem;
}

.account-btn-primary {
  margin-top: 0.35rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}

.account-btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: var(--shadow-md);
}

.account-btn-primary--secondary {
  background: var(--surface-color);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.account-btn-primary--secondary:hover {
  background: rgba(13, 148, 136, 0.08);
}

.account-btn-outline {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.account-btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.account-btn-outline:focus-visible,
.account-btn-primary:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.account-btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: #fff !important;
  border: none !important;
}

.account-btn-danger--full {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
}

.account-btn-danger--full:hover {
  filter: brightness(1.05);
}

/* パスワード忘れ */
.account-details {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
}

.account-details__summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-color);
  padding: 0.5rem 0;
}

.account-details__summary::-webkit-details-marker {
  display: none;
}

.account-details__summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}

.account-details[open] .account-details__summary::before {
  transform: rotate(90deg);
}

.account-details__body {
  padding: 0.75rem 0 0.25rem;
}

/* 登録後モーダル風バナー */
.account-recovery-modal {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary-color);
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.1) 0%, var(--surface-color) 100%);
  box-shadow: var(--shadow-md);
}

.account-recovery-modal__title {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.account-recovery-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.account-recovery-modal__actions .account-btn-primary {
  margin-top: 0;
  flex: 1;
  min-width: 8rem;
}

.account-recovery-modal__actions .account-btn-outline {
  flex: 1;
  min-width: 6rem;
}

.account-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* ログイン後ダッシュボード */
.account-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.account-dashboard__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.account-dashboard__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.account-dashboard__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--primary-light);
  font-size: 1.35rem;
  flex-shrink: 0;
}

.account-dashboard__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.15rem;
}

.account-dashboard__name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  word-break: break-all;
}

.account-settings-card {
  padding: 1.15rem 1.25rem;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.account-settings-card--danger {
  border-color: rgba(185, 28, 28, 0.35);
  background: linear-gradient(180deg, #fffafa 0%, var(--surface-color) 100%);
}

.account-settings-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--text-primary);
}

.account-settings-card__title--danger {
  color: #991b1b;
}

.account-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  min-height: 1.25rem;
  font-size: 0.95rem;
}

.account-message--error {
  background: #fef2f2;
  color: #991b1b;
}

/* ログイン／登録直後のワンショット通知（user-sync.js） */
.soccer-global-toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--primary-light);
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(110%);
  transition: transform 0.28s ease;
  pointer-events: none;
  max-width: 100%;
  box-sizing: border-box;
}

.soccer-global-toast.soccer-global-toast--visible {
  transform: translateY(0);
}

/* 初回ログイン時の同期選択モーダル（user-sync.js） */
.soccer-sync-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
}

.soccer-sync-choice-modal__panel {
  width: min(36rem, 100%);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1rem 1rem 1.1rem;
}

.soccer-sync-choice-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.soccer-sync-choice-modal__text {
  margin: 0.5rem 0 0;
  line-height: 1.55;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.soccer-sync-choice-modal__text--warn {
  color: #92400e;
}

.soccer-sync-choice-modal__actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.95rem;
}

.soccer-sync-choice-modal__btn {
  appearance: none;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.72rem 0.82rem;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
}

.soccer-sync-choice-modal__btn--primary {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.soccer-sync-choice-modal__btn--outline {
  background: #fff;
  color: var(--text-primary);
}

/* アカウント削除（折りたたみ・デフォルトは閉じる） */
.account-danger-zone {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: linear-gradient(180deg, #fffafa 0%, var(--surface-color) 100%);
  box-shadow: var(--shadow-sm);
}

.account-danger-zone__summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: #991b1b;
  padding: 1rem 1.25rem;
  line-height: 1.45;
}

.account-danger-zone__summary::-webkit-details-marker {
  display: none;
}

.account-danger-zone__summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
  color: #991b1b;
}

.account-danger-zone[open] .account-danger-zone__summary::before {
  transform: rotate(90deg);
}

.account-danger-zone__hint {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.account-danger-zone__body {
  padding: 0 1.25rem 1.15rem;
  border-top: 1px solid rgba(185, 28, 28, 0.2);
}

.account-note--danger {
  color: #b91c1c;
}

.account-recovery__textarea {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
  padding: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  resize: vertical;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .account-dashboard__header {
    flex-direction: column;
    align-items: stretch;
  }

  .account-dashboard__header .account-btn-outline {
    width: 100%;
  }
}

