/* ============================================
   TAISEN - Design System v2
   Modern Japanese Matching App Style
   ============================================ */

:root {
  /* Primary Navy Palette */
  --navy-900: #0a1628;
  --navy-800: #0f2240;
  --navy-700: #142d52;
  --navy-600: #1a3a6e;
  --navy-500: #1e4d8a;
  --navy-400: #2a6cb5;
  --navy-300: #4a90d9;
  --navy-200: #7eb3e8;
  --navy-100: #b3d4f5;
  --navy-50: #eef4fd;

  /* Brand Gradients */
  --grad-brand: linear-gradient(135deg, #0f2240 0%, #1e4d8a 100%);
  --grad-brand-bright: linear-gradient(135deg, #1a3a6e 0%, #3b82f6 100%);
  --grad-accent: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --grad-green: linear-gradient(135deg, #059669 0%, #10b981 100%);

  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-cyan: #06b6d4;
  --accent-orange: #f97316;

  /* Neutral */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e8eef5;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;

  /* Semantic */
  --bg-primary: #ffffff;
  --bg-surface: #f4f7fc;
  --bg-card: #ffffff;
  --text-primary: #0a1628;
  --text-secondary: #4a5568;
  --text-muted: #94a3b8;
  --border-color: #e8eef5;
  --border-light: #f0f4fa;
  --shadow-xs: 0 1px 4px rgba(10, 22, 40, 0.06);
  --shadow-sm: 0 2px 12px rgba(10, 22, 40, 0.08);
  --shadow-md: 0 6px 24px rgba(10, 22, 40, 0.10);
  --shadow-lg: 0 12px 40px rgba(10, 22, 40, 0.13);
  --shadow-brand: 0 6px 24px rgba(20, 45, 82, 0.28);

  /* Spacing */
  --header-height: 56px;
  --bottom-nav-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
    'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  background: #dce8f8;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ============================================
   App Shell
   ============================================ */
.app-container {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--bg-surface);
  box-shadow: 0 0 80px rgba(10, 22, 40, 0.14);
}

/* ============================================
   Splash / Login Screen
   ============================================ */
.screen-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  overflow: hidden;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px 28px 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: logoFade 0.5s ease-out both;
}

.splash-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 10px;
  mix-blend-mode: multiply;
}

.splash-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 0;
}

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

/* Login Form */
.login-form {
  width: 100%;
  margin-top: 24px;
}

.login-field {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.login-field::placeholder { color: var(--gray-400); }
.login-field:focus {
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(42, 108, 181, 0.1);
}

.login-error {
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #f87171;
  font-size: .85rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  display: none;
}
.login-error.show {
  display: block;
}

.btn-login {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-lg);
  background: var(--grad-brand);
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-top: 6px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-brand);
}

.btn-login:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(20, 45, 82, 0.2);
}

.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.login-links a {
  font-size: 0.8rem;
  color: var(--navy-400);
  transition: color 0.2s;
}

.login-links a:hover { color: var(--navy-700); }

/* リンクが1つだけのときは中央寄せ（space-between だと左端に寄るため） */
.login-links-single { justify-content: center; }

/* 半年間無料キャンペーンへの導線（通常ログイン導線とは別立て） */
.login-campaign-link {
  display: block;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px dashed rgba(16, 185, 129, 0.45);
  color: #0f766e;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  transition: background 0.2s;
}

.login-campaign-link:hover { background: rgba(16, 185, 129, 0.18); }

.splash-hidden { display: none !important; }

/* ============================================
   Header
   ============================================ */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--white);
  color: var(--navy-900);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 16px rgba(10, 22, 40, 0.05);
}

.header-back {
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--navy-700);
  background: transparent;
  border: none;
  margin-right: 6px;
  margin-left: -6px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}
.header-back:hover { background: var(--gray-100); }
.header-back:active { background: var(--gray-200); transform: scale(0.94); }
.header-back svg { width: 22px; height: 22px; }

.header-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-right: 10px;
  border-radius: 6px;
  cursor: pointer;
}

.header-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  flex: 1;
  color: var(--navy-800);
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--bottom-nav-height);
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1px solid var(--border-light);
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 24px rgba(10, 22, 40, 0.08);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--gray-400);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  position: relative;
  padding: 6px 0 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s;
  stroke-width: 2;
}

.nav-item:not(.nav-center):hover {
  color: var(--navy-500);
}

.nav-item.active {
  color: var(--navy-700);
  font-weight: 800;
}

.nav-item.active svg {
  transform: scale(1.08);
  stroke-width: 2.4;
}

/* Active indicator bar */
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--grad-brand-bright);
  border-radius: 0 0 4px 4px;
}

.nav-item.nav-center::after {
  display: none;
}

/* Notification badge on nav item */
.nav-badge-wrap {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -14px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  background: var(--accent-red);
  border-radius: 100px;
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}

/* === Center FAB === */
.nav-item.nav-center {
  position: relative;
}

.nav-center-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad-brand-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  margin-top: -22px;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4), 0 2px 6px rgba(20, 45, 82, 0.2);
  transition: transform 0.2s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1)), box-shadow 0.2s;
  border: 3px solid var(--white);
}

.nav-item.nav-center:hover .nav-center-btn {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.5), 0 4px 10px rgba(20, 45, 82, 0.25);
}

.nav-center-btn:active {
  transform: scale(0.94);
  box-shadow: 0 3px 12px rgba(20, 45, 82, 0.3);
}

.nav-center-btn svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.8;
}

.nav-item.nav-center > span {
  margin-top: 3px;
  color: var(--navy-600);
  font-weight: 800;
}

/* ============================================
   Screen Container
   ============================================ */
.screens-wrapper {
  padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
}

.screen {
  display: none;
  animation: screenIn 0.3s ease-out;
}

.screen.active { display: block; }

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

/* ============================================
   Screen: Dashboard
   ============================================ */

/* Home Hero */
.home-hero {
  background: var(--white);
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--border-light);
}

.home-hero-inner {}

.home-hero-greeting {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  font-weight: 500;
}

.home-hero-team {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--navy-800);
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}

.home-hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 10px 0;
  border: 1px solid var(--border-light);
}

.home-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.home-hero-stat-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-800);
  line-height: 1;
}

.home-hero-stat-label {
  font-size: 0.63rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.home-hero-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
}

/* Alert Banner */
.alert-banner {
  margin: 14px 16px 0;
  padding: 13px 16px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border-radius: var(--radius-lg);
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--accent-orange);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #9a3412;
  box-shadow: 0 2px 12px rgba(249,115,22,0.1);
}

.alert-banner svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent-orange); }

/* Section */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 16px 10px;
}

.section-title {
  font-size: 0.93rem;
  font-weight: 800;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--gray-300);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-more {
  font-size: 0.8rem;
  color: var(--accent-blue);
  font-weight: 700;
}

/* Match Card Carousel */
.match-carousel-wrap {
  position: relative;
}

.carousel-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(calc(-50% - 12px));
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, box-shadow 0.2s;
  padding: 0;
}

.carousel-arrow svg {
  width: 18px;
  height: 18px;
  color: var(--navy-800);
}

.carousel-arrow:hover {
  box-shadow: var(--shadow-md);
}

.carousel-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

.carousel-arrow-left { left: 4px; }
.carousel-arrow-right { right: 4px; }

@media (hover: hover) and (pointer: fine) {
  .carousel-arrow {
    display: flex;
  }
}

.match-carousel {
  display: flex;
  gap: 12px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.match-carousel::-webkit-scrollbar { display: none; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 2px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-300, #d1d5db);
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
  background: var(--accent-blue, #2563eb);
  transform: scale(1.3);
}

.match-card {
  flex: 0 0 calc(100vw - 48px);
  max-width: 320px;
  scroll-snap-align: start;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-md);
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.match-card:active { transform: scale(0.98); box-shadow: var(--shadow-sm); }

.match-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.match-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--navy-500);
}

.match-card-status {
  font-size: 0.68rem;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.status-confirmed {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-pending {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.status-recruiting {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.match-card-teams {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.team-emblem {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--navy-100) 0%, var(--navy-50) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--navy-700);
  border: 1.5px solid var(--border-color);
  flex-shrink: 0;
}

.match-vs {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--gray-300);
  letter-spacing: 1px;
}

.match-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.match-info-row svg { width: 14px; height: 14px; color: var(--navy-400); flex-shrink: 0; }

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 12px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.quick-action-btn:active { transform: scale(0.96); box-shadow: var(--shadow-xs); }

.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-icon svg { width: 24px; height: 24px; }

.quick-action-icon.icon-post { background: var(--navy-50); box-shadow: none; }
.quick-action-icon.icon-post svg { color: var(--navy-600); }
.quick-action-icon.icon-search { background: #e0f2fe; box-shadow: none; }
.quick-action-icon.icon-search svg { color: #0284c7; }

.quick-action-label {
  font-size: 0.87rem;
  font-weight: 800;
  color: var(--navy-900);
}


/* AI Insight Banner */
.ai-insight-banner {
  margin: 0 16px 20px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-xl);
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.ai-insight-banner:active { transform: scale(0.98); box-shadow: var(--shadow-xs); }

.ai-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--navy-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.ai-icon svg { width: 20px; height: 20px; color: var(--navy-500); }

.ai-insight-text {
  flex: 1;
}

.ai-insight-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 2px;
}

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

.ai-insight-arrow {
  color: var(--gray-400);
}

/* ============================================
   Screen: Search / Find
   ============================================ */
.search-bar {
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  transition: border-color 0.2s;
}

.search-input-wrap:focus-within {
  border-color: var(--navy-400);
  background: var(--white);
}

.search-input-wrap > svg { width: 18px; height: 18px; color: var(--gray-400); flex-shrink: 0; }

.filter-detail-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--navy-50);
  color: var(--navy-700);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s;
}
.filter-detail-btn:hover { background: var(--navy-100); }
.filter-detail-btn svg { flex-shrink: 0; color: var(--navy-600); }

.search-input-wrap input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.search-input-wrap input::placeholder { color: var(--gray-400); }

/* Filter Chips */
.filter-chips {
  display: flex;
  gap: 8px;
  padding: 10px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--white);
}

