html {
    scroll-behavior: smooth;
}

body {
    position: relative;
}

.intro-section {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    align-items: center;
    gap: clamp(1rem, 4vw, 3.5rem);
    width: min(1280px, 100%);
    min-height: max(42rem, calc(100svh - 6rem));
    margin: 0 auto;
    padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 4vw, 3.5rem) 8rem;
}

.home-hero-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.intro-section h1 {
    max-width: 13ch;
    margin: 0 0 1rem;
    font-size: clamp(2.8rem, 5.3vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: 0.002em;
    text-shadow: 2px 2px 8px #000;
}

.intro-section h1 span {
    display: block;
    color: #8fffd3;
}

.home-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.9rem !important;
    color: #8fffd3;
    font-size: 0.73rem !important;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.home-eyebrow span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #00ffae;
    box-shadow: 0 0 14px rgba(0, 255, 174, 0.75);
}

.intro-section p {
    max-width: 36rem;
    font-size: clamp(1.02rem, 1.5vw, 1.2rem);
    margin: 0 0 1.6rem;
    text-shadow: 1px 1px 6px #000;
    line-height: 1.5;
}

.home-world-art {
    display: grid;
    justify-items: center;
    align-content: center;
    min-width: 0;
    position: relative;
}

.home-world-art::before {
    content: "";
    position: absolute;
    width: 85%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 174, 0.11), transparent 68%);
    filter: blur(8px);
}

.home-world-art img {
    position: relative;
    display: block;
    width: min(100%, 540px);
    height: auto;
    filter: drop-shadow(0 15px 32px rgba(0, 255, 174, 0.12));
    animation: home-world-float 5.5s ease-in-out infinite;
}

.home-art-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: -0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(159, 255, 220, 0.16);
    border-radius: 999px;
    background: rgba(5, 14, 18, 0.72);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.72rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.home-art-label span {
    color: #00ffae;
}

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

.intro-section .buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    grid-auto-rows: 78px;
    gap: 1rem;
    justify-content: center;
    align-items: stretch;
    width: min(100%, 720px);
    margin-top: 0.25rem;
}

.cta-button {
    --cta-color: #00ffae;
    --cta-color-rgb: 0, 255, 174;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    min-height: 0;
    padding: 1rem 1.15rem;
    overflow: hidden;
    border: 1px solid rgba(var(--cta-color-rgb), 0.42);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--cta-color-rgb), 0.2), rgba(12, 20, 25, 0.76));
    color: #fff;
    text-align: left;
    text-decoration: none;
    z-index: 1;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        background 0.22s ease;
}

.cta-button::before {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.16), transparent 45%);
    content: "";
    pointer-events: none;
}

.cta-button:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--cta-color-rgb), 0.9);
    background: linear-gradient(135deg, rgba(var(--cta-color-rgb), 0.34), rgba(12, 20, 25, 0.84));
    box-shadow:
        0 16px 30px rgba(0, 0, 0, 0.3),
        0 0 22px rgba(var(--cta-color-rgb), 0.14);
}

.cta-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 3px;
}

.cta-button:active {
    transform: translateY(-1px);
}

.cta-button--create {
    --cta-color: #a78bfa;
    --cta-color-rgb: 167, 139, 250;
}

.cta-button--join {
    --cta-color: #ffd369;
    --cta-color-rgb: 255, 211, 105;
}

.cta-button--custom {
    --cta-color: #66d9ff;
    --cta-color-rgb: 102, 217, 255;
}

.cta-icon {
    position: relative;
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(var(--cta-color-rgb), 0.5);
    border-radius: 12px;
    background: rgba(var(--cta-color-rgb), 0.16);
    color: var(--cta-color);
    line-height: 1;
}

.cta-icon img {
    display: block;
    width: 28px;
    height: 28px;
}

.cta-content {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
}

