* { 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, #0a4d2e 0%, #073d24 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 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

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;
}

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;
}

#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);
}

#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 {
    background: rgba(255, 255, 255, 0.08);
    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;
}
.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 {
    margin-top: 1.5rem;
    text-align: left;
}
.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.08);
    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-empty {
    padding: 0.85rem 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

.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.8rem;
    font-size: 0.95rem;
    line-height: 1.3;
    color: #0a4d2e;
}

.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); }
}
