:root {
    --background: #141212;
    --main-color: #252525;
    --darker-main-color: #181818;
    --accent: #7CFF3A;
    --gray: #2f2f2f;
    --gray2: #404040;
    --settings-scale: 0.93;
    --settings-shift: 1.2vh;
    --tab-container-height: 50px;
    --tab-slider-padding: 4px;
    --tab-gap: 4px;
    --bottom-bar-height: 56px;
}

/* ===== Required for sliding navigation container + iframes ===== */
* {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: manipulation;
}

input,
textarea,
select,
[contenteditable="true"],
[contenteditable=""],
[contenteditable="plaintext-only"] {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* Prevent the document from scrolling behind the sliding pages */
html,
body {
    height: 100%;
    /* overflow-x: hidden; */
    overflow-y: auto;
}

html.app-shell,
body.app-shell {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

/* Your theme defaults */
body {
    margin: 0;
    background-color: var(--background);
    color: white;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    /* font-family: 'Inter'; */
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body.page-with-nav {
    height: calc(100vh - (var(--bottom-bar-height) + env(safe-area-inset-bottom)));
}

/* App splash loader (shown on app shell only) */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    background: var(--background);
    opacity: 1;
    transition: opacity 400ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.app-loader__content {
    text-align: center;
    display: grid;
    place-items: center;
}

.app-loader__spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgba(255, 255, 255, 0.85);
    opacity: 0;
    animation: loader-spin 0.9s linear infinite, loader-spinner-fade-in 200ms ease forwards;
    transition: opacity 400ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.app-loader--hidden {
    opacity: 0;
    pointer-events: none;
}

.app-loader--hidden .app-loader__spinner {
    opacity: 0;
}

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

@keyframes loader-fade-in {
    to { opacity: 1; }
}

@keyframes loader-spinner-fade-in {
    to { opacity: 1; }
}

@keyframes app-shell-fade-in {
    to { opacity: 1; }
}

/* Wrapper for the sliding app shell (used by the navigation HTML, not by individual pages like friends.html) */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
    transform-origin: center center;
    transform: translateX(0);
}

.app-shell.fade-in .app-container {
    opacity: 0;
    animation: app-shell-fade-in 200ms ease forwards;
}

/* The viewport where pages slide */
.content-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pan-y;
    min-height: 0;
    height: 100%;
}

body.settings-open .app-container {
    transform: translateX(-30%);
}

.settings-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
    pointer-events: none;
    z-index: 15;
}

body.settings-open .settings-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    transform: translate3d(100%, 0, 0);
    transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 20;
    pointer-events: none;
    background: var(--background);
    visibility: hidden;
    will-change: transform;
}

.settings-overlay iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: var(--background);
}

.settings-overlay[aria-hidden="false"] {
    visibility: visible;
}

.settings-overlay.is-open {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
}

.settings-overlay.is-closing {
    transform: translate3d(100%, 0, 0);
}


/* Each page layer that slides */
.page {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;

    transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
    transform: translate3d(0, 0, 0);

    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Disable transition while dragging for 1:1 tracking */
.content-area.dragging .page {
    transition: none;
}

/* Iframes fill their page */
.page iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: transparent;
}


/* Your bottom bar gets safe-area padding so it doesn't clash with iPhone home indicator */
.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    background-color: var(--main-color);
    height: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
    width: 100%;
    justify-content: space-evenly;
    align-items: center;
    font-size: 10px;
    border-top: 1px solid var(--gray);
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;

    /* optional but helps feel closer to iOS */
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    transform: translateY(0);
    transition: transform 360ms ease;
    will-change: transform;
}

.bottom-bar.is-hidden {
    transform: translateY(120%);
}

@media (prefers-reduced-motion: reduce) {
    .page { transition: none; }
    .app-container,
    .settings-backdrop,
    .settings-overlay,
    .bottom-bar { transition: none; }
}

