/* ============================================
   ソルマーレ長崎FC アプリ v2 CSS
   カラー: Navy × Gold × Black
   ============================================ */

:root {
  --navy: #1a3668;
  --navy-dark: #0f2247;
  --navy-light: #2a4a82;
  --gold: #d4a017;
  --gold-light: #f0c040;
  --gold-pale: #fdf4d8;
  --black: #1a2236;
  --white: #ffffff;
  --gray-50: #f8f9fb;
  --gray-100: #f1f3f5;
  --gray-200: #e2e5ea;
  --gray-300: #cdd1d8;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: all 0.2s ease;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 56px;
  --nav-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100dvh;
  overscroll-behavior: none;
}

#root {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--white);
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.06);
}

/* ===== Header ===== */
.header {
  background: var(--black);
  height: var(--header-h);
  padding: var(--safe-top) 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo img { height: 34px; display: block; }

.header-settings {
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.header-settings:hover { background: rgba(255,255,255,0.2); }
.header-settings svg { width: 20px; height: 20px; }

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  height: var(--nav-h);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 0.58rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  gap: 2px;
  position: relative;
}

.nav-item.active { color: var(--navy); }
.nav-item svg { width: 22px; height: 22px; }

.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 16px);
  background: var(--red);
  color: var(--white);
  font-size: 0.55rem;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ===== Main Content ===== */
.main-content {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 4px);
  min-height: calc(100dvh - var(--header-h));
}

/* ===== Tabs ===== */
.tab-bar {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: var(--header-h);
  z-index: 50;
}

.tab-item {
  flex: 1;
  padding: 10px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-400);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-align: center;
}

