/* Общие стили для raketa.html и groza.html.
   Цветовые переменные (--bg, --accent, --accent-2) задаются в самих HTML. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Manrope', -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    letter-spacing: -0.02em;
    overflow-x: hidden;
}

.page-bg {
    position: fixed; inset: 0;
    background: var(--bg-grad);
    pointer-events: none; z-index: 0;
}

.container { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; position: relative; z-index: 1; }

/* Header */
.header { text-align: center; margin-bottom: 20px; }
.header .logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 12px; display: block; box-shadow: 0 0 30px var(--accent-glow); }
.header h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.04em; }
.header h1 span { color: var(--accent); }
.header .subtitle { color: var(--text2); font-size: 13px; margin-top: 6px; }
.header .brand-sub { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.card-title {
    font-size: 12px; font-weight: 700; color: var(--text2);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
}

.status-card { text-align: center; padding: 18px 16px; }
.status-text { font-size: 15px; font-weight: 600; }
.progress-track { width: 100%; height: 4px; background: var(--surface2); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; transition: width .35s ease; }

.btn {
    width: 100%; padding: 15px; border: none; border-radius: 100px;
    background: var(--accent); color: #fff;
    font-family: inherit; font-size: 15px; font-weight: 700;
    cursor: pointer; margin-bottom: 12px; transition: transform .15s, box-shadow .25s, background .2s;
    letter-spacing: -0.02em;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 0 32px var(--accent-glow); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.secondary { background: var(--surface2); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.secondary:hover:not(:disabled) { background: rgba(255,255,255,.08); box-shadow: none; }

.ip-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13px; }
.ip-row .label { color: var(--text2); }
.ip-row .value { font-weight: 600; text-align: right; max-width: 62%; word-break: break-all; }

.res-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.res-item:last-child { border-bottom: none; }
.res-name { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.res-icon {
    width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    background: var(--surface2); color: var(--text2);
    border: 1px solid var(--border);
}
.res-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.res-status.ok      { color: #4ade80; }  /* legacy fallback */
.res-status.fast    { color: #4ade80; }  /* < 500 мс — зелёный */
.res-status.normal  { color: #fbbf24; }  /* 500..1500 мс — жёлтый */
.res-status.slow    { color: #fb923c; }  /* 1500..3000 мс — оранжевый */
.res-status.poor    { color: #f97316; }  /* > 3000 мс — насыщенный оранжевый (но не красный — красный = недоступен) */
.res-status.fail    { color: #f87171; }
.res-status.warn    { color: #fbbf24; }
.res-status.checking { color: var(--accent-2); }
.res-status.waiting { color: var(--text3); }

.speed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.speed-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.speed-grid-3 .speed-value { font-size: 22px; letter-spacing: -0.02em; white-space: nowrap; }
.speed-grid-3 .speed-item { padding: 14px 8px; min-width: 0; }
.speed-grid-3 .speed-value .spinner { width: 18px; height: 18px; border-width: 2px; opacity: 0.6; }
@media (max-width: 480px) { .speed-grid-3 { grid-template-columns: 1fr 1fr; } .speed-grid-3 .speed-item:last-child { grid-column: 1 / -1; } }
.speed-item {
    background: var(--surface2); border-radius: 12px; padding: 14px; text-align: center;
    border: 1px solid var(--border);
}
.speed-label { font-size: 11px; letter-spacing: 0.06em; color: var(--text2); text-transform: uppercase; }
.speed-value { font-size: 30px; font-weight: 700; margin: 4px 0 2px; line-height: 1; }
.speed-unit { font-size: 11px; color: var(--text2); }

.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid var(--text2); border-top-color: transparent;
    border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.verdict {
    display: none;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid;
    background: var(--surface);
    backdrop-filter: blur(10px);
}
.verdict.ok   { border-color: rgba(74,222,128,.5); box-shadow: 0 0 24px rgba(74,222,128,.15); }
.verdict.warn { border-color: rgba(251,191,36,.5); box-shadow: 0 0 24px rgba(251,191,36,.15); }
.verdict.bad  { border-color: rgba(248,113,113,.5); box-shadow: 0 0 24px rgba(248,113,113,.2); }
.verdict-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.verdict.ok   .verdict-title { color: #4ade80; }
.verdict.warn .verdict-title { color: #fbbf24; }
.verdict.bad  .verdict-title { color: #f87171; }
.verdict-text { font-size: 14px; color: var(--text); opacity: .9; }
.verdict-notes { margin-top: 10px; padding-left: 18px; font-size: 13px; color: var(--text2); }
.verdict-notes li { margin-bottom: 3px; }

.copy-box { display: none; text-align: center; }
.copy-hint { font-size: 12px; color: var(--text2); margin-top: 4px; }

.footer { text-align: center; font-size: 11px; color: var(--text3); margin-top: 20px; letter-spacing: 0.04em; }

@media (min-width: 560px) {
    .container { padding: 32px 20px 48px; }
    .header h1 { font-size: 30px; }
}

.btn.support-btn {
    background: linear-gradient(135deg, #229ED9 0%, #2AABEE 100%);
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    padding: 16px 20px;
    border: none;
    box-shadow: 0 4px 14px rgba(42, 171, 238, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn.support-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(42, 171, 238, 0.5); }
.btn.support-btn:active { transform: translateY(0); }
.btn.support-btn .tg-icon { display: inline-block; margin-right: 8px; font-size: 18px; }
