@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,600;14..32,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Times+New+Roman&display=swap');

/* ---------- БАЗОВЫЕ ПЕРЕМЕННЫЕ (ИЗНАЧАЛЬНЫЙ СТИЛЬ) ---------- */
:root {
    --bg: radial-gradient(circle at 10% 20%, #0a0f1e, #03060c);
    --card-bg: rgba(20, 28, 45, 0.7);
    --border: rgba(255, 217, 102, 0.3);
    --text: #f0f3fa;
    --text-dim: #cbd5e6;
    --accent: #FFD966;
    --header-border: rgba(255,255,255,0.1);
    --btn-bg: rgba(255, 217, 102, 0.15);
    --btn-hover-bg: rgba(255, 217, 102, 0.3);
    --glow: 0 0 3px #FFD966;
    --shadow: 0 10px 20px -8px rgba(0,0,0,0.5);
    --font: 'Inter', sans-serif;
    --hole-color: #FFD966;
    --hole-inner: #cc9900;
    --hole-outer: #ffcc44;
    --radius: 28px;
    --border-width: 1px;
}

/* ---------- СРЕДНЕВЕКОВЬЕ ---------- */
body.style-medieval {
    --bg: #dacba8;
    --card-bg: rgba(245, 235, 200, 0.92);
    --border: #5a3a1a;
    --text: #2a1a0a;
    --text-dim: #5a3a1a;
    --accent: #8b5a2b;
    --header-border: #5a3a1a;
    --btn-bg: #e0c8a0;
    --btn-hover-bg: #c8a878;
    --glow: 0 0 2px #8b5a2b;
    --shadow: 0 4px 12px rgba(0,0,0,0.2);
    --font: 'Times New Roman', serif;
    --hole-color: #c97e2a;
    --hole-inner: #8b5a2b;
    --hole-outer: #daa520;
    --radius: 8px;
    --border-width: 2px;
}
body.style-medieval::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" opacity="0.05"><path fill="none" stroke="%235a3a1a" stroke-width="0.8" d="M10 10 L390 10 M10 20 L390 20 M10 30 L390 30" /></svg>');
    background-repeat: repeat;
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}
body.style-medieval .featured-card,
body.style-medieval .server-info,
body.style-medieval .rules-info {
    border: var(--border-width) solid var(--border);
    border-left: 6px solid var(--accent);
}

/* ---------- ТЕРМИНАЛ ---------- */
body.style-terminal {
    --bg: #0a0c10;
    --card-bg: #0f1117;
    --border: #2a2f3a;
    --text: #0f0;
    --text-dim: #aaa;
    --accent: #0f0;
    --header-border: #2a2f3a;
    --btn-bg: #0f1117;
    --btn-hover-bg: #1a1f2a;
    --glow: 0 0 3px #0f0;
    --shadow: none;
    --font: 'Fira Code', monospace;
    --hole-color: #0f0;
    --hole-inner: #0a2a0a;
    --hole-outer: #0a4a0a;
    --radius: 0px;
    --border-width: 1px;
}
body.style-terminal .style-panel,
body.style-terminal .featured-card,
body.style-terminal .server-info,
body.style-terminal .rules-info,
body.style-terminal .badge,
body.style-terminal .download-btn,
body.style-terminal .details-btn {
    border-radius: 0 !important;
}
body.style-terminal .download-btn:hover,
body.style-terminal .details-btn:hover {
    animation: matrixBlink 0.1s infinite;
}
@keyframes matrixBlink {
    0% { opacity: 1; text-shadow: 0 0 1px currentColor; }
    50% { opacity: 0.8; text-shadow: 0 0 3px currentColor; letter-spacing: 1px; }
    100% { opacity: 1; }
}
.glitch-text {
    animation: textGlitch 0.3s ease-in-out;
    color: #ff4444 !important;
    text-shadow: -2px 0 red, 2px 0 blue;
}
@keyframes textGlitch {
    0% { transform: translate(0); opacity: 1; text-shadow: -2px 0 red, 2px 0 blue; }
    20% { transform: translate(-2px, 1px); text-shadow: 2px 0 red, -2px 0 blue; }
    40% { transform: translate(2px, -1px); text-shadow: -2px 0 blue, 2px 0 red; }
    60% { transform: translate(-1px, 2px); text-shadow: 2px 0 red, -2px 0 blue; }
    80% { transform: translate(1px, -2px); text-shadow: -2px 0 blue, 2px 0 red; }
    100% { transform: translate(0); text-shadow: none; }
}

