/* base */
body {
  font-family: "Poppins", sans-serif;
  background: radial-gradient(circle at top, #001f3f, #000);
  color: #fff;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* HEADER */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(10,30,60,0.95), rgba(0,12,20,0.9));
  position: sticky;
  top: 0;
  z-index: 50;
}

/* left header (live) */
.left-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator {
  width: 12px;
  height: 12px;
  background: red;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255,0,0,0.95);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.2); }
}

.live-text {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  font-size: 0.88rem;
  text-transform: uppercase;
}

/* title block with light-blue wave background behind it */
.title-block {
  text-align: center;
  position: relative;
  padding: 6px 14px;
  border-radius: 12px;
  background-image:
    radial-gradient( circle at 10% 10%, rgba(173,216,230,0.06), transparent 10%),
    radial-gradient( circle at 90% 70%, rgba(173,216,230,0.04), transparent 15%),
    linear-gradient(180deg, rgba(20,80,160,0.05), rgba(5,20,40,0.0));
  backdrop-filter: blur(2px);
  min-width: 260px;
}

.title {
  font-size: 1.12rem;
  color: #f1f1f1;
  margin: 0;
}

/* gold subtitle */
.subtitle {
  margin-top: 6px;
  color: #ffd24d;
  font-weight: 600;
  font-size: 0.82rem;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}

/* menu */
.menu {
  position: relative;
}

#menuBtn {
  background: transparent;
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background: rgba(20, 20, 20, 0.95);
  min-width: 120px;
  border-radius: 6px;
  z-index: 60;
}

.dropdown-content button {
  width: 100%;
  background: transparent;
  color: #fff;
  border: none;
  padding: 10px;
  cursor: pointer;
  text-align: left;
}

.dropdown-content button:hover {
  background: #333;
}

/* container & table */
.container {
  padding: 6px 8px;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 6px;
  text-align: left;
}

/* columns width compact */
.col-rank { width: 8%; }
.col-country { width: 62%; }
.col-gifts { width: 30%; }

/* smaller vertical spacing between rows to fit more on phone */
tbody tr {
  transition: transform 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease;
  padding: 4px 0;
  height: 52px;
  vertical-align: middle;
  position: relative; /* for popup absolute positioning */
  display: table-row;
  border-radius: 8px;
  margin: 0;
  will-change: box-shadow, transform;
}

tbody tr td {
  padding: 8px 6px;
  text-align: left;
  font-size: 1rem;
}

/* country cell layout */
.country-name { margin-left: 8px; vertical-align: middle; }

/* progress (Gifts) bar */
.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

/* fill bar */
.progress-fill {
  height: 100%;
  transition: width 0.6s ease;
  border-radius: 12px;
}

/* small yellow marker look */
.progress-marker {
  width: 14px;
  height: 100%;
  border-radius: 8px;
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: left center;
  background: #ffd200;
  box-shadow: 0 0 6px rgba(255,210,0,0.9);
}

/* colors for fills */
.goldFill { background: linear-gradient(90deg, #FFD700, #EBA200); }
.greenFill { background: linear-gradient(90deg, #7CFC00, #2CB84A); }

/* popup +N */
.gift-popup {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  font-weight: 700;
  font-size: 0.95rem;
  animation: popupMove 900ms ease forwards;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* popup animation */
@keyframes popupMove {
  0% { opacity: 0; transform: translateY(-10%) translateX(6px) scale(0.96); }
  30% { opacity: 1; transform: translateY(-50%) translateX(0) scale(1.02); }
  100% { opacity: 0; transform: translateY(-90%) translateX(-10px) scale(0.98); }
}

/* fade on rank change */
.rank-change {
  animation: rankFade 1s ease;
}

@keyframes rankFade {
  0% { opacity: 0.2; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

/* light-blue highlight when gift arrives (1.5s) */
.gift-highlight {
  box-shadow: 0 0 24px rgba(135,206,255,0.95);
  animation: giftGlow 1.5s ease;
  background: linear-gradient(90deg, rgba(135,206,255,0.06), rgba(135,206,255,0.02));
  border-radius: 8px;
}

@keyframes giftGlow {
  0% { box-shadow: 0 0 0 rgba(135,206,255,0.0); }
  30% { box-shadow: 0 0 28px rgba(135,206,255,0.95); }
  100% { box-shadow: 0 0 0 rgba(135,206,255,0.0); }
}

/* TOP 3 static framed highlights (no rotating ring) */
.top1 {
  border: 2px solid rgba(255,215,0,0.95);
  box-shadow: 0 0 12px rgba(255,215,0,0.25);
  border-radius: 8px;
}
.top2 {
  border: 2px solid rgba(192,192,192,0.9);
  box-shadow: 0 0 10px rgba(192,192,192,0.18);
  border-radius: 8px;
}
.top3 {
  border: 2px solid rgba(205,127,50,0.9);
  box-shadow: 0 0 10px rgba(205,127,50,0.16);
  border-radius: 8px;
}

/* responsive */
@media (max-width: 420px) {
  .col-country { width: 62%; }
  .col-gifts { width: 38%; }
  tbody tr td { font-size: 0.98rem; padding: 6px 6px; }
  .gift-popup { right: 6px; font-size: 0.9rem; padding: 5px 7px; }
}
.gift-feed {
    position: fixed;
    bottom: 10px;
    left: 10px;
    width: 300px;
    font-family: Arial, sans-serif;
    color: white;
    font-size: 14px;
    pointer-events: none;
}

.gift {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.6);
    border-radius: 10px;
    padding: 6px 10px;
    margin-top: 8px;
    animation: slideUp 0.6s ease-out;
}

.gift img {
    width: 36px;
    height: 36px;
    margin-right: 8px;
    animation: float 2s ease-in-out infinite;
}

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

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