/* ==========================================================================
   44999 メインスタイルシート (common/css/main.css)
   Bento UI, Glassmorphism, Retro-Futurism, Responsive Grid, WCAG 2.2 AA
   ========================================================================== */

/* --- 1. CSS変数・テーマ定義 --- */
:root {
  --font-base: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  --font-retro: 'Courier New', Courier, monospace, sans-serif;

  /* ライトモード標準配色 */
  --bg-gradient: linear-gradient(135deg, #f5efe6 0%, #e8dfd8 50%, #d8cfc4 100%);
  --text-primary: #2b2523;
  --text-secondary: #5c534e;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.5);
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  
  --accent-color: #8c5332;       /* レトロ珈琲ブラウン */
  --accent-neon: #e65c00;        /* レトロフューチャー・オレンジ */
  --accent-cyan: #00a896;        /* レトロフューチャー・シアン */
  --focus-ring: #3A7AFE;

  --header-bg: rgba(255, 255, 255, 0.85);
  --footer-bg: rgba(245, 239, 230, 0.95);
  --dialog-bg: rgba(255, 255, 255, 0.92);
}

/* ダークモード */
html[data-color-mode="dark"] {
  --bg-gradient: linear-gradient(135deg, #181514 0%, #221c1a 50%, #121010 100%);
  --text-primary: #f5ede6;
  --text-secondary: #b8aba3;
  --card-bg: rgba(30, 26, 25, 0.75);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);

  --accent-color: #d48b5f;
  --accent-neon: #ff7733;
  --accent-cyan: #2de2c4;

  --header-bg: rgba(24, 21, 20, 0.88);
  --footer-bg: rgba(18, 16, 16, 0.95);
  --dialog-bg: rgba(30, 26, 25, 0.94);
}

/* --- 2. リセット＆ベーススタイル --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  font-size: 16px;
  word-break: break-word;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

/* アクセシビリティ: フォーカスリング */
*:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* タップ領域最低基準 44x44px */
.btn-action,
.nav-link,
.btn-toggle,
.modal-close-btn,
.banner-control-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- 3. 共通レイアウト & Bento Grid --- */
.container {
  width: calc(100% - 32px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 0;
  flex: 1;
}

/* ガラスカード定義 */
.glass-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .glass-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* Bento Grid */
.bento-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
  width: 100%;
}

/* --- レスポンシブ Grid仕様 --- */
/* タブレット (481px〜768px): 6列, gap 12px */
@media (min-width: 481px) and (max-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }
}

/* スマートフォン (480px以下): 4列, gap 8px */
@media (max-width: 480px) {
  .bento-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

/* --- 4. ヘッダー & ナビゲーション --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 8px 16px;
}

@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .site-header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.site-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* カラーモード切替ボタン */
.theme-toggle-btn {
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* ハンバーガーボタン (SP・タブレット用) */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform 0.25s, opacity 0.25s;
}

.hamburger-btn[aria-expanded="true"] .line-top {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn[aria-expanded="true"] .line-mid {
  opacity: 0;
}
.hamburger-btn[aria-expanded="true"] .line-bot {
  transform: translateY(-7px) rotate(-45deg);
}

/* メインナビゲーション (PC) */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-link, .nav-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
  color: var(--text-primary);
}

.nav-link:hover, .nav-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

html[data-color-mode="dark"] .nav-link:hover,
html[data-color-mode="dark"] .nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* サブメニュー */
.submenu-toggle-btn {
  padding: 4px 6px;
  margin-left: 2px;
  font-size: 0.8rem;
}

.submenu-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--dialog-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  list-style: none;
  padding: 6px 0;
  z-index: 110;
}

.submenu-list.is-open {
  display: block;
}

.submenu-list .nav-link {
  display: block;
  padding: 8px 16px;
}

/* SP & タブレット ナビゲーション表示切り替え */
@media (max-width: 768px) {
  .hamburger-btn {
    display: inline-flex;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 16px;
    box-shadow: var(--card-shadow);
  }
  .main-nav.is-open {
    display: block;
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .submenu-list {
    position: static;
    margin-top: 6px;
    margin-left: 16px;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.03);
  }
}

/* --- 5. パンくずリスト --- */
.breadcrumb-nav {
  max-width: 1200px;
  width: calc(100% - 32px);
  margin: 12px auto 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: ">";
  margin-right: 8px;
  opacity: 0.6;
}