.cta-label {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.cta-hint {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cta-arrow {
    position: relative;
    color: var(--cta-color);
    font-size: 1.35rem;
}

.bottom-waves {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 300px;
}

.section-divider {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
    margin-top: -2px;
    margin-bottom: 0;
    z-index: 1;
}

.section-divider img {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
}

.section-divider img:last-child {
    z-index: 0;
}

.home-community {
    background: linear-gradient(to bottom, #1a1a1a 0%, #111 58%, #111 100%);
}

.home-about {
    width: min(100% - 2rem, 52rem);
    margin: 0 auto;
    padding: 2.5rem 1rem 4.5rem;
    color: #f4fff9;
}

.home-about h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.home-about p {
    margin: 0.85rem 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.75;
}

.home-about a {
    color: #8fffd3;
    text-underline-offset: 0.2em;
}

.modes {
    display: grid;
    justify-items: center;
    padding: clamp(3.5rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3rem) 2rem;
    background: transparent;
}

#grad1 stop:first-child {
    stop-color: #111;
}

#grad1 stop:last-child {
    stop-color: #1a1a1a;
}

.modes-heading {
    width: min(100%, 48rem);
    margin: 0 auto 2.5rem;
    text-align: center;
}

.modes-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.75rem;
    color: #8fffd3;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.modes-eyebrow::before {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #00ffae;
    box-shadow: 0 0 12px rgba(0, 255, 174, 0.65);
    content: "";
}

.modes-title {
    position: relative;
    margin: 0;
    padding-bottom: 1.1rem;
    color: #f6fff9;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.modes-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.25rem;
    transform: translateX(-50%);
    width: 20.5rem;
    height: 2px;
    margin-top: 0.5rem;
    background: linear-gradient(90deg, transparent, #00ffae 25%, #c0ffe8 50%, #00ffae 75%, transparent);
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(0, 255, 174, 0.35);
}

.modes-description {
    margin: 0.75rem 0 0;
    color: rgba(226, 242, 234, 0.68);
    font-size: 1rem;
    line-height: 1.6;
}

.mode-cards-container {
    width: min(100%, 1440px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
    padding: 0 0 3rem;
}

.mode-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 16.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(150, 255, 220, 0.14);
    border-radius: 1.1rem;
    background: linear-gradient(145deg, rgba(22, 39, 43, 0.96), rgba(17, 28, 32, 0.94));
    color: inherit;
    -webkit-user-drag: none;
    text-align: left;
    text-decoration: none;
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.mode-card:hover,
.mode-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(0, 255, 174, 0.52);
    box-shadow:
        0 20px 38px rgba(0, 0, 0, 0.32),
        0 0 28px rgba(0, 255, 174, 0.09);
}

.mode-card:focus-visible {
    outline: 2px solid #8fffd3;
    outline-offset: 3px;
}

.mode-card h3 {
    margin: 1.1rem 0 0.55rem;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.mode-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.55;
}

.feature-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border: 1px solid rgba(0, 255, 174, 0.28);
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(0, 255, 174, 0.16), rgba(0, 255, 174, 0.055));
    color: #8fffd3;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.feature-icon img {
    display: block;
    width: 1.8rem;
    height: 1.8rem;
}

.feature-link {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin-top: auto;
    padding-top: 1.2rem;
    color: #a7f8d9;
    font-size: 0.84rem;
    font-weight: 700;
}

.feature-link > span {
    transition: transform 0.2s ease;
}

.mode-card:hover .feature-link > span,
.mode-card:focus-visible .feature-link > span {
    transform: translateX(3px);
}

.leaderboard {
    position: relative;
    overflow: visible;
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
    background: transparent;
    text-align: center;
}

.leaderboard-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0;
    color: #f8fff9;
    font-size: clamp(1.7rem, 4vw, 2.45rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.45);
}

.leaderboard-trophy-wrap {
    position: relative;
    display: grid;
    width: 7.25rem;
    height: 7.25rem;
    margin-top: -5.25rem;
    margin-bottom: 2rem;
    place-items: center;
    border: 1px solid rgba(255, 222, 141, 0.35);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 34%, rgba(255, 211, 105, 0.25), rgba(255, 211, 105, 0.035) 70%),
        rgba(9, 20, 20, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 28px rgba(255, 190, 55, 0.16),
        0 0 72px rgba(255, 190, 55, 0.09);
}

.leaderboard-trophy-wrap::before {
    position: absolute;
    inset: -0.65rem;
    border: 1px dashed rgba(255, 222, 141, 0.3);
    border-radius: inherit;
    content: "";
}

.leaderboard-trophy {
    display: block;
    width: 4.7rem;
    height: 4.7rem;
    filter: drop-shadow(0 6px 10px rgba(246, 184, 62, 0.48));
}

.leaderboard-trophy-shine {
    position: absolute;
    inset: 1.1rem;
    overflow: hidden;
    border-radius: 50%;
    pointer-events: none;
}

