:root{
  --bg:#0b1220;
  --text:#e8eefc;
  --muted:rgba(232,238,252,.75);

  /* cards */
  --card: rgba(255,255,255,.045);
  --border: rgba(255,255,255,.10);
  --border2: rgba(255,255,255,.16);

  --link:#93c5fd;
  --danger: rgba(239,68,68,.35);

  /* podium overlays */
  --gold: rgba(245, 200, 70, .18);
  --silver: rgba(220, 226, 235, .14);
  --bronze: rgba(224, 136, 72, .16);

  /* buttons */
  --btn-border: rgba(147,197,253,.25);
  --btn-bg: rgba(147,197,253,.14);
  --btn-bg-hover: rgba(147,197,253,.22);
  --btn-shadow: 0 10px 22px rgba(0,0,0,.22);

  --radius: 16px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--text);
  background: var(--bg);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  background: url("../img/bg.webp") center/cover no-repeat;
  filter: blur(3px);
  transform: scale(1.04);
  opacity: .28;
  z-index: -2;
}

body::after{
  content:"";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 30% 10%, rgba(255,255,255,.08), transparent 55%),
    linear-gradient(180deg, rgba(11,18,32,.78), rgba(11,18,32,.92));
  z-index: -1;
}

a{ color:var(--link); text-decoration:none; }
a:hover{ text-decoration:underline; }

.wrap{
  max-width: 1280px;
  margin:0 auto;
  padding: 22px;
}

.header{
  display:flex;
  justify-content:center; 
  margin-bottom:24px;
}

h1{
  margin:0;
  font-size:26px;
  font-weight:800;
  letter-spacing:.3px;
  color:#e8eefc;
  text-transform:uppercase;
  text-align:center;
}


h1 .season{
  margin-left:6px;
  font-size:.7em;
  font-weight:700;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(99,102,241,.15);
  color:#c7d2fe;
  vertical-align:middle;
}


.small{
  color:var(--muted);
  font-size: 13px;
  margin: 4px;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}

.card--error{
  border-color: var(--danger);
}

.player{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.player::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(800px 240px at 10% 0%, rgba(255,255,255,.10), transparent 60%);
  pointer-events:none;
}

.player__left{
  display:flex;
  align-items:center;
  gap: 14px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.pos--desk{
  width: 46px;
  text-align:center;
  font-weight: 900;
  font-size: 16px;
  opacity: .95;
}

.pos--mob{
  display:none;
}

.avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  overflow:hidden;
  border:2px solid rgba(255,255,255,.18);
  flex-shrink:0;
  box-shadow: 0 10px 20px rgba(0,0,0,.25);
}
.avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.rank__icon{
  width: 64px;
  height: 64px;
  object-fit: contain;
  display:block;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}
.rank__icon--empty{
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px dashed var(--border2);
  opacity: .7;
}

.player__id{
  min-width: 0;
  flex: 1;
}

.name{
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note{
  margin-left: 8px;
  font-weight: 700;
  font-size: 14px;
  color: rgba(232,238,252,.78);
  opacity: .95;
}

.meta{
  margin-top: 8px;
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}

.pill{
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  font-size: 13px;
  color: var(--text);
  max-width: 100%;
}

.player__right{
  display:flex;
  gap: 10px;
  flex-shrink:0;
  position: relative;
  z-index: 1;
  align-items: center;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text);

  box-shadow: var(--btn-shadow);
  text-decoration:none;

  transition: transform .12s ease, filter .12s ease, background .12s ease, border-color .12s ease;
  user-select:none;
  white-space: nowrap;
}

.btn i{
  font-size: 14px;
  opacity: .95;
}