.breadcrumb-item a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb-item[aria-current="page"] {
  font-weight: 600;
  color: var(--text-primary);
}

/* --- 6. ホーム グリッド配置仕様 --- */
/* PC (12列) */
@media (min-width: 769px) {
  .grid-row-login    { grid-column: span 12; }
  .grid-col-login    { grid-column: 1 / span 10; }
  .grid-col-register { grid-column: 11 / span 2; }
  .grid-row-menu     { grid-column: span 12; }
  .grid-row-tools    { grid-column: span 12; }

  /* 未ログイン時の店舗情報 & 利用規約 (右寄せ) */
  .is-guest .grid-col-shop  { grid-column: 9 / span 2; }
  .is-guest .grid-col-terms { grid-column: 11 / span 2; }

  /* ログイン時の店舗情報 & 利用規約 & 会員情報変更 (右寄せ) */
  .is-logged-in .grid-col-shop      { grid-column: 7 / span 2; }
  .is-logged-in .grid-col-terms     { grid-column: 9 / span 2; }
  .is-logged-in .grid-col-user-edit { grid-column: 11 / span 2; }

  .grid-row-news     { grid-column: span 12; margin-top: 16px; }
}

/* Tablet (6列) */
@media (min-width: 481px) and (max-width: 768px) {
  .grid-row-login    { grid-column: span 6; }
  .grid-col-login    { grid-column: 1 / span 4; }
  .grid-col-register { grid-column: 5 / span 2; }
  .grid-row-menu     { grid-column: span 6; }
  .grid-row-tools    { grid-column: span 6; }

  /* 未ログイン時の店舗情報 & 利用規約 */
  .is-guest .grid-col-shop  { grid-column: 3 / span 2; }
  .is-guest .grid-col-terms { grid-column: 5 / span 2; }

  /* ログイン時の店舗情報 & 利用規約 & 会員情報変更 */
  .is-logged-in .grid-col-shop      { grid-column: 1 / span 2; }
  .is-logged-in .grid-col-terms     { grid-column: 3 / span 2; }
  .is-logged-in .grid-col-user-edit { grid-column: 5 / span 2; }

  .grid-row-news     { grid-column: span 6; margin-top: 12px; }
}

/* Mobile (4列) */
@media (max-width: 480px) {
  .grid-row-login    { grid-column: span 4; }
  .grid-col-login    { grid-column: span 4; }
  .grid-col-register { grid-column: span 4; }
  .grid-row-menu     { grid-column: span 4; }
  .grid-row-tools    { grid-column: span 4; }

  .grid-col-shop,
  .is-guest .grid-col-shop,
  .is-logged-in .grid-col-shop {
    grid-column: span 2;
  }

  .grid-col-terms,
  .is-guest .grid-col-terms,
  .is-logged-in .grid-col-terms {
    grid-column: span 2;
  }

  .grid-col-user-edit,
  .is-logged-in .grid-col-user-edit {
    grid-column: 3 / span 2;
  }

  .grid-row-news     { grid-column: span 4; margin-top: 8px; }
}

/* --- 6.1 ツール一覧 グリッド配置仕様 (tools/index.php) --- */
/* デフォルト / スマホ (480px以下): 4列中2列 = 1行に2パネル */
.page-tools .tool-card {
  grid-column: span 2;
  padding: 16px 12px;
}

.page-tools .tool-card .clickable-card {
  min-height: 150px;
  gap: 6px;
}

.page-tools .tool-card .tool-icon {
  font-size: 2.4rem;
  line-height: 1;
}

.page-tools .tool-card .tool-title {
  font-size: 1.15rem;
  margin: 0;
}

.page-tools .tool-card .tool-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.page-tools .tool-card .tool-link-text {
  font-weight: 600;
  color: var(--accent-color);
  margin-top: 6px;
  font-size: 0.9rem;
}

/* タブレット (481px〜768px): 6列中3列 = 1行に2パネル */
@media (min-width: 481px) and (max-width: 768px) {
  .page-tools .tool-card {
    grid-column: span 3;
    padding: 20px;
  }

  .page-tools .tool-card .clickable-card {
    min-height: 180px;
    gap: 8px;
  }

  .page-tools .tool-card .tool-icon {
    font-size: 3rem;
  }

  .page-tools .tool-card .tool-title {
    font-size: 1.25rem;
  }

  .page-tools .tool-card .tool-desc {
    font-size: 0.9rem;
  }

  .page-tools .tool-card .tool-link-text {
    margin-top: 8px;
    font-size: 1rem;
  }
}

