/* ============================================
   出玉レポ - メインCSS
   テーマ: ホワイト・クリーン・ゴールドアクセント
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #f5f6fa;
  color: #1a1a2e;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; display: block; }

:root {
  --gold: #d97706;
  --gold-dark: #b45309;
  --gold-light: #fbbf24;
  --gold-bg: #fffbeb;
  --primary: #1e1b4b;
  --primary-light: #312e81;
  --bg: #f5f6fa;
  --white: #ffffff;
  --border: #e5e7eb;
  --border-gold: rgba(217,119,6,0.2);
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --win: #059669;
  --win-bg: #ecfdf5;
  --win-border: #a7f3d0;
  --lose: #dc2626;
  --lose-bg: #fef2f2;
  --lose-border: #fecaca;
  --even: #6b7280;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.04);
}

/* ===== HEADER ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-logo-img {
  height: 44px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
}
/* 旧ロゴ用（後方互換） */
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(67,56,202,0.3);
}
.logo-icon svg {
  width: 22px; height: 22px;
}
.logo-text-wrap .logo-main {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.logo-text-wrap .logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  transition: 0.2s;
}
.nav-link:hover { color: var(--primary); background: #f3f4f6; }
.btn-header-login {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}
.btn-header-login:hover { border-color: var(--primary); color: var(--primary); }
.btn-header-post {
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(67,56,202,0.25);
}
.btn-header-post:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(67,56,202,0.3); }

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.page-wrap { padding: 32px 16px; max-width: 1100px; margin: 0 auto; box-sizing: border-box; width: 100%; }
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }

/* ===== CARD BASE ===== */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fafafa;
}