.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid var(--border-color);
  background: var(--white);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--grad-brand);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(20,45,82,0.25);
}

.filter-chip:not(.active):active {
  background: var(--gray-100);
}

.filter-chip svg { width: 13px; height: 13px; }

/* Match List */
.match-list {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-list-item {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.match-list-item:active { transform: scale(0.98); box-shadow: var(--shadow-xs); }

.match-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.match-list-team {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-list-emblem {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--navy-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--navy-600);
}

.match-list-teamname {
  font-size: 0.95rem;
  font-weight: 700;
}

.match-list-category {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.league-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--navy-50);
  color: var(--navy-700);
  font-size: 0.6rem;
  font-weight: 700;
  flex-direction: column;
  line-height: 1.1;
  padding: 0 8px;
  border: 1px solid var(--border-color);
}

.league-badge-num { font-size: 0.82rem; font-weight: 800; }

.match-list-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.match-list-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.match-list-details svg { width: 14px; height: 14px; color: var(--navy-400); }

.match-list-tags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.match-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--navy-50);
  color: var(--navy-600);
  font-weight: 600;
}

.match-tag.venue-has { background: #d1fae5; color: #065f46; }
.match-tag.venue-needs { background: #fef3c7; color: #92400e; }

/* ============================================
   Screen: Create Post
   ============================================ */
.form-screen {
  padding: 16px;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  border: none;
  margin-bottom: 14px;
}

.form-card-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--accent-red);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(42, 108, 181, 0.1);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Toggle Switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label { font-size: 0.85rem; color: var(--text-secondary); }

.toggle {
  position: relative;
  width: 50px;
  height: 28px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 14px;
  transition: background 0.3s;
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--navy-600);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.toggle-option-labels {
  display: flex;
  gap: 4px;
  font-size: 0.8rem;
}

.toggle-opt { color: var(--text-muted); transition: color 0.2s; }
.toggle-opt.active { color: var(--navy-700); font-weight: 600; }

/* Buttons */
.btn-row {
  display: flex;
  gap: 10px;
  padding: 0 16px 24px;
}

.btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
}

.btn:active { transform: scale(0.97); }

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.3);
  box-shadow: none;
  pointer-events: none;
}

.btn-primary {
  background: var(--grad-brand);
  color: var(--white);
  box-shadow: var(--shadow-brand);
  border-radius: var(--radius-lg);
}

.btn-primary:active { opacity: 0.9; }

.btn-secondary {
  background: var(--white);
  color: var(--navy-700);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.btn-full {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
}

.btn-full:active { transform: scale(0.97); }

/* ============================================
   Screen: Match Detail
   ============================================ */
.detail-hero {
  background: linear-gradient(135deg, #06101f 0%, #0f2240 50%, #1a3a6e 100%);
  padding: 24px 16px;
  color: var(--white);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.detail-back:active { background: rgba(255, 255, 255, 0.3); }

.detail-back svg { width: 18px; height: 18px; }

/* Settings/sub-screen back button (light background context) */
.settings-sub-header .detail-back {
  color: var(--navy-700);
  background: var(--gray-100);
  border: 1px solid var(--border-color);
  margin-bottom: 0;
}

.settings-sub-header .detail-back:active {
  background: var(--gray-200);
}

.detail-team-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.detail-emblem {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
}

.detail-team-info h2 {
  font-size: 1.3rem;
  font-weight: 800;
}

.detail-team-meta {
  font-size: 0.8rem;
  color: var(--navy-200);
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.detail-league-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}

.detail-body {
  padding: 16px;
}

.detail-info-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: none;
  margin-bottom: 12px;
}

.detail-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}

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

.detail-info-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--navy-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-info-icon svg { width: 18px; height: 18px; color: var(--navy-600); }

.detail-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.detail-info-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.detail-info-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  padding: 16px;
  position: sticky;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  background: var(--bg-primary);
}

/* ========== Own match action panel (recruiting) ========== */
.own-match-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: -16px;          /* counteract .detail-actions padding so toolbar sits flush */
}

.own-match-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.own-match-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #047857;
  background: #d1fae5;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.own-match-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.own-match-link {
  background: none;
  border: none;
  padding: 4px 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
}
.own-match-link:hover { text-decoration: underline; }

.own-match-link-danger { color: #dc2626; }

.own-match-link-sep {
  color: #cbd5e1;
  font-size: 0.85rem;
}

.apps-section { padding: 16px; }

.apps-section-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy-800);
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.apps-section-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  background: var(--brand-blue, #2563eb);
  padding: 2px 8px;
  border-radius: 999px;
}

.app-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.app-card-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.app-card-emblem {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--navy-700);
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.app-card-info { min-width: 0; flex: 1; }

.app-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy-800);
}

.app-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.app-card-message {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--navy-700);
  white-space: pre-wrap;
  word-break: break-word;
}

.app-card-actions {
  display: flex;
  gap: 8px;
}

.app-btn-accept,
.app-btn-reject {
  flex: 1;
  padding: 10px;
  font-size: 0.88rem;
  border-radius: 10px;
}

.apps-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.apps-empty svg { color: #cbd5e1; margin-bottom: 8px; }
.apps-empty-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 4px;
}
.apps-empty-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-apply {
  flex: 1;
  padding: 15px;
  background: var(--grad-brand);
  color: var(--white);
  border-radius: var(--radius-lg);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow-brand);
  transition: opacity 0.15s, transform 0.15s;
  text-align: center;
}

.btn-apply:active { opacity: 0.9; transform: scale(0.98); }

.btn-chat {
  padding: 15px 20px;
  background: var(--white);
  color: var(--navy-700);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1.5px solid var(--border-color);
  transition: background 0.15s;
}

.btn-chat:active { background: var(--gray-100); }

/* ============================================
   Screen: Chat
   ============================================ */
.chat-header {
  background: linear-gradient(135deg, #0f2240, #1a3a6e);
  padding: 12px 16px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(10,22,40,0.2);
}

.chat-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-back svg { width: 20px; height: 20px; }

.chat-header-info { flex: 1; }
.chat-header-title { font-size: 0.9rem; font-weight: 700; }
.chat-header-sub { font-size: 0.75rem; color: var(--navy-200); }

.chat-body {
  padding: 16px;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-msg.received {
  align-self: flex-start;
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.chat-msg.sent {
  align-self: flex-end;
  background: var(--grad-brand);
  color: var(--white);
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(20,45,82,0.2);
}

.chat-msg-time {
  font-size: 0.65rem;
  margin-top: 4px;
  opacity: 0.6;
}

.chat-system-msg {
  align-self: center;
  background: var(--navy-50);
  color: var(--navy-600);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.chat-confirm-btn {
  align-self: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: var(--white);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.chat-confirm-btn:active { transform: scale(0.97); }
.chat-confirm-btn svg { width: 18px; height: 18px; }

.chat-footer {
  position: sticky;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--white);
  border-top: 1px solid var(--border-color);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--gray-50);
  font-size: 0.9rem;
  outline: none;
}

.chat-input:focus { border-color: var(--navy-400); }

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy-700);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-send svg { width: 18px; height: 18px; }

/* ============================================
   Screen: Record (Score Input)
   ============================================ */
/* 公式戦・アプリ外練習試合の追加CTA（記録画面トップ） */
.record-add-external-wrap {
  padding: 16px 16px 0;
}
.record-add-external-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--navy-700);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.record-add-external-btn:hover {
  border-color: var(--brand-primary, #2563eb);
  background: rgba(37, 99, 235, 0.04);
}
.record-add-external-btn svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--brand-primary, #2563eb);
}
.record-add-external-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.record-add-external-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-800);
}
.record-add-external-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.record-empty-hint {
  margin: 16px;
  padding: 18px;
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-align: center;
  line-height: 1.6;
}

.record-header-card {
  margin: 16px;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: none;
}

.record-match-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.record-teams-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy-800);
}

.record-teams-display .vs { color: var(--gray-400); font-size: 0.85rem; }

/* Score Grid */
.score-section {
  padding: 0 16px 16px;
}