.leaderboard-trophy-shine::after {
    position: absolute;
    inset: -50% auto -50% -65%;
    width: 40%;
    transform: rotate(25deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    content: "";
}

@keyframes leaderboard-row-enter {
    from {
        opacity: 0;
        translate: 0 10px;
    }
    to {
        opacity: 1;
        translate: 0 0;
    }
}

.leaderboard-caption {
    margin: 0.6rem 0 1.6rem !important;
    color: rgba(224, 241, 233, 0.64);
    font-size: 0.92rem;
    letter-spacing: 0.025em;
}

.daily-quest-toast {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1100;
    width: min(23rem, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid rgba(143, 255, 211, 0.35);
    border-radius: 1.1rem;
    background: linear-gradient(145deg, rgba(10, 27, 29, 0.97), rgba(19, 38, 43, 0.97));
    box-shadow:
        0 16px 42px rgba(0, 0, 0, 0.48),
        0 0 24px rgba(0, 255, 174, 0.12);
    backdrop-filter: blur(14px);
    color: #f4fff9;
    animation: daily-quest-toast-enter 0.28s ease-out both;
}

.daily-quest-toast[hidden] {
    display: none;
}

.daily-quest-toast__topline,
.daily-quest-toast__footer,
.daily-quest-toast__progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.daily-quest-toast__topline {
    margin-bottom: 0.75rem;
}

.daily-quest-toast__eyebrow {
    margin: 0;
    color: #8fffd3;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.daily-quest-toast__eyebrow span {
    margin-right: 0.25rem;
    color: #00ffae;
}

.daily-quest-toast__close,
.daily-quest-toast__navigation button {
    display: flex;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(159, 255, 220, 0.2);
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.06);
    color: #eafff6;
    font: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}

.daily-quest-toast__close {
    font-family: Arial, sans-serif;
}

.daily-quest-toast__navigation button img {
    display: block;
    width: 1rem;
    height: 1rem;
}

.daily-quest-toast__close:hover,
.daily-quest-toast__navigation button:hover {
    border-color: rgba(0, 255, 174, 0.6);
    background: rgba(0, 255, 174, 0.12);
}

.daily-quest-toast__quest {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.daily-quest-toast__icon {
    display: grid;
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid rgba(0, 255, 174, 0.28);
    border-radius: 0.8rem;
    background: rgba(0, 255, 174, 0.1);
}

.daily-quest-toast__icon img {
    display: block;
    width: 1.85rem;
    height: 1.85rem;
    object-fit: contain;
}

.daily-quest-toast__copy {
    min-width: 0;
}

.daily-quest-toast__copy h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    line-height: 1.3;
}

.daily-quest-toast__copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    line-height: 1.45;
}

.daily-quest-toast__progress {
    margin: 0.85rem 0;
    color: #d5f9e9;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.daily-quest-toast__track {
    flex: 1;
    height: 0.42rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.daily-quest-toast__track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #00c78a, #8fffd3);
    transition: width 0.25s ease;
}

.daily-quest-toast__footer {
    padding-top: 0.7rem;
    border-top: 1px solid rgba(159, 255, 220, 0.12);
}

.daily-quest-toast__footer > a {
    color: #8fffd3;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
}

.daily-quest-toast__footer > a:hover {
    color: #fff;
}

.daily-quest-toast__claim {
    width: 100%;
    min-height: 2.5rem;
    margin-top: 0.75rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(143, 255, 211, 0.44);
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(0, 255, 174, 0.2), rgba(0, 193, 138, 0.12));
    color: #eafff6;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        opacity 0.18s ease;
}

.daily-quest-toast__claim:hover:not(:disabled),
.daily-quest-toast__claim:focus-visible {
    border-color: rgba(143, 255, 211, 0.8);
    background: rgba(0, 255, 174, 0.24);
}

.daily-quest-toast__claim:focus-visible {
    outline: 2px solid #8fffd3;
    outline-offset: 2px;
}

.daily-quest-toast__claim:disabled {
    opacity: 0.65;
    cursor: wait;
}