/* ===== REPORT CARD ===== */
.report-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  transition: 0.2s;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.report-card:hover {
  border-color: #c7d2fe;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.report-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.report-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 13px; font-weight: 700; color: var(--text); }
.report-date { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.balance-badge {
  font-size: 20px;
  font-weight: 900;
  padding: 5px 14px;
  border-radius: 10px;
  letter-spacing: -0.02em;
}
.balance-badge.win {
  color: var(--win);
  background: var(--win-bg);
  border: 1.5px solid var(--win-border);
}
.balance-badge.lose {
  color: var(--lose);
  background: var(--lose-bg);
  border: 1.5px solid var(--lose-border);
}
.balance-badge.even {
  color: var(--even);
  background: #f9fafb;
  border: 1.5px solid var(--border);
}

.report-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.report-info-item { display: flex; align-items: center; gap: 3px; }
.report-info-item .material-symbols-rounded { font-size: 14px; }
.store-name-link { color: #4338ca; font-weight: 700; }
.store-name-link:hover { text-decoration: underline; }
.machine-name { color: var(--text); font-weight: 600; }

.report-comment {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 3px solid #c7d2fe;
}

.report-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: 0.2s;
}
.action-btn:hover { color: #4338ca; background: #eef2ff; }
.action-btn.liked { color: #4338ca; }
.action-btn .material-symbols-rounded { font-size: 16px; }

/* ===== WIN/LOSE ===== */
.win { color: var(--win) !important; }
.lose { color: var(--lose) !important; }
.even { color: var(--even) !important; }

/* ===== RANKING ===== */
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: 0.2s;
}
.rank-item:last-child { border-bottom: none; }
.rank-item:hover { background: #f9fafb; }
.rank-num {
  width: 28px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.rank-num.top1 { font-size: 18px; }
.rank-num.top2 { font-size: 16px; }
.rank-num.top3 { font-size: 15px; }
.rank-user { flex: 1; min-width: 0; }
.rank-username { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.rank-detail { font-size: 11px; color: var(--text-muted); }
.rank-amount { font-size: 15px; font-weight: 900; flex-shrink: 0; }

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: 0.2s;
}
.tab-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 7px; }
.form-label span { color: var(--lose); margin-left: 4px; }
.form-control {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: 0.2s;
  font-family: inherit;
}
.form-control:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-control::placeholder { color: #9ca3af; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: 0.2s;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  color: #fff;
  width: 100%;
  box-shadow: 0 2px 8px rgba(67,56,202,0.25);
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(67,56,202,0.3); }
.btn-secondary {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
  width: 100%;
}
.btn-secondary:hover { border-color: #6366f1; color: #4338ca; background: #eef2ff; }
.btn-danger { background: var(--lose-bg); border: 1.5px solid var(--lose-border); color: var(--lose); }

/* ===== AUTH PAGES ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f6fa 50%, #fdf4ff 100%);
}
.auth-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-icon-wrap {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 12px rgba(67,56,202,0.3);
}
.auth-logo .logo-main { font-size: 24px; font-weight: 900; color: var(--primary); }
.auth-logo .logo-sub { font-size: 12px; color: var(--text-muted); }
.auth-title { font-size: 18px; font-weight: 800; margin-bottom: 24px; color: var(--text); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: #4338ca; font-weight: 600; }

/* ===== HERO (TOP) ===== */
.hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: #fff;
  padding: 48px 20px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(251,191,36,0.15), transparent 70%);
  border-radius: 50%;
}
.hero h1 {
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
  position: relative; z-index: 1;
  letter-spacing: -0.02em;
}
.hero h1 span { color: #fbbf24; }
.hero p { font-size: 14px; color: rgba(255,255,255,0.75); margin-bottom: 28px; position: relative; z-index: 1; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  max-width: 500px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.hero-stat-item {
  flex: 1;
  text-align: center;
  padding: 16px 20px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.hero-stat-item:last-child { border-right: none; }
.hero-stat-num { font-size: 26px; font-weight: 900; color: #fbbf24; display: block; line-height: 1; }
.hero-stat-label { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 4px; }

/* ===== FILTER BAR ===== */
.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: var(--shadow);
}
.filter-bar select {
  background: #f9fafb;
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.filter-bar select:focus { border-color: #6366f1; }

/* ===== NOTICE / ALERT ===== */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: var(--win-bg); border: 1px solid var(--win-border); color: var(--win); }
.alert-error { background: var(--lose-bg); border: 1px solid var(--lose-border); color: var(--lose); }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ===== MYPAGE ===== */
.mypage-header {
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(67,56,202,0.25);
}
.mypage-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.3);
}
.mypage-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mypage-username { font-size: 22px; font-weight: 900; color: #fff; }
.mypage-meta { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 4px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.stat-card-value { font-size: 20px; font-weight: 900; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s;
  cursor: pointer;
}
.page-btn:hover, .page-btn.active { background: #4338ca; color: #fff; border-color: #4338ca; }

/* ===== FOOTER ===== */
.site-footer {
  background: #1e1b4b;
  color: rgba(255,255,255,0.7);
  padding: 48px 20px 28px;
  margin-top: 60px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-top { display: flex; gap: 48px; flex-wrap: wrap; margin-bottom: 32px; }
.footer-brand .logo-main { font-size: 20px; font-weight: 900; color: #fff; }
.footer-brand .logo-sub-footer { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.footer-brand p { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 12px; line-height: 1.8; max-width: 260px; }
.footer-links-col h4 { font-size: 11px; font-weight: 800; color: #fbbf24; margin-bottom: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-links-col a { display: block; font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 10px; transition: 0.2s; }
.footer-links-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 11px; color: rgba(255,255,255,0.4); }

/* ===== MOBILE ===== */
.hamburger-btn { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger-bar { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: 0.3s; }
.mobile-menu { display: none; position: fixed; top: 0; right: -100%; width: 80%; max-width: 300px; height: 100vh; background: #fff; border-left: 1px solid #e5e7eb; z-index: 200; transition: right 0.3s; padding: 60px 24px 24px; box-shadow: -4px 0 20px rgba(0,0,0,0.1); }
.mobile-menu.active { right: 0; display: block; }
.mobile-menu a { display: block; font-size: 15px; font-weight: 700; color: #1a1a2e !important; padding: 14px 0; border-bottom: 1px solid #e5e7eb; }
.mobile-menu a:hover { color: #4338ca !important; }
.menu-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: #6b7280; cursor: pointer; font-size: 24px; }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .side-col { order: -1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .header-nav { display: none; }
  .hamburger-btn { display: block; }
  .hero h1 { font-size: 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .mypage-header { flex-direction: column; text-align: center; }
  .footer-top { gap: 28px; }
  .page-wrap { padding: 16px 12px; }
  .report-card { padding: 14px 12px; }
  .filter-bar { padding: 10px 12px; gap: 6px; }
  .filter-bar select { font-size: 12px; padding: 6px 8px; }
  .hero { padding: 40px 14px 32px; }
  .battle-box { margin: 0 0 24px; }
  .battle-amount { font-size: 20px; }
  .section-header { padding: 0 12px; }
  .scroll-row { padding: 0 12px 12px; }
}

/* ===== BOTTOM NAV (スマホ専用) ===== */
.bottom-nav {
  display: none;
}
@media (max-width: 767px) {
  /* ボトムナビ分の余白 */
  body { padding-bottom: 68px; }

  .bottom-nav {
    display: flex;
    flex-wrap: wrap;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: rgba(13,15,26,0.97);
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* 1行に5〜6個並ぶよう均等配置 */
    justify-content: space-around;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 4px);
  }

  .bnav-item {
    flex: 1 0 0;
    min-width: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    gap: 2px;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: 0.15s;
    position: relative;
  }
  .bnav-item:active { opacity: 0.7; }

  .bnav-icon {
    font-size: 22px;
    line-height: 1;
    display: block;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  }
  .bnav-item.bnav-active .bnav-icon {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  }
  .bnav-lbl {
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }

  /* アクティブ状態 */
  .bnav-item.bnav-active {
    color: #fbbf24;
  }
  .bnav-item.bnav-active .bnav-icon {
    filter: drop-shadow(0 0 4px rgba(251,191,36,0.7));
  }
  .bnav-item.bnav-active::after {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 2px;
    background: linear-gradient(90deg, #d97706, #fbbf24);
    border-radius: 0 0 4px 4px;
  }

  /* 投稿ボタンは強調 */
  .bnav-post {
    color: #fbbf24 !important;
  }
  .bnav-post .bnav-icon {
    background: linear-gradient(135deg, #d97706, #fbbf24);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24 !important;
    color: #0d0f1a !important;
    box-shadow: 0 2px 12px rgba(251,191,36,0.45);
    margin-bottom: 1px;
  }
}