.score-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 10px;
  text-align: center;
}

.score-grid-container {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: none;
  margin-bottom: 12px;
}

.score-team-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.score-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 2px solid var(--border-color);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-700);
  transition: all 0.2s;
}

.score-btn:active { transform: scale(0.95); }

.score-btn.selected {
  background: var(--grad-brand);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 2px 10px rgba(20,45,82,0.25);
}

/* MVP Section */
.mvp-section {
  padding: 0 16px 16px;
}

.mvp-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: none;
}

.player-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-chip {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.player-chip:active { transform: scale(0.95); }

.player-chip.selected {
  background: var(--grad-brand);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(20,45,82,0.2);
}

/* Scorer Stepper */
.scorer-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.scorer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.scorer-row:last-child { border-bottom: none; }

.scorer-row.has-goals {
  background: var(--navy-50);
  margin: 0 -16px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

.scorer-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.scorer-pos {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.scorer-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stepper-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy-600);
  background: var(--gray-50);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.stepper-btn:active { background: var(--gray-200); }

.stepper-minus { border-right: 1.5px solid var(--border-color); }
.stepper-plus { border-left: 1.5px solid var(--border-color); }

.stepper-value {
  width: 36px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stepper-value.has-goals {
  color: var(--navy-700);
  background: var(--navy-50);
}

/* Coach Memo */
.memo-section {
  padding: 0 16px 16px;
}

.memo-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: none;
}

.memo-textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  background: var(--gray-50);
}

.memo-textarea:focus { border-color: var(--navy-400); background: var(--white); }

/* Player memo */
.player-memo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-memo-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.player-memo-header {
  background: var(--gray-100);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}

.player-memo-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy-700);
}

.player-memo-textarea {
  width: 100%;
  min-height: 60px;
  border: none;
  padding: 10px 12px;
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  background: var(--white);
  color: var(--text-primary);
  font-family: inherit;
}

.player-memo-textarea:focus { background: var(--navy-50); }

/* ============================================
   Reflections (子供の振り返り)
   ============================================ */
.reflection-intro {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 16px;
}

.reflection-new {
  background: var(--navy-50);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.reflection-new .form-group {
  margin-bottom: 12px;
}

.reflection-new .form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy-700);
  margin-bottom: 6px;
  display: block;
}

.reflection-new .memo-textarea {
  min-height: 80px;
  background: var(--white);
  font-size: 0.88rem;
}

.reflection-new .form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.reflection-new .form-select:focus { border-color: var(--navy-400); }

.reflection-new .btn-primary {
  width: 100%;
  margin-top: 4px;
}

.reflection-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reflection-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--gray-100);
  border-radius: var(--radius-md);
}

.reflection-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--white);
  position: relative;
}

.reflection-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.reflection-player {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.reflection-player-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-700);
}

.reflection-player-pos {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.reflection-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.reflection-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.reflection-del-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.reflection-del-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.reflection-body {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-primary);
  padding: 10px 12px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.reflection-coach {
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.reflection-coach-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy-700);
  margin-bottom: 6px;
}

.reflection-coach-done {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 100px;
  background: #dcfce7;
  color: #166534;
}

.reflection-coach-input {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  background: var(--gray-50, #f8fafc);
  font-family: inherit;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.reflection-coach-input:focus { border-color: var(--navy-400); background: var(--white); }

.reflection-coach-save {
  font-size: 0.78rem;
  padding: 8px 16px;
}

/* ============================================
   Follows (チームフォロー)
   ============================================ */
.follows-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px;
  padding: 20px 12px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.follows-stat {
  text-align: center;
  position: relative;
}

.follows-stat + .follows-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 20%;
  height: 60%;
  width: 1px;
  background: var(--border-color);
}

.follows-stat-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--navy-700);
  line-height: 1.1;
}

.follows-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.follows-tabs {
  display: flex;
  margin: 0 16px 12px;
  border-bottom: 1px solid var(--border-color);
  gap: 4px;
}

.follows-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  font-family: inherit;
  transition: color 0.15s;
}

.follows-tab:hover { color: var(--navy-700); }

.follows-tab.active {
  color: var(--navy-700);
}

.follows-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 12%;
  right: 12%;
  height: 3px;
  background: var(--navy-500);
  border-radius: 2px 2px 0 0;
}

.follows-list {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.follows-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.follow-team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light, #f1f5f9);
}

.follow-team-emblem {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-400), var(--navy-500));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.follow-team-body {
  flex: 1;
  min-width: 0;
}

.follow-team-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy-700);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.follow-team-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.follow-team-tags {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.8;
}

.follow-mutual-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 100px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: var(--white);
  white-space: nowrap;
}

.follow-mutual-badge-soft {
  background: var(--navy-50);
  color: var(--navy-700);
}

.follow-btn {
  border: none;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.02em;
}

.follow-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.follow-btn-idle {
  background: var(--navy-500);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(30, 77, 138, 0.25);
}

.follow-btn-idle:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 77, 138, 0.35);
}

.follow-btn-active {
  background: var(--gray-100);
  color: var(--navy-700);
  border: 1px solid var(--border-color);
}

.follow-btn-active:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

/* Follows screen - discover button */
.follows-discover {
  padding: 0 16px 16px;
}

.follows-discover-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--navy-500), var(--navy-400));
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(30, 77, 138, 0.25);
  transition: transform 0.15s, box-shadow 0.2s;
  font-family: inherit;
}

.follows-discover-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.follows-discover-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 77, 138, 0.35);
}

/* ============================================
   Teams Directory (チームを探す)
   ============================================ */
.teams-search-bar {
  padding: 12px 16px 8px;
  background: var(--white);
}

.teams-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--gray-100);
  border-radius: 100px;
  padding: 0 16px;
  border: 1px solid var(--border-color);
}

.teams-search-input-wrap svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 10px;
}

.teams-search-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 0.9rem;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
}

.teams-search-input-wrap input::placeholder {
  color: var(--text-muted);
}

.teams-filter-chips {
  display: flex;
  gap: 8px;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.teams-filter-chips::-webkit-scrollbar { display: none; }

.teams-filter-chip {
  background: var(--white);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
}

.teams-filter-chip:hover {
  border-color: var(--navy-400);
  color: var(--navy-700);
}

.teams-filter-chip.active {
  background: var(--navy-500);
  color: var(--white);
  border-color: var(--navy-500);
}

.teams-header {
  padding: 4px 16px 10px;
}

.teams-total {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.teams-list {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.team-directory-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light, #f1f5f9);
  transition: box-shadow 0.2s, transform 0.15s;
}

.team-directory-card:hover {
  box-shadow: 0 4px 20px rgba(10, 22, 40, 0.08);
  transform: translateY(-1px);
}

.team-directory-top {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}

.team-directory-emblem {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-400), var(--navy-500));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  border: 3px solid var(--white);
  box-shadow: 0 2px 10px rgba(30, 77, 138, 0.2);
  position: relative;
}

