/*


 */

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

:root {
  --bg:       #0c0c12;
  --bg2:      #16162a;
  --bg3:      #21213a;
  --accent:   #7c5af7;
  --accent2:  #b08afa;
  --pink:     #f07fa0;
  --fg:       #e4e4f5;
  --fg2:      #8888aa;
  --border:   #2c2c48;
  --danger:   #e05555;
  --success:  #4caf80;
  --radius:   10px;
  --shadow:   0 4px 24px rgba(0,0,0,0.45);
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Segoe UI', 'Hiragino Sans', system-ui, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--fg2); }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--fg); }

/* ── ヘッダー ───────────────────────────────── */
header {
  background: rgba(22,22,42,0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

header nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.nav-logo-icon { font-size: 1.3rem; }

.nav-logo-text {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--fg);
  letter-spacing: 0.02em;
}

.nav-logo-slash { color: var(--accent2); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user {
  font-size: 0.9rem;
  color: var(--fg2);
  padding: 0.3rem 0.8rem;
  background: var(--bg3);
  border-radius: 20px;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--fg2);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--fg); background: var(--bg3); text-decoration: none; }

.nav-btn {
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff !important;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  transition: background 0.2s;
}

.nav-btn:hover { background: var(--accent2); text-decoration: none; }

.nav-btn-ghost {
  font-size: 0.85rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg2);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.nav-btn-ghost:hover { border-color: var(--fg2); color: var(--fg); }

/* ── メインコンテンツ ────────────────────────── */
main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── フッター ───────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.82rem;
  color: var(--fg2);
}

/* ── フラッシュメッセージ ──────────────────── */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.flash--notice {
  background: rgba(76,175,128,0.1);
  border-color: var(--success);
  color: var(--success);
}

.flash--alert {
  background: rgba(224,85,85,0.1);
  border-color: var(--danger);
  color: #ff9090;
}

/* ── ヒーロー（トップページ） ──────────────── */
.hero {
  background: linear-gradient(135deg, var(--bg2) 0%, #1a1030 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(124,90,247,0.12) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
}

.hero-avatar {
  flex-shrink: 0;
}

.hero-icon {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px rgba(124,90,247,0.4);
}

.hero-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 0.25rem;
}

.hero-name {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero-slash { color: var(--accent2); }

.hero-bio {
  color: var(--fg2);
  font-size: 0.95rem;
  line-height: 1.8;
}

.hero-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--fg2);
  font-size: 1.1rem;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
}

.hero-social-link:hover { text-decoration: none; transform: translateY(-2px); }
.hero-social-link--x:hover      { background: #000; color: #fff; border-color: #555; }
.hero-social-link--twitch:hover { background: #9146ff; color: #fff; border-color: #9146ff; }
.hero-social-link--youtube:hover{ background: #ff0000; color: #fff; border-color: #ff0000; }

/* ── ゲーム一覧 ─────────────────────────────── */
.games-section { margin-bottom: 3rem; }

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.game-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.game-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.game-card__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.game-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.game-card__link:hover { text-decoration: none; color: inherit; }

.game-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.4rem;
  padding-right: 2.5rem;
}

.game-card__desc {
  font-size: 0.85rem;
  color: var(--fg2);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.game-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.game-card__version {
  font-size: 0.78rem;
  color: var(--fg2);
  background: var(--bg3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.game-card__play {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent2);
}

/* ── タイトル画面プレビュー ─────────────────── */
.title-preview {
  position: relative;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 420px;
  background: #050212;
}

.title-preview__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  display: block;
}

.title-preview__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
}

.title-preview__btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: radial-gradient(circle at 40% 35%, #9955ff, #5511cc);
  border-radius: 40px;
  color: #fff !important;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 2.2rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 28px rgba(140,80,255,0.6);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none !important;
}

.title-preview__btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 44px rgba(160,100,255,0.8);
}

.title-preview__icon { font-size: 1.25rem; }

@media (max-width: 768px) {
  .title-preview { height: 320px; }
}

/* ── プレイカバー ───────────────────────────── */
.play-cover {
  position: relative;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050212;
  cursor: pointer;
}

.play-cover__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 50% 50%, rgba(100,60,200,0.25) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,0.012) 3px, rgba(255,255,255,0.012) 4px);
}

.play-cover__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

.play-cover__label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 600;
}

.play-cover__title {
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 30px rgba(150,100,255,0.8);
  letter-spacing: 0.04em;
}

.play-cover__btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: radial-gradient(circle at 40% 35%, #9955ff, #5511cc);
  border: none;
  border-radius: 40px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 2.2rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: 0 0 28px rgba(140,80,255,0.55);
  transition: transform 0.15s, box-shadow 0.15s;
}

.play-cover__btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 40px rgba(160,100,255,0.75);
}

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

.play-cover__hint {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.06em;
}

