/* Hotel Lorelei — 체크아웃 명단: checkout name tags on the TRUE END card (js/rank.js). Everything is scoped under .rankboard. */
.rankboard {
  --rb-z: 1;                                   /* size factor: 1 on the 1600x900 stage, --uiz in body.compact */
  --rb-ink: #2a2118;
  --rb-pen: rgba(22, 30, 62, 0.92);            /* the ink of the name on the envelope */
  position: relative;
  flex: 0 1 auto;                              /* on the flex end card: takes what is left under the buttons, never more */
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 1200px;
  max-width: 96%;
  margin: 24px auto 0;
  font-family: var(--serif, 'Myeongjo', serif);
  color: var(--rb-ink);
  opacity: 0;
  user-select: none;
  -webkit-user-select: none;
}
.rankboard.rb-on { opacity: 1; animation: rb-in 1.8s ease both; }
.rankboard .rb-none { margin-top: calc(10px * var(--rb-z)); font-size: calc(17px * var(--rb-z)); letter-spacing: 0.12em; color: rgba(210, 190, 160, 0.5); }
@keyframes rb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.rankboard .rb-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(14px * var(--rb-z));
  margin: 0 0 calc(10px * var(--rb-z));
  font-size: calc(16px * var(--rb-z));
  line-height: 1.3;
  color: rgba(201, 164, 92, 0.82);
  white-space: nowrap;
}
.rankboard .rb-head::before, .rankboard .rb-head::after {
  content: '';
  flex: none;
  width: calc(84px * var(--rb-z));
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 164, 92, 0), rgba(201, 164, 92, 0.6));
}
.rankboard .rb-head::after { background: linear-gradient(270deg, rgba(201, 164, 92, 0), rgba(201, 164, 92, 0.6)); }
.rankboard .rb-title { letter-spacing: 0.5em; margin-right: -0.5em; }
.rankboard .rb-where { font-size: calc(12px * var(--rb-z)); letter-spacing: 0.05em; color: rgba(210, 190, 160, 0.42); }

.rankboard .rb-scroll {
  position: relative;                           /* offsetTop of the tags is measured from here (js reveal) */
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: calc(6px * var(--rb-z)) calc(12px * var(--rb-z)) calc(14px * var(--rb-z));
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 164, 92, 0.45) transparent;
}
.rankboard .rb-scroll::-webkit-scrollbar { width: 6px; }
.rankboard .rb-scroll::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, 0.45); border-radius: 3px; }
.rankboard .rb-scroll::-webkit-scrollbar-track { background: transparent; }
.rankboard.rb-empty .rb-scroll { display: none; }

.rankboard .rb-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1150px;                            /* five tags a row: 1-5, 6-10 */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 16px;
}
.rankboard .rb-own { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(201, 164, 92, 0.32); max-width: 300px; }
.rankboard .rb-own[hidden] { display: none; }

/* one tag: [badge] 609호 name / time · date */
.rankboard .rb-tag {
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: calc(214px * var(--rb-z));
  height: calc(60px * var(--rb-z));
  display: grid;
  grid-template-columns: calc(34px * var(--rb-z)) minmax(0, 1fr) auto;
  grid-template-rows: 1fr 1fr;
  grid-template-areas: "no who who" "no time date";
  align-items: center;
  column-gap: calc(9px * var(--rb-z));
  padding: calc(5px * var(--rb-z)) calc(11px * var(--rb-z)) calc(5px * var(--rb-z)) calc(8px * var(--rb-z));
  background: #e4d6b6 url('../assets/img/paper.webp') 30% 40% / 420px auto;
  border: 1px solid rgba(90, 66, 30, 0.75);
  border-radius: 2px calc(8px * var(--rb-z)) calc(8px * var(--rb-z)) 2px;
  box-shadow: inset 0 0 0 2px rgba(238, 229, 205, 0.85), inset 0 0 0 3px rgba(141, 111, 58, 0.4), 0 4px 12px rgba(0, 0, 0, 0.6);
  color: var(--rb-ink);
  line-height: 1.1;
  overflow: hidden;
}
.rankboard .rb-list .rb-tag:nth-child(4n+1) { transform: rotate(-0.6deg); background-position: 12% 20%; }
.rankboard .rb-list .rb-tag:nth-child(4n+2) { transform: rotate(0.45deg) translateY(1px); background-position: 70% 55%; }
.rankboard .rb-list .rb-tag:nth-child(4n+3) { transform: rotate(-0.25deg); background-position: 40% 85%; }
.rankboard .rb-list .rb-tag:nth-child(4n) { transform: rotate(0.7deg) translateY(-1px); background-position: 88% 10%; }