/* PC (769px以上): 12列中4列 = 1行に3パネル */
@media (min-width: 769px) {
  .page-tools .tool-card {
    grid-column: span 4;
    padding: 20px;
  }

  .page-tools .tool-card .clickable-card {
    min-height: 180px;
    gap: 8px;
  }

  .page-tools .tool-card .tool-icon {
    font-size: 3rem;
  }

  .page-tools .tool-card .tool-title {
    font-size: 1.25rem;
  }

  .page-tools .tool-card .tool-desc {
    font-size: 0.9rem;
  }

  .page-tools .tool-card .tool-link-text {
    margin-top: 8px;
    font-size: 1rem;
  }
}

/* --- 共通コンポーネント: ページ導入カード＆アクションボタン --- */
.page-intro-card {
  margin-bottom: 24px;
}

.page-intro-title {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.page-intro-desc {
  color: var(--text-secondary);
}

.page-action-area {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-outline,
.btn-back-home {
  padding: 10px 20px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
  font-weight: 500;
}

.btn-outline:hover,
.btn-back-home:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.9);
}

html[data-color-mode="dark"] .btn-outline:hover,
html[data-color-mode="dark"] .btn-back-home:hover {
  background-color: rgba(45, 40, 38, 0.9);
}

/* --- 6.2 お品書き (メニュー) グリッド配置仕様 --- */
/* カテゴリ一覧カード (menu/index.php) */
.menu-category-card {
  grid-column: span 4;
}

.menu-category-card .clickable-card {
  min-height: 180px;
}

.menu-category-card .menu-card-icon {
  font-size: 3rem;
  line-height: 1;
}

.menu-category-card .menu-card-title {
  font-size: 1.25rem;
}

.menu-category-card .menu-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.menu-category-card .menu-card-link-text {
  font-weight: 600;
  color: var(--accent-color);
  margin-top: 8px;
}

/* カテゴリ別商品一覧カード (menu/drinks, foods, desserts) */
.menu-product-card {
  grid-column: span 6;
}

.menu-product-card .clickable-card {
  min-height: 160px;
}

.menu-product-card .menu-card-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.menu-product-card .menu-card-title {
  font-size: 1.25rem;
}

.menu-product-card .menu-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.menu-product-card .menu-card-link-text {
  font-weight: 600;
  color: var(--accent-color);
  margin-top: 8px;
}

@media (min-width: 481px) and (max-width: 768px) {
  .menu-category-card {
    grid-column: span 3; /* タブレット時 6列中3列 = 1行2パネル */
  }
}

@media (max-width: 480px) {
  .menu-category-card {
    grid-column: span 2; /* スマホ時 4列中2列 = 1行2パネル */
    padding: 16px 12px;
  }
  .menu-category-card .clickable-card {
    min-height: 150px;
    gap: 6px;
  }
  .menu-category-card .menu-card-icon {
    font-size: 2.4rem;
  }
  .menu-category-card .menu-card-title {
    font-size: 1.15rem;
  }
  .menu-category-card .menu-card-desc {
    font-size: 0.85rem;
  }

  .menu-product-card {
    grid-column: span 4; /* スマホ時 4列全幅 */
  }
}

/* ログイン・ユーザーカード詳細スタイル */
.user-welcome-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.user-welcome-name {
  font-size: 1.2rem;
  display: block;
}

.user-no-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-card-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-logout {
  padding: 8px 16px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.login-heading {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.login-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.login-error-msg {
  color: #dc3545;
  font-size: 0.9rem;
  width: 100%;
}

.checkbox-label-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.card-subtext {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.category-title {
  font-size: 1.3rem;
}

.category-more-link {
  text-decoration: underline;
  font-weight: 600;
}

.sub-card-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 6px;
}

.sub-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.shop-icon-text {
  font-size: 2.2rem;
}

.terms-card-btn {
  width: 100%;
  border: 0;
  background: transparent;
}

.news-empty-msg {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 12px 0;
}

/* ログイン・ユーザーカード */
.login-card-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.login-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-text {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--dialog-bg);
  color: var(--text-primary);
  min-height: 44px;
}

.btn-icon-submit, .btn-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  transition: opacity 0.2s;
}

