:root {
  --bg: #0f1115;
  --surface: rgba(22, 26, 34, 0.92);
  --elevated: #1c222d;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f3f7;
  --muted: #8b93a5;
  --accent: #e8a64a;
  --accent2: #5ec9b3;
  --accent-violet: #a78bfa;
  --accent-blue: #60a5fa;
  --danger: #e85d4c;
  --radius: 16px;
  --font: "Outfit", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(167, 139, 250, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(96, 165, 250, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(251, 146, 60, 0.05), transparent),
    linear-gradient(180deg, #12151c, var(--bg));
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, #b8c0d0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.view {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.panel--hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.lead {
  color: var(--muted);
  margin: 0;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

h2,
h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0.5rem 0 0.25rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"] {
  width: 100%;
  max-width: 22rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0a0d12;
  color: var(--text);
  font-family: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--elevated);
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform 0.1s, filter 0.15s;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: scale(0.98) translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--accent {
  background: linear-gradient(135deg, #f0b85a, #c77d2a);
  color: #1a1208;
  border: none;
  box-shadow: 0 4px 18px rgba(232, 166, 74, 0.25);
}

.btn--accent:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(232, 166, 74, 0.35);
}

.btn--ghost {
  background: transparent;
}

.btn--sm {
  margin-top: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(232, 166, 74, 0.15);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.card-grid--dense {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.tc-card {
  position: relative;
  background: var(--elevated);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition:
    transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.22s ease;
}

.tc-card:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(167, 139, 250, 0.15),
    0 0 28px rgba(96, 165, 250, 0.12);
}

.tc-card__badges {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  pointer-events: none;
}

.tc-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #111;
}

.tc-card__meta {
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.starter-card {
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}

.starter-card--on {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(94, 201, 179, 0.35);
}

.badge {
  font-size: 0.62rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge--team {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(37, 99, 235, 0.9));
}

.badge--new {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.95), rgba(234, 88, 12, 0.95));
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.35);
}

.team-admin-score {
  font-size: 0.88rem;
  margin: 0.35rem 0 0.75rem;
  color: var(--accent2);
  font-weight: 600;
}

.team-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.team-slot {
  background: var(--elevated);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.82rem;
}

.team-slot img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 0.35rem;
}

.ranked-anim {
  margin-top: 0.75rem;
  padding: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.ranked-result {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(94, 201, 179, 0.1);
  border: 1px solid rgba(94, 201, 179, 0.35);
}

.ranked-result h3 {
  margin-top: 0;
  color: var(--accent2);
}

.phrase-main {
  font-style: italic;
  line-height: 1.5;
}

.phrase-ev {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
}

.lb {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.lb th,
.lb td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.lb-me {
  background: rgba(232, 166, 74, 0.12);
  font-weight: 600;
}

.foot {
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.foot a {
  color: var(--accent);
  text-decoration: none;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--elevated);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  max-width: min(92vw, 26rem);
  text-align: center;
}

.toast--ok {
  border-color: rgba(94, 201, 179, 0.4);
}

.toast--err {
  border-color: rgba(232, 93, 76, 0.45);
  color: #ffb4a8;
}

.error {
  color: #f99;
}

/* Arène combat (classé / quotidien) */
.ranked-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(15, 17, 21, 0.6);
  border: 1px solid var(--border);
  animation: rankedArenaIn 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes rankedArenaIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ranked-arena__side {
  text-align: center;
}

.ranked-arena__side--win .ranked-arena__label {
  color: var(--accent2);
}

.ranked-arena__label {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.ranked-arena__row {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ranked-arena__row img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.ranked-arena__vs {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent);
  opacity: 0.85;
}

.ranked-result--pop {
  animation: rankedPop 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes rankedPop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