.daily-quest-toast__navigation {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

@keyframes daily-quest-toast-enter {
    from {
        opacity: 0;
        transform: translateY(0.7rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard p {
    margin: 0.7rem;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.65rem;
    width: min(100%, 43rem);
    margin: 0 auto;
    text-align: left;
}

.daily-quest-toast {
    right: 0.75rem;
    bottom: 0.75rem;
    width: min(23rem, calc(100vw - 1.5rem));
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3.75rem;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(218, 255, 239, 0.1);
    border-radius: 1rem;
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
    font-size: 1rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.leaderboard-list > .leaderboard-item:not(.leaderboard-skeleton) {
    animation: leaderboard-row-enter 0.45s both;
}

.leaderboard-list > .leaderboard-item:nth-child(2) {
    animation-delay: 0.08s;
}

.leaderboard-list > .leaderboard-item:nth-child(3) {
    animation-delay: 0.16s;
}

.leaderboard-list > .leaderboard-item:nth-child(4) {
    animation-delay: 0.24s;
}

.leaderboard-list > .leaderboard-item:hover {
    transform: translateY(-2px);
    border-color: rgba(143, 255, 211, 0.28);
    background: linear-gradient(110deg, rgba(0, 255, 174, 0.09), rgba(255, 255, 255, 0.035));
}

.leaderboard-list > .leaderboard-item:nth-child(1) {
    border-color: rgba(255, 203, 83, 0.24);
    background: linear-gradient(110deg, rgba(255, 190, 55, 0.1), rgba(255, 255, 255, 0.025) 70%);
}

.leaderboard-list > .leaderboard-item:nth-child(2) {
    border-color: rgba(206, 224, 232, 0.18);
}

.leaderboard-list > .leaderboard-item:nth-child(3) {
    border-color: rgba(219, 147, 99, 0.18);
}

.leaderboard-item .username {
    flex: 1;
    padding-left: 0.5rem;
    font-weight: 500;
    display: flex;
    overflow: hidden;
    align-items: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.leaderboard-item .score {
    margin-left: 1rem;
    padding: 0.38rem 0.7rem;
    border: 1px solid rgba(255, 211, 105, 0.16);
    border-radius: 999px;
    background: rgba(255, 211, 105, 0.09);
    color: #ffd978;
    font-size: 0.83rem;
    font-weight: 800;
    white-space: nowrap;
}

.leaderboard-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.7rem 1.25rem;
    border: 1px solid rgba(0, 255, 174, 0.52);
    background: rgba(0, 255, 174, 0.08);
    color: #d9fff2;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.leaderboard-button:hover {
    background: rgba(0, 255, 174, 0.16);
    border-color: rgba(0, 255, 174, 0.85);
    transform: translateY(-2px);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.22),
        0 0 16px rgba(0, 255, 174, 0.1);
}

.leaderboard-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.leaderboard-item .rank {
    font-weight: bold;
    width: 30px;
    display: inline-block;
    text-align: center;
}

.leaderboard-list > .leaderboard-item .rank {
    position: relative;
    flex: 0 0 2rem;
    width: 2rem;
}

.leaderboard-list > .leaderboard-item:nth-child(-n + 3) .rank {
    visibility: hidden;
}

.leaderboard-list > .leaderboard-item:nth-child(-n + 3) .rank::before {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 1.6rem;
    height: 1.6rem;
    transform: translate(-50%, -50%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    content: "";
    visibility: visible;
}

.leaderboard-list > .leaderboard-item:nth-child(1) .rank::before {
    background-image: url("/resources/images/leaderboard/crown.svg");
}

.leaderboard-list > .leaderboard-item:nth-child(2) .rank::before {
    background-image: url("/resources/images/leaderboard/silver-medal.svg");
}

.leaderboard-list > .leaderboard-item:nth-child(3) .rank::before {
    background-image: url("/resources/images/leaderboard/bronze-medal.svg");
}

.leaderboard-item:last-of-type {
    min-height: 3.25rem;
}

.leaderboard-item:nth-child(n + 4) .rank {
    color: #00ffae;
}

.cta-item {
    color: #00ffae;
    font-weight: bold;
    font-style: italic;
}

.leaderboard-list > .leaderboard-item.cta-item {
    border-style: dashed;
    border-color: rgba(0, 255, 174, 0.24);
    background: rgba(0, 255, 174, 0.035);
}

@media (max-width: 900px) {
    .intro-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
        padding-top: 2.5rem;
        text-align: center;
    }

    .home-world-art {
        grid-row: 1;
    }

    .home-world-art img {
        width: min(100%, 390px);
    }

    .home-hero-copy {
        grid-row: 2;
    }

    .intro-section h1,
    .intro-section p {
        margin-right: auto;
        margin-left: auto;
    }

    .home-eyebrow {
        justify-content: center;
    }

    .intro-section h1 {
        max-width: 14ch;
        font-size: clamp(2.6rem, 8vw, 4rem);
    }

    .intro-section .buttons {
        margin-right: auto;
        margin-left: auto;
        width: min(100%, 36rem);
    }

    .mode-cards-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(100%, 46rem);
    }
}

@media (max-width: 620px) {
    .intro-section {
        min-height: 100svh;
        padding: 2rem 1rem 8rem;
    }

    .intro-section h1 {
        font-size: clamp(2.1rem, 9vw, 3rem);
    }

    .intro-section p {
        max-width: 32rem;
        font-size: 1.05rem;
    }

    .home-eyebrow {
        justify-content: center;
    }

    .home-world-art img {
        width: min(86vw, 340px);
    }

    .intro-section .buttons {
        grid-template-columns: 1fr;
        width: min(100%, 28rem);
    }

    .modes {
        padding: 3rem 1rem 1rem;
    }

    .mode-cards-container {
        grid-template-columns: minmax(0, 1fr);
        width: min(100%, 32rem);
        gap: 0.85rem;
        padding-bottom: 2rem;
    }

    .mode-card {
        min-height: 14rem;
        padding: 1.25rem;
    }

    .leaderboard {
        padding: 1.5rem 1rem 2rem;
    }

    .leaderboard-list {
        display: grid;
        gap: 0.55rem;
        width: min(100%, 40rem);
        margin: 0 auto;
    }

    .leaderboard-list > .leaderboard-item {
        display: grid;
        grid-template-columns: 2rem minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.35rem 0.55rem;
        height: auto;
        min-height: 3.35rem;
        padding: 0.6rem 0.7rem;
        border: 1px solid rgba(255, 255, 255, 0.09);
        border-radius: 0.85rem;
        background: rgba(255, 255, 255, 0.045);
        font-size: 0.92rem;
    }

    .leaderboard-list > .leaderboard-item .username {
        min-width: 0;
        padding-left: 0;
    }

    .leaderboard-list > .leaderboard-item .score {
        max-width: 8.5rem;
        margin-left: 0;
        font-size: 0.78rem;
        text-align: right;
        white-space: nowrap;
    }

    .leaderboard-list > .leaderboard-item:last-of-type {
        height: auto;
    }
}

@media (max-width: 420px) {
    .intro-section {
        padding-top: 1.6rem;
        padding-bottom: 6.5rem;
    }

    .intro-section .buttons {
        gap: 0.75rem;
    }

    .cta-button {
        gap: 0.65rem;
        padding: 0.8rem 0.8rem;
    }

    .cta-icon {
        flex-basis: 2.4rem;
        width: 2.4rem;
        height: 2.4rem;
    }

    .cta-label {
        font-size: 0.95rem;
    }

    .cta-hint {
        font-size: 0.72rem;
    }

    .home-art-label {
        margin-top: 0.25rem;
        padding: 0.45rem 0.7rem;
        font-size: 0.68rem;
    }

    .leaderboard-button {
        width: 100%;
    }

    .leaderboard-list > .leaderboard-item {
        grid-template-columns: 1.8rem minmax(0, 1fr) auto;
        gap: 0.3rem 0.4rem;
        padding-inline: 0.55rem;
        font-size: 0.85rem;
    }

    .leaderboard-list > .leaderboard-item .rank {
        flex-basis: 1.8rem;
        width: 1.8rem;
    }

    .leaderboard-list > .leaderboard-item:nth-child(-n + 3) .rank::before {
        width: 1.45rem;
        height: 1.45rem;
    }

    .leaderboard-list > .leaderboard-item .score {
        max-width: 7rem;
        font-size: 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mode-card,
    .feature-link > span,
    .leaderboard-heading > span:last-child,
    .leaderboard-list > .leaderboard-item {
        animation: none;
        transition: none;
    }

    .mode-card:hover,
    .mode-card:focus-visible {
        transform: none;
    }

    .mode-card:hover .feature-link > span,
    .mode-card:focus-visible .feature-link > span {
        transform: none;
    }
}

.leaderboard-item a.player-link,
.leaderboard-item a.player-link:visited {
    color: inherit;
    text-decoration: none;
}

.leaderboard-item a.player-link:hover,
.leaderboard-item a.player-link:focus-visible {
    color: #a8ffdf;
    text-decoration: underline;
}
