/* =========================================================
   CHILIZ PREDICT 2026 — styles (LIGHT THEME)
   白基調 × Chilizレッド/ピンクの差し色 × 動く背景
   ========================================================= */
:root {
  --chiliz: #ff0a4e;
  --chiliz-2: #ff3d6e;
  --chiliz-deep: #d4003f;
  --gold: #e8a200;
  --pitch: #12b46a;
  --bg: #f4f6fb;
  --bg-soft: #eef1f8;
  --card: #ffffff;
  --line: rgba(20, 22, 44, 0.10);
  --line-strong: rgba(20, 22, 44, 0.18);
  --text: #15151f;
  --muted: #6b7184;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(40, 30, 70, 0.10);
  --shadow-soft: 0 4px 16px rgba(40, 30, 70, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans JP", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---------- 背景（白基調 + Chiliz差し色グロー） ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(20,22,44,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,22,44,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 35%, transparent 100%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -4;
  background:
    radial-gradient(820px 460px at 82% -6%, rgba(255,10,78,0.16), transparent 60%),
    radial-gradient(680px 440px at 6% 8%, rgba(255,61,110,0.12), transparent 55%),
    linear-gradient(180deg, #ffffff, #eef1f8);
}

/* ---------- 動く背景（サッカーボール & Chilizロゴ） ---------- */
.bg-decor { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.bg-decor img { position: absolute; will-change: transform; }
.bg-ball {
  opacity: 0.07;
  filter: grayscale(20%);
}
.bg-logo {
  opacity: 0.06;
}
.bg-ball.b1 { width: 260px; top: 12%; left: -60px; animation: floatA 26s ease-in-out infinite, spin 40s linear infinite; }
.bg-ball.b2 { width: 180px; bottom: 8%; right: -40px; animation: floatB 32s ease-in-out infinite, spin 55s linear infinite reverse; }
.bg-ball.b3 { width: 130px; top: 58%; left: 12%; animation: floatA 38s ease-in-out infinite, spin 48s linear infinite; opacity: 0.05; }
.bg-logo.l1 { width: 300px; top: 30%; right: 6%; animation: floatB 30s ease-in-out infinite; }
.bg-logo.l2 { width: 200px; bottom: 18%; left: 4%; animation: floatA 34s ease-in-out infinite; opacity: 0.05; }

@keyframes floatA { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px,-36px); } }
@keyframes floatB { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-46px,34px); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bg-decor img { animation: none !important; } }

b { color: var(--text); }
small { font-size: 0.62em; opacity: 0.65; font-weight: 600; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(40,30,70,0.05);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(255,10,78,0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-family: "Oswald", sans-serif; font-weight: 600; letter-spacing: 1px; font-size: 20px; }
.brand-title b { color: var(--chiliz); }
.brand-sub { font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-lang {
  font-family: "Oswald", sans-serif; font-weight: 600; font-size: 12px;
  letter-spacing: 0.5px; cursor: pointer; color: var(--text);
  background: #fff; border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 7px 12px; white-space: nowrap; transition: all 0.15s;
}
.btn-lang:hover { border-color: var(--chiliz); color: var(--chiliz); }
.net-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--muted); background: #fff; white-space: nowrap;
}
.net-badge.ok { color: #0b8f53; border-color: rgba(18,180,106,0.4); background: rgba(18,180,106,0.10); }
.net-badge.warn { color: #b07400; border-color: rgba(232,162,0,0.4); background: rgba(232,162,0,0.10); }

/* ---------- ボタン ---------- */
.btn {
  font-family: inherit; font-weight: 700; cursor: pointer;
  border: none; border-radius: 999px;
  padding: 11px 18px; font-size: 14px; color: #fff;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-connect {
  background: linear-gradient(135deg, var(--chiliz), var(--chiliz-deep));
  box-shadow: 0 8px 20px rgba(255,10,78,0.30);
  white-space: nowrap; flex-shrink: 0;
}
.btn-connect .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.8); opacity: 0.95; }
.btn-connect.connected { background: #fff; color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow-soft); }
.btn-connect.connected .dot { background: var(--pitch); box-shadow: 0 0 8px var(--pitch); }
.btn-connect.loading { opacity: 0.75; pointer-events: none; }
.btn-connect.loading .dot { animation: pulseDot 0.9s ease-in-out infinite; }
@keyframes pulseDot { 0%,100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.6); opacity: 1; } }