.team-directory-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.team-directory-name {
  font-size: 1rem;
  font-weight: 900;
  color: var(--navy-700);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.team-directory-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.team-directory-tags {
  font-size: 0.7rem;
  color: var(--navy-400);
  margin-top: 4px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.team-directory-stats {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.team-directory-stats strong {
  color: var(--navy-700);
  font-weight: 900;
  font-size: 0.82rem;
  margin-right: 2px;
}

.team-directory-desc {
  font-size: 0.82rem;
  color: var(--text-body, #475569);
  line-height: 1.6;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--gray-50, #f8fafc);
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 4.2em;
  overflow: hidden;
  position: relative;
}

.team-directory-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.team-directory-actions .follow-btn {
  min-width: 120px;
  padding: 10px 22px;
}

/* ============================================
   Tournaments (カップ戦)
   ============================================ */
.tournament-filter-chips {
  display: flex;
  gap: 8px;
  padding: 12px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tournament-filter-chips::-webkit-scrollbar { display: none; }

.tournament-filter-chip {
  background: var(--white);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
}
.tournament-filter-chip:hover { border-color: var(--navy-400); color: var(--navy-700); }
.tournament-filter-chip.active {
  background: var(--navy-500);
  color: var(--white);
  border-color: var(--navy-500);
}

.tournament-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 12px;
  gap: 12px;
}

.tournament-total {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-host-cup {
  background: linear-gradient(135deg, #f59e0b, #fb923c);
  color: var(--white);
  border: none;
  padding: 9px 16px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-host-cup svg { width: 14px; height: 14px; }
.btn-host-cup:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.tournament-list {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tournament-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light, #f1f5f9);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.tournament-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #f59e0b, #fb923c);
}
.tournament-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(10, 22, 40, 0.1);
}

.t-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.t-card-emblem {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-400), var(--navy-500));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.8rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(30, 77, 138, 0.2);
}

.t-card-head-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.t-card-name {
  font-size: 1rem;
  font-weight: 900;
  color: var(--navy-700);
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 2px;
}

.t-card-host {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.t-status {
  font-size: 0.66rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.t-status-recruiting { background: #dcfce7; color: #166534; }
.t-status-closed { background: var(--gray-100); color: var(--text-muted); }
.t-status-ongoing { background: #dbeafe; color: #1e40af; }
.t-status-completed { background: var(--gray-100); color: var(--text-muted); }
.t-status-cancelled { background: #fee2e2; color: #991b1b; }

.t-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.t-card-badges:empty { display: none; }

.t-badge {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.03em;
}
.t-badge-host { background: linear-gradient(135deg, #f59e0b, #fb923c); color: var(--white); }
.t-badge-pending { background: #fef3c7; color: #92400e; }
.t-badge-accepted { background: #dcfce7; color: #166534; }
.t-badge-rejected { background: #fee2e2; color: #991b1b; }

.t-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--gray-50, #f8fafc);
  border-radius: var(--radius-md);
}

.t-card-info span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-body, #475569);
}

.t-card-info svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.t-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.t-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--navy-50);
  color: var(--navy-700);
  letter-spacing: 0.02em;
}
.t-tag-fee {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

/* ===== Tournament Detail ===== */
.t-detail-hero {
  margin: 12px 16px 20px;
  padding: 24px 20px;
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-500) 100%);
  border-radius: var(--radius-xl);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.t-detail-hero::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), transparent 70%);
  pointer-events: none;
}

.t-detail-hero-top {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.t-detail-name {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 18px;
  position: relative;
}

.t-detail-host-row {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.t-detail-host-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.t-detail-host-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--white);
}

.t-detail-section {
  margin: 0 16px 20px;
}

.t-detail-section-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--navy-700);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.t-detail-count {
  display: inline-flex;
  align-items: center;
  background: var(--navy-50);
  color: var(--navy-700);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 100px;
}
.t-detail-count-pending {
  background: #fef3c7;
  color: #92400e;
}

.t-detail-info-list {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 6px 0;
}

.t-detail-info {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}
.t-detail-info:last-child { border-bottom: none; }

.t-info-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  min-width: 70px;
  flex-shrink: 0;
  padding-top: 2px;
}

.t-info-value {
  flex: 1;
  color: var(--text-primary);
  font-weight: 600;
  word-break: break-word;
}
.t-info-value small { color: var(--text-muted); font-weight: 400; font-size: 0.78rem; }

.t-detail-body {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-body, #475569);
  white-space: pre-wrap;
}

.t-entry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.t-entry-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.t-entry-emblem {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-400), var(--navy-500));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.72rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.t-entry-body { flex: 1; min-width: 0; }

.t-entry-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy-700);
}

.t-entry-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.t-entry-msg {
  font-size: 0.75rem;
  color: var(--text-body, #475569);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--gray-50, #f8fafc);
  border-radius: 8px;
  border-left: 2px solid var(--navy-400);
}

.t-entry-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.t-btn {
  border: none;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.2s;
}

.t-btn-accept {
  background: #10b981;
  color: var(--white);
}
.t-btn-accept:hover { background: #059669; }

.t-btn-reject {
  background: var(--gray-100);
  color: #991b1b;
  border: 1px solid #fecaca;
}
.t-btn-reject:hover { background: #fee2e2; }

.t-btn-withdraw {
  background: var(--gray-100);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
}
.t-btn-withdraw:hover { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.t-btn-delete { color: #dc2626; }

.t-apply-form {
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.t-apply-form textarea { margin-bottom: 12px; min-height: 70px; }
.t-btn-apply { width: 100%; }
.t-apply-note {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #92400e;
}

.t-my-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 800;
  flex-wrap: wrap;
}
.t-my-status-pending { background: #fef3c7; color: #92400e; }
.t-my-status-accepted { background: #dcfce7; color: #166534; }
.t-my-status-rejected { background: var(--gray-100); color: var(--text-muted); }

.t-action-row {
  display: flex;
  gap: 10px;
  padding: 0;
}
.t-action-row .btn { flex: 1; }

.t-detail-actions {
  padding-bottom: 24px;
}

/* Detail screen follow row (match detail opposing team) */
.detail-team-follow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--navy-50);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.detail-team-follow-row:empty {
  display: none;
}

.detail-follow-counts {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.detail-follow-counts strong {
  font-size: 0.95rem;
  color: var(--navy-700);
  font-weight: 900;
  margin-right: 2px;
}

/* ============================================
   Screen: Team Management
   ============================================ */
.team-profile-card {
  margin: 16px;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 24px 16px;
  color: var(--navy-900);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.team-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy-700);
}

.team-name { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; color: var(--navy-800); }
.team-meta { font-size: 0.8rem; color: var(--text-muted); }

.team-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.team-badge-item {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--navy-50);
  color: var(--navy-700);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
}

.team-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.team-stat {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 10px;
}

.team-stat-num { font-size: 1.3rem; font-weight: 800; color: var(--navy-800); }
.team-stat-label { font-size: 0.65rem; color: var(--text-muted); }

/* Staff Section */
.staff-section {
  padding: 0 16px;
  margin-bottom: 16px;
}

.staff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.staff-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  border: none;
}

.staff-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy-50);
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-avatar svg { width: 20px; height: 20px; color: var(--navy-600); }

.staff-info { flex: 1; }
.staff-name { font-size: 0.9rem; font-weight: 600; }
.staff-role { font-size: 0.75rem; color: var(--text-muted); }

.btn-invite {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--navy-50);
  color: var(--navy-700);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 10px;
  transition: background 0.2s;
}

.btn-invite svg { width: 16px; height: 16px; }

/* Roster Table */
.roster-section {
  padding: 0 16px 16px;
}

.roster-table {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: none;
}

.roster-thead {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  background: var(--gray-100);
  color: var(--text-secondary);
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
}

.roster-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.85rem;
  align-items: center;
}

.roster-row:last-child { border-bottom: none; }

.roster-name { font-weight: 600; color: var(--navy-800); }
.roster-pos {
  font-size: 0.75rem;
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--navy-50);
  color: var(--navy-600);
  font-weight: 600;
  text-align: center;
}

.roster-grade { text-align: center; }

.btn-add-player {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 0.85rem;
  color: var(--navy-600);
  font-weight: 600;
  cursor: pointer;
  border-top: 1px dashed var(--border-color);
}

.btn-add-player svg { width: 16px; height: 16px; }

/* ============================================
   Screen: AI Analysis
   ============================================ */
.ai-hero {
  background: var(--white);
  padding: 20px 16px 16px;
  color: var(--navy-900);
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.ai-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-hero-icon svg { width: 26px; height: 26px; color: var(--navy-600); }
.ai-hero h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy-800);
  margin-bottom: 4px;
  line-height: 1.4;
  word-break: break-word;
}
.ai-hero p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
}

/* Trend Cards
   元: 横スクロール (flex 0 0 140px × overflow-x:auto) で右端が画面外に隠れて見える問題があった。
   2 列グリッドに変更して必ず viewport 内に収まるようにする。 */
.trend-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px;
}

@media (min-width: 560px) {
  .trend-cards { grid-template-columns: repeat(4, 1fr); }
}

.trend-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  min-width: 0;
}

.trend-card-num { font-size: 1.5rem; font-weight: 800; color: var(--navy-800); }
.trend-card-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.trend-card-change {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 4px;
}
.trend-card-change.up { color: var(--accent-green); }
.trend-card-change.down { color: var(--accent-red); }

/* AI Feedback Card */
.ai-feedback-card {
  margin: 0 16px 12px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.ai-feedback-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ai-feedback-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-feedback-icon svg { width: 18px; height: 18px; }
.ai-feedback-icon.tactical { background: var(--navy-50); }
.ai-feedback-icon.tactical svg { color: var(--navy-600); }
.ai-feedback-icon.training { background: #ecfdf5; }
.ai-feedback-icon.training svg { color: var(--accent-green); }
.ai-feedback-icon.mental { background: #fffbeb; }
.ai-feedback-icon.mental svg { color: var(--accent-amber); }

.ai-feedback-title { font-size: 0.9rem; font-weight: 700; color: var(--navy-800); }
.ai-feedback-subtitle { font-size: 0.75rem; color: var(--text-muted); }

.ai-feedback-body {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.ai-feedback-body strong { color: var(--navy-700); }

.training-menu-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.training-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.training-menu-item .num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--navy-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Match History in AI */
.ai-match-history {
  padding: 0 16px 16px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.history-result {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
}

.history-result.win { background: #d1fae5; color: #065f46; }
.history-result.lose { background: #fee2e2; color: #991b1b; }
.history-result.draw { background: #e0e7ff; color: #3730a3; }

.history-result .score { font-size: 1rem; }

.history-info { flex: 1; }
.history-opponent { font-size: 0.9rem; font-weight: 600; }
.history-date { font-size: 0.75rem; color: var(--text-muted); }

.history-arrow { color: var(--gray-400); }
.history-arrow svg { width: 16px; height: 16px; }

/* ============================================
   Modal / Overlay
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 22, 40, 0.5);
  backdrop-filter: blur(4px);
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-content {
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 16px;
  animation: modalUp 0.3s ease-out;
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes modalUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--gray-300);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--navy-800);
}

/* Filter Modal Specifics */
.filter-group {
  margin-bottom: 16px;
}

.filter-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-option {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.filter-option.selected {
  background: var(--navy-700);
  color: var(--white);
  border-color: var(--navy-700);
}

/* ============================================
   Toast / Notification
   ============================================ */
.toast {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--navy-800);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease-out;
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }

.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }

/* ============================================
   Utility
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }

/* Empty state */
.empty-state {
  padding: 40px 16px;
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--gray-300);
  margin-bottom: 12px;
}

.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state p { font-size: 0.8rem; color: var(--text-muted); }

/* Scroll fade */
.screen-content {
  overflow-y: auto;
}

/* ============================================
   Screen: Register (New Team Registration)
   ============================================ */
.screen-register {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-surface);
  overflow-y: auto;
  animation: screenIn 0.35s ease-out;
}

.register-container {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  box-shadow: var(--shadow-md);
}

/* Register Header */
.register-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--header-height);
  background: var(--white);
  color: var(--navy-900);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 16px rgba(10, 22, 40, 0.07);
}

.register-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--navy-600);
  transition: background 0.2s;
}

.register-back:hover { background: var(--gray-100); }
.register-back svg { width: 20px; height: 20px; }

.register-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.register-header-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--navy-800);
}