.btn-icon-submit:hover, .btn-icon-link:hover {
  opacity: 0.9;
}

/* お知らせセクション */
.news-section-title {
  font-size: 1.25rem;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--card-border);
  padding-bottom: 6px;
}

.news-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-card {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 3em; /* 日付との間隔を3文字分確保 */
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
}

html[data-color-mode="dark"] .news-card {
  background: rgba(0, 0, 0, 0.25);
}

.news-card time {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  white-space: nowrap;
}

.news-title-btn {
  text-align: left;
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
  word-break: break-word;
}

/* お品書き・ツール親コンテナカード */
.category-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.category-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.sub-card-item {
  display: block;
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  transition: transform 0.2s;
  text-align: center;
}

html[data-color-mode="dark"] .sub-card-item {
  background: rgba(0, 0, 0, 0.25);
}

.sub-card-item:hover {
  transform: translateY(-2px);
}

/* 店舗情報＆利用規約カード */
.clickable-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  min-height: 120px;
}

.card-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* --- 7. レトロ・フューチャリズム装飾 (商品詳細 & 店舗情報) --- */
.page-blendcoffee,
.page-cafeaulait,
.page-toast,
.page-custardpudding,
.page-parfait,
.page-shop {
  --neon-glow: 0 0 10px rgba(230, 92, 0, 0.45);
}

.page-blendcoffee .product-title,
.page-cafeaulait .product-title,
.page-toast .product-title,
.page-custardpudding .product-title,
.page-parfait .product-title,
.page-shop .shop-title {
  font-family: var(--font-retro);
  color: var(--accent-neon);
  text-shadow: var(--neon-glow);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

@media (max-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
}

.product-image-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--accent-neon);
  box-shadow: 0 0 16px rgba(230, 92, 0, 0.2);
}

.product-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.product-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-neon), transparent);
  margin: 24px 0;
}

.nav-buttons-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.product-description-title {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--accent-color);
}

.product-description-text {
  line-height: 1.8;
  color: var(--text-primary);
}

.btn-nav-accent {
  padding: 10px 20px;
  border: 1px solid var(--accent-neon);
  border-radius: 8px;
  color: var(--accent-neon);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-nav-accent:hover {
  transform: translateY(-2px);
  background-color: rgba(230, 92, 0, 0.1);
}

/* 店舗情報 (shop/index.php) */
.shop-layout {
  margin-bottom: 24px;
}

.shop-info-table {
  width: 100%;
  border-collapse: collapse;
  line-height: 1.8;
}

.shop-info-table tr {
  border-bottom: 1px solid var(--card-border);
}

.shop-info-table tr:last-child {
  border-bottom: none;
}

.shop-info-table th {
  text-align: left;
  padding: 10px 0;
  width: 100px;
  color: var(--accent-neon);
}

.shop-info-table td {
  padding: 10px 0;
}

.shop-info-table .shop-name-td {
  font-weight: 600;
}

.shop-tel-link {
  text-decoration: underline;
  color: inherit;
}

.shop-map-title {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--accent-color);
}

/* 地図iframe */
.map-responsive-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  margin-top: 16px;
}

.map-responsive-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- 8. モーダル (<dialog>) --- */
.app-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 24px;
  width: fit-content;
  min-width: min(340px, 80vw);
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 16px;
  background: var(--dialog-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.35)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* モーダル表示中の背景スクロール抑止 */
html:has(dialog[open]:modal),
body:has(dialog[open]:modal) {
  overflow: hidden;
}


.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.dialog-close-btn {
  font-size: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--card-border);
}

.terms-content-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.terms-section h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
  color: var(--accent-color);
}

.news-dialog-date {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.news-dialog-body {
  margin-top: 12px;
  line-height: 1.7;
}

/* --- 9. フッター & バナースライダー --- */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--card-border);
  padding: 16px 0 80px; /* バナースライダーの高さ確保 */
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  font-size: 0.9rem;
}

