/* ============================================================
   Kupa 2026 — Stiller (koyu stadyum teması, altın vurgular)
   ============================================================ */
:root {
  --bg: #07140e;
  --bg2: #0a1f17;
  --panel: #0f2a20;
  --panel2: #134031;
  --line: rgba(255, 255, 255, 0.10);
  --txt: #eaf5ee;
  --muted: #9bb4a7;
  --green: #28c76f;
  --green-d: #16a34a;
  --gold: #ffcc33;
  --gold-d: #e0a800;
  --red: #ff5b5b;
  --blue: #3aa0ff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, #163a2b 0%, transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  color: var(--txt);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Üst bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(7, 20, 14, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .5px; }
.brand-logo { font-size: 22px; }
.brand-name { font-size: 18px; }
.brand-name b { color: var(--gold); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.wallet {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-weight: 700;
}
.wallet .coin { filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.icon-btn {
  background: var(--panel); border: 1px solid var(--line); color: var(--txt);
  width: 38px; height: 38px; border-radius: 999px; font-size: 16px; cursor: pointer;
}

/* ---------- Genel ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 80px; }
.screen { display: none; animation: fade .25s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.btn {
  border: none; border-radius: 12px; cursor: pointer; font-weight: 700;
  padding: 12px 18px; font-size: 15px; color: #06140d;
  background: var(--green); transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--gold-d)); color: #2a1d00; }
.btn-ghost { background: transparent; color: var(--txt); border: 1px solid var(--line); }
.btn-outline { background: var(--panel); color: var(--txt); border: 1px solid var(--line); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

.card {
  background: linear-gradient(180deg, var(--panel), #0c2118);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.muted { color: var(--muted); }
.center { text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: var(--panel2); color: var(--txt);
  border: 1px solid var(--line);
}

/* ---------- Ana ekran ---------- */
.hero { text-align: center; padding: 24px 10px 8px; }
.hero .cup { font-size: 64px; filter: drop-shadow(0 8px 18px rgba(255,204,51,.25)); }
.hero h1 { font-size: clamp(28px, 6vw, 46px); margin: 6px 0 2px; line-height: 1.05; }
.hero h1 .y { color: var(--gold); }
.hero p { color: var(--muted); max-width: 620px; margin: 8px auto 0; font-size: 15px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 22px 0 10px; }
.hero-cta .btn { padding: 14px 26px; font-size: 16px; }

.stat-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; min-width: 120px; text-align: center; }
.stat b { display: block; font-size: 22px; color: var(--gold); }
.stat span { font-size: 12px; color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 26px; }
.feature { padding: 16px; }
.feature .ic { font-size: 26px; }
.feature h3 { margin: 8px 0 4px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Bölüm başlığı ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 22px; }
.section-head .tools { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Tahmin ekranı ---------- */
.predict-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 14px 0; }
.team-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border-radius: 12px; cursor: pointer; text-align: center;
  background: var(--panel); border: 2px solid transparent; transition: .12s;
}
.team-pick:hover { border-color: var(--line); }
.team-pick.sel { border-color: var(--gold); background: #15301f; }
.team-pick .fl { font-size: 26px; line-height: 1; }
.team-pick .nm { font-size: 11px; color: var(--muted); font-weight: 600; }
.team-pick .rt { font-size: 10px; color: var(--gold); font-weight: 700; }

/* ---------- Gruplar ---------- */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.group-card { padding: 12px 12px 14px; }
.group-card h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.group-card h3 .tag { font-size: 10px; }
table.standings { width: 100%; border-collapse: collapse; font-size: 13px; }
table.standings th { color: var(--muted); font-weight: 600; font-size: 11px; text-align: center; padding: 2px 0; }
table.standings th.l, table.standings td.l { text-align: left; }
table.standings td { padding: 5px 2px; text-align: center; border-top: 1px solid var(--line); }
table.standings tr.qual td { background: rgba(40,199,111,.08); }
table.standings tr.qual2 td { background: rgba(58,160,255,.08); }
.team-cell { display: flex; align-items: center; gap: 6px; }
.team-cell .fl { font-size: 16px; }
.team-cell .cd { font-weight: 700; }
.pos { width: 16px; color: var(--muted); font-weight: 700; }
.matches { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.match-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  background: #0c2017; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 13px;
}
.match-row .side { display: flex; align-items: center; gap: 6px; min-width: 0; }
.match-row .side.away { justify-content: flex-end; }
.match-row .side .fl { font-size: 16px; }
.match-row .score { font-weight: 800; min-width: 46px; text-align: center; }
.match-row .vs { color: var(--muted); font-weight: 700; }
.match-row.played .score { color: var(--gold); }
.match-actions { display: flex; gap: 6px; justify-content: center; margin-top: 2px; }
.win-mark { color: var(--green); font-weight: 800; }

.md-tabs { display: flex; gap: 6px; }
.md-tab { padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 700; }
.md-tab.active { background: var(--gold); color: #2a1d00; border-color: var(--gold); }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(90deg, #14402f, #0f2a20); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
}
.banner b { color: var(--gold); }

/* ---------- Maç ekranı ---------- */
.match-screen { max-width: 980px; margin: 0 auto; }
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  background: #0b1f16; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
}
.scoreboard .t { display: flex; align-items: center; gap: 10px; min-width: 0; }
.scoreboard .t.away { justify-content: flex-end; }
.scoreboard .t .fl { font-size: 30px; }
.scoreboard .t .nm { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .sc { font-size: 34px; font-weight: 900; letter-spacing: 2px; text-align: center; min-width: 96px; }
.scoreboard .sc small { display: block; font-size: 12px; color: var(--muted); letter-spacing: 0; font-weight: 700; }
.stage-label { text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.pitch-wrap { position: relative; border-radius: 14px; overflow: hidden; border: 2px solid #0a1c13; box-shadow: var(--shadow); }
#match-canvas { display: block; width: 100%; height: min(60vh, 520px); background: #2b8540; }
.match-controls { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.spd-group { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.spd { padding: 6px 12px; border-radius: 8px; border: none; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.spd.active { background: var(--green); color: #06140d; }
.goal-pop {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  pointer-events: none; font-size: 12px;
}

/* ---------- Eleme ağacı ---------- */
.bracket-scroll { overflow-x: auto; padding-bottom: 10px; }
.bracket { display: flex; gap: 18px; min-width: max-content; }
.round-col { display: flex; flex-direction: column; gap: 12px; min-width: 220px; }
.round-col h4 { margin: 0 0 2px; font-size: 13px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; text-align: center; }
.ko-match { background: #0c2017; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.ko-team { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; font-size: 13px; }
.ko-team .fl { font-size: 16px; }
.ko-team .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ko-team .sc { font-weight: 800; }
.ko-team.win { background: rgba(40,199,111,.14); }
.ko-team.win .nm { color: var(--green); font-weight: 800; }
.ko-team.lose { opacity: .55; }
.ko-empty { color: var(--muted); font-style: italic; font-size: 12px; padding: 12px 6px; text-align: center; }
.ko-actions { display: flex; gap: 6px; margin-top: 6px; }
.ko-pens { font-size: 11px; color: var(--gold); text-align: center; margin-top: 2px; }
.final-col { justify-content: center; }
.champ-slot { text-align: center; padding: 14px; border: 1px dashed var(--gold); border-radius: 12px; }
.champ-slot .cup { font-size: 34px; }

/* ---------- Şampiyon ---------- */
.champion-screen { text-align: center; padding: 20px 10px; }
.champion-screen .cup { font-size: 90px; filter: drop-shadow(0 10px 24px rgba(255,204,51,.4)); animation: pop .6s ease; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.champion-screen .fl { font-size: 70px; }
.champion-screen h1 { font-size: clamp(30px, 8vw, 56px); margin: 6px 0; }
.champion-screen .sub { color: var(--gold); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.payout { display: inline-flex; flex-direction: column; gap: 4px; margin: 18px auto; padding: 16px 24px; border-radius: 16px; }
.payout.win { background: rgba(40,199,111,.12); border: 1px solid var(--green); }
.payout.lose { background: var(--panel); border: 1px solid var(--line); }
.payout .big { font-size: 26px; font-weight: 900; }
.payout.win .big { color: var(--green); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(3, 10, 7, 0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; animation: fade .2s ease;
}
.modal { width: 100%; max-width: 460px; padding: 20px; max-height: 88vh; overflow: auto; }
.modal h3 { margin: 0 0 4px; font-size: 20px; }
.modal .close { float: right; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.pkg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin-top: 10px; }
.pkg .info b { font-size: 17px; }
.pkg .info .bonus { color: var(--green); font-size: 12px; font-weight: 700; }
.pkg .tag { font-size: 10px; background: var(--gold); color: #2a1d00; padding: 2px 8px; border-radius: 999px; font-weight: 800; }
.how li { margin: 8px 0; color: var(--txt); }
.note { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.5; }

/* ---------- Bayrak görselleri ---------- */
.flagimg { display: inline-block; object-fit: cover; border-radius: 3px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.35); background: #0c2017; }
.fi-sm { width: 22px; height: 15px; }
.fi-md { width: 30px; height: 21px; }
.fi-lg { width: 42px; height: 29px; }
.fi-xl { width: 104px; height: 72px; border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.45); }

/* ---------- Tarih / stadyum bilgisi ---------- */
.match-meta { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.ko-meta { font-size: 10px; color: var(--muted); text-align: center; margin-top: 3px; }
.ko-3rd-label { font-size: 11px; color: var(--gold); text-align: center; margin: 12px 0 2px; font-weight: 700; }

/* ---------- Şampiyon podyumu ---------- */
.champ-flag { margin: 8px 0; }
.podium { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 16px 0 6px; }
.podium .po { display: flex; align-items: center; gap: 8px; font-size: 15px; background: var(--panel); border: 1px solid var(--line); padding: 8px 18px; border-radius: 999px; }
.podium .po1 { font-size: 17px; border-color: var(--gold); }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; display: none; }

@media (max-width: 560px) {
  .scoreboard .t .nm { font-size: 13px; }
  .scoreboard .sc { font-size: 28px; min-width: 80px; }
  main { padding: 14px 10px 70px; }
  /* taller portrait pitch → vertical goals (top & bottom) fill the screen */
  #match-canvas { height: min(72vh, 720px); }
  .match-screen { max-width: 100%; }
}
