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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--tg-theme-bg-color, #fff);
    color: var(--tg-theme-text-color, #000);
    font-size: 14px;
    padding: 12px;
    min-height: 100vh;
}

#access-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
}

.loader {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tg-theme-hint-color, #ccc);
    border-top-color: var(--tg-theme-button-color, #2481cc);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

#access-msg {
    color: var(--tg-theme-hint-color, #888);
    font-size: 15px;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-row {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-row label {
    font-size: 11px;
    color: var(--tg-theme-hint-color, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-row input {
    padding: 8px 10px;
    border: 1px solid var(--tg-theme-hint-color, #ccc);
    border-radius: 8px;
    font-size: 14px;
    background: var(--tg-theme-secondary-bg-color, #f4f4f5);
    color: var(--tg-theme-text-color, #000);
    outline: none;
}

.filter-row input:focus {
    border-color: var(--tg-theme-button-color, #2481cc);
}

#stats-bar {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #888);
    margin-bottom: 8px;
    padding: 4px 0;
}

#table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: right;
    padding: 8px 6px;
    border-bottom: 1px solid var(--tg-theme-hint-color, #ddd);
    color: var(--tg-theme-hint-color, #888);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--tg-theme-bg-color, #fff);
    cursor: pointer;
    user-select: none;
}

th.col-symbol {
    text-align: left;
}

td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color, #eee);
    text-align: right;
    white-space: nowrap;
}

td.col-symbol {
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    color: var(--tg-theme-link-color, #2481cc);
}

td.col-symbol:active {
    opacity: 0.6;
}

.tv-link {
    display: inline-block;
    margin-right: 6px;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}

.tv-link:active {
    opacity: 0.5;
}

.coin-name {
    vertical-align: middle;
}

tr:hover {
    background: var(--tg-theme-secondary-bg-color, #f9f9f9);
}

.positive {
    color: #22c55e;
}

.negative {
    color: #ef4444;
}

/* ===== Экран подписки (gate) ===== */
#no-access {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 88vh;
    padding: 16px;
}

.gate-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: 34px 24px 24px;
    border-radius: 24px;
    text-align: center;
    background: var(--tg-theme-secondary-bg-color, #16181d);
    border: 1px solid rgba(128, 128, 128, 0.18);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: gate-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes gate-in {
    from { opacity: 0; transform: translateY(26px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-glow {
    position: absolute;
    top: -140px;
    left: 50%;
    width: 340px;
    height: 340px;
    transform: translateX(-50%);
    background: radial-gradient(circle, var(--tg-theme-button-color, #3b82f6) 0%, transparent 62%);
    opacity: 0.28;
    filter: blur(16px);
    pointer-events: none;
    animation: gate-glow-pulse 4s ease-in-out infinite;
}

@keyframes gate-glow-pulse {
    0%, 100% { opacity: 0.2; }
    50%      { opacity: 0.4; }
}

.gate-badge {
    position: relative;
    z-index: 1;
    width: 92px;
    height: 92px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gate-badge-icon {
    position: relative;
    z-index: 2;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tg-theme-button-color, #3b82f6), #8b5cf6);
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.5);
    animation: gate-float 3s ease-in-out infinite;
}

@keyframes gate-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.gate-badge-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--tg-theme-button-color, #3b82f6);
    opacity: 0;
    animation: gate-ring 2.6s ease-out infinite;
}

.gate-badge-ring--2 { animation-delay: 1.3s; }

@keyframes gate-ring {
    0%   { transform: scale(0.72); opacity: 0.55; }
    100% { transform: scale(1.55); opacity: 0; }
}

.gate-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--tg-theme-text-color, #fff);
    margin-bottom: 8px;
}

.gate-sub {
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-hint-color, #9aa4b2);
    max-width: 300px;
    margin: 0 auto 16px;
}

.gate-channel {
    display: inline-block;
    padding: 6px 15px;
    margin-bottom: 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--tg-theme-button-color, #3b82f6);
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid var(--tg-theme-button-color, #3b82f6);
}

.gate-perks {
    list-style: none;
    text-align: left;
    max-width: 300px;
    margin: 0 auto 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gate-perks li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--tg-theme-text-color, #e6e9ef);
}

.gate-perk-ico {
    flex: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 17px;
    background: rgba(128, 128, 128, 0.14);
}

.gate-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    color: var(--tg-theme-button-text-color, #fff);
    background: linear-gradient(135deg, var(--tg-theme-button-color, #3b82f6), #8b5cf6);
    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.4);
    overflow: hidden;
    transition: transform 0.15s ease;
}

.gate-btn span { position: relative; z-index: 1; }

.gate-btn:active { transform: scale(0.97); }

.gate-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: gate-shine 3s ease-in-out infinite;
}

@keyframes gate-shine {
    0%       { left: -60%; }
    55%, 100% { left: 130%; }
}

.gate-recheck {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--tg-theme-hint-color, #9aa4b2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.gate-recheck:active {
    background: rgba(128, 128, 128, 0.14);
    color: var(--tg-theme-text-color, #fff);
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color, #fff);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
}
