/* rated.css — レート戦ポータル（/rated）。/rankings と同じ GitHub-dark 世界観。 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: #0d1117;
  color: #e6edf3;
  min-height: 100vh;
  padding: 16px;
}
.rt-wrap { max-width: 820px; margin: 0 auto; }

/* ヘッダ */
.rt-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.rt-header h1 { font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.rt-icon { font-size: 26px; }
.rt-nav { margin-left: auto; display: flex; gap: 8px; }
.rt-nav a {
  color: #8b949e; text-decoration: none; font-size: 13px; padding: 6px 10px;
  border: 1px solid #30363d; border-radius: 8px; transition: all .15s;
}
.rt-nav a:hover { color: #e6edf3; border-color: #8b949e; }

.rt-section-title { font-size: 15px; font-weight: 700; color: #c9d1d9; margin: 22px 0 10px; }
.rt-section-head { display: flex; align-items: center; gap: 10px; }
.rt-section-head .rt-section-title { margin-bottom: 10px; }
.rt-live {
  margin-left: auto; font-size: 11px; color: #3fb950; display: inline-flex; align-items: center; gap: 5px;
}
.rt-live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3fb950;
  box-shadow: 0 0 0 0 rgba(63,185,80,.6); animation: rt-pulse 2s infinite;
}
@keyframes rt-pulse { 0%{box-shadow:0 0 0 0 rgba(63,185,80,.5);} 70%{box-shadow:0 0 0 6px rgba(63,185,80,0);} 100%{box-shadow:0 0 0 0 rgba(63,185,80,0);} }

/* 共通ボタン */
.rt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid #30363d; border-radius: 8px; background: #21262d; color: #e6edf3;
  font-size: 13px; font-weight: 700; padding: 8px 14px; cursor: pointer; text-decoration: none;
  transition: all .15s; white-space: nowrap;
}
.rt-btn:hover { border-color: #8b949e; }
.rt-btn-login, .rt-btn-go, .rt-btn-recruit { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.rt-btn-login:hover, .rt-btn-go:hover, .rt-btn-recruit:hover { background: #2a7bf6; border-color: #2a7bf6; }
.rt-btn-join { background: #238636; border-color: #238636; color: #fff; }
.rt-btn-join:hover { background: #2ea043; border-color: #2ea043; }
.rt-btn-watch { background: transparent; color: #c9d1d9; }
.rt-btn-ghost { background: transparent; color: #8b949e; }

/* ① 自分のレート状況 */
.rt-me {
  background: linear-gradient(135deg, rgba(31,111,235,.16), rgba(31,111,235,.04));
  border: 1px solid #1f6feb; border-radius: 12px; padding: 14px 16px; margin-bottom: 8px;
}
.rt-me-hello { font-size: 13px; color: #8b949e; margin-bottom: 8px; }
.rt-me-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-me-chip {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.04);
  border: 1px solid #30363d; border-radius: 999px; padding: 6px 12px;
}
.rt-me-game { font-size: 13px; font-weight: 600; color: #c9d1d9; }
.rt-me-val { display: inline-flex; align-items: center; gap: 6px; }
.rt-me-more { display: inline-block; margin-top: 10px; font-size: 12px; color: #58a6ff; text-decoration: none; }
.rt-me-more:hover { text-decoration: underline; }

.rt-me-guest { display: flex; align-items: center; gap: 14px; }
.rt-me-lock { font-size: 26px; }
.rt-me-text { flex: 1; }
.rt-me-title { font-size: 15px; font-weight: 700; }
.rt-me-sub { font-size: 12px; color: #8b949e; margin-top: 2px; }

/* レート/ティアの小バッジ */
.rt-rating { font-size: 16px; font-weight: 800; }
.rt-tier { font-size: 11px; font-weight: 700; }
.rt-prov { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(210,153,34,.18); color: #d29922; }
.rt-rank { font-size: 12px; font-weight: 800; color: #e3b341; }
.rt-norec { font-size: 12px; color: #6e7681; }

/* ② ゲームカード（募集） */
.rt-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.rt-game-card {
  background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 16px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
}
.rt-game-icon { font-size: 34px; line-height: 1; }
.rt-game-name { font-size: 16px; font-weight: 800; }
.rt-game-me { display: inline-flex; align-items: center; gap: 6px; min-height: 20px; }
.rt-game-min { font-size: 11px; color: #6e7681; }
.rt-game-card .rt-btn-recruit { width: 100%; margin-top: 4px; padding: 10px; }

/* ③ アクティブ一覧 */
.rt-active { display: flex; flex-direction: column; gap: 14px; }
.rt-group { border: 1px solid #30363d; border-radius: 12px; overflow: hidden; }
.rt-group-head {
  font-size: 13px; font-weight: 800; padding: 10px 14px; background: #161b22;
  border-bottom: 1px solid #21262d; display: flex; align-items: baseline; gap: 8px;
}
.rt-group-head span { font-size: 11px; font-weight: 600; color: #8b949e; }
.rt-group-open { color: #3fb950; }
.rt-group-live { color: #58a6ff; }
.rt-group-empty { padding: 14px; font-size: 12px; color: #6e7681; text-align: center; }
.rt-room {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #21262d;
}
.rt-room:last-child { border-bottom: none; }
.rt-room-game { font-size: 14px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-room-count { font-size: 12px; font-weight: 700; color: #c9d1d9; min-width: 48px; text-align: right; }
.rt-room-time { font-size: 11px; color: #6e7681; min-width: 64px; text-align: right; }
.rt-room .rt-btn { padding: 7px 14px; }

.rt-empty, .rt-loading, .rt-disabled { padding: 28px 16px; text-align: center; color: #8b949e; font-size: 13px; line-height: 1.7; }

/* 仕組みの説明 */
.rt-howto { margin: 26px 0 12px; border: 1px solid #21262d; border-radius: 10px; background: #0f141a; }
.rt-howto summary { padding: 12px 16px; cursor: pointer; font-size: 13px; font-weight: 700; color: #8b949e; }
.rt-howto summary:hover { color: #e6edf3; }
.rt-howto ul { padding: 0 18px 14px 36px; }
.rt-howto li { font-size: 12px; color: #8b949e; line-height: 1.9; }
.rt-howto strong { color: #c9d1d9; }

/* 募集確認モーダル */
.rt-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 1000; opacity: 0; transition: opacity .15s;
}
.rt-overlay.show { opacity: 1; }
.rt-modal {
  background: #161b22; border: 1px solid #30363d; border-radius: 14px; padding: 22px;
  max-width: 380px; width: 100%; transform: translateY(8px); transition: transform .15s;
}
.rt-overlay.show .rt-modal { transform: translateY(0); }
.rt-modal-title { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.rt-modal-game { font-size: 15px; font-weight: 700; color: #58a6ff; margin: 10px 0 12px; }
.rt-modal-list { padding-left: 18px; margin-bottom: 12px; }
.rt-modal-list li { font-size: 12px; color: #c9d1d9; line-height: 1.8; }
.rt-modal-list strong { color: #fff; }
.rt-modal-discord { font-size: 12px; color: #c9a227; background: rgba(210,153,34,.1); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.rt-modal-me { font-size: 13px; color: #8b949e; display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.rt-modal-me strong { color: #fff; }
.rt-modal-actions { display: flex; gap: 10px; }
.rt-modal-actions .rt-btn { flex: 1; padding: 11px; }

@media (max-width: 480px) {
  .rt-room-time { display: none; }
  .rt-games { grid-template-columns: 1fr 1fr; }
}