.btn-bet {
  width: 100%; justify-content: center; font-size: 16px; padding: 15px;
  background: linear-gradient(135deg, var(--chiliz), var(--chiliz-deep));
  box-shadow: 0 10px 24px rgba(255,10,78,0.35);
}
.btn-x { width: 100%; justify-content: center; margin-top: 10px; background: #15151f; color: #fff; border: 1px solid #15151f; }
.btn-x:hover { background: #000; }

/* ---------- ヒーロー ---------- */
.hero { padding: clamp(32px, 7vw, 72px) clamp(16px, 5vw, 48px) 20px; }
.hero-inner { max-width: 1000px; margin: 0 auto; text-align: center; }
.hero-kicker {
  display: inline-block; font-family: "Oswald", sans-serif;
  font-size: 12px; letter-spacing: 3px; color: var(--chiliz-deep);
  border: 1px solid rgba(255,10,78,0.30); border-radius: 999px;
  padding: 6px 14px; margin-bottom: 18px; background: rgba(255,10,78,0.05);
}
.hero-title {
  font-family: "Oswald", "Noto Sans JP", sans-serif; font-weight: 700; line-height: 1.12;
  font-size: clamp(30px, 6.5vw, 60px); letter-spacing: 0.5px; color: var(--text);
}
.hero-title .grad {
  background: linear-gradient(120deg, var(--chiliz), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { color: var(--muted); margin: 18px auto 0; max-width: 640px; line-height: 1.9; font-size: clamp(13px, 1.7vw, 16px); }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 720px; margin: 34px auto 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px; text-align: center; box-shadow: var(--shadow-soft); }
.stat-label { display: block; font-size: 11px; color: var(--muted); letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-family: "Oswald", sans-serif; font-size: clamp(18px, 3vw, 26px); font-weight: 600; }

.payout-bar { display: flex; max-width: 720px; margin: 28px auto 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); height: 56px; box-shadow: var(--shadow-soft); }
.payout-seg { width: var(--w); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-size: 10px; gap: 1px; min-width: 0; overflow: hidden; }
.payout-seg b { font-family: "Oswald", sans-serif; font-size: 16px; }
.payout-seg span { white-space: nowrap; opacity: 0.92; }
.payout-seg.champ { background: linear-gradient(135deg, var(--chiliz), var(--chiliz-deep)); }
.payout-seg.runner { background: linear-gradient(135deg, #8a91a3, #626a7d); }
.payout-seg.third { background: linear-gradient(135deg, #c98a4a, #9a5f2c); }
.payout-seg.ops { background: #2a2c3a; }
.payout-note { text-align: center; color: var(--muted); font-size: 11px; margin: 12px auto 0; max-width: 660px; line-height: 1.6; }

/* ---------- カテゴリ切替 ---------- */
.category-switch {
  position: sticky; top: 62px; z-index: 20;
  display: flex; gap: 8px; justify-content: center; padding: 14px 16px; margin: 8px auto 0; flex-wrap: wrap;
  background: rgba(244, 246, 251, 0.82); backdrop-filter: blur(10px);
}
.cat-btn {
  font-family: "Oswald", "Noto Sans JP", sans-serif; font-weight: 600; font-size: 14px; letter-spacing: 0.5px;
  background: #fff; color: var(--muted); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 10px 18px; cursor: pointer; transition: all 0.18s; box-shadow: var(--shadow-soft);
}
.cat-btn:hover { color: var(--text); border-color: var(--chiliz); }
.cat-btn.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--chiliz), var(--chiliz-deep)); box-shadow: 0 6px 16px rgba(255,10,78,0.30); }

/* ---------- 人気ランキング ---------- */
.ranking { max-width: 760px; margin: 18px auto 0; padding: 0 16px; }
.ranking-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.ranking-head h2 { font-family: "Oswald", "Noto Sans JP", sans-serif; font-weight: 600; font-size: clamp(16px, 2.6vw, 20px); letter-spacing: 0.5px; }
.rank-cat { color: var(--chiliz-deep); }
.ranking-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Oswald", sans-serif; font-size: 11px; letter-spacing: 1.5px;
  color: #0b8f53; border: 1px solid rgba(18,180,106,0.35); border-radius: 999px; padding: 4px 10px; background: rgba(18,180,106,0.08);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pitch); box-shadow: 0 0 8px var(--pitch); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.ranking-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; cursor: pointer; position: relative; overflow: hidden; box-shadow: var(--shadow-soft);
  transition: transform 0.2s, border-color 0.15s, box-shadow 0.2s;
}
.rank-item:hover { border-color: var(--chiliz); box-shadow: 0 8px 20px rgba(255,10,78,0.12); transform: translateY(-1px); }
.rank-pos { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 18px; width: 28px; text-align: center; color: var(--muted); flex-shrink: 0; }
.rank-item.top1 .rank-pos { color: var(--gold); }
.rank-item.top2 .rank-pos { color: #8a91a3; }
.rank-item.top3 .rank-pos { color: #c98a4a; }
.rank-item.top1 { border-color: rgba(232,162,0,0.45); }
.rank-flag { width: 38px; height: 25px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.18); flex-shrink: 0; background: #eee; }
.rank-name { flex: 1; min-width: 0; }
.rank-name b { font-size: 15px; display: block; }
.rank-name span { font-size: 10px; color: var(--muted); letter-spacing: 0.5px; }
.rank-amt { text-align: right; flex-shrink: 0; }
.rank-amt b { font-family: "Oswald", sans-serif; font-size: 16px; color: var(--chiliz-deep); }
.rank-amt span { display: block; font-size: 10px; color: var(--muted); }
.rank-fill { position: absolute; left: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--chiliz), var(--gold)); width: 0%; transition: width 0.6s ease; }
.ranking-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--card); }

/* ---------- マイパネル ---------- */
.my-panel { max-width: 1100px; margin: 16px auto 0; padding: 0 16px; }
.my-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-soft); }
.my-item { display: flex; flex-direction: column; gap: 3px; }
.my-label { font-size: 11px; color: var(--muted); }
.my-value { font-family: "Oswald", sans-serif; font-size: 17px; }

