﻿/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-glass: rgba(26, 31, 46, 0.7);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #fbbf24;
  --accent-hover: #f59e0b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --border: rgba(148, 163, 184, 0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

/* ===== Background particles ===== */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(251, 191, 36, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(34, 197, 94, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* ===== Container ===== */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.header {
  padding: 48px 0 32px;
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.4));
}

.logo h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.accent {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 1.05rem;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card--glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(148, 163, 184, 0.1);
}

.card--dark {
  background: var(--bg-secondary);
}

.card--error {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.25);
}

.card:hover {
  border-color: rgba(148, 163, 184, 0.25);
}

.card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card__header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.card__icon {
  font-size: 1.3rem;
}

.card__desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

/* ===== Inputs ===== */
.input-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input {
  flex: 1;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input--select {
  min-width: 100px;
  flex: 0 0 auto;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn--accent {
  background: var(--accent);
  color: #0a0e17;
}
.btn--accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3);
}

/* ===== Search Row ===== */
.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-row .input {
  min-width: 150px;
}

.search-row .input:first-child {
  flex: 0 0 90px;
}

/* ===== Status Messages ===== */
.status-msg {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  min-height: 1.4em;
}

/* ===== Profile ===== */
.profile {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.profile__icon-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile__icon-wrapper img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  background: var(--bg-card);
}

.profile__level {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0a0e17;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.profile__name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.profile__updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* ===== Ranked Grid ===== */
.ranked-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .ranked-grid {
    grid-template-columns: 1fr;
  }
}

.ranked-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: border-color var(--transition);
}

.ranked-card:hover {
  border-color: rgba(148, 163, 184, 0.3);
}

.ranked-card__queue {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ranked-card__tier {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ranked-card__tier img {
  width: 56px;
  height: 56px;
}

.ranked-card__tier span {
  font-size: 1.4rem;
  font-weight: 700;
}

.ranked-card__lp {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.ranked-card__stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.ranked-card__stats .stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ranked-card__stats .stat--wins {
  color: var(--success);
  font-weight: 600;
}

.ranked-card__stats .stat--losses {
  color: var(--danger);
  font-weight: 600;
}

.ranked-card__winrate {
  margin-top: 12px;
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

.winrate--good {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.winrate--ok {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent);
}

.winrate--bad {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* ===== Champions Grid ===== */
.champions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

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

.champion-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition);
}

.champion-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 191, 36, 0.3);
}

.champion-card__image {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 10px;
  border: 2px solid var(--border);
  object-fit: cover;
}

.champion-card__name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.champion-card__points {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.champion-card__level {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ===== Loading Spinner ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 0;
  color: var(--text-secondary);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Error ===== */
.error-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 32px 0 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer .accent {
  -webkit-text-fill-color: var(--accent);
}

/* ===== Utilities ===== */
.hidden {
  display: none !important;
}