.tab-item.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ===== Section ===== */
.section { padding: 16px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.section-more {
  font-size: 0.75rem;
  color: var(--navy);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card + .card { margin-top: 10px; }

/* ===== Home Banner ===== */
.home-banner {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: var(--white);
  padding: 20px 16px 24px;
  position: relative;
  overflow: hidden;
}

.home-banner::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(212,160,23,0.12);
  border-radius: 50%;
}

.home-greeting { font-size: 0.85rem; opacity: 0.85; }

.home-next-label {
  font-size: 0.7rem;
  color: var(--gold-light);
  margin-top: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.home-next-date { font-size: 1.1rem; font-weight: 700; margin-top: 2px; }
.home-next-title { font-size: 0.9rem; opacity: 0.9; margin-top: 2px; }

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px;
  margin-top: -14px;
  position: relative;
  z-index: 1;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.stat-number { font-size: 1.3rem; font-weight: 900; color: var(--navy); }
.stat-label { font-size: 0.6rem; color: var(--gray-500); margin-top: 1px; }

/* ===== Schedule Items ===== */
.schedule-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.schedule-item:hover { border-color: var(--navy); background: #f8f9fd; }

.schedule-date-box {
  min-width: 50px;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 6px 4px;
}

.schedule-date-box.cat-training { background: #eef2ff; }
.schedule-date-box.cat-trm { background: var(--gold-pale); }
.schedule-date-box.cat-cup { background: #fce7f3; }
.schedule-date-box.cat-official { background: #fee2e2; }
.schedule-date-box.cat-other { background: var(--gray-100); }

.schedule-month { font-size: 0.6rem; color: var(--gray-500); font-weight: 500; }
.schedule-day { font-size: 1.3rem; font-weight: 900; line-height: 1.2; }

.cat-training .schedule-day { color: var(--navy); }
.cat-trm .schedule-day { color: #92400e; }
.cat-cup .schedule-day { color: #9d174d; }
.cat-official .schedule-day { color: var(--red); }
.cat-other .schedule-day { color: var(--gray-600); }

.schedule-dow { font-size: 0.55rem; color: var(--gray-500); }
.schedule-info { flex: 1; min-width: 0; }

.schedule-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  margin-bottom: 3px;
}

.badge-training { background: #eef2ff; color: var(--navy); }
.badge-trm { background: var(--gold-pale); color: #92400e; }
.badge-cup { background: #fce7f3; color: #9d174d; }
.badge-official { background: #fee2e2; color: var(--red); }
.badge-other { background: var(--gray-100); color: var(--gray-600); }

.schedule-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }

.schedule-meta {
  font-size: 0.7rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.schedule-meta svg { width: 13px; height: 13px; flex-shrink: 0; }

.att-counts { display: flex; gap: 8px; margin-top: 6px; font-size: 0.65rem; font-weight: 600; }
.att-yes { color: var(--green); }
.att-no { color: var(--red); }
.att-tbd { color: var(--gray-400); }

/* ===== Schedule view modes ===== */
.schedule-view-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  background: var(--white);
}

.view-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  color: var(--gray-500);
}

.view-tab.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ===== Announcements ===== */
.announcement-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: var(--transition);
}

.announcement-item:last-child { border-bottom: none; }
.announcement-item:hover { background: #f8f9fd; }

.ann-top { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }

.ann-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
}

.ann-info { background: var(--gray-100); color: var(--gray-600); }
.ann-urgent { background: #fee2e2; color: var(--red); }
.ann-event { background: #fce7f3; color: #9d174d; }
.ann-result { background: var(--green-bg); color: var(--green); }

.ann-pin { color: var(--gold); display: flex; }
.ann-pin svg { width: 14px; height: 14px; }

.ann-title { font-size: 0.85rem; font-weight: 600; }
.ann-preview { font-size: 0.75rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ann-footer { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--gray-400); margin-top: 4px; }

/* ===== Detail Panel ===== */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.panel {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 18px calc(18px + var(--safe-bottom));
  animation: slideUp 0.25s ease;
}

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

.panel-handle { width: 36px; height: 4px; background: var(--gray-300); border-radius: 2px; margin: 0 auto 14px; }
.panel-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.panel-meta { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 14px; display: flex; gap: 10px; }
.panel-content { font-size: 0.85rem; line-height: 1.8; color: var(--gray-700); white-space: pre-wrap; }

.detail-row { display: flex; gap: 10px; padding: 8px 0; }
.detail-row svg { width: 18px; height: 18px; color: var(--navy); flex-shrink: 0; margin-top: 2px; }
.detail-label { font-size: 0.7rem; color: var(--gray-500); }
.detail-value { font-size: 0.85rem; font-weight: 500; }

.detail-date-header { text-align: center; padding: 14px 0; border-bottom: 1px solid var(--gray-100); margin-bottom: 12px; }
.detail-date-big { font-size: 1.8rem; font-weight: 900; color: var(--navy); }
.detail-date-dow { font-size: 0.85rem; color: var(--gray-500); }

.att-buttons { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gray-100); }

.att-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  background: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.att-btn:hover { border-color: var(--navy); }
.att-btn.sel-yes { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.att-btn.sel-no { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.att-btn.sel-tbd { border-color: var(--gray-400); background: var(--gray-100); color: var(--gray-600); }

.parking-warn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fef3c7;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: 0.8rem;
  color: #92400e;
  font-weight: 500;
}

/* ===== Members / Team ===== */
.member-list { padding: 12px 16px; }

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

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

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

.member-avatar.staff-avatar { background: linear-gradient(135deg, var(--gold), #c49000); }
.member-name { font-size: 0.85rem; font-weight: 600; }
.member-sub { font-size: 0.7rem; color: var(--gray-500); }

.member-number {
  margin-left: auto;
  background: var(--navy);
  color: var(--gold-light);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== Player (my child) ===== */
.player-hero {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: var(--white);
  padding: 24px 16px;
  text-align: center;
}

.player-hero-name { font-size: 1.2rem; font-weight: 900; }
.player-hero-sub { font-size: 0.75rem; opacity: 0.8; margin-top: 2px; }
.player-hero-number { display: inline-block; font-size: 2rem; font-weight: 900; color: var(--gold); margin-top: 4px; }

.memory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
}

.memory-item {
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

.memory-item h4 { font-size: 0.65rem; color: var(--gray-500); margin-bottom: 2px; }
.memory-item p { font-size: 0.85rem; font-weight: 600; }
.memory-item.highlight { background: var(--gold-pale); border-color: var(--gold); }
.memory-item.highlight h4 { color: #92400e; }

.memory-full {
  margin: 0 16px 10px;
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.memory-full h4 { font-size: 0.7rem; color: var(--gray-500); margin-bottom: 4px; }
.memory-full p { font-size: 0.85rem; line-height: 1.6; }

/* ===== Library ===== */
.library-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: var(--transition);
}

.library-item:hover { background: #f8f9fd; }

.library-thumb {
  width: 80px;
  height: 56px;
  border-radius: var(--radius-xs);
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.library-thumb svg { width: 24px; height: 24px; color: var(--gray-400); }

.play-icon {
  position: absolute;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon svg { width: 14px; height: 14px; color: var(--white) !important; }

.library-info { flex: 1; min-width: 0; }
.library-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.library-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.library-tag {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-600);
}

.tag-indoor { background: #dbeafe; color: #1e40af; }
.tag-outdoor { background: #dcfce7; color: #166534; }
.tag-shoot { background: #fee2e2; color: var(--red); }
.tag-pass { background: #eef2ff; color: var(--navy); }
.tag-dribble { background: var(--gold-pale); color: #92400e; }
.tag-tactics { background: #fce7f3; color: #9d174d; }
.tag-physical { background: #f0fdf4; color: var(--green); }
.tag-gk { background: #f5f3ff; color: #6d28d9; }

.library-added-by { font-size: 0.6rem; color: var(--gray-400); margin-top: 4px; }

/* ===== Calendar ===== */
.mini-calendar { padding: 12px 16px; }

.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month { font-size: 0.9rem; font-weight: 700; }

.cal-nav {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.8rem;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }

.cal-dow { font-size: 0.6rem; font-weight: 600; color: var(--gray-400); padding: 4px 0; }

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  font-weight: 500;
}

.cal-day:hover { background: var(--gray-100); }
.cal-day.today { font-weight: 900; color: var(--navy); }

.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.cal-day.selected { background: var(--navy); color: var(--white); }
.cal-day.selected::after { background: var(--gold-light); }
.cal-day.other-month { color: var(--gray-300); }
.cal-day.sunday { color: var(--red); }
.cal-day.saturday { color: var(--blue); }
.cal-day.selected.sunday, .cal-day.selected.saturday { color: var(--white); }

/* ===== Forms & Auth ===== */
.auth-page { padding: 40px 24px; text-align: center; }
.auth-logo { width: 80px; margin: 0 auto 16px; }
.auth-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 24px; }

.form-group { margin-bottom: 14px; text-align: left; }
.form-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--gray-600); margin-bottom: 4px; }

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,54,104,0.1); }

.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  gap: 6px;
}

.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-full { width: 100%; }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-outline { background: var(--white); color: var(--navy); border: 1px solid var(--navy); }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }

.text-link {
  color: var(--navy);
  font-size: 0.8rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  text-decoration: underline;
  margin-top: 12px;
}

/* ===== Utility ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-400); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 8px; }
.empty-state p { font-size: 0.8rem; }

.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  right: calc(50% - 220px);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 50;
}

.fab:hover { background: #c49000; transform: scale(1.05); }
.fab svg { width: 22px; height: 22px; }

@media (max-width: 480px) {
  #root { box-shadow: none; }
  .fab { right: 16px; }
}
