/* Ranking page — shared layout lives in game.css. */

body[data-page="ranking"] { -webkit-user-select: none; user-select: none; }
.topbar-spacer { width: 90px; }

.admin-bar {
  max-width: 1150px;
  margin: 0 auto 10px;
  padding: 10px 16px;
  background: #fde68a;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.rank-layout {
  max-width: 1150px;
  margin: 0 auto;
  padding: 4px 16px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 880px) {
  .rank-layout { grid-template-columns: minmax(0, 1fr); }
}
.rank-layout.no-join { grid-template-columns: minmax(0, 1fr); max-width: 760px; }

.rank-card, .join-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--line);
  padding: 20px;
}
.rank-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rank-head h2 { margin: 0; font-size: 1.8rem; color: var(--wall); }

.class-form { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 1.1rem; }
.class-row { display: flex; gap: 8px; }
.class-row input {
  flex: 1;
  font: inherit;
  font-size: 1.3rem;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--line);
  min-height: 48px;
  -webkit-user-select: text;
  user-select: text;
}
.class-row input:focus { outline: none; border-color: var(--blue); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 6px; }
.tabs button {
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  background: #eef2ff;
  color: var(--ink);
  cursor: pointer;
}
.tabs button.active { background: var(--wall); color: #fff; }

/* ---------- Podium ---------- */
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 10px;
  margin: 22px 0 10px;
}
.podium:empty { display: none; }
.spot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.spot .avatar { font-size: 2.6rem; line-height: 1; }
.spot.first .avatar { font-size: 3.4rem; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.spot .name { font-weight: 700; font-size: 1.15rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot .stars { color: #b45309; font-weight: 700; }
.spot .block {
  width: 100%;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  font-size: 2rem;
}
.spot.first .block { height: 120px; background: linear-gradient(#fde68a, #facc15); }
.spot.second .block { height: 90px; background: linear-gradient(#e5e7eb, #cbd5e1); }
.spot.third .block { height: 66px; background: linear-gradient(#fed7aa, #fdba74); }
.spot.me .name { color: var(--wall); }
.spot.ghost { visibility: hidden; }

/* ---------- List ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-list li {
  display: grid;
  grid-template-columns: 44px 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f6f8fd;
  animation: rowIn .3s ease both;
}
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
.rank-list .pos { font-weight: 700; font-size: 1.1rem; text-align: center; color: var(--muted); }
.rank-list .avatar { font-size: 1.7rem; text-align: center; }
.rank-list .who { min-width: 0; }
.rank-list .who b { display: block; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-top: 4px; }
.rank-list .bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--yellow), #f59e0b); }
.rank-list .stars { font-weight: 700; color: #b45309; font-size: 1.1rem; white-space: nowrap; }
.rank-list li.me { background: #eef2ff; box-shadow: inset 0 0 0 2px var(--wall); }
.rank-list .del {
  font: inherit; border: none; background: #fee2e2; color: #b91c1c;
  border-radius: 10px; min-width: 40px; height: 40px; cursor: pointer; margin-left: 6px;
}
.you { font-size: .8rem; background: var(--wall); color: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }

.empty { text-align: center; padding: 26px 10px 10px; font-size: 1.15rem; color: var(--muted); }
.empty .big { font-size: 3rem; display: block; margin-bottom: 6px; }
.updated { text-align: right; color: var(--muted); font-size: .85rem; margin: 12px 0 0; }

/* ---------- Join card ---------- */
.join-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; position: sticky; top: 12px; }
.join-card h2 { margin: 0; font-size: 1.4rem; }
.qr { width: 240px; height: 240px; background: #fff; border-radius: 16px; padding: 8px; box-shadow: inset 0 0 0 2px var(--line); }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.join-help { margin: 0; color: var(--muted); }
.join-url { margin: 0; font-weight: 700; word-break: break-all; color: var(--wall); }
