/* ============================================================
   StudyQuest - style.css
   テーマ: ダークRPGゲーム風 × モダンUI
   フォント: Cinzel（見出し）× Noto Sans JP（本文）
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* ============================================================
   CSS変数
   ============================================================ */
:root {
  --bg-deep:        #0d0f1a;
  --bg-mid:         #13172a;
  --bg-card:        #1a1f35;
  --bg-card-hover:  #1f2540;
  --border:         #2a3058;
  --border-light:   #3a4070;

  --accent:         #7c6af7;
  --accent-light:   #9d8fff;
  --accent-glow:    rgba(124, 106, 247, 0.35);
  --accent2:        #f7c948;
  --accent2-glow:   rgba(247, 201, 72, 0.3);
  --success:        #4ade80;
  --success-glow:   rgba(74, 222, 128, 0.25);
  --danger:         #f87171;
  --danger-glow:    rgba(248, 113, 113, 0.25);

  --text-primary:   #e8eaf6;
  --text-secondary: #8892b0;
  --text-muted:     #4a5580;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 24px var(--accent-glow);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   リセット・ベース
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;

  /* 星空背景 */
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(124,106,247,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(74,222,128,0.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Ccircle cx='50' cy='80' r='1' fill='%23ffffff08'/%3E%3Ccircle cx='150' cy='30' r='1.5' fill='%23ffffff06'/%3E%3Ccircle cx='300' cy='120' r='1' fill='%23ffffff08'/%3E%3Ccircle cx='370' cy='60' r='1' fill='%23ffffff05'/%3E%3Ccircle cx='80' cy='300' r='1.5' fill='%23ffffff06'/%3E%3Ccircle cx='250' cy='350' r='1' fill='%23ffffff08'/%3E%3Ccircle cx='320' cy='280' r='1' fill='%23ffffff05'/%3E%3Ccircle cx='180' cy='200' r='1' fill='%23ffffff06'/%3E%3C/svg%3E");
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

ul { list-style: none; }

/* ============================================================
   サイトヘッダー
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 26, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent2) !important;
  text-shadow: 0 0 20px var(--accent2-glow);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary) !important;
  transition: all var(--transition);
}
.nav-link:hover {
  background: var(--bg-card);
  color: var(--text-primary) !important;
}

/* ヘッダーXPバー */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.level-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent2);
  background: rgba(247,201,72,0.12);
  border: 1px solid rgba(247,201,72,0.3);
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xp-bar {
  width: 80px;
  height: 6px;
  background: var(--bg-mid);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}

.xp-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.streak {
  font-size: 0.85rem;
  color: #fb923c;
  font-weight: 700;
  white-space: nowrap;
}

.user-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.btn-logout {
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  color: var(--danger) !important;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-logout:hover {
  background: rgba(248,113,113,0.2);
}

/* ============================================================
   メインコンテンツ
   ============================================================ */
.main-content { min-height: calc(100vh - 64px - 48px); }

.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   カード
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-light); }

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ============================================================
   ボタン
   ============================================================ */
.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), #5b4dd4);
  color: #fff !important;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  background: transparent;
  color: var(--accent-light) !important;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover {
  background: var(--accent-glow);
}

.btn-full { width: 100%; text-align: center; }

.btn-small {
  font-size: 0.78rem;
  color: var(--accent-light) !important;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-small:hover { border-color: var(--accent); background: var(--accent-glow); }

.btn-complete {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform var(--transition);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.btn-complete:hover { transform: scale(1.3); }

.btn-delete {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--transition);
  padding: 4px;
}
.btn-delete:hover { opacity: 1; }

/* ============================================================
   フォーム
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Noto Sans JP', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group select option { background: var(--bg-card); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   アラート
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}
.alert-success {
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.3);
  color: var(--success);
}
.alert-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--danger);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   タスクリスト
   ============================================================ */
.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  gap: 12px;
}
.task-item:hover { border-color: var(--border-light); background: var(--bg-card-hover); }

.task-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.subject-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-subject {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.task-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-actions { display: flex; gap: 4px; flex-shrink: 0; }

.task-item-done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.empty-message {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0;
}

.badge-count {
  font-size: 0.75rem;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
}

/* ============================================================
   ダッシュボード
   ============================================================ */

/* ウェルカムバナー */
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(124,106,247,0.15), rgba(74,222,128,0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 32px;
  margin-bottom: 24px;
  gap: 16px;
}
.welcome-banner h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}
.welcome-banner p { color: var(--text-secondary); font-size: 0.9rem; }

.streak-banner {
  font-size: 1.1rem;
  color: #fb923c;
  background: rgba(251,146,60,0.12);
  border: 1px solid rgba(251,146,60,0.25);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,146,60,0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(251,146,60,0); }
}

/* XPカード */
.xp-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.level-circle {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent2);
  background: rgba(247,201,72,0.1);
  border: 2px solid rgba(247,201,72,0.4);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--accent2-glow);
  animation: rotateBorder 4s linear infinite;
}
@keyframes rotateBorder {
  0%   { box-shadow: 0 0 20px var(--accent2-glow), 2px 0 10px rgba(247,201,72,0.2); }
  50%  { box-shadow: 0 0 30px var(--accent2-glow), -2px 0 10px rgba(247,201,72,0.2); }
  100% { box-shadow: 0 0 20px var(--accent2-glow), 2px 0 10px rgba(247,201,72,0.2); }
}

.xp-card-right { flex: 1; }

.xp-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.xp-bar-large {
  width: 100%;
  height: 12px;
  background: var(--bg-mid);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}

.xp-bar-fill-large {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), #c4b8ff);
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--accent-glow);
  position: relative;
  overflow: hidden;
}
.xp-bar-fill-large::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 2s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { left: -60%; }
  100% { left: 150%; }
}

