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

body {
    background: linear-gradient(145deg, #0b0e1a 0%, #1a1f2f 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #e0e6f0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(20, 28, 48, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 40px;
    padding: 30px;
    box-shadow: 0 25px 50px -8px rgba(0,0,0,0.8), inset 0 1px 2px rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.03);
}

h1 {
    font-weight: 300;
    font-size: 2.2rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #b7c9ff, #6d8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #8892b0;
    margin-bottom: 30px;
    font-size: 0.95rem;
    border-left: 3px solid #4a6cf7;
    padding-left: 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: rgba(12, 18, 34, 0.6);
    border-radius: 20px;
    padding: 18px 16px;
    border: 1px solid rgba(255,255,255,0.04);
    transition: transform 0.2s ease, border-color 0.2s;
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: rgba(74, 108, 247, 0.3);
    transform: translateY(-2px);
}

.card-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6a7a9f;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-value {
    font-size: 1.4rem;
    font-weight: 500;
    color: #f0f4ff;
    letter-spacing: 0.5px;
    word-break: break-all;
}

.card-unit {
    font-size: 0.9rem;
    color: #6a7a9f;
    margin-left: 4px;
    font-weight: 300;
}

.card-extra {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #6a7a9f;
}

/* Hints */

.hint-content {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: rgba(74, 108, 247, 0.06);
    border-left: 2px solid #4a6cf7;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #a8b3cf;
    line-height: 1.6;
}

.hint-content.open {
    display: block;
}

.hint-content a {
    color: #6d8cff;
    text-decoration: none;
    border-bottom: 1px dashed #6d8cff;
}

.hint-content a:hover {
    color: #b7c9ff;
}

/* Badge */
.badge {
    display: inline-block;
    background: rgba(74, 108, 247, 0.15);
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 0.75rem;
    color: #8ea4ff;
    border: 1px solid rgba(74, 108, 247, 0.2);
}

/* Status LED */
.status-led {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.led-green { background: #3bdd9b; box-shadow: 0 0 12px #3bdd9b88; }
.led-red   { background: #f75c6a; box-shadow: 0 0 12px #f75c6a88; }
.led-yellow{ background: #f7c948; box-shadow: 0 0 12px #f7c94888; }

/* Footer */
.footer-info {
    color: #5a6e92;
    font-size: 0.75rem;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.04);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Geolocation button */
.geo-btn {
    background: #2a3457;
    border: 1px solid #3a4870;
    color: #d0daf0;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 25px;
    font-size: 0.9rem;
}

.geo-btn:hover:not(:disabled) {
    background: #3a4870;
    border-color: #4a6cf7;
}

.geo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.geo-warning {
    margin-top: 15px;
    padding: 16px;
    background: rgba(247, 201, 72, 0.08);
    border: 1px solid rgba(247, 201, 72, 0.3);
    border-radius: 12px;
    color: #f7c948;
    font-size: 0.85rem;
    line-height: 1.5;
}

.geo-warning-btns {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.geo-warning-btns button {
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.85rem;
}

.geo-confirm { background: #f7c948; color: #0b0e1a; }
.geo-cancel { background: #5a6e92; color: #e0e6f0; }

.geo-result {
    margin-top: 20px;
}

/* Header */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 600px) {
    .container { padding: 18px; border-radius: 24px; }
    h1 { font-size: 1.6rem; }
    .card-value { font-size: 1.1rem; }
}

/* ============================================
   TOOLTIP (всплывающая подсказка)
   ============================================ */
.card {
    position: relative;
}

.hint-toggle {
    background: rgba(74, 108, 247, 0.1);
    border: 1px solid rgba(74, 108, 247, 0.2);
    color: #8ea4ff;
    cursor: pointer;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.2s;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hint-toggle:hover {
    background: rgba(74, 108, 247, 0.25);
    border-color: #4a6cf7;
    color: #b7c9ff;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(15, 22, 40, 0.98);
    color: #c8d0e8;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(74, 108, 247, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 260px;
    z-index: 1000;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(74, 108, 247, 0.25);
}

.tooltip a {
    color: #6d8cff;
    text-decoration: none;
    border-bottom: 1px dashed #6d8cff;
    display: inline-block;
    margin-top: 6px;
    font-size: 0.75rem;
}

.tooltip a:hover {
    color: #b7c9ff;
    border-bottom-color: #b7c9ff;
}

.hint-toggle:hover .tooltip,
.hint-toggle:focus .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Скрываем старые hint-content (уберём после обновления HTML) */
.hint-content {
    display: none !important;
}

@media (max-width: 600px) {
    .tooltip {
        width: 220px;
        font-size: 0.75rem;
        padding: 10px 12px;
    }
}

/* ============================================
   FIX: Tooltip поверх всех карточек
   ============================================ */
.card {
    position: relative;
    z-index: 1;
}

.card:hover {
    z-index: 100;
}

.tooltip {
    z-index: 9999 !important;
}

/* ============================================
   GEO SECTION (кнопка + атрибуция)
   ============================================ */
.geo-section {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.geo-attribution {
    font-size: 0.75rem;
    color: #6a7a9f;
    text-align: center;
    max-width: 500px;
    line-height: 1.4;
}

.geo-attribution a {
    color: #8ea4ff;
    text-decoration: none;
    border-bottom: 1px dashed #8ea4ff;
}

.geo-attribution a:hover {
    color: #b7c9ff;
    border-bottom-color: #b7c9ff;
}

/* ============================================
   FIX: Более светлый тусклый текст
   ============================================ */
.subtitle {
    color: #a0aac4;
}

.card-title {
    color: #8892b0;
}

.card-extra {
    color: #8892b0;
}

.hint-content {
    color: #b0bad4;
}

.geo-attribution {
    color: #8892b0;
}

.geo-attribution a {
    color: #b0bdff;
    border-bottom-color: #b0bdff;
}

.footer-info {
    color: #7a8eb2;
}
