/* 
==================================================
名探偵コナン カードゲーム 共通スタイル
==================================================
*/

/* リセットと基本設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

/* 
==================================================
共通ヘッダー
==================================================
*/
.header {
  background: #1a1a1a;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}


/* 768px以下の画面では元のパディングに */
@media (max-width: 768px) {
  .header-content {
    padding: 0 1rem;
    gap: 1rem;
  }
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* モバイル用コンパクトヘッダー */
.mobile-header {
  display: none;
  background: #1a1a1a;
  color: white;
  padding: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mobile-logo {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* モバイルナビゲーション（アイコン） */
.mobile-nav-icons {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.mobile-nav-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  color: white !important;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.mobile-nav-icon:hover,
.mobile-nav-icon:active {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-icon.active {
  background: rgba(255, 255, 255, 0.15);
}

.mobile-nav-icon svg {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
}

.mobile-nav-icon span {
  font-size: 0.625rem;
  white-space: nowrap;
  color: white !important;
}

/* ハンバーガーメニューボタン */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* デスクトップナビゲーション */
.nav-menu {
  display: flex;
  gap: 0.5rem;
  flex-grow: 1;
  justify-content: center;
}

.nav-menu a,
.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.2s;
  font-size: 0.9rem;
}

/* 768px以上の画面で余裕を持たせる */
@media (min-width: 768px) {
  .nav-menu {
    gap: 1rem;
  }

  .nav-menu a,
  .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
}

/* 1280px以上の画面ではさらに余裕を持たせる */
@media (min-width: 1280px) {
  .nav-menu {
    gap: 1.25rem;
  }

  .nav-menu a,
  .nav-link {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
  }
}

.nav-menu a:hover,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-menu a.active,
.nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}



/* モバイルメニューオーバーレイ */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.show {
  display: block;
  opacity: 1;
}

/* モバイルスライドメニュー */
.mobile-slide-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background: #1a1a1a;
  z-index: 201;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-slide-menu.show {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.close-menu {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
}

.mobile-menu-nav {
  padding: 1rem 0;
}

.mobile-menu-nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: white !important;
  text-decoration: none;
  padding: 1rem 1.5rem;
  transition: background 0.2s;
  font-size: 1rem;
}

.mobile-menu-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-nav a.active {
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

.mobile-menu-nav svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* モバイル統計情報 */
.mobile-stats {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ユーザー情報表示 */
#user-info-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.user-info-id {
  font-size: 14px;
  font-weight: 500;
  color: white;
}

.logout-btn {
  padding: 6px 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.logout-btn:hover {
  background: #c82333;
}

.login-btn {
  padding: 8px 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-btn:hover {
  background: #0056b3;
}

/* モバイルメニュー内のユーザー情報 */
.mobile-menu-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

.mobile-menu-user .user-info {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 8px;
  color: white;
}

.mobile-menu-user .user-info-id {
  color: white !important;
  font-weight: 500;
}

.mobile-menu-user .login-btn {
  width: 100%;
  padding: 12px;
  color: white;
}

.mobile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.mobile-stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-stat-item .icon {
  font-size: 1.125rem;
}

.mobile-stat-item .label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.mobile-stat-item .value {
  font-weight: 600;
}

/* 
==================================================
共通カード・ボタンスタイル
==================================================
*/
.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ボタンの基本スタイル */
.btn,
.action-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #e5e7eb;
  color: #4b5563;
}

.btn-secondary:hover {
  background: #d1d5db;
}

/* 
==================================================
フォーム要素
==================================================
*/
.form-input,
.form-select,
.search-input,
.search-select {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.search-input:focus,
.search-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 
==================================================
モバイル対応
==================================================
*/
@media (max-width: 768px) {
  /* デスクトップヘッダーを非表示 */
  .header {
    display: none;
  }

  /* モバイルヘッダーを表示 */
  .mobile-header {
    display: block;
  }

  /* カード */
  .card {
    padding: 1rem;
    border-radius: 6px;
  }

  /* ボタン */
  .btn,
  .action-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }

  /* フォーム要素 */
  .form-input,
  .form-select,
  .search-input,
  .search-select {
    font-size: 16px; /* iOSのズーム防止 */
    padding: 0.625rem 1rem;
  }
}

/* デスクトップヘッダーの小画面対応 */
@media (max-width: 480px) {
  .header-content {
    padding: 0 0.75rem;
    gap: 0.75rem;
  }
  
  .nav-menu {
    gap: 0.25rem;
  }
  
  .nav-menu a {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
}

/* 小さいスマホ対応（iPhone SE等） */
@media (max-width: 375px) {
  .mobile-logo {
    font-size: 0.875rem;
  }

  .mobile-nav-icon {
    padding: 0.25rem;
    min-width: 40px;
    min-height: 40px;
  }

  .mobile-nav-icon span {
    font-size: 0.563rem;
  }

  .mobile-slide-menu {
    width: 280px;
    right: -280px;
  }
}

/* 横向きスマホ対応 */
@media (max-width: 812px) and (orientation: landscape) {
  .mobile-header {
    padding: 0.375rem;
  }

  .mobile-nav-icon span {
    display: none; /* 横向きではアイコンのみ表示 */
  }

  .mobile-nav-icon {
    min-height: 36px;
  }
}

/* アニメーション */
@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ブラウザのステータスバー・ツールチップ非表示 */
*::-webkit-status-bar,
*::-webkit-progress-bar {
  display: none !important;
}

/* ツールチップを非表示 */
[title]:hover::after,
[title]:hover::before {
  display: none !important;
}

/* リンクのステータス表示を無効化 */
a[href] {
  text-decoration: none;
}

a[href]:hover {
  text-decoration: none;
}

/* ブラウザの標準ツールチップを無効化 */
* {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* スクロールバーのカスタマイズ（オプション） */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
