/**
 * モバイル最適化CSS
 * 既存のstyle.cssに追加で読み込む
 */

/* モバイルファースト基本設定 */
:root {
  --touch-target: 44px;
  --mobile-padding: 16px;
  --tablet-padding: 24px;
  --desktop-padding: 32px;
}

/* タッチデバイス最適化 */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

/* モバイルでの読みやすさ改善 */
body {
  font-size: 16px !important;
  line-height: 1.8 !important;
  overflow-x: hidden;
}

/* コンテナの幅調整 */
.container {
  max-width: 100% !important;
  padding: var(--mobile-padding) !important;
}

@media (min-width: 768px) {
  .container {
    padding: var(--tablet-padding) !important;
    max-width: 768px !important;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: var(--desktop-padding) !important;
    max-width: 1200px !important;
  }
}

/* ボタンのタッチターゲット拡大 */
.btn,
button,
a.button,
input[type="submit"],
input[type="button"] {
  min-height: var(--touch-target) !important;
  min-width: var(--touch-target) !important;
  padding: 12px 24px !important;
  font-size: 16px !important;
  border-radius: 50px !important;
  cursor: pointer;
}

/* フォーム要素の改善 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea,
select {
  font-size: 16px !important;
  padding: 12px 16px !important;
  min-height: var(--touch-target) !important;
  border-radius: 8px !important;
  width: 100% !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

/* モバイルでのカード表示改善 */
.challenge-card {
  background: white !important;
  color: #333 !important;
  padding: 20px !important;
  margin-bottom: 20px !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

.challenge-card h3,
.challenge-card .text-xl {
  font-size: 18px !important;
  color: #333 !important;
  margin-bottom: 8px !important;
}

.challenge-card p,
.challenge-card .text-gray-400 {
  color: #666 !important;
  font-size: 14px !important;
}

/* ヒーローセクション */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 60px 20px 40px;
  text-align: center;
  margin-bottom: 30px;
}

.hero-title {
  font-size: 28px !important;
  font-weight: bold;
  color: white;
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
}

/* Twitterログインボタン強調 */
.twitter-login-btn,
a[href*="twitter_auth"],
a[href*="twitter/login"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  background: #1DA1F2 !important;
  color: white !important;
  padding: 16px 32px !important;
  border-radius: 50px !important;
  font-size: 18px !important;
  font-weight: bold !important;
  text-decoration: none !important;
  box-shadow: 0 4px 20px rgba(29, 161, 242, 0.3) !important;
  transition: all 0.3s ease !important;
  margin: 10px auto !important;
}

.twitter-login-btn:hover,
a[href*="twitter_auth"]:hover,
a[href*="twitter/login"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 30px rgba(29, 161, 242, 0.4) !important;
}

/* プログレスバー改善 */
.progress {
  height: 12px !important;
  background: #f0f0f0 !important;
  border-radius: 6px !important;
  overflow: hidden;
  margin: 12px 0 !important;
}

.progress-bar {
  height: 100% !important;
  background: linear-gradient(90deg, #667eea, #764ba2) !important;
  transition: width 0.5s ease !important;
}

/* グリッドレイアウト最適化 */
.grid {
  display: grid !important;
  gap: 20px !important;
  grid-template-columns: 1fr !important;
}

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

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

/* モーダル改善 */
.modal-content {
  width: 95% !important;
  max-width: 500px !important;
  margin: 20px auto !important;
  border-radius: 20px !important;
  padding: 30px 20px !important;
}

/* タブナビゲーション */
.tab-navigation {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 20px 20px;
  -webkit-overflow-scrolling: touch;
}

.tab-navigation::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  white-space: nowrap;
  border: none;
  transition: all 0.3s;
  cursor: pointer;
}

.tab-btn.active {
  background: white;
  color: #667eea;
  font-weight: bold;
}

/* アイコン調整 */
.icon,
svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

/* スクロール改善 */
.scrollable {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

/* ローディングアニメーション改善 */
.loading {
  width: 50px !important;
  height: 50px !important;
  border: 4px solid rgba(255, 255, 255, 0.3) !important;
  border-top-color: white !important;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 30px auto !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* テキストの読みやすさ */
p {
  margin-bottom: 16px;
  line-height: 1.8;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 16px;
}

/* リンクのタップ領域拡大 */
a {
  padding: 8px;
  margin: -8px;
  display: inline-block;
}

/* 画像の最適化 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* フッター固定対策 */
body {
  padding-bottom: 80px;
}

/* スマホ横向き対策 */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    padding: 30px 20px 20px;
  }
  
  .hero-title {
    font-size: 24px !important;
  }
}