.xp-percent {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

/* サマリーカード */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), 0 8px 24px var(--accent-glow);
}

.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-value {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ダッシュボードグリッド */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* 科目別進捗 */
.subject-progress-list { display: flex; flex-direction: column; gap: 14px; }

.subject-progress-item {}

.subject-progress-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.subject-name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}

.subject-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-mid);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 3px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  box-shadow: 0 0 8px rgba(124,106,247,0.3);
}

.progress-percent {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* バッジリスト（ダッシュボード） */
.badge-list { display: flex; flex-direction: column; gap: 10px; }

.badge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.badge-icon { font-size: 1.4rem; flex-shrink: 0; }

.badge-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.badge-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 累計stats */
.total-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.total-stat-item {}

.total-stat-value {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
}

.total-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 今日のサマリー */
.today-summary {
  text-align: center;
  padding: 8px 0;
}
.today-minutes {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-light);
  display: block;
}
.today-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================================
   record.php グリッド
   ============================================================ */
.record-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
  align-items: start;
}

/* ============================================================
   バッジ一覧ページ
   ============================================================ */
.badge-summary {
  background: linear-gradient(135deg, rgba(124,106,247,0.12), rgba(247,201,72,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 28px;
  text-align: center;
}

.badge-summary-count {
  margin-bottom: 4px;
}

.badge-earned-num {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent2);
  text-shadow: 0 0 30px var(--accent2-glow);
}

.badge-total-num {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.badge-summary-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.badge-overall-bar {
  width: 60%;
  max-width: 300px;
  margin: 0 auto 8px;
  height: 10px;
  background: var(--bg-mid);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.badge-overall-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), #ffd700);
  border-radius: 5px;
  box-shadow: 0 0 10px var(--accent2-glow);
  transition: width 1s ease;
}

.badge-overall-percent {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* バッジグリッド */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

.badge-earned {
  border-color: rgba(247,201,72,0.35);
  background: linear-gradient(135deg, var(--bg-card), rgba(247,201,72,0.04));
}
.badge-earned:hover {
  border-color: var(--accent2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), 0 8px 24px var(--accent2-glow);
}

.badge-locked {
  opacity: 0.7;
}
.badge-locked:hover {
  opacity: 1;
  border-color: var(--border-light);
}

.badge-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-mid);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.badge-emoji-locked { filter: grayscale(1); opacity: 0.5; }

.badge-card-body { flex: 1; min-width: 0; }

.badge-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.badge-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.badge-card-meta { display: flex; flex-direction: column; gap: 4px; }

.badge-xp {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent2);
}

.badge-earned-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.badge-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-deep);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.badge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.8s ease;
}

.badge-progress-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-xp-reward {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============================================================
   認証ページ
   ============================================================ */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-card), 0 0 60px rgba(124,106,247,0.1);
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent2);
  text-shadow: 0 0 30px var(--accent2-glow);
  margin-bottom: 4px;
}

.auth-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  background: var(--bg-mid);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted) !important;
  transition: all var(--transition);
}

.auth-tab.active {
  background: var(--accent);
  color: #fff !important;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.auth-form { display: flex; flex-direction: column; }

/* ============================================================
   フッター
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .record-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .site-header { padding: 0 16px; }
  .header-inner { gap: 12px; }
  .main-nav { display: none; }
  .xp-bar-wrap { display: none; }
  .user-name { display: none; }
  .page-container { padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .welcome-banner { flex-direction: column; padding: 20px; }
  .xp-card { flex-direction: column; text-align: center; }
  .badge-grid { grid-template-columns: 1fr; }
  .total-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .auth-container { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .level-circle { width: 56px; height: 56px; font-size: 0.9rem; }
}

/* ============================================================
   ranking.php
   ============================================================ */

/* 準備中 */
.ranking-coming-soon {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}
.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
.ranking-coming-soon h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.ranking-coming-soon p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 自分の順位カード */
.my-rank-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(124,106,247,0.15), rgba(247,201,72,0.08));
  border: 1px solid rgba(124,106,247,0.35);
  border-radius: var(--radius-xl);
  padding: 24px 32px;
  margin-bottom: 24px;
  gap: 24px;
}
.my-rank-left { text-align: center; }
.my-rank-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.my-rank-pos {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent2);
  text-shadow: 0 0 30px var(--accent2-glow);
  line-height: 1;
}
.my-rank-pos small { font-size: 1.2rem; }

.my-rank-right {
  display: flex;
  gap: 32px;
}
.my-rank-stat { text-align: center; }
.my-rank-val {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}
.my-rank-key {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ランキングテーブル */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.ranking-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.ranking-row td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  transition: background var(--transition);
}
.ranking-row:hover td { background: var(--bg-card-hover); }
.ranking-row:last-child td { border-bottom: none; }

.ranking-row-me td {
  background: rgba(124,106,247,0.08) !important;
  border-bottom: 1px solid rgba(124,106,247,0.2);
}

.rank-pos { font-size: 1.3rem; width: 60px; }
.rank-num {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--text-secondary);
}
.rank-name { font-weight: 500; }
.rank-me-badge {
  font-size: 0.7rem;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}
.rank-lv-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--accent2);
  background: rgba(247,201,72,0.1);
  border: 1px solid rgba(247,201,72,0.25);
  padding: 2px 10px;
  border-radius: 20px;
}
.rank-xp { font-weight: 700; color: var(--accent-light); }
.rank-tasks { color: var(--text-secondary); }
.rank-streak { color: #fb923c; }

@media (max-width: 768px) {
  .my-rank-card { flex-direction: column; padding: 20px; }
  .my-rank-right { gap: 16px; }
  .ranking-table thead th:nth-child(5),
  .ranking-table tbody td:nth-child(5) { display: none; }
}