.btn:hover{
  background: var(--btn-bg-hover);
  border-color: rgba(255,255,255,.18);
  text-decoration:none;
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:active{
  transform: translateY(0);
  filter: brightness(1.02);
}

.btn--view{
  background: rgba(56, 189, 248, .12);
  border-color: rgba(56, 189, 248, .22);
}
.btn--view:hover{
  background: rgba(56, 189, 248, .18);
}

.btn--refresh{
  background: rgba(34, 197, 94, .12);
  border-color: rgba(34, 197, 94, .22);
}
.btn--refresh:hover{
  background: rgba(34, 197, 94, .18);
}

.podium{
  border-color: rgba(255,255,255,.16);
}
.podium--1{
  border-color: rgba(245,200,70,.40);
}
.podium--1::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, var(--gold), transparent 70%);
  pointer-events:none;
}
.podium--2{
  border-color: rgba(220,226,235,.35);
}
.podium--2::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, var(--silver), transparent 70%);
  pointer-events:none;
}
.podium--3{
  border-color: rgba(224,136,72,.38);
}
.podium--3::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, var(--bronze), transparent 70%);
  pointer-events:none;
}

/* =========================
   Responsive
========================= */

/* Tablettes / petits laptops */
@media (max-width: 900px){
  .wrap{ padding: 18px; }
  h1{ font-size: 24px; }
  .name{ font-size: 17px; }
}

/* Mobile */
@media (max-width: 700px){
  .wrap{ padding: 14px; }

  .header{
    flex-direction:column;
    align-items:center;
    gap: 8px;
  }

  .name{ font-size: 16px; }
  .small{ font-size: 12.5px; }

  .player{
    flex-direction:column;
    align-items:stretch;
    gap: 12px;
  }

  .player__left{
    width: 100%;
    display: grid;
    grid-template-columns: 60px 1fr;
    column-gap: 12px;
    row-gap: 6px;
    align-items: start;
  }

  .avatar{
    grid-column: 1;
    grid-row: 1;
    width: 54px;
    height: 54px;
  }

  .rank{
    grid-column: 1;
    grid-row: 2;
    display:flex;
    justify-content:center;
    align-items:center;
  }
  .rank__icon,
  .rank__icon--empty{
    width: 54px;
    height: 54px;
  }

  .player__id{
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 100%;
    min-width: 0;
    padding-left: 16px;
    padding-top: 16px;
  }

  .meta{ margin-top: 8px; }

  .pos--desk{ display:none; }
  .pos--mob{
    display:inline-flex;
    align-items:baseline;
    font-weight: 900;
    opacity: .95;
    margin-right: 6px;
  }
  .pos--mob::after{
    content:"|";
    opacity: .55;
    margin-left: 6px;
  }

  .name{
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
  }

  .note{
    margin-left: 6px;
    font-size: 13px;
    opacity: .9;
    white-space: nowrap;
  }

  .meta{
    gap: 6px;
    margin-top: 6px;
  }
  .pill{
    font-size: 12.5px;
    padding: 5px 9px;
  }

  .player__right{
    width: 100%;
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .btn{
    width: 100%;
    padding: 11px 12px;
  }
}

@media (max-width: 420px){
  h1{ font-size: 20px; }
  .name{ font-size: 15px; }
  .note{ font-size: 12.5px; }

  .player__left{
    grid-template-columns: 54px 1fr;
    column-gap: 10px;
  }
  .avatar{ width: 50px; height: 50px; }
  .rank__icon,
  .rank__icon--empty{ width: 50px; height: 50px; }

    .player__id{
    padding-left: 8px;
    padding-top: 8px;
  }

  .player__right{
    grid-template-columns: 1fr;
  }

  .pill{
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* =========================
   Flash message
========================= */
.flash {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 9999;

  min-width: 240px;
  max-width: 420px;

  padding: 14px 18px;
  border-radius: 14px;

  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;

  color: rgba(235, 240, 250, .95);
  background: rgba(30, 41, 59, .92);
  border: 1px solid rgba(255, 255, 255, .12);

  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);

  opacity: 0;
  transform: translateY(-10px);
  animation: flash-in 0.35s ease forwards,
             flash-out 0.35s ease forwards 4.6s;
}

.flash--info { border-left: 4px solid #38f85b; }

@keyframes flash-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes flash-out {
  to { opacity: 0; transform: translateY(-10px); }
}

@media (max-width: 700px){
  .flash{
    left: 14px;
    right: 14px;
    bottom: 14px;
    min-width: 0;
    max-width: none;
  }
}
