* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: linear-gradient(160deg, #073524 0%, #041e12 100%);
    color: #fff;
    min-height: 100vh;
    padding: 2rem 1.25rem 3rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

section {
    padding: 1.5rem 0;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    margin-bottom: 1rem;
}

.hero-logo {
    width: 180px;
    height: 180px;
    border-radius: 36px;
    display: block;
    margin: 0 auto;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.lead {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 2rem;
}

.hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin-top: 1rem;
    line-height: 1.4;
}

#how-it-works {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    padding-bottom: 3rem;
    text-align: left;
}

.how-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    margin-bottom: 1.75rem;
}

.how-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.how-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.how-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #ffd700;
    color: #0a4d2e;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
}

.how-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.how-text p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.how-mission {
    margin-top: 2rem;
    padding: 1.1rem 1.2rem;
    background: rgba(255, 215, 0, 0.07);
    border-left: 3px solid #ffd700;
    border-radius: 0 10px 10px 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.how-mission p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

.how-notice {
    margin-top: 1.25rem;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}
.how-notice p {
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
}

.how-share {
    margin-top: 1.75rem;
    text-align: center;
}
.how-share p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.85rem;
}
.how-share-btn {
    background: transparent;
    border: 1.5px solid rgba(255, 215, 0, 0.6);
    color: #ffd700;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.how-share-btn:active {
    background: rgba(255, 215, 0, 0.1);
}

button {
    background: #ffd700;
    color: #0a4d2e;
    border: none;
    border-radius: 999px;
    padding: 1.1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
    margin-top: 0.5rem;
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.25);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
}

.count-block {
    margin: 1rem 0 0.25rem;
}

.count {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    color: #ffd700;
}

.count-label {
    font-size: 1.1rem;
    margin-top: 0.25rem;
}

.sticker-pickers {
    margin: 1.5rem 0 1rem;
    text-align: left;
}
.picker-btn + .chosen-strip + .picker-btn {
    margin-top: 5px;
}
.picker-btn {
    display: flex;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.picker-btn:active { transform: scale(0.99); }
.picker-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); }
.pb-label { flex: 1; }
.pb-count {
    background: #ffd700;
    color: #0a4d2e;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-weight: 700;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    min-width: 1.6rem;
    text-align: center;
}
.chosen-strip {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.45rem 0;
    margin-bottom: 0.5rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.chosen-strip:empty { display: none; }
.chosen-strip::-webkit-scrollbar { height: 4px; }
.chosen-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.cs-thumb {
    width: 44px;
    height: 60px;
    flex: 0 0 auto;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.cs-more {
    flex: 0 0 auto;
    align-self: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    padding: 0 0.4rem;
}

/* Picker modal */
.picker {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #073524 0%, #041e12 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}
.picker[hidden] { display: none; }
body.picker-open { overflow: hidden; }
.picker-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}
.picker-back, .picker-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    width: auto;
    margin: 0;
    box-shadow: none;
    cursor: pointer;
}
.picker-back { font-size: 2rem; }
.picker-title {
    flex: 1;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}
.picker-foot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}
.picker-sel-info {
    flex: 1;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}
.picker-done {
    background: #ffd700;
    color: #0a4d2e;
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    font-weight: 700;
    width: auto;
    margin: 0;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
}

.cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    margin-bottom: 0.4rem;
    cursor: pointer;
    color: #fff;
    transition: background 0.12s ease;
}
.cat-item:active { background: rgba(255, 215, 0, 0.18); }
.cat-name {
    font-size: 1rem;
    font-weight: 500;
}
.cat-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.cat-count.has-sel {
    color: #0a4d2e;
    background: #ffd700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
}

