:root {
  --bg: #0A0D16;
  --bg-soft: #0F1322;
  --panel: #10131F;
  --panel-alt: #161B2C;
  --line: #262C45;
  --text: #ECEEF7;
  --muted: #868CAA;
  --gold: #D4A94C;
  --cyan: #4FD6E0;
  --loss: #FF5C72;

  /* şampiyonluk kademesi renkleri (rozet + MMR vurgusu için) */
  --tier-iron: #5B5A57;
  --tier-bronze: #9C6B46;
  --tier-silver: #AEB6C2;
  --tier-gold: #D4A94C;
  --tier-platinum: #4FD6B8;
  --tier-emerald: #2FCE7A;
  --tier-diamond: #5CB8F2;
  --tier-master: #B873E8;
  --tier-grandmaster: #FF5C72;
  --tier-challenger: #F2D06B;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

h1, h2, h3, .brand-name, .mmr-number {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px;
  clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
  background: var(--gold);
  color: #0A0D16;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800;
  font-size: 20px;
}
.brand-name {
  font-size: 22px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.brand-name strong { color: var(--gold); }
.disclaimer { color: var(--muted); font-size: 13px; margin: 0; }

main { max-width: 900px; margin: 0 auto; padding: 0 20px 80px; }

.hero {
  position: relative;
  text-align: center;
  padding: 72px 20px 48px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  width: 900px;
  height: 320px;
  background: linear-gradient(100deg, transparent 42%, rgba(212, 169, 76, 0.16) 48%, rgba(79, 214, 224, 0.12) 54%, transparent 60%);
  transform: translateX(-50%) rotate(-6deg);
  pointer-events: none;
}
.hero h1 {
  position: relative;
  font-size: 46px;
  letter-spacing: 0.2px;
  margin-bottom: 14px;
}
.hero-sub {
  position: relative;
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 32px;
}

.search-row {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  max-width: 580px;
  margin: 0 auto;
}
.search-row select,
.search-row input,
.search-row button {
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--text);
  font-size: 15px;
  padding: 13px 14px;
  font-family: 'Inter', sans-serif;
}
.search-row select { border-right: none; }
.search-row #riot-name { border-left: none; flex: 1; min-width: 0; }
.hash {
  background: var(--panel-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 2px;
  color: var(--muted);
}
.search-row #riot-tag { width: 86px; border-left: none; }
.search-row button {
  background: var(--gold);
  color: #0A0D16;
  border: none;
  font-weight: 600;
  cursor: pointer;
  padding: 13px 26px;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
}
.search-row button:hover { filter: brightness(1.1); }
.search-row input::placeholder { color: var(--muted); }

.status-line { margin-top: 18px; color: var(--muted); min-height: 20px; font-size: 14px; }
.status-line.error { color: var(--loss); }

.result.hidden { display: none; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.profile-card img {
  width: 72px; height: 72px;
  clip-path: polygon(16% 0, 100% 0, 100% 84%, 84% 100%, 0 100%, 0 16%);
  border: 2px solid var(--gold);
}
.profile-info h2 { font-size: 26px; }
.profile-info p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.ranked-row { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.rank-card {
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--tier-color, var(--gold));
  padding: 16px 18px;
}
.rank-badge {
  width: 44px; height: 44px;
  flex-shrink: 0;
  clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
  background: var(--tier-color, var(--gold));
  color: #0A0D16;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800;
  font-size: 18px;
}
.rank-info { flex: 1; min-width: 0; }
.rank-info .queue { color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.rank-info .tier { font-family: 'Big Shoulders Display', sans-serif; font-weight: 700; font-size: 19px; margin: 0; }
.rank-info .wr { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.mmr-block { text-align: right; flex-shrink: 0; padding-left: 12px; border-left: 1px solid var(--line); }
.mmr-number { font-size: 28px; color: var(--cyan); line-height: 1; }
.mmr-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.panel h3 { font-size: 14px; color: var(--muted); font-weight: 600; font-family: 'Inter', sans-serif; letter-spacing: 0.2px; margin-bottom: 16px; }

.mastery-row { display: flex; gap: 14px; flex-wrap: wrap; }
.mastery-item { text-align: center; width: 78px; }
.mastery-item img {
  width: 56px; height: 56px;
  clip-path: polygon(14% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 14%);
  border: 1px solid var(--line);
}
.mastery-item .pts { font-size: 11px; color: var(--muted); margin-top: 6px; }
.mastery-item .name { font-size: 12px; margin-top: 2px; }

.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--line);
  background: var(--panel-alt);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.match-row:hover, .match-row:focus-visible {
  background: #1C2236;
}
.match-row:active { transform: scale(0.997); }
.match-row.win { border-left-color: var(--cyan); }
.match-row.loss { border-left-color: var(--loss); }
.match-row .chevron {
  color: var(--muted);
  font-size: 18px;
  margin-left: 4px;
}
.match-row img {
  width: 38px; height: 38px;
  clip-path: polygon(14% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 14%);
}
.match-row .champ { min-width: 110px; font-weight: 600; font-size: 14px; }
.match-row .mode { color: var(--muted); font-size: 12px; min-width: 100px; }
.match-row .kda { margin-left: auto; font-family: 'Big Shoulders Display', sans-serif; font-weight: 700; font-size: 16px; }
.match-row .result-tag { font-size: 12px; font-weight: 600; width: 46px; text-align: right; }
.match-row.win .result-tag { color: var(--cyan); }
.match-row.loss .result-tag { color: var(--loss); }

.empty-note { color: var(--muted); font-size: 14px; }

.performance-panel.hidden { display: none; }
.perf-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.perf-badge-block { display: flex; align-items: center; gap: 14px; }
.perf-rank-label { font-family: 'Big Shoulders Display', sans-serif; font-weight: 700; font-size: 20px; margin: 0; }
.perf-sample-note { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.perf-delta-block { text-align: right; }
.perf-delta-block.hidden { display: none; }
.perf-delta { font-family: 'Big Shoulders Display', sans-serif; font-weight: 700; font-size: 26px; }
.perf-delta.up { color: var(--cyan); }
.perf-delta.down { color: var(--loss); }
.perf-delta.flat { color: var(--muted); }
.perf-delta-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.perf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 12px;
}
.perf-stats > div { text-align: center; }
.perf-stat-val { display: block; font-family: 'Big Shoulders Display', sans-serif; font-weight: 700; font-size: 20px; }
.perf-stat-label { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.perf-verdict { font-size: 13px; color: var(--muted); margin: 0; }

@media (max-width: 480px) {
  .perf-stats { grid-template-columns: repeat(2, 1fr); }
}

/* --- Maç detay modalı --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-overlay.hidden { display: none; }

.modal-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  width: 100%;
  max-width: 640px;
  padding: 24px 22px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--gold); }

.modal-header { margin-bottom: 16px; padding-right: 30px; }
.modal-header h3 { font-size: 20px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }

.team-block { margin-bottom: 18px; }
.team-block:last-child { margin-bottom: 0; }
.team-label {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.team-label.win { color: var(--cyan); }
.team-label.loss { color: var(--loss); }

.participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.participant-champ {
  width: 36px; height: 36px;
  clip-path: polygon(14% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 14%);
  flex-shrink: 0;
}
.participant-info { min-width: 0; flex-shrink: 0; width: 120px; }
.participant-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.participant-champ-name { font-size: 11px; color: var(--muted); }
.participant-kda { flex-shrink: 0; width: 100px; }
.kda-num { font-family: 'Big Shoulders Display', sans-serif; font-weight: 700; font-size: 15px; }
.kda-extra { font-size: 10px; color: var(--muted); margin-top: 1px; }
.participant-items { display: flex; gap: 3px; margin-left: auto; flex-shrink: 0; }
.item-slot {
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.item-slot.empty { background: var(--bg-soft); }

@media (max-width: 560px) {
  .participant-row { flex-wrap: wrap; }
  .participant-info { width: auto; flex: 1; }
  .participant-kda { width: auto; }
  .participant-items { width: 100%; margin-left: 48px; margin-top: 4px; }
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 20px;
  border-top: 1px solid var(--line);
  max-width: 700px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .hero { padding: 52px 16px 36px; }
  .hero h1 { font-size: 32px; }
  .search-row { flex-wrap: wrap; }
  .search-row select { flex-basis: 100%; border-right: 1px solid var(--line); }
  .search-row #riot-name { border-left: 1px solid var(--line); }
  .rank-card { flex-wrap: wrap; }
  .mmr-block { border-left: none; padding-left: 0; text-align: left; }
}