.register-header-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-800);
}

/* Progress Steps */
.register-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 16px;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.3s;
}

.step span {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: color 0.3s;
}

.step.active .step-circle {
  background: var(--grad-brand);
  color: var(--white);
  box-shadow: var(--shadow-brand);
}

.step.active span { color: var(--navy-700); }

.step.done .step-circle {
  background: var(--accent-green);
  color: var(--white);
}

.step.done span { color: var(--accent-green); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 8px;
  margin-bottom: 18px;
  min-width: 30px;
  transition: background 0.3s;
}

.step-line.done { background: var(--accent-green); }

/* Register Card (section header) */
.reg-card {
  margin: 0;
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
}

.reg-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reg-card-icon svg { width: 20px; height: 20px; color: var(--navy-600); }
.reg-card-icon.success-icon { background: #ecfdf5; }
.reg-card-icon.success-icon svg { color: var(--accent-green); }

.reg-card-body { flex: 1; }
.reg-card-title { font-size: 0.95rem; font-weight: 700; color: var(--navy-800); margin-bottom: 2px; }
.reg-card-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Register Form */
.reg-form {
  padding: 20px 20px 4px;
}

.reg-btn-row {
  padding: 16px 20px 32px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent 0%, var(--white) 20%);
}

.form-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-group { flex: 1; }

/* Input with icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .form-input {
  padding-right: 44px;
}

.input-icon-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--navy-50);
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon-badge svg { width: 16px; height: 16px; color: var(--navy-600); }

/* Password toggle */
.input-with-toggle {
  position: relative;
}

.input-with-toggle .form-input { padding-right: 44px; }

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  padding: 4px;
}

.password-toggle svg { width: 18px; height: 18px; }

/* Password strength */
.password-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.strength-label {
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 36px;
}

/* File upload */
.file-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.file-upload-area:hover {
  border-color: var(--navy-300);
  background: var(--navy-50);
}

.file-upload-area svg { width: 32px; height: 32px; color: var(--gray-400); }

.file-upload-hint { font-size: 0.7rem; }

.file-upload-area.has-file {
  border-color: var(--accent-green);
  background: #f0fdf4;
  color: #065f46;
}

/* Radio card group */
.radio-group {
  display: flex;
  gap: 8px;
}

/* Checkbox Chip Group */
.checkbox-chip-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-chip-group.checkbox-chip-grid {
  flex-direction: row;
  flex-wrap: wrap;
}

.checkbox-chip {
  cursor: pointer;
}

.checkbox-chip input { display: none; }

.checkbox-chip-inner {
  display: block;
  padding: 10px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all 0.2s;
}

.checkbox-chip input:checked + .checkbox-chip-inner {
  border-color: var(--navy-600);
  background: var(--navy-50);
  color: var(--navy-700);
  box-shadow: 0 0 0 1px var(--navy-600);
}

.checkbox-chip-grid .checkbox-chip-inner {
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.form-hint-inline {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

.radio-card {
  flex: 1;
  cursor: pointer;
}

.radio-card input { display: none; }

.radio-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
  text-align: center;
}

.radio-card-inner svg { width: 22px; height: 22px; color: var(--gray-400); }

.radio-card input:checked + .radio-card-inner {
  border-color: var(--navy-600);
  background: var(--navy-50);
  color: var(--navy-700);
}

.radio-card input:checked + .radio-card-inner svg { color: var(--navy-600); }

/* Radio vertical list */
.radio-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s;
}

.radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy-600);
  flex-shrink: 0;
}

.radio-item-inner {
  display: flex;
  flex-direction: column;
}

.radio-item-inner strong { font-size: 0.85rem; color: var(--navy-800); }
.radio-item-inner span { font-size: 0.72rem; color: var(--text-muted); }

.radio-item:has(input:checked) {
  border-color: var(--navy-600);
  background: var(--navy-50);
}

/* Checkbox */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy-600);
  flex-shrink: 0;
}

/* Confirm section */
.confirm-section {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: none;
}

.confirm-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--navy-100);
}

.confirm-section-title svg {
  width: 18px;
  height: 18px;
  color: var(--navy-600);
}

.confirm-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
}

.confirm-row:last-child { border-bottom: none; }
.confirm-row-label { color: var(--text-muted); flex-shrink: 0; margin-right: 12px; }
.confirm-row-value { font-weight: 600; color: var(--navy-800); text-align: right; }

/* Terms box */
.terms-box {
  max-height: 140px;
  overflow-y: auto;
  padding: 12px;
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.terms-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.terms-text p { margin-bottom: 6px; }

/* Registration Complete */
.reg-complete {
  padding: 40px 24px;
  text-align: center;
}

.reg-complete-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: completePopIn 0.5s cubic-bezier(0.17, 0.67, 0.21, 1.2);
}

.reg-complete-icon svg { width: 36px; height: 36px; color: var(--white); }

@keyframes completePopIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.reg-complete-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy-800);
  margin-bottom: 8px;
}

.reg-complete-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.reg-complete-info {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: none;
  text-align: left;
}

.reg-complete-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--gray-100);
}

.reg-complete-info-row:last-child { border-bottom: none; }
.reg-complete-info-row span { color: var(--text-muted); }

.btn-register-submit {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Campaign registration (半年間無料キャンペーン申込フォーム) ===== */
.campaign-banner {
  margin: 16px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0f766e, #10b981);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.campaign-banner-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.campaign-banner-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: 8px;
}

.campaign-banner-note {
  font-size: 0.78rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.campaign-legal-links {
  padding: 4px 16px 32px;
  font-size: 0.72rem;
  line-height: 1.9;
  color: var(--text-muted);
  text-align: center;
}

.campaign-legal-links a {
  color: var(--accent-blue);
  font-weight: 700;
  text-decoration: underline;
}

/* 先行登録モード：戻り先が無いので離脱系のボタンを隠す */
body.prelaunch-locked #campaignScreen .register-back,
body.prelaunch-locked #campaignScreen .btn-secondary,
body.prelaunch-locked #campaignComplete .btn-primary {
  display: none;
}

body.prelaunch-locked #campaignScreen .reg-btn-row .btn-primary {
  flex: 1;
}

/* Withdraw Complete */
.withdraw-complete-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: completePopIn 0.5s cubic-bezier(0.17, 0.67, 0.21, 1.2) both;
}

.withdraw-complete-icon svg { width: 32px; height: 32px; }

.withdraw-complete-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-800);
  text-align: center;
  margin-bottom: 10px;
}

.withdraw-complete-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: center;
  margin-bottom: 20px;
}

/* ============================================
   Screen: Password Reset
   ============================================ */

/* 6-digit code input */
.code-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.code-input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy-800);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  caret-color: var(--navy-600);
}

.code-input:focus {
  border-color: var(--navy-500);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26, 58, 110, 0.12);
}

.code-input.filled {
  border-color: var(--navy-600);
  background: var(--navy-50);
}

.code-separator {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-400);
  margin: 0 2px;
}

/* Resend area */
.resend-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-top: 4px;
}

.resend-timer {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.resend-btn {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-blue);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.resend-btn:hover:not(.disabled) {
  background: var(--navy-50);
}

.resend-btn.disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ========== Roster 4-col ========== */
.roster-thead-4col,
.roster-row-4col {
  grid-template-columns: 1fr 72px 52px auto !important;
  column-gap: 12px;
  align-items: center;
}

/* Keep heading labels on a single line (e.g. "ポジション" must not wrap "ン") */
.roster-thead-4col > span,
.roster-thead > span {
  white-space: nowrap;
}

.roster-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.roster-qr-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--navy-700);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.roster-qr-btn:hover {
  background: var(--navy-50);
  border-color: var(--navy-300);
  color: var(--navy-500);
}
.roster-qr-btn:active { transform: scale(0.94); }
.roster-qr-btn svg { width: 16px; height: 16px; }

.roster-row-4col {
  padding: 12px 16px;
}

.roster-thead-4col > span,
.roster-row-4col > span {
  display: flex;
  align-items: center;
  min-width: 0;
}

