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

:root {
    --bg: #0b0b14;
    --bg-card: #151527;
    --border: #2a2a45;
    --text: #e6e6f0;
    --muted: #9a9ab5;
    --accent: #f5a623;
    --accent2: #8b5cf6;
    --danger: #e5484d;
    --success: #30a46c;
}

body {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: rgba(11, 11, 20, 0.9);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.logo span {
    color: var(--accent);
}

.logo:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-links > a:not(.btn) {
    color: var(--text);
}

.nav-user {
    color: var(--muted);
}

.inline-form {
    display: inline;
}

/* Кнопки */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #e07b00);
    color: #111;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 166, 35, 0.35);
    text-decoration: none;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-full {
    width: 100%;
}

/* Hero */
.hero {
    background:
        radial-gradient(circle at 70% 30%, rgba(245, 166, 35, 0.25), transparent 40%),
        radial-gradient(circle at 30% 70%, rgba(139, 92, 246, 0.25), transparent 45%),
        var(--bg);
    padding: 90px 0 70px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 14px;
}

.accent {
    color: var(--accent);
}

.hero-sub {
    color: var(--muted);
    max-width: 620px;
    margin: 0 auto 30px;
    font-size: 1.1rem;
}

.ip-box {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 14px 20px;
    border-radius: 12px;
}

.ip-label {
    color: var(--muted);
}

.ip-box code {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    font-family: Consolas, monospace;
}

.copy-msg {
    min-height: 24px;
    margin-top: 10px;
    color: var(--success);
}

.status {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--muted);
}

.status.online {
    color: var(--success);
    border-color: var(--success);
}

.status.offline {
    color: var(--danger);
    border-color: var(--danger);
}

/* Секции */
.section {
    padding: 60px 20px;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
}

.muted {
    color: var(--muted);
    margin-bottom: 16px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 10px;
}

/* Новости */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.news-card {
    margin-bottom: 0;
    transition: border-color 0.2s;
}

.news-card:hover {
    border-color: var(--accent2);
}

.news-meta {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* Соцсети */
.socials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0;
    transition: transform 0.15s, border-color 0.15s;
}

.social-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    text-decoration: none;
}

.social-icon {
    font-size: 1.6rem;
}

/* Формы */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding-top: 60px;
    padding-bottom: 60px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    margin-bottom: 20px;
    text-align: center;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 0.95rem;
}

.form input,
.form textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.alert-error {
    background: rgba(229, 72, 77, 0.15);
    border: 1px solid var(--danger);
    color: #ff9b9e;
}

.alert-success {
    background: rgba(48, 164, 108, 0.15);
    border: 1px solid var(--success);
    color: #7ee2a8;
}

/* Таблица */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.table th {
    color: var(--muted);
    font-weight: 600;
}

/* Футер */
.footer {
    border-top: 1px solid var(--border);
    padding: 30px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .nav-inner {
        justify-content: center;
    }
    .hero {
        padding: 60px 0 50px;
    }
}

/* Личный кабинет */
.nav-links > a.nav-user {
    color: var(--muted);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    border: 2px solid var(--border);
    image-rendering: pixelated;
    background: var(--bg);
}

.profile-info {
    flex: 1;
    min-width: 240px;
}

.profile-info h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 1.5rem;
}

.role-badge {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 600;
}

.role-admin {
    color: var(--accent);
    border-color: var(--accent);
}

.profile-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 20px;
    margin-top: 10px;
}

.profile-list dt {
    color: var(--muted);
}

.profile-list dd {
    word-break: break-all;
}

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

.profile-grid .card {
    margin-bottom: 0;
}

.profile-grid + .card {
    margin-top: 20px;
}

.danger-zone {
    border-color: rgba(229, 72, 77, 0.5);
}

.danger-zone .form {
    max-width: 360px;
}

@media (max-width: 600px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
    .profile-info h3 {
        justify-content: center;
    }
    .profile-list {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Профиль на главной */
.home-profile-wrap {
    margin-top: -36px;
    position: relative;
    z-index: 2;
}

.home-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.home-avatar {
    width: 72px;
    height: 72px;
}

.home-profile-main {
    flex: 1;
    min-width: 240px;
}

.home-profile-main h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 1.3rem;
}

.home-guest .muted {
    margin-bottom: 0;
}

.home-stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.home-stat {
    display: flex;
    flex-direction: column;
}

.home-stat-value {
    font-weight: 700;
    color: var(--accent);
}

.home-stat-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.home-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .home-profile-wrap {
        margin-top: 20px;
    }
    .home-profile {
        flex-direction: column;
        text-align: center;
    }
    .home-profile-main h3,
    .home-stats,
    .home-profile-actions {
        justify-content: center;
    }
}

/* Twitch */
.social-card[href*="twitch.tv"]:hover {
    border-color: #9146ff;
    box-shadow: 0 6px 18px rgba(145, 70, 255, 0.35);
}