#planet-features-root,
#planet-features-root * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

#planet-features-root input,
#planet-features-root button {
    font: inherit;
}

#planet-features-root input {
    user-select: text;
}

.planet-leaderboard-open {
    position: fixed;
    left: 14px;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    z-index: 99980;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #f7fbff;
    background: #162640;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .16);
    font-weight: 800;
}

.planet-feature-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 8, 18, .68);
    backdrop-filter: blur(7px);
}

.planet-feature-overlay[hidden] {
    display: none;
}

.planet-feature-panel {
    width: min(430px, 100%);
    max-height: min(720px, calc(100vh - 36px));
    overflow: auto;
    border-radius: 8px;
    color: #f5f8ef;
    background: linear-gradient(180deg, #10233a 0%, #111827 54%, #142116 100%);
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    text-align: left;
}

.planet-feature-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.planet-feature-kicker {
    margin: 0 0 6px;
    color: #9ee493;
    font-size: 13px;
    font-weight: 800;
}

.planet-feature-title {
    margin: 0;
    color: #fff9dc;
    font-size: 24px;
    line-height: 1.16;
    font-weight: 900;
}

.planet-feature-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    color: #dce8ff;
    background: rgba(255, 255, 255, .1);
    font-size: 22px;
    line-height: 1;
}

.planet-feature-body {
    padding: 18px 20px 20px;
}

.planet-score-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 16px;
}

.planet-score-label {
    color: #b9c6d7;
    font-size: 13px;
}

.planet-score-value {
    color: #fff1a6;
    font-size: 46px;
    line-height: 1;
    font-weight: 950;
}

.planet-rank-badge {
    min-width: 90px;
    padding: 9px 10px;
    border-radius: 8px;
    text-align: center;
    color: #17301d;
    background: #9ee493;
    font-size: 13px;
    font-weight: 900;
}

.planet-submit-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin: 0 0 14px;
}

.planet-submit-form input {
    min-width: 0;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    padding: 0 13px;
    color: #f8fbff;
    background: rgba(255, 255, 255, .1);
    outline: none;
}

.planet-submit-form input:focus {
    border-color: #9ee493;
    box-shadow: 0 0 0 3px rgba(158, 228, 147, .2);
}

.planet-feature-button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    color: #102016;
    background: #fff1a6;
    font-weight: 900;
}

.planet-feature-button.secondary {
    color: #eaf5ff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
}

.planet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.planet-revive-hint {
    margin: -4px 0 14px;
    color: #b9c6d7;
    font-size: 13px;
    line-height: 1.45;
}

.planet-leaderboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.planet-leaderboard-head h2 {
    margin: 0;
    color: #f7fbff;
    font-size: 17px;
}

.planet-leaderboard-refresh {
    border: 0;
    color: #9ee493;
    background: transparent;
    font-weight: 800;
}

.planet-leaderboard-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.planet-leaderboard-list li {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: #e8eef7;
    font-size: 14px;
}

.planet-leaderboard-list .rank {
    color: #9ee493;
    font-weight: 900;
}

.planet-leaderboard-list .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planet-leaderboard-list .score {
    color: #fff1a6;
    font-weight: 900;
}

.planet-empty {
    margin: 12px 0 0;
    padding: 14px;
    border: 1px dashed rgba(255, 255, 255, .22);
    border-radius: 8px;
    color: #b9c6d7;
    text-align: center;
    font-size: 14px;
}

.planet-toast {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    z-index: 99999;
    max-width: min(360px, calc(100vw - 36px));
    transform: translateX(-50%) translateY(16px);
    border-radius: 999px;
    padding: 11px 15px;
    color: #102016;
    background: #fff1a6;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.planet-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 380px) {
    .planet-feature-panel {
        max-height: calc(100vh - 24px);
    }

    .planet-feature-head,
    .planet-feature-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .planet-score-value {
        font-size: 38px;
    }

    .planet-submit-form,
    .planet-actions {
        grid-template-columns: 1fr;
    }
}

@media (min-aspect-ratio: 3/2) and (min-width: 760px) {
    .planet-leaderboard-open {
        left: calc((100vw - 430px) / 2 + 14px);
    }
}