.rankboard .rb-no {
  grid-area: no;
  justify-self: center;
  width: calc(32px * var(--rb-z));
  height: calc(32px * var(--rb-z));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: calc(15px * var(--rb-z));
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #3a2a12;
  text-shadow: 0 1px 0 rgba(255, 236, 190, 0.45);
  background: radial-gradient(circle at 34% 30%, #d6bd87 0%, #a3834a 55%, #6a5127 100%);
  box-shadow: inset 0 0 0 1.5px rgba(60, 42, 16, 0.55), inset 0 1px 2px rgba(255, 240, 200, 0.4), 0 1px 2px rgba(0, 0, 0, 0.35);
}
.rankboard .rb-no.rb-wide { font-size: calc(11px * var(--rb-z)); letter-spacing: -0.03em; }
.rankboard .rb-top .rb-no { background: radial-gradient(circle at 34% 30%, #fbe8b4 0%, #d4ad5f 50%, #8d6f3a 100%); }

.rankboard .rb-who {
  grid-area: who;
  align-self: end;
  display: flex;
  align-items: baseline;
  gap: calc(6px * var(--rb-z));
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  padding-bottom: calc(1px * var(--rb-z));
}
.rankboard .rb-room { flex: none; font-size: calc(12px * var(--rb-z)); letter-spacing: 0.06em; color: rgba(58, 44, 30, 0.72); }
.rankboard .rb-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--pen, 'Pen', cursive);
  font-size: calc(26px * var(--rb-z));
  line-height: 0.95;
  color: var(--rb-pen);
}
.rankboard .rb-name.rb-mid { font-size: calc(21px * var(--rb-z)); }
.rankboard .rb-name.rb-long { font-size: calc(17px * var(--rb-z)); }
.rankboard .rb-time {
  grid-area: time;
  align-self: start;
  padding-top: calc(2px * var(--rb-z));
  font-weight: 700;
  font-size: calc(17px * var(--rb-z));
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: #2a2118;
}
.rankboard .rb-date {
  grid-area: date;
  align-self: start;
  justify-self: end;
  padding-top: calc(5px * var(--rb-z));
  font-size: calc(11px * var(--rb-z));
  letter-spacing: 0.04em;
  color: rgba(58, 44, 30, 0.55);
}

/* the player's own tag: a lighter card, a brass rim, and the hotel's red seal for a badge */
.rankboard .rb-tag.rb-me {
  z-index: 1;
  background-color: #f1e6cc;
  border-color: rgba(201, 164, 92, 0.95);
  box-shadow: inset 0 0 0 2px rgba(247, 239, 219, 0.95), inset 0 0 0 3px rgba(201, 164, 92, 0.7),
    0 0 0 1px rgba(201, 164, 92, 0.6), 0 0 22px 3px rgba(201, 164, 92, 0.36), 0 6px 16px rgba(0, 0, 0, 0.7);
}
.rankboard .rb-list .rb-tag.rb-me { transform: translateY(-3px); }
.rankboard .rb-me .rb-no {
  color: #f6e6c4;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  background: radial-gradient(circle at 34% 30%, #b8483d 0%, #7a1d1d 58%, #480e0e 100%);
  box-shadow: inset 0 0 0 1.5px rgba(40, 6, 6, 0.6), inset 0 1px 2px rgba(255, 200, 180, 0.35), 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* small screens: one column that scrolls inside whatever height the end card leaves */
body.compact .rankboard { --rb-z: var(--uiz, 1); width: auto; max-width: 96%; margin-top: calc(10px * var(--rb-z)); }
body.compact .rankboard .rb-head { margin-bottom: calc(6px * var(--rb-z)); }
body.compact .rankboard .rb-scroll { min-height: calc(72px * var(--rb-z)); padding: calc(4px * var(--rb-z)) calc(10px * var(--rb-z)) calc(10px * var(--rb-z)); }
body.compact .rankboard .rb-list { flex-direction: column; flex-wrap: nowrap; align-items: center; gap: calc(8px * var(--rb-z)); max-width: none; }
body.compact .rankboard .rb-own { margin-top: calc(8px * var(--rb-z)); padding-top: calc(8px * var(--rb-z)); }
body.compact .rankboard .rb-list .rb-tag {   /* one line per tag, so more of them fit the little height left */
  transform: none;
  width: calc(372px * var(--rb-z));
  height: calc(44px * var(--rb-z));
  grid-template-columns: calc(30px * var(--rb-z)) minmax(0, 1fr) auto auto;
  grid-template-rows: 1fr;
  grid-template-areas: "no who time date";
  column-gap: calc(10px * var(--rb-z));
  padding: calc(4px * var(--rb-z)) calc(12px * var(--rb-z)) calc(4px * var(--rb-z)) calc(7px * var(--rb-z));
}
body.compact .rankboard .rb-no { width: calc(28px * var(--rb-z)); height: calc(28px * var(--rb-z)); font-size: calc(13px * var(--rb-z)); }
body.compact .rankboard .rb-no.rb-wide { font-size: calc(10px * var(--rb-z)); }
body.compact .rankboard .rb-who, body.compact .rankboard .rb-time, body.compact .rankboard .rb-date { align-self: center; padding: 0; }

body.reduce .rankboard.rb-on { animation: none; }
@media (prefers-reduced-motion: reduce) { .rankboard.rb-on { animation: none; } }
