:root {
  --ink: #2a1a2e;
  --cream: #fff6ef;
  --rose: #ff6b8b;
  --rose-deep: #e2456a;
  --gold: #ffd28a;
  --teal: #38c6b4;
  --glass: rgba(255, 255, 255, 0.16);
  --glass-strong: rgba(255, 255, 255, 0.3);
  --shadow: 0 20px 60px rgba(40, 15, 40, 0.35);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--cream);
  background: #1c1020 url("https://assets.friendortrend.dedyn.io/picsart.jpg") center / cover no-repeat fixed;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, rgba(28, 16, 32, 0.68), rgba(28, 16, 32, 0.86));
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(94vw, 580px);
  text-align: center;
}

.logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
  animation: floaty 4s ease-in-out infinite;
}

.logo-sm {
  width: 52px;
  height: 52px;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2.1rem;
  margin: 12px 0 4px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.tagline {
  opacity: 0.85;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 24px;
}

.card {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-strong);
  border-radius: 26px;
  padding: 26px 22px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s ease both;
}

.btn {
  border: none;
  border-radius: 16px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  width: 100%;
}

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

.btn-primary {
  background: linear-gradient(120deg, var(--rose), var(--rose-deep));
  color: #fff;
  box-shadow: 0 12px 30px rgba(226, 69, 106, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: var(--cream);
  border: 1px solid var(--glass-strong);
}

.field {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-strong);
  background: rgba(255, 255, 255, 0.14);
  color: var(--cream);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 14px;
  text-align: center;
  text-transform: uppercase;
}

.field::placeholder {
  color: rgba(255, 246, 239, 0.6);
  text-transform: none;
}

.field:focus {
  outline: none;
  border-color: var(--gold);
}

/* Podium */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.pod {
  flex: 1;
  max-width: 130px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-strong);
  border-radius: 18px 18px 12px 12px;
  padding: 14px 8px 12px;
  animation: rise 0.6s ease both;
}

.pod .medal {
  font-size: 1.6rem;
}

.pod .pname {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 6px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pod .pscore {
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  color: var(--gold);
}

.pod-1 {
  order: 2;
  transform: translateY(-14px);
  background: linear-gradient(160deg, rgba(255, 210, 138, 0.35), rgba(255, 255, 255, 0.1));
  border-color: var(--gold);
}

.pod-2 {
  order: 1;
}

.pod-3 {
  order: 3;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
}

.pod-1 {
  animation-delay: 0.15s;
}

/* List rows */
.rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-strong);
  animation: fadeUp 0.4s ease both;
}

.row .rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}

.row .name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .score {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  color: var(--gold);
}

.row.me {
  border-color: var(--gold);
  background: rgba(255, 210, 138, 0.18);
}

.hidden {
  display: none !important;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 30px auto;
}

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

.empty {
  opacity: 0.85;
  padding: 20px 0;
}

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

.footer-actions {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.meta {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-bottom: 16px;
}