.st-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
@media (min-width: 480px) {
    .st-grid { grid-template-columns: repeat(4, 1fr); }
}
.st-cell {
    background: rgba(255, 255, 255, 0.13);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 0.4rem;
    margin: 0;
    width: auto;
    max-width: none;
    box-shadow: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    transition: border-color 0.12s ease, background 0.12s ease;
    position: relative;
}
.st-cell img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    display: block;
}
.st-num {
    font-size: 0.72rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
}
.st-cell.sel {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.18);
}
.st-cell.sel .st-num { color: #ffd700; font-weight: 700; }
.st-cell.sel::after {
    content: "✓";
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: #ffd700;
    color: #0a4d2e;
    font-weight: 800;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

#map {
    height: 55vh;
    min-height: 320px;
    width: 100%;
    border-radius: 16px;
    margin-top: 1rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.map-wrap {
    position: relative;
}

.locate-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 900;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: #fff;
    color: #0a4d2e;
    font-size: 1.3rem;
    line-height: 1;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    max-width: none;
    transition: transform 0.1s;
}

.locate-btn:active { transform: scale(0.92); }

#groups {
    margin-top: 1.5rem;
    text-align: left;
}
.groups-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
#groups-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
#groups-list li,
#explore-list li.clickable {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
#groups-list li.clickable,
#explore-list li.clickable {
    cursor: pointer;
    transition: background 0.12s ease, transform 0.08s ease;
}
#groups-list li.clickable:active,
#explore-list li.clickable:active {
    background: rgba(255, 215, 0, 0.18);
    transform: scale(0.98);
}
.g-name {
    font-size: 1rem;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.g-count {
    background: #ffd700;
    color: #0a4d2e;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-weight: 700;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

#explore,
#rank-needed,
#rank-available {
    margin-top: 1.5rem;
    text-align: left;
}
.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.rank-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    margin-bottom: 0.4rem;
}
.rank-thumb {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.rank-info {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
    color: #fff;
}
.rank-info b {
    color: #ffd700;
    margin-right: 0.4rem;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}
.rank-count {
    color: #ffd700;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    flex-shrink: 0;
    background: rgba(255, 215, 0, 0.12);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}
.rank-more {
    display: block;
    text-align: right;
    color: #ffd700;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.3rem 0;
}
.rank-more:active { opacity: 0.7; }
.explore-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.explore-head .groups-title {
    margin: 0;
}
.explore-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
    flex-shrink: 0;
}
.explore-filter input[type="checkbox"] {
    accent-color: #ffd700;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    cursor: pointer;
}

.explore-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0.6rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px;
    border-radius: 999px;
    overflow-x: auto;
    scrollbar-width: none;
}
.explore-tabs::-webkit-scrollbar { display: none; }
.explore-tab {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    flex: 1 0 auto;
    margin: 0;
    width: auto;
    max-width: none;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.explore-tab.active {
    background: #ffd700;
    color: #0a4d2e;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.25);
}
.explore-tab:active { transform: none; }
#explore-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
#explore-list li {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.e-name {
    font-size: 1rem;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.e-count {
    background: #ffd700;
    color: #0a4d2e;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-weight: 700;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.e-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    overflow: hidden;
}

.e-dist {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
}

.e-empty {
    padding: 0.85rem 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

/* categoria no rank-info do mapa (contexto diferente do rk-list) */
#rank-needed .rank-info,
#rank-available .rank-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow: hidden;
}
#rank-needed .rank-info-cat,
#rank-available .rank-info-cat {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----- /rankings.html ----- */

body.rankings-body {
    /* Reset the global body flex (which defaults to row and was squishing
       header/tabs/filter/list horizontally on mobile). */
    display: block;
    padding: 0 0 5rem;
    align-items: initial;
    justify-content: initial;
}
body.rankings-body #app { display: none; }

.rk-head {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 0.5rem;
    background: rgba(7, 61, 36, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rk-back {
    color: #fff;
    text-decoration: none;
    font-size: 1.9rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: background 0.12s ease;
}
.rk-back:active { background: rgba(255, 255, 255, 0.12); }
.rk-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}
.rk-spacer { width: 44px; flex-shrink: 0; }

.rk-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: #25d366;
    flex-shrink: 0;
    transition: background 0.12s ease;
}
.rk-whatsapp:active { background: rgba(37, 211, 102, 0.15); }
.rk-whatsapp[hidden] { display: none; }

.whatsapp-field { margin-top: -0.5rem; }
.field-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.4rem;
    text-align: left;
}