/* ---------- グループ ---------- */
.groups { max-width: 1180px; margin: 26px auto 60px; padding: 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.group-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); border-top: 4px solid var(--chiliz);
}
.group-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 2px solid var(--line-strong); background: linear-gradient(180deg, rgba(255,10,78,0.06), rgba(255,10,78,0.02)); }
.group-badge { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 15px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--chiliz), var(--chiliz-deep)); }
.group-title { font-family: "Oswald", sans-serif; letter-spacing: 1px; font-size: 14px; color: var(--muted); }

.team { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; position: relative; border-top: 1px solid var(--line); transition: background 0.15s; }
.team:first-of-type { border-top: none; }
.team:hover { background: rgba(255,10,78,0.05); }
.team-flag { width: 42px; height: 28px; border-radius: 5px; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,0.18); flex-shrink: 0; background: #eee; }
.team-info { flex: 1; min-width: 0; }
.team-name { font-weight: 700; font-size: 15px; }
.team-en { font-size: 11px; color: var(--muted); letter-spacing: 0.5px; }
.team-amount { text-align: right; flex-shrink: 0; }
.team-amount b { font-family: "Oswald", sans-serif; font-size: 16px; color: var(--chiliz-deep); }
.team-amount span { display: block; font-size: 10px; color: var(--muted); }
.team-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--chiliz), var(--gold)); width: 0%; transition: width 0.5s ease; border-radius: 0 3px 0 0; }

/* ---------- 結果 ---------- */
.results { max-width: 900px; margin: 0 auto 60px; padding: 0 16px; text-align: center; }
.results h2 { font-family: "Oswald", sans-serif; letter-spacing: 1px; margin-bottom: 18px; }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.result { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; background: var(--card); box-shadow: var(--shadow-soft); }
.result span { font-size: 13px; color: var(--muted); }
.result b { font-size: 20px; font-family: "Oswald", sans-serif; }
.result.champ { background: rgba(255,10,78,0.06); border-color: rgba(255,10,78,0.3); }
.result.third { background: rgba(201,138,74,0.08); border-color: rgba(201,138,74,0.3); }

/* ---------- フッター ---------- */
.site-footer { text-align: center; padding: 34px 16px 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; background: rgba(255,255,255,0.5); }
.site-footer .muted { font-size: 11px; opacity: 0.7; margin-top: 14px; }
.footer-share {
  margin: 16px auto 4px; max-width: 320px; width: 100%;
}
.footer-share .btn-x { margin-top: 0; }

