:root {
  --bg: #0a0a0f;
  --bg-card: #1a1a26;
  --bg-elev: #232333;
  --accent: #ff4655;
  --accent-2: #ff8f6b;
  --text: #f5f5fa;
  --text-dim: #9999b3;
  --good: #1ed760;
  --bad: #ff4655;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(255, 70, 85, 0.10), transparent 60%), radial-gradient(circle at 85% 90%, rgba(255, 143, 107, 0.06), transparent 45%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app { max-width: 760px; margin: 0 auto; padding: 2rem 1rem 4rem; }

/* Header */
.header { text-align: center; margin-bottom: 1.75rem; position: relative; }
.lang { position: absolute; top: 0; right: 0; display: flex; gap: 0.3rem; }
.lang__btn { padding: 0.25rem 0.6rem; border-radius: 8px; border: 1px solid #3a3a4f; background: var(--bg-card); color: var(--text-dim); font-weight: 700; font-size: 0.78rem; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease; }
.lang__btn:hover { border-color: var(--accent-2); color: var(--text); }
.lang__btn--active { background: var(--accent); color: #fff; border-color: transparent; }
.header__title { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; letter-spacing: 0.12em; }
.header__title span { color: var(--accent); }
.header__subtitle { color: var(--text-dim); margin-top: 0.25rem; }

/* Search */
.search { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.search__input {
  flex: 1 1 200px; min-width: 0; padding: 0.75rem 1rem; border-radius: var(--radius);
  border: 1px solid #3a3a4f; background: var(--bg-card); color: var(--text); font-size: 1rem;
}
.search__select {
  padding: 0.75rem; border-radius: var(--radius); border: 1px solid #3a3a4f;
  background: var(--bg-card); color: var(--text); font-size: 0.95rem; cursor: pointer;
}
.search__input:focus, .search__select:focus { outline: 2px solid var(--accent-2); border-color: transparent; }
.search__btn {
  padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius); background: var(--accent);
  color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.search__btn:hover { filter: brightness(1.1); }
.search__btn:active { transform: scale(0.98); }
.search__btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Message */
.message { padding: 0.9rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.95rem; border: 1px solid transparent; }
.message--error { background: rgba(255, 70, 85, 0.12); border-color: var(--accent); color: #ffb3ba; }
.message--warn { background: rgba(255, 196, 0, 0.12); border-color: #ffc400; color: #ffe08a; }
.message--info { background: rgba(255, 143, 107, 0.1); border-color: var(--accent-2); color: #ffd0bf; }

/* Skeleton */
.skeleton { background: var(--bg-card); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.skeleton__line {
  height: 18px; border-radius: 8px; margin-bottom: 0.9rem;
  background: linear-gradient(90deg, #2a2a3a 25%, #33333f 37%, #2a2a3a 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
.skeleton__line--lg { height: 32px; width: 60%; }
.skeleton__line--sm { width: 40%; margin-bottom: 0; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Cards genéricos */
.card {
  background: var(--bg-card); border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow); border: 1px solid #2a2a3a; margin-bottom: 1.1rem;
}
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.muted { color: var(--text-dim); font-weight: 400; font-size: 0.85rem; }
.label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--text-dim); font-weight: 600; }

/* Banner */
.banner {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.1rem;
  background: var(--bg-card); border: 1px solid #2a2a3a; background-size: cover; background-position: center;
}
.banner--art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,10,15,0.92), rgba(10,10,15,0.55)); }
.banner__overlay { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.5rem; min-height: 120px; }
.banner__name { font-size: 1.6rem; font-weight: 800; word-break: break-word; }
.banner__meta { color: var(--text-dim); font-size: 0.92rem; margin-top: 0.2rem; }
.puuid {
  margin-top: 0.5rem; max-width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 0.7rem;
  color: var(--text-dim); background: rgba(35,35,51,0.8); border: 1px solid #3a3a4f; border-radius: 8px;
  padding: 0.25rem 0.55rem; cursor: pointer; word-break: break-all; text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.puuid:hover { border-color: var(--accent-2); color: var(--accent-2); }
.badge { font-size: 0.72rem; padding: 0.2rem 0.55rem; border-radius: 999px; background: rgba(255,143,107,0.15); color: var(--accent-2); white-space: nowrap; border: 1px solid rgba(255,143,107,0.3); }

/* Rank */
.card__rank { display: flex; align-items: center; gap: 1.25rem; padding: 1.25rem; background: var(--bg-elev); border-radius: var(--radius); margin-bottom: 1.25rem; }
.card__rank-icon { width: 88px; height: 88px; object-fit: contain; flex-shrink: 0; }
.card__rank-info { flex: 1; min-width: 0; }
.card__tier { font-size: 1.6rem; font-weight: 800; margin: 0.1rem 0 0.6rem; }
.card__leaderboard { margin-top: 0.5rem; color: var(--accent-2); font-weight: 700; font-size: 0.9rem; }

/* RR bar */
.rr { display: flex; align-items: center; gap: 0.75rem; }
.rr__bar { flex: 1; height: 10px; border-radius: 999px; background: #0a0a0f; overflow: hidden; }
.rr__fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.6s ease; }
.rr__text { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* Grid de stats */
.card__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.stat { background: var(--bg-elev); border-radius: var(--radius); padding: 0.9rem 1rem; }
.stat__value { font-size: 1.15rem; font-weight: 700; margin-top: 0.25rem; }
.stat__sub { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.1rem; }
.up { color: var(--good); }
.down { color: var(--bad); }

/* Performance */
.perf__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-bottom: 1.25rem; }
.perf__stat { background: var(--bg-elev); border-radius: var(--radius); padding: 0.8rem; text-align: center; }
.perf__value { font-size: 1.35rem; font-weight: 800; margin-top: 0.2rem; }
.perf__split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.chip { display: flex; align-items: center; gap: 0.45rem; background: var(--bg-elev); border: 1px solid #3a3a4f; border-radius: 999px; padding: 0.3rem 0.7rem 0.3rem 0.35rem; }
.chip__icon { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #0a0a0f; }
.chip__label { font-weight: 600; font-size: 0.85rem; }
.chip__meta { color: var(--text-dim); font-size: 0.75rem; }

/* Tendência (sparkline) */
.trend__chart { background: var(--bg-elev); border-radius: var(--radius); padding: 0.5rem; margin-bottom: 1rem; }
.spark { width: 100%; height: 80px; display: block; }
.trend__list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.trend__item { display: flex; align-items: center; gap: 0.5rem; background: var(--bg-elev); border-radius: 10px; padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.trend__tier { color: var(--text-dim); }
.trend__chg { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Partidas */
.match-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.match { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; background: var(--bg-elev); border-radius: 12px; padding: 0.7rem 0.9rem; border-left: 4px solid #3a3a4f; }
.match--win { border-left-color: var(--good); }
.match--loss { border-left-color: var(--bad); }
.match__left { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.match__agent { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #0a0a0f; flex-shrink: 0; }
.match__map { font-weight: 700; }
.match__sub { color: var(--text-dim); font-size: 0.78rem; }
.match__right { text-align: right; flex-shrink: 0; }
.match__result { font-weight: 700; font-size: 0.85rem; }
.match--win .match__result { color: var(--good); }
.match--loss .match__result { color: var(--bad); }
.match__kda { font-variant-numeric: tabular-nums; font-weight: 600; }
.match__extra { color: var(--text-dim); font-size: 0.76rem; }

/* Tabela de atos */
.table-wrap { overflow-x: auto; }
.seasons-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.seasons-table th, .seasons-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid #2a2a3a; }
.seasons-table th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; }

/* Comandos da Twitch */
.twitch-list { display: flex; flex-direction: column; gap: 0.7rem; }
.twitch__row { background: var(--bg-elev); border-radius: 12px; padding: 0.7rem 0.9rem; }
.twitch__head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; }
.twitch__cmd { font-weight: 800; color: var(--accent-2); }
.twitch__desc { color: var(--text-dim); font-size: 0.82rem; }
.twitch__code {
  display: block; font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem;
  background: #0a0a0f; border: 1px solid #3a3a4f; border-radius: 8px; padding: 0.45rem 0.6rem;
  color: var(--text); cursor: pointer; word-break: break-all; transition: border-color 0.15s ease;
}
.twitch__code:hover { border-color: var(--accent-2); }
.twitch__code--ok { color: var(--good); border-color: var(--good); }

/* Abas Comando | Status */
.tabs { display: flex; gap: 0.6rem; margin-bottom: 1.1rem; }
.tab-btn {
  flex: 1; padding: 0.75rem 1rem; border-radius: var(--radius);
  border: 1px solid #3a3a4f; background: var(--bg-card); color: var(--text-dim);
  font-weight: 800; font-size: 0.95rem; cursor: pointer; letter-spacing: 0.04em;
  text-transform: uppercase; transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.tab-btn:hover { border-color: var(--accent-2); color: var(--text); }
.tab-btn--active { background: var(--accent); color: #fff; border-color: transparent; }
.tab-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.tab-panel[hidden] { display: none; }

/* Construtor de comando personalizado */
.chip--btn { cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease; }
.chip--btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.custom__textarea {
  width: 100%; margin-top: 0.4rem; padding: 0.6rem 0.7rem; border-radius: 10px;
  border: 1px solid #3a3a4f; background: #0a0a0f; color: var(--text);
  font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; resize: vertical;
}
.custom__textarea:focus { outline: 2px solid var(--accent-2); border-color: transparent; }
.custom__preview {
  margin-top: 0.4rem; padding: 0.7rem 0.9rem; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid #3a3a4f; color: var(--text);
  min-height: 1.2rem; word-break: break-word;
}

@media (max-width: 560px) {
  .card__grid { grid-template-columns: 1fr 1fr; }
  .perf__grid { grid-template-columns: 1fr 1fr; }
  .perf__split { grid-template-columns: 1fr; }
  .card__rank { flex-direction: column; text-align: center; }
}
