@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    font-size: 15px;
    line-height: 1.7;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 30%, #16213e 70%, #0f3460 100%);
    min-height: 100vh;
    background-attachment: fixed;
}

#page {
    max-width: 1100px;
    margin: 30px auto;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
    padding: 0;
    border: none;
    position: relative;
    overflow: hidden;
}

#header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
    animation: floatGlow 6s ease-in-out infinite;
}

#header::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    pointer-events: none;
    animation: floatGlow 8s ease-in-out infinite reverse;
}

@keyframes floatGlow {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

#logo {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    padding: 28px 36px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
}

#logo::before {
    content: '🎮';
    font-size: 32px;
}

@media (max-width: 600px) {
    #logo { font-size: 22px; padding: 20px 24px; }
    #logo::before { font-size: 26px; }
}

#mainmenu {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

#mainmenu ul {
    padding: 8px 20px;
    margin: 0;
    display: flex;
    list-style: none;
    gap: 4px;
}

#mainmenu ul li { display: inline-block; margin: 0; position: relative; }

#mainmenu ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}

#mainmenu ul li a:hover {
    color: #667eea;
    background: #eef2ff;
    transform: translateY(-1px);
    text-decoration: none;
}

#mainmenu ul li.active a {
    color: #ffffff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

#mainmenu ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 8px;
    padding-top: 15px;
    min-width: 220px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    flex-direction: column;
    gap: 4px;
    animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

#mainmenu ul li.parent { position: relative; }

#mainmenu ul li.parent::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 1001;
}

#mainmenu ul li:hover > ul,
#mainmenu ul li.parent:hover ul { display: flex; }

#mainmenu ul ul li { display: block; margin: 0; }

#mainmenu ul ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

#mainmenu ul ul li a:hover {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #667eea;
    transform: none;
}

#mainmenu ul ul li.active a {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #667eea;
    font-weight: 600;
}

/* Контент */
#content {
    padding: 36px;
    min-height: 400px;
}

#sidebar {
    padding: 36px 28px;
}

#footer {
    padding: 24px 36px;
    margin: 0;
    font-size: 13px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

/* Flash сообщения */
div.flash-error,
div.flash-notice,
div.flash-success {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

div.flash-error { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }
div.flash-notice { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; }
div.flash-success { background: #f0fdf4; color: #166534; border-left: 4px solid #22c55e; }

div.flash-error a,
div.flash-notice a,
div.flash-success a { color: inherit; text-decoration: underline; }

/* View */
div.view {
    padding: 20px;
    margin: 16px 0;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

div.view:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

/* Breadcrumbs */
div.breadcrumbs {
    padding: 12px 36px;
    font-size: 13px;
    color: #94a3b8;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

div.breadcrumbs span {
    font-weight: 500;
    color: #667eea;
}

div.breadcrumbs a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

div.breadcrumbs a:hover {
    color: #667eea;
    text-decoration: none;
}

/* Portlet */
.portlet { margin-bottom: 24px; }

.portlet-decoration {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f1f5f9, #eef2ff);
    border-radius: 12px 12px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
}

.portlet-title {
    font-size: 13px;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portlet-content {
    font-size: 14px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    margin-bottom: 0;
}

.portlet-content ul { list-style: none; margin: 0; padding: 0; }
.portlet-content li { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.portlet-content li:last-child { border-bottom: none; }

.portlet-content li a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.portlet-content li a:hover { color: #764ba2; }

/* Посты */
.post { margin: 0 0 28px; padding: 0; }

.post .title {
    font-size: 22px;
    border: none;
    margin-bottom: 6px;
}

.post .title a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
    line-height: 1.3;
}

.post .title a:hover { color: #667eea; text-decoration: none; }

.post .author {
    color: #94a3b8;
    font-size: 13px;
    margin: 0 0 12px;
}

.post .nav {
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
}

.post .nav a { color: #667eea; text-decoration: none; font-weight: 500; }
.post .nav a:hover { text-decoration: underline; }

/* Комментарии */
.comment {
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin: 12px 0;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.comment:hover { border-color: #cbd5e1; }
.comment .content { margin: 10px 0; line-height: 1.7; }

.comment .author {
    margin: 0 0 8px;
    padding: 0 0 8px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #1e293b;
}

.comment .time { color: #94a3b8; font-size: 12px; }

.comment a.cid {
    color: #cbd5e1;
    float: right;
    font-size: 18px;
    font-weight: 700;
    padding: 0 4px 4px 4px;
    text-decoration: none;
    transition: color 0.2s;
}

.comment a.cid:hover { color: #667eea; }
.comment .pending { color: #ef4444; font-size: 12px; font-weight: 600; }

/* Кнопки */
.btn,
input[type="submit"],
input[type="button"],
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
}

.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    color: #fff;
}

.btn:active,
input[type="submit"]:active,
input[type="button"]:active,
button:active { transform: translateY(0); }

a { color: #667eea; text-decoration: none; transition: color 0.2s; }
a:hover { color: #764ba2; text-decoration: underline; }

/* Таблицы */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

th {
    background: linear-gradient(135deg, #f1f5f9, #eef2ff);
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* Заголовки */
h1, h2, h3, h4, h5, h6 { color: #1e293b; font-weight: 700; line-height: 1.3; }
h1 { font-size: 28px; margin-bottom: 16px; }
h2 { font-size: 22px; margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 10px; }
p { margin-bottom: 16px; }

/* Поля ввода */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
textarea,
select {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #334155;
    background: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
    max-width: 400px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

textarea { min-height: 100px; resize: vertical; }