:root {
  --silver-0: #ececec;
  --silver-1: #cfcfcf;
  --silver-2: #9a9a9a;
  --silver-3: #6c6c6c;
  --ink: #1c1c1c;
  --green-0: #d4f59a;
  --green-1: #8ed43a;
  --green-2: #5eaa18;
  --green-3: #3e7c0e;
  --tile-gap: 10px;
  --focus: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Noto Sans", "Segoe UI", sans-serif;
  color: #fff;
  background: #6a6a6a;
}

button, input, select, textarea { font-family: inherit; }

.shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 18px 46px 14px;
  user-select: none;
  background:
    radial-gradient(80% 62% at 50% 38%, var(--silver-0) 0%, #d8d8d8 24%, var(--silver-1) 46%, var(--silver-2) 72%, var(--silver-3) 100%);
}

.top {
  position: relative;
  height: 74px;
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.channels {
  display: flex;
  align-items: flex-end;
  gap: 34px;
  padding-bottom: 8px;
}

.channel {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 2px 8px;
  color: #5a5a5a;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  cursor: pointer;
  line-height: 1;
}

.channel.active {
  color: #fff;
  font-size: 30px;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.18);
}

.channel.is-focused {
  box-shadow: inset 0 -3px 0 #fff;
}

.sound-toggle {
  position: absolute;
  left: 0;
  top: 10px;
  margin: 0;
  z-index: 2;
}

.sound-toggle .checkbox-label {
  color: #3a3a3a;
  font-weight: 600;
}

.profile {
  position: absolute;
  right: 0;
  top: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}

.profile-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.gamertag {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
}