.roster-thead-4col > span:nth-child(2),
.roster-thead-4col > span:nth-child(3),
.roster-row-4col > span:nth-child(2),
.roster-row-4col > span:nth-child(3) {
  justify-content: center;
}

.roster-thead-4col > span:nth-child(4),
.roster-row-4col > span:nth-child(4) {
  justify-content: flex-end;
}

.roster-record-btn {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  letter-spacing: 0.01em;
}

.roster-record-btn:hover {
  background: rgba(37, 99, 235, 0.15);
}

/* ========== Player Record Screen ========== */
.player-record-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px 16px;
}

.player-record-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-700);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.player-record-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-800);
}

.player-record-pos {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-record-history {
  padding-bottom: 24px;
}

.player-record-list {
  padding: 0 16px;
}

.player-record-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.player-record-item-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.player-record-item-comment {
  font-size: 0.85rem;
  color: var(--navy-800);
  line-height: 1.5;
  white-space: pre-wrap;
}

.player-record-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== Message List ========== */
.message-list {
  padding: 0 16px;
}

.message-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: box-shadow 0.2s;
  position: relative;
}

.message-item:hover {
  box-shadow: var(--shadow-md);
}

.message-item.unread {
  background: var(--navy-50);
  border-color: var(--navy-200);
}

.message-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-600), var(--navy-800));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.message-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy-800);
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.message-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-date-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.message-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ========== Detail - Team Profile ========== */
.detail-team-profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-team-profile-emblem {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-700);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.detail-team-profile-info {
  flex: 1;
  min-width: 0;
}

.detail-team-profile-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-800);
  /* Long team names ("FCマルヤス岡崎U-15") must wrap on narrow screens
     instead of being squeezed character-by-character into a 1-char column. */
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.detail-team-profile-area {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Badges row spans both grid columns and sits below the name/area block so it
   no longer competes with the name for horizontal space. */
.detail-team-profile-badges {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.detail-team-profile-stats {
  display: flex;
  gap: 8px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 14px;
}

.detail-team-profile-stat {
  flex: 1;
  text-align: center;
}

.detail-team-profile-stat-num {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy-800);
}

.detail-team-profile-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.detail-team-profile-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-team-profile-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-team-profile-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-team-profile-value {
  font-size: 0.85rem;
  color: var(--navy-800);
  line-height: 1.4;
}

/* ========== Settings Screen ========== */
.settings-profile-card {
  text-align: center;
  padding: 28px 16px 20px;
}

.settings-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-600), var(--navy-800));
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 700;
}

.settings-profile-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 4px;
}

.settings-profile-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.settings-menu {
  padding: 0 16px;
}

.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}

.settings-menu-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.settings-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--navy-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-menu-icon svg {
  width: 20px;
  height: 20px;
  color: var(--navy-600);
}

.settings-menu-icon.icon-line {
  background: #e6f9e6;
}
.settings-menu-icon.icon-line svg { color: #06c755; }

.settings-menu-icon.icon-plan {
  background: #fff8e6;
}
.settings-menu-icon.icon-plan svg { color: #f59e0b; }

.settings-menu-icon.icon-danger {
  background: #fef2f2;
}
.settings-menu-icon.icon-danger svg { color: var(--accent-red); }

.settings-menu-text {
  flex: 1;
  min-width: 0;
}

.settings-menu-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 2px;
}

.settings-menu-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.settings-menu-danger .settings-menu-title {
  color: var(--accent-red);
}

.settings-menu-danger {
  border-color: rgba(239, 68, 68, 0.2);
}

.settings-menu-arrow svg {
  width: 18px;
  height: 18px;
  color: var(--gray-400);
}

.settings-footer {
  padding: 24px 16px;
  text-align: center;
}

.btn-logout {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: var(--gray-100);
}

.settings-version {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--gray-400);
}

/* Settings Sub Header */
.settings-sub-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-sub-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-800);
}

/* Settings Toggle Row */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.settings-toggle-row:last-child {
  border-bottom: none;
}

.settings-toggle-text {
  flex: 1;
  margin-right: 12px;
}

.settings-toggle-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 2px;
}

.settings-toggle-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Plan Cards */
.plan-cards {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-billing-toggle {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--navy-50, #f1f5f9);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

.plan-billing-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.plan-billing-opt.is-active {
  background: var(--white);
  color: var(--navy-800);
  box-shadow: var(--shadow-sm);
}

.plan-billing-save {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--white);
  background: #f97316;
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.plan-tax-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: -6px;
}

.plan-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: relative;
}

.plan-price-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-top: -8px;
  margin-bottom: 12px;
}

.plan-campaign {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  color: #0f766e;
  background: rgba(16, 185, 129, 0.1);
  border: 1px dashed rgba(16, 185, 129, 0.45);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.plan-card.plan-current {
  border-color: var(--navy-300);
  background: var(--navy-50);
}

.plan-card.plan-recommended {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15), var(--shadow-md);
}

.plan-badge-current,
.plan-badge-recommend {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.plan-badge-current {
  background: var(--navy-200);
  color: var(--navy-700);
}

.plan-badge-recommend {
  background: var(--accent-blue);
  color: var(--white);
}

.plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 4px;
}

.plan-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy-800);
  margin-bottom: 12px;
}

.plan-period {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.plan-features li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
}

.plan-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.plan-card .btn {
  width: 100%;
}

.plan-withdraw-link {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  padding: 16px 0 8px;
}

.plan-coming-soon-note {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f1f5f9;
  border-left: 3px solid #94a3b8;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #475569;
}

/* Stripe Checkout Confirm Modal */
.checkout-confirm-body {
  padding: 0 20px 24px;
}

.checkout-plan-summary {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.checkout-plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 4px;
}

.checkout-plan-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy-800);
}

.checkout-details {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.checkout-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.checkout-detail-row + .checkout-detail-row {
  border-top: 1px solid var(--border-light);
}

.checkout-stripe-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: #635BFF;
}

.checkout-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 20px;
}

.checkout-stripe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #635BFF !important;
  box-shadow: 0 4px 16px rgba(99, 91, 255, 0.3);
}

.checkout-stripe-btn:active {
  opacity: 0.9;
}

/* Stripe Redirect Overlay */
.stripe-redirect-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #f6f9fc;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.stripe-redirect-overlay.show { display: flex; }

.stripe-redirect-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.stripe-redirect-logo svg {
  filter: drop-shadow(0 4px 12px rgba(99, 91, 255, 0.25));
}

.stripe-redirect-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #32325d;
}

.stripe-redirect-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: #635BFF;
  border-radius: 50%;
  animation: stripeSpin 0.8s linear infinite;
}

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

/* Plan change complete state */
.plan-card.plan-changed {
  border-color: var(--accent-green);
  background: #f0fdf4;
}

.plan-badge-changed {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-green);
  color: var(--white);
  margin-bottom: 6px;
}

.plan-withdraw-link:hover {
  color: var(--accent-red);
}

/* Withdraw Warning */
.withdraw-warning-card {
  background: #fef2f2 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  text-align: center;
}

.withdraw-warning-icon svg {
  width: 40px;
  height: 40px;
  color: var(--accent-red);
  margin-bottom: 10px;
}

.withdraw-warning-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 10px;
}

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

.withdraw-warning-list {
  text-align: left;
  padding-left: 20px;
  margin: 0 0 12px;
}

.withdraw-warning-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 3px 0;
}

.withdraw-warning-alert {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-red);
}

.btn-danger {
  background: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  color: var(--white) !important;
}

/* ============================================
   iOS Safari Fixes
   ============================================ */

/* Prevent iOS bounce scroll from showing background behind header */
@supports (-webkit-touch-callout: none) {
  .app-header {
    /* Fixed height, no shrink on iOS address bar hide */
    height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }

  .bottom-nav {
    padding-bottom: max(var(--safe-bottom), 20px);
  }

  /* Prevent content from hiding behind fixed header */
  .screens-wrapper {
    padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  }

  /* Prevent rubber-band scroll on body */
  body {
    overscroll-behavior-y: none;
  }

  /* Tap highlight removal for interactive elements */
  .nav-item,
  .detail-back,
  .btn,
  .match-list-item {
    -webkit-tap-highlight-color: transparent;
  }

  /* Input zoom prevention on iOS (font-size < 16px triggers zoom) */
  input, select, textarea {
    font-size: 16px;
  }
}

/* Responsive - Tablet/Desktop */
@media (min-width: 431px) {
  .app-container {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    box-shadow: 0 0 40px rgba(10, 22, 40, 0.08);
  }

  body {
    background: var(--gray-100);
  }
}

/* ============================================
   UX v3: Home / Discover / MyPage / Create Menu
   ============================================ */

/* === Home: Greeting === */
.home-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  gap: 14px;
}

.home-greeting-text {
  flex: 1;
  min-width: 0;
}

.home-greeting-hi {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}

.home-greeting-name {
  font-size: 1.18rem;
  font-weight: 900;
  color: var(--navy-800);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.home-greeting-emblem {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad-brand-bright);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
  border: 2.5px solid var(--white);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.home-greeting-emblem:active { transform: scale(0.95); }

/* === Home: Sections === */
.home-section {
  padding: 16px 0 8px;
}

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 10px;
}

