/* レスポンシブデザインの基盤 */

/* モバイルファーストアプローチ */
/* デフォルトはモバイル（320px〜767px） */

/* タブレット（768px〜1023px） */
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
  
  /* 2カラムグリッド */
  .grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* PC（1024px以上） */
@media (min-width: 1024px) {
  html {
    font-size: 16px;
  }
  
  .container {
    max-width: 1200px;
  }
  
  /* 3カラムグリッド */
  .grid-responsive {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* 4カラムグリッド（大画面） */
  .grid-responsive-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* 5カラムグリッド（PC表示） */
  .grid-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 入金ページのモバイル最適化 */
@media (max-width: 767px) {
  .deposit-method-tabs {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .deposit-method-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .deposit-tab-btn {
    font-size: 14px;
    padding: 10px 12px !important;
    min-width: 100px !important;
  }
  
  #deposit-amount {
    font-size: 18px !important;
    padding: 16px !important;
  }
  
  #copy-reference-btn {
    padding: 12px 20px !important;
    font-size: 16px !important;
  }
  
  .input-group {
    margin-bottom: 20px;
  }
  
  .card-body {
    padding: 20px !important;
  }
}

/* 超大画面（1400px以上） */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }
}

/* レスポンシブタイポグラフィ */
@media (max-width: 767px) {
  h1 { font-size: var(--font-size-xxl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }
  h4 { font-size: var(--font-size-base); }
}

/* レスポンシブスペーシング */
@media (max-width: 767px) {
  .section {
    padding: var(--spacing-lg) 0;
  }
  
  .card {
    padding: var(--spacing-md);
  }
}

/* レスポンシブボタン */
@media (max-width: 767px) {
  .btn {
    width: 100%;
  }
  
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .btn-group {
    display: flex;
    gap: var(--spacing-sm);
  }
  
  .btn-group .btn {
    width: auto;
  }
}

/* レスポンシブナビゲーション */
@media (max-width: 767px) {
  .mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--bg-secondary);
    z-index: var(--z-modal);
    transition: left var(--transition-base);
    padding: var(--spacing-xl) var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  
  .mobile-nav.active {
    left: 0;
  }
  
  .mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }
  
  .mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
  }
}

/* レスポンシブグリッド */
.grid-responsive {
  display: grid;
  gap: var(--spacing-md);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-responsive {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid-responsive-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* レスポンシブカード */
@media (max-width: 767px) {
  .card {
    margin-bottom: var(--spacing-md);
  }
}

/* レスポンシブプレイヤー */
@media (max-width: 767px) {
  .player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
  }
}

/* レスポンシブヘッダー */
@media (max-width: 767px) {
  .header-content {
    padding: 0 var(--spacing-md);
  }
  
  .header-logo {
    font-size: var(--font-size-lg);
  }
}

/* レスポンシブ検索 */
@media (max-width: 767px) {
  .search-bar {
    width: 100%;
  }
}

/* レスポンシブモーダル */
@media (max-width: 767px) {
  .modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    max-height: 90vh;
  }
  
  .modal-content {
    padding: var(--spacing-lg);
  }
}

@media (min-width: 768px) {
  .modal {
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-card);
  }
}

/* レスポンシブテーブル */
@media (max-width: 767px) {
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table thead {
    display: none;
  }
  
  .table tbody,
  .table tr,
  .table td {
    display: block;
  }
  
  .table tr {
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-card);
    padding: var(--spacing-md);
  }
  
  .table td {
    border: none;
    padding: var(--spacing-xs) 0;
    text-align: right;
  }
  
  .table td::before {
    content: attr(data-label);
    float: left;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
  }
}

/* レスポンシブフォーム */
@media (max-width: 767px) {
  .form-group {
    margin-bottom: var(--spacing-md);
  }
  
  .form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
  }
  
  .form-input,
  .form-select,
  .form-textarea {
    width: 100%;
  }
}

/* レスポンシブユーティリティ */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
  
  .show-mobile {
    display: block !important;
  }
  
  .text-center-mobile {
    text-align: center;
  }
}

@media (min-width: 768px) {
  .hide-desktop {
    display: none !important;
  }
  
  .show-desktop {
    display: block !important;
  }
}

/* タッチデバイス最適化 */
@media (hover: none) and (pointer: coarse) {
  /* タッチターゲットを大きく */
  button,
  .btn,
  .nav-link,
  a {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ユーザーメニューモーダルのレスポンシブ対応 */
@media (max-width: 767px) {
  #user-menu-modal .modal-content {
    top: 50px !important;
    right: 10px !important;
    left: auto !important;
    max-width: calc(100vw - 20px) !important;
  }
}