@supports (height: 100dvh) {
    .app-container {
        height: 100dvh;
    }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-bar {
        /* height: calc(49px + env(safe-area-inset-bottom)); */
        height: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
    }
}

/* ===== Your existing styles (unchanged) ===== */

.bottom-bar-button {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: var(--bottom-bar-height);
}

.bottom-bar-icon {
    width: 25px;
    height: auto;
}


.green {
    filter: brightness(0) saturate(100%) invert(89%) sepia(78%) saturate(1256%) hue-rotate(37deg) brightness(101%) contrast(77%) !important;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    height: 40px;
    max-height: 40px;
}

.page-title {
    font-size: 28px;
    font-weight: bold;
}

.page-title-subtitle {
    font-size: 14px;
    font-weight: normal;
    opacity: 60%;
}

.friends-button {
    background-color: var(--accent);
    padding: 9px 25px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-radius: 4px;
}

.friends-button-label {
    color: black;
    font-weight: bold;
    font-size: 14px;
}

.friends-button-icon {
    margin-right: 10px;
}

.wrapper {
    margin: 30px;
}

.search-bar {
    height: 50px;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
    background-color: var(--main-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.search-bar-icon {
    width: 25px;
    opacity: 60%;
    margin-right: 10px;
}

.search-bar-input {
    background-color: unset;
    border: none;
    color: white;
    width: 100%;
    font-size: 16px;
}

input:focus {
    outline: none;
    box-shadow: none;
}

.user-group {
    margin-top: 30px;
}

.user-group-circle {
    background-color: var(--accent);
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.user-group-text {
    opacity: 60%;
    font-size: 11px;
    font-weight: 600;
}

.user-group-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.user-card {
    background-color: var(--main-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.user-card:last-child {
    margin-bottom: 0;
}

.user-card-pfp {
    width: 50px;
    height: 50px;
    background-color: var(--gray2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.user-card-name {
    font-weight: 600;
    font-size: 14px;
}

.user-card-status {
    margin-top: 2px;
    font-size: 11px;
    display: flex;
    gap: 5px;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
}

.user-card-circle {
    background-color: var(--accent);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    position: absolute;
    right: -5%;
    bottom: 0%;
    border: 3px solid var(--main-color);
}

.inactive {
    background-color: rgba(255, 255, 255, 0.6);
}

.blue {
    color: #9EF5FF;
}

.shadow {
    box-shadow: 0px 4px 4px rgba(0,0,0,0.2);
}

.home-card {
    background-color: var(--main-color);
    border-radius: 4px;
    padding: 20px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.home-card-pfp {
    width: 60px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray2);
}

.home-card-title {
    font-size: 24px;
    font-weight: bold;
}

.home-card-subtitle {
    opacity: 60%;
    font-size: 14px;
}

.home-card-progress-bar-outer {
    background-color: var(--darker-main-color);
    width: 100%;
    height: 15px;
    border-radius: 15px;
    position: relative;
    margin-bottom: 20px;
}

.home-card-progress-bar-inner {
    background-color: var(--accent);
    width: 25%;
    height: 15px;
    border-radius: 15px;
    position: absolute;
    left: 0;
}

.home-card-stat-value {
    font-size: 24px;
    font-weight: bold;
}

.home-card-stat-key {
    opacity: 60%;
    font-size: 14px;
}

.home-card-stats {
    display: flex;
    justify-content: space-evenly;
    padding-top: 15px;
    border-top: 1px solid var(--gray2);
}

.home-card-stat {
    text-align: center;
    width: 100%;
    padding: 5px 0;
    border-right: 1px solid var(--gray2);
}

.home-card-stat:last-child {
    border-right: none;
}

.tabs {
    position: relative;
    display: flex;
    background: var(--main-color);
    border-radius: 4px;
    height: var(--tab-container-height);
    min-height: var(--tab-container-height);
    max-height: var(--tab-container-height);
    padding: var(--tab-slider-padding);
    gap: var(--tab-gap);
    box-sizing: border-box;
    margin: 20px 0 20px 0;
    align-items: stretch;
}

.tabs input {
    display: none;
}

.tabs label {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    z-index: 1;
    font-size: 14px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider {
    position: absolute;
    top: var(--tab-slider-padding);
    left: var(--tab-slider-padding);
    width: calc((100% - (var(--tab-slider-padding) * 2) - (var(--tab-gap) * 2)) / 3);
    height: calc(var(--tab-container-height) - (var(--tab-slider-padding) * 2));
    background: #7CFF3A;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.tabs.tabs-two .slider {
    width: calc((100% - (var(--tab-slider-padding) * 2) - var(--tab-gap)) / 2);
}

/* Active states */
#tab1:checked ~ .slider {
    transform: translateX(0%);
}

#tab2:checked ~ .slider {
    transform: translateX(calc(100% + var(--tab-gap)));
}

#tab3:checked ~ .slider {
    transform: translateX(calc(200% + (var(--tab-gap) * 2)));
}

#tab1:checked ~ label[for="tab1"],
#tab2:checked ~ label[for="tab2"],
#tab3:checked ~ label[for="tab3"] {
    color: #000;
}

.home-quest-title {
    font-weight: bold;
}

.home-quest {
    background-color: var(--main-color);
    border-radius: 4px;
    padding: 20px;
}

.home-quest-subtitle {
    font-size: 14px;
    opacity: 60%;
}

.notification-circle {
    background-color: #FF4545;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 3px solid var(--background);
    position: absolute;
    left: 12px;
    top: -5px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.login-input {
    width: 100%;
    padding: 18px;
    max-height: 55px;
    border: none;
    border-radius: 4px;
    background: var(--main-color);
    color: #fff;
    font-size: 16px;
    box-sizing: border-box;
}

.login-button {
    width: 100%;
    height: 55px;
    border: none;
    border-radius: 4px;
    background: #3a3a3c;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-button:active {
    transform: scale(0.97);
    background: #2a2a2c;
}

.login-button:disabled {
    background: #2a2a2c;
    cursor: not-allowed;
    opacity: 0.7;
}

.login-button .button-text {
    transition: opacity 0.2s ease;
}

.login-button .loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.login-button.loading .button-text {
    opacity: 0;
}

.login-button.loading .loader {
    opacity: 1;
}

.login-button.success {
    /* background: #34c759; */
}

.login-button .success-icon {
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.5);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.login-button.success .success-icon {
    opacity: 1;
    transform: scale(1);
}

.login-button.success .button-text,
.login-button.success .loader {
    opacity: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

.error {
    color: #ff3b30;
    font-size: 14px;
    text-align: center;
    margin-bottom: 15px;
}

.signup-link {
    text-align: center;
    margin: 20px 0 15px;
    font-size: 14px;
    color: #8e8e93;
}

.signup-link a {
    color: #007aff;
    text-decoration: none;
    font-weight: 500;
}

.terms-text {
    position: fixed !important;
    bottom: 30px;
    margin: 0 auto 0 auto;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    width: 60%;
}

a {
    color: white;
}

a:visited{
    color: white;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.separator span {
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 14px;
}

.separator::before,
.separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--main-color);
}

.oauth-button {
    width: 100%;
    height: 55px;
    background-color: #000000;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    gap: 10px;
}

.oauth-button:active {
    transform: scale(0.97);
}

.oauth-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.oauth-icon {
    font-size: 20px;
    line-height: 1;
}

.login-hero-image {
    width: 40%;
    margin: -70px 0 50px 0;
}

.ios-title-bar-left {
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.ios-title-bar-icon {
    margin-left: -8px;
}

.ios-title-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.ios-title-bar-center {
    font-weight: 600;
    position: absolute;
    text-align: center;
    width: 100%;
    pointer-events: none;
}

.settings-pfp {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    width: 128px;
    margin: 30px 0;
}

.settings-menu {
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

.settings-menu:last-child {
    margin-bottom: 0;
}

.setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--main-color);
    padding: 0 16px 0 16px;
}

.setting-right {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
    gap: 3px;
    flex: 0 1 55%;
    min-width: 0;
    justify-content: flex-end;
}

.setting-right span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.settings-menu > .setting:last-child {
    border-radius: 0 0 4px 4px;
}

.settings-menu > .setting:first-of-type,
.settings-group-label + .setting {
    border-radius: 4px 4px 0 0;
}

.settings-menu > .setting:only-of-type,
.settings-group-label + .setting:last-child {
    border-radius: 4px;
}

.setting-inner {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0 14px 0;
    border-bottom: 1px solid var(--gray2);
}

.setting:last-of-type .setting-inner {
    border-bottom: none;
}

.leaderboard-wrapper {
  width: 100vw;
  height: 100%;
  background: var(--background);
  position: relative;
  overflow: visible;
}

.leaderboard-inner {
  margin: 30px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
}

.leaderboard-nav {
  margin-bottom: 30px;
}

.page-title {
  font-size: 28px;
  font-weight: bold;
}

.leaderboard-title {
  font-size: 28px;
  font-weight: bold;
}

/* ================= Tabs ================= */

.leaderboard-content input {
  display: none;
}

.leaderboard-tabs {
  position: relative;
  height: var(--tab-container-height);
  background: var(--main-color);
  border-radius: 4px;
  display: flex;
  padding: var(--tab-slider-padding);
  gap: 4px;
  margin-bottom: 30px;
  width: 100%;
}

.leaderboard-tabs label {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  z-index: 1;
  font-size: 14px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.leaderboard-tabs label img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
  transition: filter 0.2s ease;
}

.leaderboard-tabs .slider {
  position: absolute;
  top: var(--tab-slider-padding);
  left: var(--tab-slider-padding);
  width: calc(50% - var(--tab-slider-padding));
  height: calc(100% - (var(--tab-slider-padding) * 2));
  background: var(--accent);
  border-radius: 4px;
  transition: transform 0.2s ease;
}

#tab-level:checked ~ .leaderboard-tabs .slider {
  transform: translateX(0%);
}

#tab-coins:checked ~ .leaderboard-tabs .slider {
  transform: translateX(100%);
}

#tab-level:checked ~ .leaderboard-tabs label[for="tab-level"],
#tab-coins:checked ~ .leaderboard-tabs label[for="tab-coins"] {
  color: black;
}

#tab-level:checked ~ .leaderboard-tabs label[for="tab-level"] img,
#tab-coins:checked ~ .leaderboard-tabs label[for="tab-coins"] img {
  filter: brightness(0);
}

/* ================= Podium ================= */

.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 30px;
  /* padding: 0 10px; */
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.podium-first { order: 2; }
.podium-second { order: 1; }
.podium-third { order: 3; }

.podium-rank-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.podium-rank-icon img {
  width: 100%;
  height: 100%;
}

.podium-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gray2);
  margin-bottom: 8px;
  border: 2px solid var(--accent);
  overflow: hidden;
}

