/* ======================
   ルーレットアズ — レスポンシブ
====================== */

/* ─── Tablet (768px以下) ─── */
@media (max-width: 768px) {
  .hamburger { display: block; }
  .nav-drawer {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 8px 0;
    flex-direction: column;
  }
  .nav-drawer.open { display: flex; }
  .nav-drawer .nav { flex-direction: column; gap: 0; padding: 0 12px; }
  .nav-btn { width: 100%; padding: 12px 16px; border-radius: 10px; font-size: 0.95rem; justify-content: flex-start; }
  .header-inner { height: 56px; }

  .home-title { font-size: clamp(24px, 5vw, 36px); }
  .home-hero { padding: 32px 0 24px; }
  .home-actions { flex-direction: column; align-items: center; width: 100%; }
  .home-actions .btn { width: 100%; justify-content: center; }

  /* ギャラリー一時無効化
  .gallery-controls { flex-direction: column; align-items: stretch; }
  .category-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .sort-controls { margin-left: 0; }
  .search-box { min-width: unset; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  */

  /* ルーレットプレイヤー */
  .roulette-canvas {
    width: 320px;
    height: 320px;
  }

  .pointer {
    top: 5px !important;
    font-size: 30px;
  }

  .result-display {
    min-width: 200px;
    padding: 8px 18px;
  }

  .result-text {
    font-size: 1.05rem;
  }

  .control-buttons {
    gap: 12px;
  }

  .control-buttons button {
    padding: 12px 28px;
    font-size: 1rem;
    min-width: 110px;
  }

  .play-title {
    font-size: 1.4rem;
  }

  .play-actions {
    flex-direction: column;
    align-items: center;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-num { font-size: 1.5rem; }

  .profile-row { flex-direction: column; }

  .dash-roulette {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .dash-roulette-actions {
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    flex-wrap: nowrap;
  }

  .dash-roulette-actions .btn-label { display: none; }
  .dash-roulette-actions .btn-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; }
  .dash-roulette-actions .btn-icon .material-icons { font-size: 18px; }
  .dash-roulette-actions .btn {
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: none;
  }
}

/* ─── Mobile (480px以下) ─── */
@media (max-width: 480px) {
  .header { padding: 0 12px; }
  .logo { font-size: 1rem; }
  .main { padding: 16px 12px; }

  .home-icon { font-size: 56px; }
  .home-title { font-size: 22px; }

  /* ギャラリー一時無効化
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card-body { padding: 8px 12px; }
  .card-title { font-size: 0.85rem; }
  .card-stats { font-size: 0.7rem; gap: 8px; }
  */

  /* ルーレットプレイヤー */
  .roulette-canvas {
    width: 280px;
    height: 280px;
  }

  .center-point {
    width: 16px;
    height: 16px;
  }

  .pointer {
    font-size: 28px;
    top: 0px !important;
  }

  .result-display {
    min-width: 180px;
    padding: 8px 14px;
  }

  .result-text {
    font-size: 0.95rem;
  }

  .control-buttons button {
    padding: 12px 24px;
    font-size: 0.95rem;
    min-width: 100px;
  }

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

  .remove-segment-btn {
    font-size: 0.85rem;
    padding: 8px 20px;
  }

  .description-summary {
    font-size: 0.8rem;
    gap: 8px;
  }

  .upload-dropzone { padding: 32px 16px; }
  .modal-content { padding: 24px; }

  .stats-grid { gap: 6px; }
  .stat-card { padding: 14px 8px; }
  .stat-num { font-size: 1.3rem; }
  .stat-label { font-size: 0.7rem; }
}

/* ─── Extra Small (360px以下) ─── */
@media (max-width: 360px) {
  /* .gallery-grid { grid-template-columns: 1fr; } ギャラリー一時無効化 */

  .roulette-canvas {
    width: 250px;
    height: 250px;
  }

  .result-display {
    min-width: 160px;
    padding: 6px 12px;
  }

  .result-text {
    font-size: 0.9rem;
  }

  .control-buttons button {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-width: 90px;
  }
}

/* ─── Desktop (1024px以上) ─── */
@media (min-width: 1024px) {
  /* .gallery-grid { grid-template-columns: repeat(4, 1fr); } ギャラリー一時無効化 */
}

/* ─── タッチデバイス専用 ─── */
@media (hover: none) and (pointer: coarse) {
  .control-buttons button {
    min-height: 48px;
    padding: 14px 28px;
  }

  .control-buttons button:active {
    transform: scale(0.97);
  }

  .remove-segment-btn {
    min-height: 44px;
  }

  .remove-segment-btn:active {
    transform: scale(0.98);
  }
}

/* ─── 高解像度ディスプレイ ─── */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  .pointer {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