.home-section-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--navy-800);
  letter-spacing: -0.01em;
}

.home-section-link {
  font-size: 0.72rem;
  color: var(--navy-400);
  font-weight: 700;
  cursor: pointer;
}
.home-section-link:hover { color: var(--navy-600); }

/* Horizontal scroll containers */
.home-tournament-scroll,
.home-teams-scroll {
  display: flex;
  gap: 12px;
  padding: 4px 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.home-tournament-scroll::-webkit-scrollbar,
.home-teams-scroll::-webkit-scrollbar { display: none; }

.home-tournament-card {
  flex: 0 0 240px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.home-tournament-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #f59e0b, #fb923c);
}
.home-tournament-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.home-tournament-date {
  font-size: 0.68rem;
  color: var(--accent-amber);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.home-tournament-name {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--navy-800);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.home-tournament-host {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-tournament-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.home-tournament-meta span {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--navy-50);
  color: var(--navy-700);
}
.home-tournament-meta span:last-child {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

/* Home: suggested team cards (instagram-like circle) */
.home-team-card {
  flex: 0 0 108px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 8px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.home-team-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.home-team-emblem {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--grad-brand-bright);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.8rem;
  margin: 0 auto 8px;
  border: 2.5px solid var(--white);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
  letter-spacing: -0.02em;
}

.home-team-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--navy-800);
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.home-team-meta {
  font-size: 0.64rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-team-followers {
  font-size: 0.62rem;
  color: var(--navy-400);
  font-weight: 700;
}

/* Recent results list */
.home-recent-list {
  padding: 0 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-result-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 16px 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, box-shadow 0.2s;
  overflow: hidden;
}

.recent-result-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.recent-result-card.result-win::before { background: linear-gradient(180deg, #10b981, #059669); }
.recent-result-card.result-loss::before { background: linear-gradient(180deg, #ef4444, #dc2626); }
.recent-result-card.result-draw::before { background: linear-gradient(180deg, #94a3b8, #64748b); }

.recent-result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.recent-result-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.recent-result-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.recent-result-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.recent-result-team-right {
  justify-content: flex-end;
}

.recent-result-emblem {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-brand-bright);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(30, 77, 138, 0.18);
}

.recent-result-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.recent-result-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 6px;
}

.recent-result-score .rs-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--navy-800);
  letter-spacing: -0.02em;
  line-height: 1;
}

.recent-result-score .rs-dash {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 700;
}

.recent-result-score .rs-pending {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  padding: 4px 10px;
  background: var(--gray-100);
  border-radius: 100px;
}

.recent-result-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}

.recent-result-card.result-win .recent-result-badge { background: #dcfce7; color: #166534; }
.recent-result-card.result-loss .recent-result-badge { background: #fee2e2; color: #991b1b; }
.recent-result-card.result-draw .recent-result-badge { background: var(--gray-100); color: var(--text-muted); }

/* ============================================
   QR Code Modal (子供の振り返り入力URL)
   ============================================ */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  transition: background 0.25s ease;
}

.qr-modal-overlay.show {
  display: flex;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.qr-modal {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border-radius: 24px;
  padding: 28px 24px 24px;
  box-shadow: 0 20px 60px rgba(10, 22, 40, 0.4);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  text-align: center;
}

.qr-modal-overlay.show .qr-modal {
  transform: scale(1);
}

.qr-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-mute);
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.qr-modal-close:hover { background: var(--gray-200); color: var(--navy-700); }

.qr-modal-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent-blue);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.qr-modal-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--navy-800);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.qr-modal-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.qr-modal-frame {
  background: var(--white);
  border: 4px solid var(--navy-50);
  border-radius: 16px;
  padding: 16px;
  width: 240px;
  height: 240px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(20, 45, 82, 0.15);
}

.qr-modal-canvas {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-modal-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
  shape-rendering: crispEdges;
}

.qr-modal-url {
  font-size: 0.65rem;
  color: var(--text-mute);
  background: var(--gray-50);
  padding: 8px 12px;
  border-radius: 8px;
  word-break: break-all;
  margin-bottom: 16px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  line-height: 1.5;
}

.qr-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qr-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 12px;
  background: var(--white);
  color: var(--navy-700);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.qr-action-btn:hover {
  background: var(--navy-50);
  border-color: var(--navy-300);
  color: var(--navy-500);
}
.qr-action-btn svg { width: 14px; height: 14px; }

/* === Discover hub shared sub-tabs === */
.discover-tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.discover-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}

.discover-tab svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

.discover-tab:hover { color: var(--navy-500); }

.discover-tab.active {
  color: var(--navy-700);
  font-weight: 900;
}

.discover-tab.active::after {
  content: '';
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -1px;
  height: 3px;
  background: var(--grad-brand-bright);
  border-radius: 3px 3px 0 0;
}

.discover-tab.active svg {
  stroke-width: 2.4;
}

/* === Create Menu (FAB popup) === */
.create-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  transition: background 0.25s ease;
}

.create-menu-overlay.show {
  display: flex;
  background: rgba(10, 22, 40, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.create-menu {
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(24px + var(--safe-bottom));
  box-shadow: 0 -8px 32px rgba(10, 22, 40, 0.25);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.create-menu-overlay.show .create-menu {
  transform: translateY(0);
}

.create-menu-handle {
  width: 40px;
  height: 4px;
  background: var(--gray-300);
  border-radius: 100px;
  margin: 4px auto 18px;
}

.create-menu-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--navy-800);
  text-align: center;
  letter-spacing: -0.02em;
}

.create-menu-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 22px;
}

.create-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: var(--white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.18s;
}

.create-menu-item:hover {
  border-color: var(--navy-300);
  background: var(--navy-50);
  transform: translateY(-1px);
}

.create-menu-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(10, 22, 40, 0.1);
}

.create-menu-icon svg { width: 24px; height: 24px; }

.create-menu-icon.icon-match {
  background: var(--grad-brand-bright);
}

.create-menu-icon.icon-cup {
  background: linear-gradient(135deg, #f59e0b, #fb923c);
}

.create-menu-text {
  flex: 1;
  min-width: 0;
}

.create-menu-label {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--navy-800);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.create-menu-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.create-menu-arrow {
  width: 18px;
  height: 18px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.create-menu-cancel {
  width: 100%;
  padding: 14px;
  background: var(--gray-100);
  color: var(--navy-700);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  transition: background 0.15s;
}
.create-menu-cancel:hover { background: var(--gray-200); }

/* === My Page === */
/* mypage は screens-wrapper 側の padding-bottom (= nav-height + safe-bottom)
   だけで bottom-nav を避けるのに十分。重ねて padding-bottom を持つと
   version の下に nav-height + 24px 分の余白が積まれて隙間が目立つので持たせない。
   他画面 (home / search / settings 等) と同じ扱い。 */
.mypage-hero {
  background: linear-gradient(160deg, var(--navy-800) 0%, var(--navy-600) 55%, var(--navy-500) 100%);
  color: var(--white);
  padding: 24px 20px 20px;
  margin: 0;
  position: relative;
  overflow: hidden;
}
.mypage-hero::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
  pointer-events: none;
}

.mypage-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.mypage-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  border: 3px solid var(--white);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  /* Tap target for emblem upload — overrides default <button> chrome. */
  position: relative;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s;
}
.mypage-avatar:active { transform: scale(0.96); }
.mypage-avatar.uploading { opacity: 0.6; cursor: progress; }

/* Camera badge sits at the bottom-right of the avatar (LINE-style cue that
   tapping changes the photo). Visible whether or not an image is set. */
.mypage-avatar-camera {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy-800, #1e293b);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.mypage-avatar-camera svg {
  width: 12px;
  height: 12px;
}

/* Shared image style for any avatar circle that has an uploaded emblem. */
.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Inherit the parent's rounded corners (50% for circles, var(--radius-lg)
     for the squarer roster avatar) so the image matches its container. */
  border-radius: inherit;
  position: absolute;
  inset: 0;
}

/* When the circle holds an image, hide any text fallback that may still be
   present in the DOM (kept by some renderers as a sibling node). */
.has-image > :not(.avatar-image):not(.mypage-avatar-camera) {
  display: none !important;
}

/* The home greeting and roster avatars are smaller circles that don't have
   their own positioning context — give them one so the absolute image fills
   correctly. */
.home-greeting-emblem,
.team-avatar,
.settings-avatar {
  position: relative;
  overflow: hidden;
}

.mypage-hero-info {
  flex: 1;
  min-width: 0;
}

.mypage-name {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 4px;
}

.mypage-meta {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.mypage-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mypage-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  backdrop-filter: blur(4px);
  letter-spacing: 0.02em;
}

.mypage-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 14px 6px;
  backdrop-filter: blur(6px);
  position: relative;
}

.mypage-stat {
  text-align: center;
  padding: 0 4px;
  cursor: pointer;
  position: relative;
}
.mypage-stat + .mypage-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 15%;
  bottom: 15%;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.mypage-stat-num {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.mypage-stat-label {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  margin-top: 3px;
}

.mypage-menu-section {
  padding: 20px 16px 6px;
}

.mypage-menu-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding: 0 4px;
}