.podium-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-first .podium-avatar {
  width: 60px;
  height: 60px;
}

.podium-first .podium-rank-icon {
  width: 38px;
  height: 38px;
}

.podium-name {
  font-weight: bold;
  text-align: center;
  margin-bottom: 2px;
}

.podium-username {
  font-size: 12px;
  color: #9b9b9b;
  text-align: center;
  margin-bottom: 6px;
}

.podium-stats {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.podium-platform {
  width: 100%;
  background: var(--main-color);
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray);
  border-bottom: none;
  position: relative;
}

.podium-platform::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  border-radius: 8px 8px 0 0;
}

.podium-number {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

.podium-platform-first {
  height: 90px;
}

.podium-platform-first::before {
  background: linear-gradient(90deg, #ffd700, #ffa500);
}

.podium-platform-second {
  height: 70px;
}

.podium-platform-second::before {
  background: linear-gradient(90deg, #c0c0c0, #a8a8a8);
}

.podium-platform-third {
  height: 55px;
}

.podium-platform-third::before {
  background: linear-gradient(90deg, #cd7f32, #b8733d);
}

/* Hide/show podium containers based on tab */
.podium-coins {
  display: none;
}

#tab-level:checked ~ .podium-level {
  display: flex;
}

#tab-level:checked ~ .podium-coins {
  display: none;
}

#tab-coins:checked ~ .podium-coins {
  display: flex;
}

#tab-coins:checked ~ .podium-level {
  display: none;
}