/* 利用規約 */
.terms { max-width: 720px; margin: 18px auto 0; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-soft); }
.terms summary { cursor: pointer; padding: 14px 18px; font-weight: 700; color: var(--text); font-size: 13px; list-style: none; user-select: none; }
.terms summary::-webkit-details-marker { display: none; }
.terms summary::before { content: "📄 "; }
.terms[open] summary { border-bottom: 1px solid var(--line); }
.terms-list { margin: 0; padding: 16px 18px 18px 36px; display: flex; flex-direction: column; gap: 10px; }
.terms-list li { font-size: 12px; line-height: 1.7; color: var(--muted); }
.terms-list li b { color: var(--text); }

/* ---------- モーダル ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20,18,34,0.45); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade 0.18s ease; }
.modal-overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { position: relative; width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 24px; text-align: center; box-shadow: 0 30px 70px rgba(20,18,40,0.30); animation: pop 0.2s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: scale(0.94) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--chiliz); }
.modal-flag img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.22); margin: 0 auto; }
.modal h3 { font-size: 24px; margin-top: 14px; }
.modal-cat { color: var(--chiliz-deep); font-weight: 700; font-size: 13px; margin-top: 4px; }

.modal-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.modal-totals > div { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; }
.modal-totals span { font-size: 10px; color: var(--muted); display: block; }
.modal-totals b { font-family: "Oswald", sans-serif; font-size: 16px; color: var(--chiliz-deep); }

.modal-amount-label { display: block; text-align: left; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.amount-row { display: flex; flex-direction: column; gap: 10px; }
#betAmount { width: 100%; padding: 14px 16px; font-size: 18px; font-family: "Oswald", sans-serif; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); }
#betAmount:focus { outline: none; border-color: var(--chiliz); }
.quick { display: flex; gap: 8px; }
.quick button { flex: 1; padding: 9px; border-radius: 10px; cursor: pointer; background: var(--bg-soft); border: 1px solid var(--line-strong); color: var(--text); font-family: "Oswald", sans-serif; font-weight: 600; }
.quick button:hover { border-color: var(--chiliz); color: var(--chiliz); }

.modal-msg { font-size: 12px; margin-top: 12px; min-height: 16px; }
.modal-msg.err { color: var(--chiliz-deep); }
.modal-msg.ok { color: #0b8f53; }

/* 同意モーダル */
.agree-sub { color: var(--muted); font-size: 13px; margin: 8px 0 14px; line-height: 1.6; }
.agree-scroll { max-height: 240px; overflow-y: auto; text-align: left; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 32px; margin-bottom: 16px; }
.agree-check { display: flex; align-items: flex-start; gap: 10px; text-align: left; font-size: 13px; color: var(--text); cursor: pointer; margin-bottom: 16px; background: rgba(255,10,78,0.05); border: 1px solid rgba(255,10,78,0.25); border-radius: 10px; padding: 12px 14px; }
.agree-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--chiliz); flex-shrink: 0; cursor: pointer; }
#agreeCancel { margin-top: 8px; }

/* ---------- トースト ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--line-strong); color: var(--text); padding: 14px 20px; border-radius: 12px; z-index: 60; box-shadow: var(--shadow); font-size: 14px; max-width: 90vw; animation: pop 0.2s ease; }
.toast.ok { border-color: rgba(18,180,106,0.5); }
.toast.err { border-color: rgba(255,10,78,0.5); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 560px) {
  .brand-sub { display: none; }
  .site-header { padding: 12px 14px; }
  .brand-mark { font-size: 22px; }
  .brand-title { font-size: 17px; }
  .header-actions { gap: 6px; }
  .net-badge { display: none; }
  .btn-lang { padding: 7px 9px; font-size: 11px; }
  .btn-connect { padding: 9px 12px; font-size: 12px; }
  .btn-connect .dot { width: 6px; height: 6px; }
  .hero-stats { grid-template-columns: 1fr; }
  .payout-seg span { display: none; }
  .payout-seg.third, .payout-seg.ops { font-size: 9px; }
  .category-switch { top: 60px; }
  .cat-btn { padding: 9px 14px; font-size: 13px; }
  .groups { grid-template-columns: 1fr; gap: 26px; }       /* グループ間を広く */
  .group-card { border-top-width: 5px; box-shadow: 0 10px 26px rgba(40,30,70,0.14); }
  .group-head { padding: 16px; }
  .team { padding: 14px 16px; }
  .bg-ball.b1, .bg-logo.l1 { width: 180px; }
  .bg-ball.b2 { width: 120px; }
  .results-grid { grid-template-columns: 1fr; }
}