.mypage-menu {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mypage-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: none;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}
.mypage-menu-item:last-child { border-bottom: none; }
.mypage-menu-item:hover { background: var(--gray-50); }
.mypage-menu-item:active { background: var(--gray-100); }

.mypage-menu-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}

.mypage-menu-icon svg { width: 19px; height: 19px; stroke-width: 2; }

.mypage-menu-icon.icon-roster { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.mypage-menu-icon.icon-record { background: linear-gradient(135deg, #10b981, #059669); }
.mypage-menu-icon.icon-ai { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.mypage-menu-icon.icon-follow { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.mypage-menu-icon.icon-cup-m { background: linear-gradient(135deg, #f59e0b, #fb923c); }
.mypage-menu-icon.icon-profile { background: linear-gradient(135deg, #64748b, #475569); }
.mypage-menu-icon.icon-line-m { background: linear-gradient(135deg, #06c755, #00b800); }
.mypage-menu-icon.icon-plan-m { background: linear-gradient(135deg, #f59e0b, #d97706); }

.mypage-menu-text {
  flex: 1;
  min-width: 0;
}

.mypage-menu-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy-800);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.mypage-menu-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.mypage-menu-arrow {
  width: 16px;
  height: 16px;
  color: var(--gray-300);
  flex-shrink: 0;
}

.mypage-logout-wrap {
  padding: 14px 16px 6px;
  /* コンテンツがビューポートに収まる場合でも、ログアウト＋versionが
     bottom-navのすぐ上に張り付くようにフレックス末尾へ寄せる */
  margin-top: auto;
}

/* mypage 全体を縦flexにして、上から順に積みつつ logout-wrap 以下を底へ */
#screen-mypage.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-height) - var(--bottom-nav-height) - var(--safe-bottom));
}

.mypage-logout-btn {
  width: 100%;
  padding: 14px;
  background: var(--white);
  color: var(--accent-red);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.mypage-logout-btn:hover {
  border-color: #fecaca;
  background: #fef2f2;
}

/* ========== Player record item kind chip ========== */
.player-record-item-kind {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 4px;
  background: var(--gray-100, #f1f5f9);
  color: var(--text-secondary);
  vertical-align: middle;
}

/* ========== Record screen tabs ========== */
.record-tabs {
  display: flex;
  gap: 0;
  margin: 14px 0 16px;
  border-bottom: 1px solid var(--border-light);
}
.record-tab {
  flex: 1;
  padding: 12px 8px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.record-tab:hover { color: var(--navy-700); }
.record-tab.active {
  color: var(--brand-primary, #2563eb);
  border-bottom-color: var(--brand-primary, #2563eb);
}
.record-tab-pane[hidden] { display: none; }

/* ========== Matches list (試合履歴) ========== */
/* screen-matches 内のコンテンツに左右余白を持たせる
   （settings-sub-header は自前で padding:16px を持つので除外） */
#screen-matches > .matches-add-wrap,
#screen-matches > .matches-tabs,
#screen-matches > .matches-list {
  padding-left: 16px;
  padding-right: 16px;
}
.matches-add-wrap {
  margin: 0 0 14px;
}
.matches-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  background: var(--white);
  border: 1.5px dashed var(--brand-primary, #2563eb);
  border-radius: var(--radius-lg);
  color: var(--brand-primary, #2563eb);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.matches-add-btn:hover {
  background: rgba(37,99,235,0.05);
}
.matches-add-btn svg { width: 18px; height: 18px; }

.matches-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin: 0 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.matches-tabs::-webkit-scrollbar { display: none; }
.matches-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.matches-tab:hover { background: var(--gray-50); }
.matches-tab.active {
  background: var(--brand-primary, #2563eb);
  border-color: var(--brand-primary, #2563eb);
  color: #fff;
}

.matches-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.matches-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}
/* 試合履歴のカード。ホーム画面の横スクロール .match-card と衝突を避けるため
   ここでは .matches-item を別名で定義する。 */
.matches-item {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.matches-item:hover {
  border-color: var(--brand-primary, #2563eb);
  background: var(--gray-50);
}
.matches-item:active {
  transform: scale(0.99);
}
.matches-item-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.matches-item-kind {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.matches-item-kind.kind-official {
  background: #fef3c7;
  color: #92400e;
}
.matches-item-kind.kind-external {
  background: #e0e7ff;
  color: #3730a3;
}
.matches-item-kind.kind-matching {
  background: #dcfce7;
  color: #166534;
}
.matches-item-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.matches-item-status.is-recorded {
  background: #f1f5f9;
  color: var(--text-muted);
}
.matches-item-status.is-pending {
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
}
.matches-item-status.is-upcoming {
  background: #eff6ff;
  color: #1d4ed8;
}
.matches-item-row2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px 0;
}
.matches-item-team-mine, .matches-item-team-opp {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-700);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.matches-item-team-mine { text-align: right; }
.matches-item-team-opp { text-align: left; }
.matches-item-score {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--navy-700);
  flex-shrink: 0;
  padding: 0 6px;
  letter-spacing: 0.04em;
}
.matches-item-vs {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gray-300);
  flex-shrink: 0;
  padding: 0 6px;
  letter-spacing: 0.04em;
}
.matches-item-row3 {
  display: flex;
  justify-content: flex-end;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ========== Mypage Quick CTA ========== */
.mypage-quick {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* hero 直下にくっつかないよう上に18px、左右はメニューセクションと揃えて16px */
  padding: 18px 16px 0;
  margin: 0;
}
.mypage-quick-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
}
.mypage-quick-cta:hover {
  background: var(--gray-50);
}
.mypage-quick-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}
.mypage-quick-cta-icon svg {
  width: 20px;
  height: 20px;
}
.mypage-quick-cta-text {
  flex: 1;
  min-width: 0;
}
.mypage-quick-cta-label {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--navy-700);
}
.mypage-quick-cta-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.mypage-quick-cta-arrow {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}
/* Warn variant: 未記録の試合あり */
.mypage-quick-cta-warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.mypage-quick-cta-warn:hover,
.mypage-quick-cta-warn:focus,
.mypage-quick-cta-warn:active {
  background: #fef3c7;
  border-color: #fde68a;
}
.mypage-quick-cta-warn .mypage-quick-cta-icon {
  background: #f59e0b;
  color: #fff;
}
.mypage-quick-cta-warn .mypage-quick-cta-label {
  color: #92400e;
}
/* Primary variant: 試合を追加
   注意: ベースの .mypage-quick-cta:hover が background:gray-50 を当ててくるので、
   ここで :hover/:focus/:active を明示的に上書きしないと白文字×グレー背景で
   テキストが視認不能になる。 */
.mypage-quick-cta-primary {
  background: var(--brand-primary, #2563eb);
  border-color: var(--brand-primary, #2563eb);
}
.mypage-quick-cta-primary:hover,
.mypage-quick-cta-primary:focus,
.mypage-quick-cta-primary:active {
  background: var(--brand-primary, #2563eb);
  border-color: var(--brand-primary, #2563eb);
  filter: brightness(1.06);
}
.mypage-quick-cta-primary .mypage-quick-cta-icon {
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.mypage-quick-cta-primary .mypage-quick-cta-label,
.mypage-quick-cta-primary .mypage-quick-cta-sub,
.mypage-quick-cta-primary .mypage-quick-cta-arrow {
  color: #fff;
}
.mypage-quick-cta-primary .mypage-quick-cta-sub {
  color: rgba(255,255,255,0.85);
}

/* ========== Post-save actions sheet ========== */
.post-save-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-save-action {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 14px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
}
.post-save-action:hover {
  border-color: var(--brand-primary, #2563eb);
  background: var(--gray-50);
}
.post-save-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}
.post-save-action-icon svg {
  width: 20px;
  height: 20px;
}
.post-save-action-text {
  flex: 1;
  min-width: 0;
}
.post-save-action-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-700);
}
.post-save-action-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== マイページ内 専属AIコーチ チャット ===== */
.coach-card {
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 16px;
}
.coach-card-title { font-weight: 700; font-size: 1rem; }
.coach-card-sub { color: var(--text-secondary, #94a3b8); font-size: 0.8rem; margin: 2px 0 10px; }
.coach-log {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.coach-empty { color: var(--text-secondary, #94a3b8); font-size: 0.85rem; line-height: 1.6; padding: 8px 0; }
.coach-bubble {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 0.9rem;
  border-radius: 10px;
  padding: 10px 12px;
  max-width: 92%;
  word-break: break-word;
}
.coach-bubble.user { align-self: flex-end; background: #e0ecff; }
.coach-bubble.ai { align-self: flex-start; background: #f1f5f9; }
.coach-think {
  align-self: flex-start;
  font-size: 0.78rem;
  color: var(--text-secondary, #94a3b8);
  background: #f8fafc;
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 8px 10px;
  white-space: pre-wrap;
}
.coach-input-row { display: flex; gap: 8px; }
.coach-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
}
.coach-input-row button { white-space: nowrap; }