/* 画面最下部固定バナースライダー */
.fixed-banner-slider {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(24, 21, 20, 0.92);
  border-top: 1px solid var(--card-border);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.banner-track {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  width: 100%;
  height: 60px;
  overflow: hidden;
  position: relative;
}

.banner-slide {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.banner-slide.is-active {
  display: flex;
}

.banner-slide img {
  max-height: 60px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.banner-control-btn {
  color: #fff;
  font-size: 1.4rem;
  background: transparent;
  padding: 4px 8px;
}

/* --- 9.1 ルーレットツール (Roulette) --- */
.roulette-card {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.roulette-box {
  background: rgba(0, 0, 0, 0.06);
  border: 2px dashed var(--card-border);
  border-radius: 16px;
  padding: 40px 20px;
  margin-bottom: 24px;
}

html[data-color-mode="dark"] .roulette-box {
  background: rgba(255, 255, 255, 0.04);
}

.roulette-display-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-neon);
  min-height: 48px;
}

.roulette-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.roulette-btn {
  padding: 12px 32px;
  font-size: 1.1rem;
}

.roulette-btn-stop {
  padding: 12px 32px;
  font-size: 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
}

.roulette-items-box {
  text-align: left;
  background: rgba(255, 255, 255, 0.4);
  padding: 16px;
  border-radius: 8px;
}

html[data-color-mode="dark"] .roulette-items-box {
  background: rgba(0, 0, 0, 0.25);
}

.roulette-items-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.roulette-items-textarea {
  width: 100%;
  font-family: inherit;
}

/* --- 9.2 効果音ツール (Sound Effects) --- */
.soundeffects-card {
  max-width: 680px;
  margin: 0 auto;
}

.soundeffects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.btn-edit-se {
  padding: 6px 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.soundeffects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.se-btn {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--card-border);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

html[data-color-mode="dark"] .se-btn {
  background: rgba(0, 0, 0, 0.25);
}

.se-btn:hover {
  transform: translateY(-2px);
}

.se-icon {
  font-size: 2rem;
}

/* 効果音設定 (soundeffects/edit) */
.se-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(0, 0, 0, 0.04);
  padding: 20px;
  border-radius: 12px;
}

html[data-color-mode="dark"] .se-edit-panel {
  background: rgba(255, 255, 255, 0.04);
}

.se-field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.se-input-full {
  width: 100%;
}

.se-test-play-wrap {
  text-align: center;
  margin-top: 10px;
}

.btn-test-play {
  padding: 12px 32px;
  font-size: 1.1rem;
}

.link-underline {
  text-decoration: underline;
}

/* --- 10. 文字反転ツール (Text Flip) --- */
.page-textflip .glass-card {
  max-width: 760px;
  margin: 0 auto;
}

.textflip-textarea-wrapper {
  margin-top: 16px;
  margin-bottom: 16px;
}

.textflip-textarea-label {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.textflip-textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

html[data-color-mode="dark"] .textflip-textarea {
  background: rgba(30, 26, 25, 0.75);
}

.textflip-btn-group {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.textflip-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  min-width: 96px;
}

.textflip-btn-clear {
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-primary);
}

.textflip-btn-clear:hover {
  background: rgba(0, 0, 0, 0.08);
}

html[data-color-mode="dark"] .textflip-btn-clear:hover {
  background: rgba(255, 255, 255, 0.12);
}

.textflip-btn-show {
  /* btn-icon-submit スタイル適用 */
}

/* 過去の履歴セクション */
.textflip-history-section {
  margin-top: 20px;
}

.textflip-history-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.textflip-history-container {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* スマホ: 10行分 (1行約44px = 440px) */
  height: 440px;
  max-height: 440px;
}

html[data-color-mode="dark"] .textflip-history-container {
  background: rgba(0, 0, 0, 0.25);
}

/* タブレット・PC: 20行分 (1行約42px = 840px、画面高さを考慮してmax-height指定) */
@media (min-width: 601px) {
  .textflip-history-container {
    height: 840px;
    max-height: 840px;
  }
}

.textflip-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.textflip-history-item {
  display: flex;
  align-items: center;
  height: 42px;
  min-height: 42px;
  border-bottom: 1px solid var(--card-border);
  box-sizing: border-box;
}

.textflip-history-item:last-child {
  border-bottom: none;
}

.textflip-history-delete-btn {
  width: 44px;
  height: 42px;
  min-width: 44px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  border-right: 1px solid var(--card-border);
  background: transparent;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.textflip-history-delete-btn:hover,
.textflip-history-delete-btn:focus-visible {
  color: #e63946;
  background: rgba(230, 57, 70, 0.1);
}

.textflip-history-text-btn {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 14px;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.textflip-history-text-btn:hover,
.textflip-history-text-btn:focus-visible {
  background: rgba(0, 0, 0, 0.05);
}

html[data-color-mode="dark"] .textflip-history-text-btn:hover,
html[data-color-mode="dark"] .textflip-history-text-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.textflip-history-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* 全画面画像表示モーダル */
.textflip-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background: var(--bg-gradient);
  color: var(--text-primary);
  z-index: 99999;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.textflip-modal::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.textflip-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.textflip-img {
  position: absolute;
  transform-origin: center center;
  cursor: grab;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  max-width: none;
  max-height: none;
  pointer-events: auto;
}

.textflip-img.is-dragging {
  cursor: grabbing;
}

/* 右下固定フローティングコントロール */
.textflip-controls {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 100000;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.textflip-controls.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.textflip-ctrl-btn {
  min-width: 46px;
  min-height: 46px;
  padding: 4px 6px;
  border-radius: 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.textflip-ctrl-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

html[data-color-mode="dark"] .textflip-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.textflip-ctrl-btn .ctrl-label {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  margin-top: 3px;
  color: var(--text-secondary);
}

.textflip-ctrl-close {
  color: var(--accent-neon);
}

.textflip-ctrl-close .ctrl-label {
  color: var(--accent-neon);
}

/* --- 11. ユーザー登録・編集フォーム (User Profile & Register Forms) --- */
.form-container-card {
  max-width: 680px;
  margin: 0 auto;
}

.page-form-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.form-message-box {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.form-message-success {
  background: rgba(40, 167, 69, 0.15);
  border: 1px solid #28a745;
  color: #28a745;
}

.form-message-error {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid #dc3545;
}

.form-error-list {
  padding-left: 20px;
  color: #dc3545;
  margin: 0;
}

.user-action-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.required-mark {
  color: #dc3545;
}

.input-full {
  width: 100%;
}

.input-readonly-text {
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
}

html[data-color-mode="dark"] .input-readonly-text {
  background: rgba(255, 255, 255, 0.08);
}

.form-fieldset-reset {
  border: 0;
  padding: 0;
  margin: 0;
}

.form-legend {
  font-weight: 600;
  margin-bottom: 4px;
}

.form-inline-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.select-month-day {
  min-width: 100px;
}

.select-region {
  min-width: 180px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.checkbox-label-block {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

.form-notice-box {
  background: rgba(0, 0, 0, 0.05);
  padding: 14px;
  border-radius: 8px;
  margin-top: 8px;
}

html[data-color-mode="dark"] .form-notice-box {
  background: rgba(255, 255, 255, 0.06);
}

.form-notice-title {
  font-size: 1rem;
  margin-bottom: 8px;
}

.form-notice-text {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.form-notice-text:last-of-type {
  margin-bottom: 0;
}

.form-agree-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.form-terms-check-wrap {
  margin-top: 4px;
}

.terms-open-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  color: var(--accent-color);
}

.form-button-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.btn-submit-main {
  padding: 12px 24px;
  font-size: 1.05rem;
}

/* 登録完了モーダル (Register Dialog) */
.dialog-body-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dialog-success-heading {
  color: #28a745;
  font-weight: 600;
}

.dialog-info-card {
  background: rgba(0, 0, 0, 0.05);
  padding: 14px;
  border-radius: 8px;
  font-family: monospace;
}

html[data-color-mode="dark"] .dialog-info-card {
  background: rgba(255, 255, 255, 0.06);
}

.dialog-sub-note {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dialog-footer-center {
  margin-top: 12px;
  text-align: center;
}

.btn-dialog-close {
  padding: 10px 24px;
}

/* ユーザー編集固有 (User Edit Specific) */
.form-divider {
  border: 0;
  border-top: 1px solid var(--card-border);
  margin: 32px 0;
}

.form-sub-section {
  margin-bottom: 32px;
}

.form-sub-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.form-sub-title-danger {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: #dc3545;
}

.form-sub-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.btn-setting-outline {
  padding: 8px 16px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

html[data-color-mode="dark"] .btn-setting-outline {
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger-outline {
  padding: 8px 16px;
  border: 1px solid #dc3545;
  color: #dc3545;
  border-radius: 8px;
  background: rgba(220, 53, 69, 0.05);
  font-weight: 600;
}

html[data-color-mode="dark"] .btn-danger-outline {
  background: rgba(220, 53, 69, 0.15);
}

/* --- 12. prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