.rk-tabs {
    display: flex;
    gap: 4px;
    margin: 1rem 1rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 999px;
}
.rk-tab {
    flex: 1;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 0.7rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    width: auto;
    margin: 0;
    box-shadow: none;
    min-height: 40px;
}
.rk-tab.active {
    background: #ffd700;
    color: #0a4d2e;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}
.rk-tab:active { transform: scale(0.98); }

.rk-filter {
    margin: 0 1rem 1rem;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.rk-filter > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.95rem 1.1rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    user-select: none;
    min-height: 48px;
    box-sizing: border-box;
}
.rk-filter > summary::-webkit-details-marker { display: none; }
.rk-filter > summary::after {
    content: "▾";
    color: rgba(255, 255, 255, 0.55);
    margin-left: 0.25rem;
    font-size: 0.9rem;
    transition: transform 0.18s ease;
}
.rk-filter[open] > summary::after { transform: rotate(180deg); }
.rk-filter > summary > span:first-child { flex: 1; }
.rk-filter-count {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    min-width: 1.6rem;
    text-align: center;
}
.rk-filter-count.has-sel { background: #ffd700; color: #0a4d2e; }
.rk-filter-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 1rem 0.6rem;
}
.rk-filter-clear {
    background: transparent;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    width: auto;
    margin: 0;
    box-shadow: none;
    cursor: pointer;
}
.rk-filter-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0.6rem 0.75rem;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.rk-filter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.5rem;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    min-height: 44px;
    box-sizing: border-box;
}
.rk-filter-item:active { background: rgba(255, 255, 255, 0.18); }
.rk-filter-item input[type="checkbox"] {
    accent-color: #ffd700;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin: 0;
}
.rk-filter-item > span:nth-child(2) {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rk-filter-cat-count {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.rk-list {
    list-style: none;
    margin: 0;
    padding: 0 1rem;
}
.rk-list li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.rk-list .rank-thumb {
    width: 44px;
    height: 60px;
    border-radius: 6px;
}
.rank-info-block {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.rank-info-head {
    color: #fff;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}
.rank-info-head b {
    color: #ffd700;
    margin-right: 0.5rem;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.rank-info-cat {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rk-empty, .rk-error {
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    margin: 2.5rem 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ----- /trader.html (also uses body.rankings-body for the layout reset) ----- */
.trader-meta {
    padding: 0.85rem 1rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    line-height: 1.35;
    background: rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.trader-section {
    padding: 1rem 1rem 0.5rem;
}
.trader-section .groups-title {
    margin: 0 0 0.7rem;
}
.trader-section .st-grid {
    margin-bottom: 0;
}
/* Match highlight on the trader sticker grid — visually mirrors the picker's
   .sel state but keeps semantics distinct (here it means "matches my list"). */
.st-cell.match {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.18);
}
.st-cell.match .st-num { color: #ffd700; font-weight: 700; }
.st-cell.match::after {
    content: "✓";
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: #ffd700;
    color: #0a4d2e;
    font-weight: 800;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* Category filter chips on trader page */
.td-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem 1rem 0;
}

.td-cat-chip {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    width: auto;
    max-width: none;
    box-shadow: none;
    margin: 0;
}

.td-cat-chip.active {
    background: #ffd700;
    color: #0a4d2e;
    border-color: #ffd700;
}

/* "Ver mais" button inside trader sections */
.td-more {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
    text-align: center;
    box-shadow: none;
    max-width: none;
}

.td-more[hidden] { display: none; }
.td-more:active { background: rgba(255, 255, 255, 0.15); }

.user-arrow-icon {
    background: transparent;
    border: none;
}
.user-arrow {
    width: 32px;
    height: 32px;
    transform-origin: center;
    transition: transform 0.18s ease-out;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.leaflet-popup-content {
    margin: 0.6rem 0.7rem;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #0a4d2e;
    word-break: break-word;
}
.leaflet-popup-content .mp-sec {
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(10, 77, 46, 0.18);
}
.leaflet-popup-content .mp-sec-t {
    margin-bottom: 0.3rem;
}
.leaflet-popup-content .m-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.2rem 0;
    line-height: 1.2;
}
.leaflet-popup-content .m-row img {
    width: 30px;
    height: 40px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 3px;
    background: #f0f0f0;
    border: 1px solid rgba(10, 77, 46, 0.12);
}
.leaflet-popup-content .m-row span {
    font-size: 0.8rem;
}
.leaflet-popup-content .m-more {
    margin-top: 0.25rem;
    color: #5b7a6a;
    font-size: 0.78rem;
}
.leaflet-popup-content .m-none {
    color: #5b7a6a;
    margin-top: 0.5rem;
    display: block;
}
.leaflet-popup-content .mp-link {
    color: #0a4d2e;
    text-decoration: underline;
    text-underline-offset: 2px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.leaflet-popup-content .mp-link:active { opacity: 0.7; }
.leaflet-popup-content .mp-wa {
    color: #25d366;
    flex-shrink: 0;
    vertical-align: middle;
}

.empty {
    margin: 1.5rem 0;
    opacity: 0.7;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#error-msg {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    margin: 1rem auto 1.5rem;
    animation: spin 0.8s linear infinite;
}

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

body.map-body {
    padding: 0 1.25rem 3rem;
}

/* ---- Name input (welcome + modal) ---- */

.name-field {
    margin-bottom: 1.25rem;
}

.name-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    padding: 0.85rem 1rem;
    outline: none;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}
.name-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.name-input:focus { border-color: #ffd700; }

.name-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.name-modal[hidden] { display: none; }

.name-modal-box {
    background: linear-gradient(160deg, #073524 0%, #041e12 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    padding: 1.5rem;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.name-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 1rem;
}

.name-modal-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    padding: 0.85rem 1rem;
    outline: none;
    margin-bottom: 1rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}
.name-modal-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.name-modal-input:focus { border-color: #ffd700; }

.name-modal-actions {
    display: flex;
    gap: 0.75rem;
}

.name-modal-btn {
    flex: 1;
    padding: 0.85rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    margin: 0;
    max-width: none;
    width: auto;
    box-shadow: none;
}
.name-modal-btn-cancel {
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.name-modal-btn-save {
    background: #ffd700;
    color: #0a4d2e;
}

/* ---- Map page header & menu button ---- */

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0 0.75rem;
    gap: 0.75rem;
}

.map-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    flex-shrink: 0;
}

.map-count-group {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex: 1;
}

.map-count {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffd700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.map-count-label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1;
}

.map-menu-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    max-width: none;
    flex-shrink: 0;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.12s ease;
}
.map-menu-btn:active { background: rgba(255, 255, 255, 0.22); transform: scale(0.96); }

/* ---- Bottom-sheet drawer ---- */

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.menu-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1101;
    background: linear-gradient(180deg, #0d5c37 0%, #073d24 100%);
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
}
.menu-drawer.open { transform: translateY(0); }

.menu-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 0.75rem auto 1rem;
}

.menu-nav {
    padding: 0 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    width: 100%;
    max-width: none;
    margin: 0;
    box-shadow: none;
    transition: background 0.12s ease;
}
.menu-nav-item:active { background: rgba(255, 215, 0, 0.15); transform: scale(0.99); }

.mni-label { flex: 1; }

.mni-badge {
    background: #ffd700;
    color: #0a4d2e;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-weight: 700;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    min-width: 1.6rem;
    text-align: center;
    flex-shrink: 0;
}

.mni-arrow {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1;
    flex-shrink: 0;
}

/* ---- Person markers on map ---- */

.p-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: none;
}

.p-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid #0a4d2e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    pointer-events: all;
}

.p-time {
    font-size: 0.58rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 4px;
    padding: 1px 4px;
    white-space: nowrap;
    line-height: 1.3;
    pointer-events: none;
}

.p-offline .p-dot {
    opacity: 0.45;
    border-color: rgba(10,77,46,0.5);
}

.p-offline .p-time {
    opacity: 0.55;
}

.mni-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.mni-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Offline toggle icon in menu */
.mni-toggle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1;
}
.mni-toggle.active {
    font-size: 1.6rem;
    color: #f5c518;
}

/* ---- Sticker detail page ---- */

#sk-tabs { margin-bottom: 1.25rem; }

.sk-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1.5rem;
}

.sk-img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.sk-info { flex: 1; text-align: left; }

.sk-id {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.sk-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.sk-cat {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.sk-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    padding: 2.5rem 0;
}

.sk-section { margin-bottom: 1.75rem; }

.sk-section-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.sk-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex: 1;
}

.sk-section-label--need { color: #fbbf24; }
.sk-section-label--have { color: #4ade80; }

.sk-section-count {
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    padding: 0.15rem 0.6rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
}

.sk-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sk-list li {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.sk-list li.clickable {
    cursor: pointer;
    transition: background 0.12s ease, transform 0.08s ease;
}

.sk-list li.clickable:active {
    background: rgba(255, 215, 0, 0.18);
    transform: scale(0.98);
}

.sk-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 2.5rem 0;
    font-size: 0.9rem;
}