/* Hide podium stats based on tab */
#tab-level:checked ~ .podium-level .podium-stats-coins {
  display: none;
}

#tab-coins:checked ~ .podium-coins .podium-stats-level {
  display: none;
}

/* ================= Leaderboard List ================= */

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 30px;
}

#tab-level:checked ~ .leaderboard-list--coins {
  display: none;
}

#tab-coins:checked ~ .leaderboard-list--level {
  display: none;
}

.leaderboard-row {
  height: 72px;
  background: var(--main-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.leaderboard-row--featured {
  border: 1px solid var(--accent);
}

.leaderboard-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-rank-icon,
.leaderboard-rank-badge {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.leaderboard-rank-icon {
  background-image: url("../icons/user.svg");
  background-size: cover;
  background-position: center;
}

.leaderboard-rank-icon img {
  display: none;
}

.leaderboard-rank-badge {
  background: var(--gray2);
}

.leaderboard-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray2);
  overflow: hidden;
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.leaderboard-row-name {
  font-size: 14px;
  font-weight: 700;
}

.leaderboard-row-username {
  font-size: 12px;
  color: #9b9b9b;
}

.leaderboard-row-meta {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 110px;
  align-items: flex-end;
}

.leaderboard-row-level {
  font-size: 14px;
  font-weight: 700;
}

.leaderboard-row-coins {
  font-size: 12px;
  color: #9b9b9b;
}

/* Hide featured rows to avoid duplication */
.leaderboard-list .leaderboard-row--featured {
  display: none;
}

.check-toggle {
    display: block;
    height: 12px;
    position: relative;
    width: 27px;
    margin-right: 10px;
}

.check-toggle input[type="checkbox"] {
    opacity: 0; 
}

.check-toggle input[type="checkbox"] + span {
    position: absolute;
    left: 0;
    top: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 16px;
    display: inline-block;
    background: white;
    border: 1px solid #939393;
    width: 25px;
    height: 14px;
    box-shadow: -11px 0 #939393 inset;
    transition: box-shadow .20s;
    scale: 1.9;
}

.check-toggle input[type="checkbox"] + span:focus {
    outline: none;
}

.check-toggle input[type="checkbox"] + span:focus + span {
    border-color: blue;
}

.check-toggle input[type="checkbox"]:checked + span {
    box-shadow: 11px 0 var(--accent) inset;
    border-color: var(--accent);
}

.check-toggle input[type="checkbox"]:checked + span:focus + span {
    border-color: blue;
}

@supports (padding-top: env(safe-area-inset-top)) {
    /* Dynamic Island devices expose meaningful safe-area values */
    body.friends-page .nav,
    body.leaderboard-page .nav {
        margin-top: env(safe-area-inset-top);
    }

    body.profile-page .nav,
    body.community-page .nav {
        margin-top: calc(env(safe-area-inset-top) - 30px);
    }

    .add-friend-overlay {
        top: env(safe-area-inset-top);
        bottom: 0;
        height: auto;
        max-height: calc(100vh - env(safe-area-inset-top));
    }

    .ios-title-bar {
        padding-top: env(safe-area-inset-top) !important;
    }
}