.gamerscore {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.g-badge {
  width: 16px;
  height: 16px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.gamerscore:empty { display: none; }

.profile.is-signed-out .gamertag {
  font-weight: 600;
  opacity: 0.92;
}

.profile img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: #f4f4f4;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.profile.is-focused img {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 8px;
}

.view { height: 100%; }

.home-grid {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(160px, 18vw) 1fr 1fr minmax(160px, 18vw);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: var(--tile-gap);
}

.tile,
.thumb,
.art-frame {
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  border-radius: 4px;
  border: 3px solid var(--focus);
  box-shadow: inset 0 0 0 3px #111, 0 8px 18px rgba(0, 0, 0, 0.28);
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: #111 center / cover no-repeat;
  background-clip: padding-box;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.thumb,
.art-frame {
  background-clip: padding-box;
}

.tile.is-focused,
.thumb.is-focused,
.thumb.is-current,
.tile:focus,
.thumb:focus {
  outline: none;
  box-shadow:
    inset 0 0 0 3px #111,
    0 0 14px 3px rgba(255, 255, 255, 0.7),
    0 10px 22px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.input-field.is-focused,
.input-field:focus,
.input-field:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.btn-long:focus,
.btn-short:focus,
.btn-long:focus-visible,
.btn-short:focus-visible,
.btn-long:active,
.btn-short:active,
.btn-long.is-focused,
.btn-short.is-focused {
  outline: none;
  box-shadow: none;
}

.span-2 { grid-column: span 2; }

.tile.hero {
  grid-row: span 2;
}

.tile.hero .label {
  font-size: clamp(16px, 1.7vw, 22px);
  font-weight: 500;
  padding-bottom: 12px;
}

.tile.hero .hero-slide {
  position: absolute;
  inset: 0;
  background-color: #111;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
  z-index: 0;
}

.tile.hero .hero-slide.is-active {
  opacity: 1;
}

.tile.hero .hero-slide-art {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 1;
}

.tile.hero .hero-slide-wotw {
  overflow: hidden;
}

.tile.hero .hero-slide-wotw .label {
  z-index: 2;
}


.tile .label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.tile.system {
  background: linear-gradient(180deg, #96dc45 0%, #69b61e 46%, #4b9613 100%);
}

.tile.system::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
  border-radius: inherit;
}

.tile.system .glyph {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 58%;
  height: 52%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.18));
}

.tile.system .label {
  background: none;
  padding: 0 14px 12px;
  font-size: 18px;
}

.logo-tile {
  background: #f3f3f3 url("../images/logo.webp") center / cover no-repeat;
}

.logo-tile .label {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}

.hintbar {
  flex: none;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f7f7f7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  font-size: 15px;
  font-weight: 500;
}

.hints { display: flex; gap: 22px; align-items: center; }

.hint { display: inline-flex; align-items: center; }

.face {
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 1px rgba(0, 0, 0, 0.35);
}

.face.a { background: radial-gradient(circle at 35% 30%, #c6ef86, #62b418 58%, #3d7a0c); }
.face.b { background: radial-gradient(circle at 35% 30%, #ff9d9d, #e23d3d 58%, #9d1414); }

.library, .studio, .social, .support, .detail {
  height: 100%;
  display: grid;
  gap: 14px;
}

.library {
  grid-template-rows: 1fr auto;
}

.library-stage, .detail {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 14px;
  min-height: 0;
}

.art-frame {
  min-height: 0;
  background: #111 center / cover no-repeat;
}

.library-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.thumb {
  position: relative;
  overflow: hidden;
  padding: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #111 center / cover no-repeat;
  cursor: pointer;
  color: #fff;
}

.thumb span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 6px 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.window,
.textbox-dark,
.textbox-light,
.input-message,
.progress-bar {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.textbox-dark,
.textbox-light {
  height: auto;
  min-height: 0;
}

.library-stage > .window,
.detail > .window,
.support > .window {
  height: 100%;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.library-stage > .window .window-content,
.detail > .window .window-content,
.support > .window .window-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.window-content .btn-long,
.window-content .btn-short {
  position: static;
  margin-right: 8px;
}

.window-content .btn-long {
  width: 100%;
  background: linear-gradient(180deg, rgba(230, 230, 230, 1) 0%, rgba(212, 212, 212, 1) 90%);
  color: #525252;
  text-align: left;
}

.window-content .btn-long:hover,
.window-content .btn-long.active {
  background: linear-gradient(0deg, rgba(115, 143, 50, 1) 0%, rgba(142, 219, 70, 1) 100%);
  color: #fff;
}

.window-content .textbox-dark,
.window-content .textbox-dark p { color: #fff; }

.window-content p.meta { color: #3d6d12; }
.window-content p.fine { color: #444; }

a.btn-long,
a.btn-short { text-decoration: none; }

.btn-long.is-disabled,
.btn-long:disabled {
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
  color: #555;
}

.window-content p + p { margin-top: 8px; }

.meta {
  color: #3d6d12;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.studio {
  height: auto;
  align-content: start;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: auto auto;
}

.stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats .textbox-dark,
.pillars .textbox-dark,
.pillars .textbox-light,
.faq-answer { margin-bottom: 0; }

.stats .textbox-dark strong { font-size: 20px; }

.pillars { display: grid; gap: 10px; }

.social {
  height: 100%;
  align-content: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
}

.chat-wrapper {
  min-height: 0;
  height: 100%;
  background: #1e1f22;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.chat-wrapper iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.social > .window {
  height: 100%;
  margin-bottom: 0;
}

.support {
  grid-template-columns: 0.9fr 1.1fr;
}

.rows .btn-long { width: 100%; margin-bottom: 8px; }

.field {
  display: block;
  margin: 8px 0 4px;
  font-size: 13px;
  color: #525252;
}

.input-field,
select.input-field,
textarea.input-field {
  width: 100%;
  display: block;
  margin-bottom: 8px;
  user-select: text;
  background: #fff;
}

textarea.input-field { min-height: 88px; resize: vertical; }

.char-count { text-align: right; font-size: 11px; color: #555; }

.checkbox-wrapper { display: flex; align-items: center; margin: 8px 0 12px; }

#recaptcha-container { margin: 8px 0 12px; min-height: 78px; }

.modal-back {
  position: absolute;
  inset: 0;
  background: rgba(30, 30, 30, 0.28);
  display: grid;
  place-items: center;
  z-index: 4;
  padding: 20px;
}

.modal-back .window { width: min(460px, 100%); height: auto; }

.fine {
  margin-top: 14px;
  font-size: 12px;
  color: #444;
}

.fine a { color: #24580c; }

.legal-shell {
  height: auto;
  min-height: 100dvh;
  user-select: text;
}

.legal-shell .top { justify-content: flex-start; }

.legal-shell .channel { text-decoration: none; }

.legal-shell .stage {
  display: flex;
  flex-direction: column;
}

.legal-shell .window {
  height: auto;
  padding-bottom: 0;
}

.legal-shell .window-content h2 {
  margin: 18px 0 2px;
  padding: 0 5px;
  font-size: 13px;
  font-weight: 700;
  color: #3d6d12;
}

.legal-shell .window-content h2:first-child { margin-top: 4px; }

.legal-shell .window-content h3 {
  margin: 10px 0 0;
  padding: 0 5px;
  font-size: 13px;
  font-weight: 700;
  color: #525252;
}

.legal-shell .window-content a { color: #24580c; }

.legal-shell .window-content .btn-long { margin-top: 12px; }

@media (max-width: 980px) {
  .shell { padding: 14px 16px 10px; height: auto; min-height: 100dvh; }
  body { overflow: auto; }
  .top { height: auto; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .sound-toggle { position: static; width: 100%; margin-bottom: 8px; }
  .profile { position: static; margin-left: 12px; }
  .channels { gap: 12px 16px; overflow: visible; flex-wrap: wrap; width: auto; flex: 1; justify-content: flex-start; }
  .channel { font-size: 16px; flex: none; }
  .channel.active { font-size: 20px; }
  .profile-text { display: none; }
  .home-grid {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .home-grid .tile { min-height: 140px; grid-column: 1 / -1; }
  .tile.hero, .span-2 { grid-column: 1 / -1; }
  .tile.hero { grid-row: auto; min-height: 210px; }
  .library, .library-stage, .detail, .studio, .social, .support {
    height: auto;
    grid-template-columns: 1fr;
  }
  .art-frame { min-height: 220px; }
  .chat-wrapper { min-height: 480px; }
  .library-row {
    display: flex;
    height: auto;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }
  .library-row .thumb { flex: 0 0 18%; aspect-ratio: 1 / 1; }
  .stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Development tab (patch notes) */
.development {
  height: 100%;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}
.development > .window {
  height: 100%;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.development > .window .window-content { flex: 1; min-height: 0; overflow: auto; }
.development .rows { margin-top: 12px; }
.window-content .btn-long.dev-filter { border-left: 6px solid var(--accent, #62b418); }
.patch {
  border-left: 6px solid var(--accent);
  background: linear-gradient(180deg, #f4f4f4 0%, #e4e4e4 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  padding: 10px 14px 12px;
  margin-bottom: 12px;
  color: #333;
}
.patch-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.patch-game {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.patch h3 { margin: 0; font-size: 16px; font-weight: 700; color: #222; flex: 1; }
.patch time { font-size: 12px; font-weight: 600; color: #666; }
.patch ul { margin: 8px 0 0; padding-left: 20px; }
.patch li { font-size: 14px; line-height: 1.45; margin: 2px 0; }
@media (max-width: 980px) {
  .development { height: auto; grid-template-columns: 1fr; }
  .development > .window { height: auto; }
  .development > .window .window-content { overflow: visible; }
  .patch h3 { font-size: 15px; }
}

/* ---- Phone layout (added 2026-11-04). Desktop (>768px) is untouched. ---- */
@media (max-width: 768px) {
  body { -webkit-text-size-adjust: 100%; }
  .shell { padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); user-select: auto; }
  .top { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; }
  .sound-toggle { grid-column: 1; grid-row: 1; width: auto; margin: 0; min-height: 44px; }
  .profile { grid-column: 2; grid-row: 1; margin: 0; min-height: 44px; }
  .profile img { width: 40px; height: 40px; }
  /* One swipeable row of channels instead of two wrapped lines */
  .channels {
    grid-column: 1 / -1; grid-row: 2;
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
    gap: 4px; padding: 0 2px 2px; margin: 0 -12px; padding-left: 12px; padding-right: 12px;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
  }
  .channels::-webkit-scrollbar { display: none; }
  .channel { min-height: 44px; padding: 10px 10px; font-size: 18px; scroll-snap-align: center; }
  .channel.active { font-size: 22px; }
  .stage { margin-top: 6px; }
  /* Home: two-column tile grid keeps the dashboard feel and halves scrolling */
  .home-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .home-grid .tile { min-height: 120px; grid-column: auto; }
  .home-grid .tile.hero, .home-grid .span-2 { grid-column: 1 / -1; }
  .home-grid .tile.hero { min-height: 190px; }
  .home-grid .logo-tile, .home-grid .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .home-grid .logo-tile { min-height: 150px; background-size: auto 190%; background-position: center 45%; }
  .tile.system .label { font-size: 16px; }
  /* Games: thumbnails become a swipeable strip that never overlaps the info box */
  .library { grid-template-rows: none; }
  .art-frame { min-height: 0; aspect-ratio: 16 / 9; }
  .library-row {
    display: flex; height: auto; gap: 8px; overflow-x: auto;
    margin: 0 -12px; padding: 2px 12px 6px; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .library-row::-webkit-scrollbar { display: none; }
  .library-row .thumb { flex: 0 0 32%; aspect-ratio: 1 / 1; scroll-snap-align: start; }
  .thumb span { font-size: 13px; }
  /* Bigger, easier buttons and readable text */
  .window-content p, .window-content li { font-size: 15px; line-height: 1.5; }
  .window-content .btn-short { min-height: 44px; padding: 0 18px; }
  .btn-long, .window-content .btn-long { min-height: 48px; display: flex; align-items: center; height: auto; }
  .rows .btn-long { white-space: normal; padding-top: 10px; padding-bottom: 10px; line-height: 1.3; }
  .input-field, select.input-field, textarea.input-field { font-size: 16px; min-height: 44px; }
  .fine, .fine a { font-size: 13px; }
  .fine a { display: inline-block; padding: 12px 0; }
  .social .chat-wrapper { min-height: 0; height: 62vh; max-height: 520px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats .textbox-dark strong { font-size: 16px; }
  /* Development: game filters as a compact row of chips */
  .development .rows { display: flex; flex-wrap: wrap; gap: 6px; }
  .development .rows .btn-long { width: auto; flex: 1 1 auto; margin: 0; }
  .patch li { font-size: 15px; }
  /* No controller hints on phones: tabs + in-page Back/Close buttons handle navigation */
  .hintbar { display: none; }
  .modal-back { position: fixed; padding: 16px; }
}
@media (max-width: 480px) {
  .sound-toggle .checkbox-label { font-size: 13px; }
  .stats { gap: 6px; }
  .stats .textbox-dark p { font-size: 13px; }
  .stats .textbox-dark strong { font-size: 15px; }
}

/* ---- Leaderboard (/leaderboard) and public profiles (/u/<name>), added 2026-11-21 ---- */
.leaderboard, .pprofile {
  height: 100%;
  display: grid;
  gap: 14px;
  min-height: 0;
}
.leaderboard { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); }
.leaderboard > .window, .pprofile > .window {
  height: 100%;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
.leaderboard > .window .window-content, .pprofile > .window .window-content { flex: 1; min-height: 0; overflow: auto; }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  display: grid;
  grid-template-columns: 52px 40px minmax(0, 1fr) auto 110px;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 8px;
  background: linear-gradient(180deg, #f4f4f4 0%, #e2e2e2 100%);
  border-left: 6px solid #b9b9b9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  color: #333;
  text-decoration: none;
  outline: none;
}
.lb-row.top1 { border-left-color: #e0b52a; }
.lb-row.top2 { border-left-color: #a9b3bd; }
.lb-row.top3 { border-left-color: #c27c3a; }
.lb-row:hover, .lb-row.is-focused, .lb-row:focus-visible {
  background: linear-gradient(0deg, rgba(115, 143, 50, 1) 0%, rgba(142, 219, 70, 1) 100%);
  color: #fff;
}
.lb-row.is-me { border-left-color: var(--green-2, #5eaa18); background: linear-gradient(180deg, #eef9df 0%, #d6efb6 100%); box-shadow: inset 0 0 0 2px var(--green-1, #8ed43a), 0 2px 6px rgba(0, 0, 0, 0.12); }
.lb-row.is-me:hover, .lb-row.is-me.is-focused { background: linear-gradient(0deg, rgba(115, 143, 50, 1) 0%, rgba(142, 219, 70, 1) 100%); }
.lb-rank { font-size: 18px; font-weight: 700; text-align: right; color: inherit; }
.lb-pfp { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 2px solid #fff; background: #ddd; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.lb-name { min-width: 0; display: flex; align-items: center; font-size: 15px; font-weight: 600; }
.lb-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name .lb-you { flex: none; }
.lb-xp { font-size: 13px; text-align: right; color: inherit; opacity: 0.85; white-space: nowrap; }
.lb-you {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fff; background: var(--green-2, #5eaa18); border-radius: 3px;
}
.lvl-badge {
  display: inline-block; padding: 2px 9px; white-space: nowrap;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #8ed43a 0%, #4e9214 100%);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.lvl-badge.big { font-size: 20px; padding: 4px 14px; }
.lb-row:hover .lvl-badge, .lb-row.is-focused .lvl-badge { border-color: rgba(255, 255, 255, 0.9); }
.lb-mine { margin-top: 14px; padding-top: 10px; border-top: 2px dashed #b4b4b4; }
.window-content p.lb-mine-label { padding: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #3d6d12; }
.lb-empty { padding: 12px 0; }
.lb-me-box { margin-bottom: 10px; }
.lb-me-box strong { font-size: 20px; }
.window-content .btn-long.lb-link { margin-top: 10px; }

.pprofile { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: stretch; }
.pp-card { min-height: 0; display: flex; align-items: center; justify-content: center; }
.pp-pfp {
  width: min(100%, 60vh, 420px);
  aspect-ratio: 1 / 1;
  border: 3px solid #fff;
  border-radius: 4px;
  background: #d4d4d4;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.pp-pfp img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pp-name { margin: 2px 0 10px; font-size: 30px; font-weight: 700; color: #222; line-height: 1.15; overflow-wrap: anywhere; }
.pp-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.pp-rank { font-size: 22px; font-weight: 700; color: #333; }
.pp-rank span { font-size: 14px; font-weight: 400; color: #666; }
.pp-bar.progress-bar { width: 100%; height: 22px; margin-bottom: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.pp-bar .progress-fill { height: 22px; }
.window-content p.pp-xp { padding: 2px 0 10px; color: #444; }
.pp-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 14px; font-size: 14px; color: #444; }
.pp-facts dt { font-weight: 600; color: #555; }
.pp-facts dd { margin: 0; }
.pp-actions .btn-long { margin-bottom: 8px; }
.pp-missing .window-content > p:first-child { font-size: 18px; color: #333; }

@media (max-width: 980px) {
  .leaderboard, .pprofile { height: auto; grid-template-columns: 1fr; }
  .leaderboard > .window, .pprofile > .window { height: auto; }
  .leaderboard > .window .window-content, .pprofile > .window .window-content { overflow: visible; }
  .pp-pfp { width: min(70vw, 300px); }
}
@media (max-width: 768px) {
  .lb-row { grid-template-columns: 40px 36px minmax(0, 1fr) auto; gap: 8px; padding: 6px 10px 6px 6px; min-height: 52px; }
  .lb-pfp { width: 36px; height: 36px; }
  .lb-rank { font-size: 15px; }
  .lb-xp { display: none; }
  .lb-name { font-size: 15px; }
  .pp-name { font-size: 26px; text-align: center; }
  .pp-badges { justify-content: center; }
  .pp-pfp { width: min(62vw, 260px); }
}

/* Home: Discord tile (official white Discord symbol on blurple, no label) */
.tile.discord-tile { background: #5865F2; }
.tile.discord-tile img { position: absolute; left: 50%; top: 44%; width: 42%; max-height: 50%; transform: translate(-50%, -50%); object-fit: contain; pointer-events: none; }
.tile.tiktok-tile { background: #000; }
.tile.tiktok-tile img { position: absolute; left: 50%; top: 42%; width: 50%; height: auto; max-height: 54%; transform: translate(-50%, -50%); object-fit: contain; pointer-events: none; }

/* Social: player card + top players */
.social.sc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sc-card { display: flex; align-items: center; gap: 14px; padding: 10px; margin-bottom: 12px; color: #222; text-decoration: none; background: linear-gradient(180deg, #fafafa 0%, #e6e6e6 100%); border-left: 6px solid var(--green-2, #5eaa18); border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.sc-card:hover, .sc-card.is-focused, .sc-card:focus-visible { outline: none; color: #fff; background: linear-gradient(0deg, rgba(115, 143, 50, 1) 0%, rgba(142, 219, 70, 1) 100%); }
.sc-card:hover .sc-rank, .sc-card.is-focused .sc-rank, .sc-card:hover .sc-rank span, .sc-card.is-focused .sc-rank span { color: #fff; }
.sc-pfp { flex: none; width: 96px; height: 96px; object-fit: cover; border-radius: 4px; border: 3px solid #fff; background: #ddd; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.sc-who { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-name { font-size: 24px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.sc-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.sc-rank { font-size: 20px; font-weight: 700; color: #333; }
.sc-rank span { font-size: 14px; font-weight: 400; color: #666; }
.window-content p.sc-xp { padding: 2px 0 10px; color: #444; }
.sc-xp span { color: #666; }
.sc-actions .btn-long { margin-bottom: 8px; }
.sc-guest { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.window-content p.sc-guest-h { font-size: 20px; font-weight: 700; color: #222; line-height: 1.25; }
.sc-top .lb-list { margin-bottom: 4px; }
@media (max-width: 768px) {
  .social.sc { grid-template-columns: 1fr; }
  .sc-pfp { width: 76px; height: 76px; }
  .sc-name { font-size: 21px; }
}

/* Role badges (Owner / Tester) on public profiles, leaderboard rows, and social card */
.role-badge {
  display: inline-block; padding: 2px 9px; white-space: nowrap;
  font-size: 12px; font-weight: 700; color: #fff;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
.role-badge.big { font-size: 20px; padding: 4px 14px; }
.role-badge.owner { background: linear-gradient(180deg, #e8b024 0%, #9b6400 100%); }
.role-badge.tester { background: linear-gradient(180deg, #7f57dc 0%, #4b2b9e 100%); }
.lb-name .role-badge { flex: none; margin-left: 7px; }
.lb-row:hover .role-badge, .lb-row.is-focused .role-badge { border-color: rgba(255, 255, 255, 0.9); }
@media (max-width: 768px) {
  .lb-name .role-badge { font-size: 11px; padding: 1px 6px; margin-left: 5px; }
}