/* ---------- ОБЩИЕ СТИЛИ (скопированы из твоего старого style.css) ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: var(--bg);
    font-family: var(--font);
    color: var(--text);
    padding: 2rem 1.5rem;
    transition: background 0.4s, color 0.4s, font-family 0.2s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.wrapper {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--header-border);
    padding-bottom: 1rem;
    gap: 1rem;
}
.logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #E0B0FF, var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.header-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.server-btn, .games-btn {
    background: var(--btn-bg);
    border: 1px solid var(--border);
    color: var(--accent);
    border-radius: 40px;
    padding: 0.3rem 1rem;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.server-btn:hover, .games-btn:hover {
    background: var(--btn-hover-bg);
    border-color: var(--accent);
}
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}
.col-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}
.section-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    border-left: 4px solid var(--accent);
    padding-left: 0.75rem;
}
.all-mods-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed;
}
.featured-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 1.8rem;
    border: 1px solid var(--border);
    transition: 0.2s;
}
.featured-card h3 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(120deg, #fff, var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}
.featured-card p {
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.badge {
    display: inline-block;
    background: rgba(255, 217, 102, 0.15);
    border: 1px solid rgba(255, 217, 102, 0.4);
    border-radius: 40px;
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}
.badge-release {
    background: #2e7d32;
    border-color: #6fcf97;
    color: white;
}
.badge-beta {
    background: #e67e22;
    border-color: #f39c12;
    color: white;
}
.download-btn, .details-btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
    border-radius: 40px;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    transition: 0.2s;
}
.download-btn {
    background: linear-gradient(95deg, #2b7a3e, #1e5a2e);
    color: white;
    margin-right: 0.75rem;
}
.download-btn:hover {
    background: linear-gradient(95deg, #359c4a, #287a38);
    transform: scale(1.02);
}
.details-btn {
    background: rgba(80, 90, 120, 0.6);
    color: #eef;
    border: 1px solid rgba(255,255,255,0.15);
}
.details-btn:hover {
    background: rgba(110, 125, 160, 0.8);
    border-color: var(--accent);
}
.server-info, .rules-info {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 1.8rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}
.server-info h3, .rules-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent);
}
.server-info p {
    margin-bottom: 0.75rem;
}
.status-online { color: #6fcf97; }
.status-offline { color: #e74c3c; }
.rules-info ul {
    list-style: none;
    margin: 1rem 0;
}
.rules-info li {
    margin-bottom: 0.6rem;
    padding-left: 1.4rem;
    position: relative;
}
.rules-info li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent);
}
.link-full {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed;
}
.footer {
    margin-top: 3rem;
    text-align: center;
    color: #6a7493;
    border-top: 1px solid var(--header-border);
    padding-top: 2rem;
    flex-shrink: 0;
}
.rickroll {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    text-decoration: none;
    color: inherit;
}
.rickroll:hover {
    opacity: 1;
    color: var(--accent);
}
.refresh-status-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 5px;
    color: var(--accent);
}
/* ----- СТИЛИ ДЛЯ ПАНЕЛИ ПЕРЕКЛЮЧЕНИЯ И ЧЁРНОЙ ДЫРЫ ----- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
}
.blackhole-logo {
    width: 44px;
    height: 44px;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}
.blackhole-logo:hover {
    transform: scale(1.05);
}
.style-panel {
    position: absolute;
    top: 55px;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 180px;
    max-height: 320px;
    overflow-y: auto;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.style-panel.open {
    transform: scaleY(1);
    opacity: 1;
}
.style-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.style-panel-item:last-child {
    border-bottom: none;
}
.style-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--hole-color), var(--hole-inner));
    box-shadow: 0 0 4px currentColor;
    transition: background 0.2s;
}
/* ----- КОНСОЛЬ (только для терминала) ----- */
#terminal-container {
    margin-top: 2rem;
    padding: 1rem;
    background: #0a0c10;
    border: 1px solid #2a2f3a;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #0f0;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#terminal-output {
    flex: 1;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-all;
}
.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #2a2f3a;
    padding-top: 0.5rem;
}
.terminal-input-line .prompt {
    color: #0f0;
    font-weight: bold;
}
#terminal-input {
    background: transparent;
    border: none;
    color: #0f0;
    font-family: inherit;
    font-size: inherit;
    flex: 1;
    outline: none;
}
body:not(.style-terminal) #terminal-container {
    display: none;
}
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
    .featured-card h3 { font-size: 1.6rem; }
    .header { flex-direction: column; align-items: stretch; }
    .header-buttons { justify-content: flex-start; }
}
@media (max-width: 480px) {
    body { padding: 1rem; }
    .download-btn, .details-btn { padding: 0.4rem 1rem; font-size: 0.8rem; }
}