.game-frame__close {
  display: block;
  width: 100%;
  background: var(--bg3);
  border: none;
  border-top: 1px solid var(--border);
  color: var(--fg2);
  font-size: 0.85rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.game-frame__close:hover { color: var(--danger); background: var(--bg2); }

/* ── ゲーム詳細ページ ───────────────────────── */
.game-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.game-version-badge {
  font-size: 0.78rem;
  color: var(--fg2);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}

.game-desc {
  color: var(--fg2);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.game-frame {
  margin: 1.25rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  display: flex;
  justify-content: center;
}

.game-frame iframe { display: block; max-width: 100%; }

.game-sections {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* ── ランキングタブ ─────────────────────────── */
.rank-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.rank-tab {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--fg2);
  background: var(--bg3);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.rank-tab:hover { color: var(--fg); border-color: var(--accent2); text-decoration: none; }

.rank-tab--active {
  border-color: var(--accent);
  color: var(--accent2);
  background: rgba(124,90,247,0.12);
}

.rank-tab--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── ログイン促進 ────────────────────────────── */
.rank-login-prompt {
  background: rgba(124,90,247,0.08);
  border: 1px solid rgba(124,90,247,0.25);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--fg2);
  line-height: 1.6;
}

.rank-login-prompt__sub {
  font-size: 0.78rem;
  color: var(--fg2);
  opacity: 0.7;
  margin-top: 0.25rem;
}

.score-form-login-cta {
  padding: 1.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}
.score-form-login-cta__score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
}
.score-form-login-cta p { color: var(--fg2); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: center; }

/* ── ランクリスト ───────────────────────────── */
.rank-list {
  list-style: none;
  margin-bottom: 1rem;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.rank-item:last-child { border-bottom: none; }

.rank-num {
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--fg2);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-num--1 { background: #f5c842; color: #000; }
.rank-num--2 { background: #c0c0c0; color: #000; }
.rank-num--3 { background: #cd7f32; color: #000; }

.rank-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.rank-user-tag {
  font-size: 0.75rem;
  color: var(--accent2);
  opacity: 0.8;
}

.rank-score {
  font-size: 0.85rem;
  color: var(--fg2);
  white-space: nowrap;
  margin-left: auto;
}

/* ── フォローボタン ──────────────────────────── */
.follow-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.follow-btn:hover { background: var(--accent); color: #fff; }

.follow-btn--active {
  background: rgba(124,90,247,0.15);
  color: var(--fg2);
  border-color: var(--border);
}

.follow-btn--active:hover { background: rgba(224,85,85,0.15); color: var(--danger); border-color: var(--danger); }

/* button_to のフォームを inline に */
.rank-name form { display: inline; margin: 0; }
.rank-name form div { margin: 0; display: inline; }

/* ── ランキング ─────────────────────────────── */
.ranking {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: fit-content;
}

.ranking ol {
  list-style: none;
  counter-reset: rank;
  margin-bottom: 1rem;
}

.ranking ol li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.ranking ol li:last-child { border-bottom: none; }

.ranking ol li::before {
  content: counter(rank);
  background: var(--bg3);
  color: var(--fg2);
  font-size: 0.72rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ranking ol li:nth-child(1)::before { background: #f5c842; color: #000; }
.ranking ol li:nth-child(2)::before { background: #c0c0c0; color: #000; }
.ranking ol li:nth-child(3)::before { background: #cd7f32; color: #000; }

.ranking ol li strong { flex: 1; }
.ranking ol li span { font-size: 0.82rem; color: var(--fg2); }

.score-toggle {
  margin-top: 0.75rem;
  font-size: 0.88rem;
}

.score-toggle summary {
  color: var(--accent2);
  cursor: pointer;
  user-select: none;
  padding: 0.3rem 0;
}

.score-form-inner { margin-top: 0.75rem; }

/* ── レビューセクション ─────────────────────── */
.reviews {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.review-form {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.review-login-prompt,
.review-posted-notice {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--fg2);
}

.review-posted-notice { color: var(--success); }

/* ── 星評価セレクト ──────────────────────────── */
.rating-group { margin-bottom: 1rem; }

.star-select {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.1rem;
  margin-top: 0.35rem;
  width: fit-content;
}

.star-select input[type="radio"] { display: none; }

.star-select label {
  font-size: 1.5rem;
  color: var(--border);
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
  display: block;
  margin: 0;
}

.star-select label:hover,
.star-select label:hover ~ label,
.star-select input[type="radio"]:checked ~ label {
  color: #f5c842;
}

/* ── レビューリスト ──────────────────────────── */
.review-list { list-style: none; }

.review-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child { border-bottom: none; }

.review-item__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.review-item__user {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
}

.review-item__stars { white-space: nowrap; }

.star { font-size: 0.95rem; }
.star.filled { color: #f5c842; }
.star.empty  { color: var(--border); }

.review-item__date {
  font-size: 0.78rem;
  color: var(--fg2);
  margin-left: auto;
}

.review-item__body {
  font-size: 0.9rem;
  color: var(--fg2);
  line-height: 1.7;
}

/* ── フォーム共通 ───────────────────────────── */
form div { margin-bottom: 1rem; }

form label {
  display: block;
  font-size: 0.84rem;
  color: var(--fg2);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

form input[type="text"],
form input[type="number"],
form input[type="url"],
form input[type="email"],
form input[type="password"],
form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}

form input:focus,
form textarea:focus { border-color: var(--accent); }

form input[type="submit"],
form button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

form input[type="submit"]:hover,
form button[type="submit"]:hover { background: var(--accent2); }

.form-errors {
  list-style: none;
  background: rgba(224,85,85,0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #ff9090;
  font-size: 0.875rem;
}

/* ── 認証ページ ─────────────────────────────── */
.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}

.auth-card__icon {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.auth-card__title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.75rem;
}

.auth-score-banner {
  background: rgba(245,200,66,0.1);
  border: 1px solid rgba(245,200,66,0.4);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: #f5d87a;
  line-height: 1.6;
  text-align: center;
}

.auth-card__footer {
  text-align: center;
  font-size: 0.88rem;
  color: var(--fg2);
  margin-top: 1.25rem;
}

/* ── misc ───────────────────────────────────── */
.empty-msg {
  color: var(--fg2);
  font-size: 0.9rem;
  padding: 1rem 0;
}

.back-link {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

thead tr { background: var(--bg3); }

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th { color: var(--fg2); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }
td a { color: var(--accent2); }

td form { display: inline; margin: 0; }
td form div { margin: 0; display: inline; }
td button {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 4px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: background 0.2s;
}
td button:hover { background: var(--danger); color: #fff; }

a.btn, .btn-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}
a.btn:hover { background: var(--accent2); text-decoration: none; color: #fff; }

/* ── レスポンシブ ───────────────────────────── */
@media (max-width: 768px) {
  /* ナビ: 縦積み、小さく */
  header nav {
    height: auto;
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    gap: 0.4rem;
  }
  .nav-links {
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
  }
  .nav-link, .nav-user { font-size: 0.8rem; padding: 0.25rem 0.6rem; }
  .nav-btn, .nav-btn-ghost { font-size: 0.8rem; padding: 0.25rem 0.7rem; }

  /* ヒーロー */
  .hero { padding: 2rem 1.25rem; }
  .hero-inner { flex-direction: column; text-align: center; gap: 1.25rem; }
  .hero-name { font-size: 1.8rem; }
  .hero-bio { font-size: 0.9rem; }
  .hero-socials { justify-content: center; }
  .avatar--xl { width: 88px; height: 88px; font-size: 2rem; }
  .hero-icon   { width: 88px; height: 88px; }

  /* レイアウト */
  .game-sections { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: 1fr; }
  .game-frame iframe { width: 100%; height: auto; }
  .review-item__date { margin-left: 0; width: 100%; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; }
  .profile-content { grid-template-columns: 1fr; }
  .user-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ── タグ ───────────────────────────────────── */
.tag-chip {
  display: inline-block;
  background: var(--bg3);
  color: var(--fg2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  text-decoration: none;
}
a.tag-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 1rem; }

.tag-chip--upcoming    { background: #374151; color: #d1d5db; border-color: #4b5563; }
.tag-chip--active      { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
.tag-chip--calculating { background: #78350f; color: #fcd34d; border-color: #92400e; }
.tag-chip--finished    { background: #1e1b4b; color: #a5b4fc; border-color: #312e81; }

/* ── アバター共通クラス ─────────────────────── */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #fff;
  box-shadow: 0 0 16px rgba(124,90,247,0.35);
  user-select: none;
}
.avatar--xl { width: 110px; height: 110px; font-size: 2.5rem; }
.avatar--lg { width: 64px;  height: 64px;  font-size: 1.6rem; }
.avatar--md { width: 48px;  height: 48px;  font-size: 1.2rem; }
.avatar--sm { width: 36px;  height: 36px;  font-size: 0.9rem; }

/* ── プロフィール ───────────────────────────── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.profile-header--slim { padding: 1rem 0; font-size: 0.9rem; }
/* .avatar--lg で代替 */
.profile-header__avatar { width: 4rem; height: 4rem; font-size: 1.6rem; }
.profile-header__name { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.5rem; }
.profile-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.profile-stats__item { text-align: center; }
.profile-stats__value { display: block; font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.profile-stats__label { font-size: 0.75rem; color: var(--fg2); }
.profile-content { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 768px) { .profile-content { grid-template-columns: 1fr; } }

/* ── ユーザーグリッド ──────────────────────── */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  list-style: none; padding: 0; margin: 0;
}
.user-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.user-card__link { text-decoration: none; display: block; }
.user-card__avatar { margin: 0 auto 0.5rem; } /* サイズは .avatar--md で指定 */
.user-card__name { font-weight: 600; color: var(--fg); margin-bottom: 0.25rem; }
.user-card__stats { font-size: 0.75rem; color: var(--fg2); display: flex; gap: 0.5rem; justify-content: center; }

/* ── フォーム共通 ──────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; color: var(--fg2); margin-bottom: 0.3rem; }
.form-input {
  width: 100%; padding: 0.5rem 0.75rem;
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg); font-size: 0.95rem;
}
.form-input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.form-errors { background: rgba(220,50,50,0.1); border: 1px solid rgba(220,50,50,0.4);
  border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1rem; }
.form-errors ul { margin: 0; padding-left: 1.25rem; font-size: 0.9rem; color: #e87; }

/* ── スコア一覧 ────────────────────────────── */
.score-list { list-style: none; padding: 0; margin: 0; }
.score-list__item { display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.score-list__value { font-weight: 700; color: var(--accent); }

/* ── スコア一言 ────────────────────────────── */
.rank-item { flex-wrap: wrap; row-gap: 0.1rem; }
.rank-comment {
  width: 100%;
  font-size: 0.8rem;
  color: var(--fg2);
  font-style: italic;
  padding-left: 2.2rem;
}

/* ── リアクションバー ──────────────────────── */
.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.8rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--fg2);
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.reaction-btn:hover { background: var(--bg2); color: var(--fg); border-color: var(--fg2); }
.reaction-btn--active {
  background: rgba(124,90,247,0.18);
  border-color: var(--accent);
  color: var(--accent2);
}
.reaction-btn--readonly { cursor: default; opacity: 0.6; }
.reaction-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent2);
  min-width: 1rem;
  text-align: left;
}

/* ── レビュー一覧（プロフィール用） ────────── */
.review-list__item { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.review-list__game { font-weight: 600; margin-bottom: 0.2rem; }
.review-list__rating { color: var(--accent); font-size: 0.9rem; }
.review-list__body { font-size: 0.85rem; color: var(--fg2); margin: 0.2rem 0 0; }

/* ═══════════════════════════════════════════════════════
   週間チャレンジ
═══════════════════════════════════════════════════════ */
.challenge-banner {
  background: linear-gradient(135deg, #2a1a6e 0%, #1a2a6e 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.challenge-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2em 0.7em;
  border-radius: 20px;
  white-space: nowrap;
}
.challenge-ends { font-size: 0.82rem; color: var(--fg2); }
.challenge-desc { width: 100%; font-size: 0.84rem; color: var(--fg2); margin-top: 0.25rem; }
.challenge-tab-note {
  font-size: 0.8rem;
  color: var(--fg2);
  background: var(--bg3);
  border-left: 3px solid var(--accent);
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 0 4px 4px 0;
}

/* チャレンジランキングタブ */
.rank-tab--challenge { color: #ffd700 !important; }
.rank-tab--challenge.rank-tab--active { border-color: #ffd700; background: rgba(255,215,0,0.1); }

/* チャレンジセクション（トップページ） */
.challenge-section { margin-bottom: 2rem; }
.challenge-card {
  background: linear-gradient(135deg, var(--bg2) 0%, #1e1a3a 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.challenge-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.challenge-card__period { font-size: 0.82rem; color: var(--fg2); }
.challenge-card__title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.challenge-card__desc { color: var(--fg2); font-size: 0.88rem; margin-bottom: 1rem; }
.challenge-card__footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.challenge-card__game { font-size: 0.82rem; color: var(--fg2); }

/* ゲームカードのチャレンジ装飾 */
.game-card--challenge { border-color: var(--accent) !important; }
.game-card__challenge-tag {
  display: inline-block;
  font-size: 0.72rem;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 0.15em 0.6em;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.status-badge { font-size: 0.78rem; padding: 0.2em 0.6em; border-radius: 12px; }
/* ═══════════════════════════════════════════════════════
   ランダムプレイ / ゲーム一覧ヘッダー
═══════════════════════════════════════════════════════ */
.games-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.games-section__header .section-title { margin-bottom: 0; }

.random-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.5rem 1.1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.random-play-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.04);
}

/* ═══════════════════════════════════════════════════════
   アクティビティフィード
═══════════════════════════════════════════════════════ */
.activity-feed { margin-top: 3rem; }

.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.activity-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  transition: background 0.15s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg3); }

.activity-icon { flex-shrink: 0; font-size: 1rem; }
.activity-body { flex: 1; color: var(--fg); line-height: 1.5; }
.activity-link { color: var(--accent2); text-decoration: none; font-weight: 600; }
.activity-link:hover { text-decoration: underline; }
.activity-score { color: var(--pink); }
.activity-stars { color: #ffd700; letter-spacing: -0.05em; }
.activity-comment { color: var(--fg2); font-size: 0.82rem; display: block; margin-top: 0.15rem; }
.activity-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--fg2);
  white-space: nowrap;
}

/* ── モバイル対応（追加分） ── */
@media (max-width: 600px) {
  .challenge-card__footer { flex-direction: column; align-items: flex-start; }
  .challenge-banner { flex-direction: column; align-items: flex-start; }
  .games-section__header { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════
   ランキングページ
═══════════════════════════════════════════════════════ */
.ranking-page-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.ranking-page-header h1 { margin: 0; }
.season-badge { display: flex; align-items: center; gap: 0.5rem; }
.season-name { font-weight: 700; font-size: 0.95rem; }
.season-days { font-size: 0.82rem; color: var(--fg2); }

.ranking-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.ranking-table th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.8rem; color: var(--fg2); }
.ranking-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.ranking-table__row--me td { background: rgba(124,90,247,0.08); }
.ranking-table__rank { font-weight: 700; color: var(--fg2); width: 3rem; }
.ranking-table__power { font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking-table__games { color: var(--fg2); font-size: 0.82rem; }

.tier-badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.my-season-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.my-season-card__tier { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.06em; }
.my-season-card__info { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; color: var(--fg2); }
.my-season-card__rank { font-weight: 700; color: var(--fg); }
.my-season-card__power { font-weight: 700; color: var(--accent); }
.my-season-card__games-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.my-season-card__games-list li { display: flex; gap: 0.75rem; align-items: center; }
.rank-sub { color: var(--fg2); font-size: 0.8rem; }

.my-game-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.featured-badge {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  color: #FFD700;
  margin-bottom: 0.75rem;
}

.simulated-rank-banner {
  background: var(--bg2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.simulated-rank-banner__score { font-size: 0.9rem; color: var(--fg2); }
.simulated-rank-banner__rank { font-size: 1.15rem; font-weight: 700; }
.simulated-rank-banner__cta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }

.season-profile-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.season-profile-card__header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.season-profile-card__season { font-size: 0.8rem; color: var(--fg2); }
.season-profile-card__stats { display: flex; gap: 1rem; font-size: 0.88rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.season-profile-card__games { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.season-profile-card__games li { display: flex; gap: 0.75rem; align-items: center; }

/* ── アカウント設定 ──────────────────────────── */
.settings-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 560px;
  margin: 2rem auto;
}
.settings-card__title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.settings-card__back { margin-top: 1.5rem; font-size: 0.88rem; }

.settings-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1.25rem;
  align-items: center;
}
.settings-list dt {
  color: var(--fg2);
  font-size: 0.88rem;
  white-space: nowrap;
  padding-top: 0.2rem;
}
.settings-list dd {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.settings-edit-link {
  font-size: 0.82rem;
  color: var(--accent2);
  white-space: nowrap;
}

/* ── 秘密の質問表示（パスワードリセット画面） ── */
.security-question-display {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.security-question-display__label {
  font-size: 0.78rem;
  color: var(--fg2);
  margin-bottom: 0.25rem;
}
.security-question-display__text {
  font-size: 0.95rem;
  font-weight: 600;
}

/* ── 認証フォーム補助 ───────────────────────── */
.form-section-label {
  font-size: 0.8rem;
  color: var(--fg2);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.auth-card__desc { font-size: 0.9rem; color: var(--fg2); margin-bottom: 1rem; }
.auth-card__sub-link { font-size: 0.82rem; color: var(--fg2); }

/* ── カレンダー（フルページ） ──────────────────────── */
.cal-page {
  max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem;
  display: grid; grid-template-columns: 1fr; gap: 1.25rem;
}
.cal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.cal-header__nav {
  display: flex; align-items: center; gap: 1rem;
}
.cal-header__title {
  font-size: 1.3rem; font-weight: 700; color: var(--fg); margin: 0;
}
.cal-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg2); color: var(--fg2); border: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.cal-nav-btn:hover { background: var(--bg3); color: var(--fg); text-decoration: none; }
.cal-today-btn {
  font-size: 0.82rem; padding: 4px 12px; border-radius: 6px;
  background: var(--bg2); color: var(--fg2); border: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.cal-today-btn:hover, .cal-today-btn--active {
  background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none;
}

.cal-grid-wrap { overflow-x: auto; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; min-width: 480px;
}
.cal-dow {
  padding: 6px 4px; text-align: center; font-size: 0.75rem; font-weight: 600;
  color: var(--fg2); background: var(--bg2); border-bottom: 1px solid var(--border);
}
.cal-dow--sun { color: #f07fa0; }
.cal-dow--sat { color: #7ec8f7; }
.cal-cell {
  min-height: 90px; padding: 6px 4px; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); display: flex; flex-direction: column;
  gap: 3px; cursor: pointer; text-decoration: none; color: var(--fg);
  transition: background .15s;
}
.cal-cell:hover { background: var(--bg3); text-decoration: none; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell--outside .cal-cell__day { color: var(--fg2); opacity: .4; }
.cal-cell--outside { background: rgba(0,0,0,.15); }
.cal-cell--today .cal-cell__day {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.cal-cell--selected { background: rgba(124,90,247,.12) !important; }
.cal-cell--sun .cal-cell__day { color: #f07fa0; }
.cal-cell--sat .cal-cell__day { color: #7ec8f7; }
.cal-cell--today.cal-cell--sun .cal-cell__day,
.cal-cell--today.cal-cell--sat .cal-cell__day { color: #fff; }
.cal-cell__day { font-size: 0.82rem; font-weight: 600; line-height: 1; }
.cal-cell__events { display: flex; flex-direction: column; gap: 2px; }
.cal-event-chip {
  font-size: 0.68rem; padding: 1px 4px; border-radius: 3px;
  color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-event-more { font-size: 0.65rem; color: var(--fg2); padding-left: 4px; }

.cal-detail {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem;
}
.cal-detail__date {
  font-size: 1rem; color: var(--fg); font-weight: 600; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}
.cal-detail__empty { color: var(--fg2); font-size: .9rem; }
.cal-detail__list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.cal-detail__item {
  background: var(--bg3); border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; padding: .75rem 1rem;
}
.cal-detail__item-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.cal-detail__type-badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cal-detail__game-link { font-size: .78rem; color: var(--accent2); }
.cal-detail__title { font-size: 1rem; font-weight: 600; color: var(--fg); margin-bottom: .2rem; }
.cal-detail__time { font-size: .78rem; color: var(--fg2); margin-bottom: .25rem; display: flex; align-items: center; gap: .3rem; }
.cal-detail__desc { font-size: .85rem; color: var(--fg2); margin-top: .25rem; }

/* ── ミニカレンダー（トップページ） ────────────────── */
.mini-cal-section { margin-top: 1.5rem; }
.mini-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.mini-cal-more { font-size: .82rem; color: var(--accent2); }
.mini-cal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
}
.mini-cal__title { font-size: .85rem; font-weight: 600; color: var(--fg2); margin-bottom: .5rem; text-align: center; }
.mini-cal__grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: .75rem;
}
.mini-cal__dow {
  text-align: center; font-size: .65rem; font-weight: 600; color: var(--fg2); padding: 2px 0;
}
.mini-cal__dow.sun { color: #f07fa0; }
.mini-cal__dow.sat { color: #7ec8f7; }
.mini-cal__day {
  text-align: center; font-size: .72rem; padding: 3px 0; border-radius: 4px;
  color: var(--fg2); text-decoration: none; display: block; line-height: 1.6;
  transition: background .12s;
}
.mini-cal__day:hover { background: var(--bg3); color: var(--fg); text-decoration: none; }
.mini-cal__day.outside { opacity: .3; }
.mini-cal__day.today { background: var(--accent) !important; color: #fff !important; border-radius: 50%; }
.mini-cal__day.has-event { color: var(--fg); font-weight: 700; }
.mini-cal__day.sun { color: #f07fa0; }
.mini-cal__day.sat { color: #7ec8f7; }
.mini-cal__events { border-top: 1px solid var(--border); padding-top: .6rem; display: flex; flex-direction: column; gap: .35rem; }
.mini-cal__event-item { display: flex; align-items: center; gap: .4rem; font-size: .78rem; }
.mini-cal__event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mini-cal__event-date { color: var(--fg2); flex-shrink: 0; font-size: .72rem; }
.mini-cal__event-title { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-cal__empty { font-size: .8rem; color: var(--fg2); padding-top: .5rem; }

/* ── トップページ 2カラムウィジェット ────────────── */
.top-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1.2rem;
}
@media (max-width: 768px) {
  .top-widgets { grid-template-columns: 1fr; }
}
.top-widgets__left,
.top-widgets__right { min-width: 0; }

.ranking-widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  height: 100%;
}
.ranking-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.ranking-widget__header h3 { margin: 0; font-size: .95rem; color: var(--fg); }
.ranking-widget__more { font-size: .78rem; color: var(--accent2); }
.ranking-widget__more:hover { color: #fff; }

.ranking-widget__list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.ranking-widget__item {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
  padding: .35rem .5rem;
  border-radius: 6px;
  background: var(--bg3);
}
.ranking-widget__rank { color: var(--fg2); font-size: .75rem; min-width: 1.8rem; }
.ranking-widget__tier { font-size: .65rem; font-weight: 700; min-width: 4.5rem; }
.ranking-widget__user { color: var(--accent2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-widget__user:hover { color: #fff; text-decoration: none; }
.ranking-widget__power { color: var(--fg2); font-size: .78rem; white-space: nowrap; }

/* ── 管理画面 ──────────────────────────────── */
.admin-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; max-width: 1100px; margin: 2rem auto 1.5rem; padding: 0 1.2rem; }
.admin-header h1 { margin: 0; font-size: 1.4rem; }
.admin-nav { display: flex; align-items: center; gap: .75rem; }
.admin-table { width: 100%; max-width: 1100px; margin: 0 auto; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: .78rem; color: var(--fg2); padding: .5rem 1.2rem; border-bottom: 1px solid var(--border); }
.admin-table td { padding: .65rem 1.2rem; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg2); }
.admin-muted { color: var(--fg2); font-size: .82rem; }
.admin-actions { display: flex; align-items: center; gap: .5rem; }
.admin-badge { font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 4px; background: var(--bg3); color: var(--fg2); }
.admin-badge--active    { background: rgba(76,175,128,.2); color: var(--success); }
.admin-badge--draft,
.admin-badge--upcoming  { background: rgba(124,90,247,.15); color: var(--accent2); }
.admin-badge--finished  { background: var(--bg3); color: var(--fg2); }
.admin-danger { color: var(--danger) !important; }
.admin-form-card { max-width: 640px; margin: 0 auto 3rem; padding: 0 1.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Cruz Personal Hub ─────────────────── */
.cruz-wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }

.cruz-header {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem;
}
.cruz-title { font-size: 1.6rem; font-weight: 800; margin: 0; }
.cruz-date { color: var(--fg2); font-size: .9rem; }

/* ── Google Calendar section ── */
.cruz-gcal-section {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.cruz-gcal-frame {
  display: block;
  width: 100%;
  height: 640px;
  border: none;
  background: #fff;
}

.cruz-gcal-setup {
  padding: 2rem 2.5rem;
  color: var(--fg2);
}
.cruz-gcal-setup__title {
  font-size: 1.1rem; font-weight: 700; color: var(--fg);
  margin-bottom: 1.2rem;
}
.cruz-gcal-setup__steps {
  padding-left: 1.4rem;
  display: flex; flex-direction: column; gap: .75rem;
  font-size: .9rem; line-height: 1.7;
}
.cruz-gcal-setup__steps code {
  background: var(--bg3); border: 1px solid var(--border);
  padding: .1rem .45rem; border-radius: 4px;
  font-size: .82rem; color: var(--accent2);
}

.cruz-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .cruz-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cruz-grid { grid-template-columns: 1fr; } }

.cruz-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.cruz-panel__head {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 1rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.cruz-panel__icon { font-size: 1.1rem; }
.cruz-panel__title { font-size: 1rem; font-weight: 700; color: var(--fg); margin: 0; flex: 1; }
.cruz-panel__more { font-size: .8rem; color: var(--accent2); white-space: nowrap; }
.cruz-todo-count { font-size: .75rem; color: var(--fg2); background: var(--bg3); padding: .15rem .5rem; border-radius: 99px; }

/* ── Todo list ── */
.cruz-todo-list { list-style: none; display: flex; flex-direction: column; gap: .3rem; margin-bottom: .75rem; }

.cruz-todo-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .5rem; border-radius: 6px;
  background: var(--bg3); transition: background .15s;
}
.cruz-todo-item:hover { background: #2a2a45; }
.cruz-todo-item--done { opacity: .5; }

.cruz-todo-toggle { display: contents; }
.cruz-todo-check {
  background: none; border: 1.5px solid var(--fg2); color: var(--fg2);
  width: 22px; height: 22px; min-width: 22px; border-radius: 5px;
  cursor: pointer; font-size: .7rem; display: flex; align-items: center; justify-content: center;
  padding: 0; transition: all .15s;
}
.cruz-todo-check--done { background: var(--success); border-color: var(--success); color: #fff; }
.cruz-todo-check:hover { border-color: var(--accent2); }

.cruz-todo-title { flex: 1; font-size: .9rem; }
.cruz-todo-item--done .cruz-todo-title { text-decoration: line-through; color: var(--fg2); }

.cruz-todo-due { font-size: .72rem; color: var(--fg2); background: var(--bg); padding: .1rem .4rem; border-radius: 4px; white-space: nowrap; }
.cruz-todo-due--overdue { color: var(--danger); background: rgba(224,85,85,.12); }

.cruz-todo-del {
  background: none; border: none; color: var(--fg2); cursor: pointer;
  padding: .1rem .3rem; border-radius: 4px; font-size: .85rem; line-height: 1;
  transition: color .15s;
}
.cruz-todo-del:hover { color: var(--danger); }

.cruz-todo-form { margin-top: .5rem; }
.cruz-todo-input-row { display: flex; gap: .4rem; }
.cruz-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border); color: var(--fg);
  padding: .45rem .7rem; border-radius: 6px; font-size: .9rem; outline: none;
}
.cruz-input:focus { border-color: var(--accent2); }
.cruz-input--date { flex: 0 0 auto; width: 110px; color-scheme: dark; }
.cruz-textarea { width: 100%; resize: vertical; min-height: 200px; }

.cruz-todo-empty { color: var(--fg2); font-size: .85rem; padding: .5rem 0; text-align: center; }

.cruz-done-details { margin-top: .75rem; }
.cruz-done-summary {
  cursor: pointer; font-size: .8rem; color: var(--fg2);
  padding: .3rem 0; list-style: none; user-select: none;
}
.cruz-done-summary:hover { color: var(--fg); }
.cruz-todo-list--done { margin-top: .5rem; }

/* ── Diary list ── */
.cruz-diary-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }

.cruz-diary-item {
  padding: .75rem; background: var(--bg3); border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.cruz-diary-item__meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.cruz-diary-item__date { font-size: .78rem; color: var(--fg2); }
.cruz-diary-badge {
  font-size: .65rem; font-weight: 700; padding: .1rem .45rem;
  border-radius: 4px; background: rgba(124,90,247,.2); color: var(--accent2);
}
.cruz-diary-badge--yesterday { background: rgba(240,127,160,.15); color: var(--pink); }

.cruz-diary-item__title { font-size: .9rem; font-weight: 600; margin-bottom: .2rem; }
.cruz-diary-item__body { font-size: .82rem; color: var(--fg2); margin-bottom: .5rem; line-height: 1.5; }
.cruz-diary-item__actions { display: flex; gap: .4rem; align-items: center; }

.cruz-diary-empty { color: var(--fg2); font-size: .85rem; text-align: center; padding: 1rem 0; }

/* ── Daily routine timeline ── */
.cruz-panel--timeline { grid-column: span 2; }
@media (max-width: 900px) { .cruz-panel--timeline { grid-column: span 1; } }

.cruz-today-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 700px) { .cruz-today-wrap { grid-template-columns: 1fr; } }

.cruz-today-label {
  font-size: .78rem;
  color: var(--fg2);
  font-weight: 600;
  margin-bottom: .5rem;
  letter-spacing: .03em;
}

.cruz-today-gcal { display: flex; flex-direction: column; }

.cruz-gcal-readonly {
  position: relative;
}
.cruz-gcal-readonly::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: default;
}

.cruz-gcal-day-frame {
  display: block;
  width: 100%;
  height: 520px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.cruz-today-routine { display: flex; flex-direction: column; }

.cruz-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: .75rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}

.cruz-tl-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: start;
  min-height: 32px;
}

.cruz-tl-hour {
  font-size: .72rem;
  color: var(--fg2);
  padding-top: 6px;
  text-align: right;
  padding-right: .5rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.cruz-tl-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.cruz-tl-block {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .6rem;
  border-left: 3px solid;
  border-radius: 0 6px 6px 0;
  margin-left: 4px;
  min-height: 32px;
}

.cruz-tl-block--gcal {
  border-left-color: #4285f4;
  background: rgba(66,133,244,.1);
}

.cruz-tl-gcal-dot { font-size: .75rem; }

.cruz-tl-label {
  font-size: .85rem;
  font-weight: 600;
  flex: 1;
  color: var(--fg);
}

.cruz-tl-dur {
  font-size: .68rem;
  color: var(--fg2);
  white-space: nowrap;
}

.cruz-tl-del {
  background: none;
  border: none;
  color: var(--fg2);
  cursor: pointer;
  padding: 0 .2rem;
  font-size: .8rem;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s, color .15s;
}
.cruz-tl-block:hover .cruz-tl-del { opacity: 1; }
.cruz-tl-del:hover { color: var(--danger); }

.cruz-tl-empty {
  margin-left: 4px;
  border-radius: 0 4px 4px 0;
  min-height: 32px;
}
.cruz-tl-row:hover .cruz-tl-empty {
  background: var(--bg3);
}

.cruz-tl-form {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.cruz-tl-form-row {
  display: flex;
  gap: .4rem;
  align-items: center;
}
.cruz-input--sm { flex: 0 0 auto; width: auto; font-size: .82rem; padding: .35rem .5rem; }

.cruz-tl-color {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  background: var(--bg3);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Memo pad ── */
.cruz-memo-new-form { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.cruz-memo-textarea { min-height: 70px; font-size: .88rem; }
.cruz-memo-add-btn { align-self: flex-end; font-size: .82rem; padding: .3rem .8rem; }

.cruz-memo-list { display: flex; flex-direction: column; gap: .6rem; }

.cruz-memo-item {
  background: var(--bg3); border-radius: 8px;
  border-left: 3px solid var(--pink);
  padding: .7rem .8rem;
}
.cruz-memo-body { font-size: .88rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; margin-bottom: .5rem; }
.cruz-memo-body p { margin: 0; }

.cruz-memo-footer { display: flex; align-items: center; gap: .4rem; }
.cruz-memo-ts { font-size: .7rem; color: var(--fg2); flex: 1; }

.cruz-memo-edit-wrap { display: flex; flex-direction: column; gap: .4rem; }
.cruz-memo-edit-actions { display: flex; gap: .4rem; }

/* ── Cruz form pages ── */
.cruz-form-wrap { max-width: 720px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.cruz-form-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.cruz-form-header h1 { font-size: 1.4rem; margin: 0; flex: 1; }
.cruz-back-link { font-size: .85rem; color: var(--fg2); white-space: nowrap; }
.cruz-back-link:hover { color: var(--fg); }

.cruz-diary-show-meta { flex: 1; }
.cruz-diary-show-date { font-size: .85rem; color: var(--fg2); display: block; margin-top: .2rem; }
.cruz-diary-show-actions { display: flex; gap: .5rem; align-items: center; }

.cruz-diary-body {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 2rem;
  font-size: 1rem; line-height: 2; white-space: pre-wrap;
}
.cruz-diary-form { display: flex; flex-direction: column; gap: 1rem; }

.cruz-field { display: flex; flex-direction: column; gap: .4rem; }
.cruz-field label { font-size: .85rem; color: var(--fg2); font-weight: 500; }
.cruz-field .cruz-input { width: 100%; flex: unset; }

.cruz-form-actions { display: flex; gap: .75rem; align-items: center; margin-top: .5rem; }

/* ── Shared small buttons ── */
.btn-sm {
  font-size: .78rem; padding: .25rem .7rem; border-radius: 6px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--fg2);
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: all .15s;
}
.btn-sm:hover { background: var(--bg); color: var(--fg); border-color: var(--accent2); text-decoration: none; }
.btn-accent {
  background: var(--accent); border: none; color: #fff;
  padding: .45rem 1rem; border-radius: 6px; cursor: pointer; font-size: .9rem; font-weight: 600;
  transition: background .15s;
}
.btn-accent:hover { background: var(--accent2); }
.btn-sm.btn-accent { padding: .25rem .7rem; font-size: .78rem; font-weight: 600; }
.btn-danger { color: var(--danger) !important; border-color: var(--danger) !important; }
.btn-danger:hover { background: rgba(224,85,85,.15) !important; }
