/* ============================================
   SHVATKA STYLES - общие стили для всех страниц
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== ШАПКА (HEADER) ===== */
.header {
    background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header-top {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo .icon {
    font-size: 40px;
}

.header-logo h1 {
    font-size: 24px;
    font-weight: bold;
    color: white;
    letter-spacing: 1px;
    margin: 0;
}

.header-logo p {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    margin: 5px 0 0 0;
}

.user-info {
    background: rgba(255,255,255,0.15);
    padding: 8px 18px;
    border-radius: 30px;
}

.user-info span {
    color: rgba(255,255,255,0.9);
}

.user-info strong {
    color: white;
    margin: 0 5px;
}

.user-info a {
    color: #ffdddd;
    text-decoration: none;
    margin-left: 10px;
    font-size: 13px;
}

.user-info a:hover {
    text-decoration: underline;
}

.nav-bar {
    background: rgba(0,0,0,0.15);
    padding: 12px 25px;
    border-radius: 0 0 12px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

.time-indicator {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-left: auto;
}

/* ===== ИНФОРМАЦИОННАЯ ПАНЕЛЬ ===== */
.info-panel {
    background: white;
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid #28a745;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.info-panel-text {
    font-size: 14px;
    color: #333;
}

.info-panel-text strong {
    color: #0088cc;
}

.info-panel-badge {
    background: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 13px;
}

/* ===== ЗАГОЛОВКИ РАЗДЕЛОВ ===== */
.section-title {
    background: white;
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid #0088cc;
}

.section-title h2 {
    color: #333;
    font-size: 22px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.section-title h2 span {
    color: #0088cc;
}

/* ===== КАРТОЧКИ ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
/*    transform: translateY(-5px);*/
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header.inactive {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.card-header h3 {
    font-size: 18px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-stats {
    display: flex;
    gap: 10px;
    font-size: 12px;
    flex-wrap: wrap;
}

.card-stats span {
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ===== ТАБЛИЦЫ ===== */
.mobile-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 350px;
}

.data-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e0e0;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    color: #555;
    font-size: 13px;
}

.data-table tr:hover td {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.player-nick {
    font-weight: 600;
    color: #0088cc;
    white-space: nowrap;
}

.player-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #e8f4f8;
    color: #0088cc;
    display: inline-block;
    white-space: nowrap;
}

.player-status.captain {
    background: #ffd700;
    color: #856404;
}

.player-points {
    font-weight: 700;
    color: #28a745;
    text-align: center;
}

.player-games {
    text-align: center;
    color: #666;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s;
    cursor: default;
}

.overlay:target {
    visibility: visible;
    opacity: 1;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    padding: 25px;
    z-index: 1001;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.overlay:target + .popup {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.popup h3 {
    color: #0088cc;
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 2px solid #0088cc;
    padding-bottom: 10px;
}

.popup-content {
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
}

.popup-content p {
    margin: 10px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    line-height: 28px;
    transition: all 0.3s;
}

.close:hover {
    background: #c82333;
    transform: rotate(360deg);
}

.close:before {
    content: "X";
    font-size: 14px;
}

/* ===== ПУСТЫЕ СОСТОЯНИЯ ===== */
.empty-state {
    text-align: center;
    padding: 60px;
    background: white;
    border-radius: 12px;
    color: #666;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* ===== БЕЙДЖИ И ИНДИКАТОРЫ ===== */
.active-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #0088cc;
    color: white;
}

.btn-primary:hover {
    background: #0066aa;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ТЕМ ===== */
.theme-switcher {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.theme-btn {
    display: inline-block;
    padding: 8px 20px;
    margin: 0 10px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

.light-btn {
    background-color: #0D5980;
    color: white !important;
}

.light-btn:hover {
    background-color: #0d4d66;
    transform: translateY(-2px);
}

.dark-btn {
    background-color: #333333;
    color: white !important;
}

.dark-btn:hover {
    background-color: #404040;
    transform: translateY(-2px);
}

.minimal-btn {
    background-color: #6c757d;
    color: white !important;
}

.minimal-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* ===== ВЕТЕРАНЫ ===== */
.rank-cell {
    font-weight: 700;
    width: 60px;
    color: #0088cc;
    font-size: 18px;
}

.games-cell {
    font-weight: 800;
    font-size: 18px;
    color: #0088cc;
    text-align: right;
    font-family: monospace;
}

.games-label {
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin-left: 4px;
}

.team-status {
    font-size: 11px;
    color: #888;
    display: block;
    margin-top: 3px;
}

/* ===== ПРОФИЛЬ ===== */
.profile-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
}

.avatar-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.avatar-wrapper {
    padding: 30px;
    background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
}

.avatar-wrapper img {
    width: 100%;
    max-width: 200px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ===== КОМАНДЫ ===== */
.team-name {
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-last-game {
    font-size: 12px;
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 20px;
}

.game-info {
    background: white;
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid #28a745;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.game-info-text {
    font-size: 14px;
    color: #333;
}

.game-info-text strong {
    color: #0088cc;
}

.game-info-badge {
    background: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 13px;
}

/* ===== ТЕМНАЯ ТЕМА ===== */
body.dark-theme,
html.dark-theme body {
    background-color: #1a1a1a !important;
}

.dark-theme .header,
html.dark-theme .header {
    background: linear-gradient(135deg, #1a4d66 0%, #0d3d52 100%) !important;
}

.dark-theme .header-logo h1,
.dark-theme .header-logo p,
html.dark-theme .header-logo h1,
html.dark-theme .header-logo p {
    color: #e0e0e0 !important;
}

.dark-theme .user-info,
html.dark-theme .user-info {
    background: rgba(0,0,0,0.3) !important;
}

.dark-theme .user-info span,
.dark-theme .user-info strong,
html.dark-theme .user-info span,
html.dark-theme .user-info strong {
    color: #e0e0e0 !important;
}

.dark-theme .nav-link,
html.dark-theme .nav-link {
    background: rgba(0,0,0,0.3) !important;
    color: #e0e0e0 !important;
}

.dark-theme .section-title,
.dark-theme .info-panel,
.dark-theme .card,
.dark-theme .avatar-card,
.dark-theme .empty-state,
.dark-theme .popup,
.dark-theme .game-info,
.dark-theme .theme-switcher,
html.dark-theme .section-title,
html.dark-theme .info-panel,
html.dark-theme .card,
html.dark-theme .avatar-card,
html.dark-theme .empty-state,
html.dark-theme .popup,
html.dark-theme .game-info,
html.dark-theme .theme-switcher {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
}

.dark-theme .section-title h2,
.dark-theme .section-title h2 span,
.dark-theme .info-panel-text,
.dark-theme .info-panel-text strong,
.dark-theme .game-info-text,
.dark-theme .game-info-text strong,
html.dark-theme .section-title h2,
html.dark-theme .section-title h2 span,
html.dark-theme .info-panel-text,
html.dark-theme .info-panel-text strong,
html.dark-theme .game-info-text,
html.dark-theme .game-info-text strong {
    color: #e0e0e0 !important;
}

.dark-theme .card-header,
html.dark-theme .card-header {
    background: linear-gradient(135deg, #1a4d66 0%, #0d3d52 100%) !important;
    color: #e0e0e0 !important;
}

.dark-theme .card-header.inactive,
html.dark-theme .card-header.inactive {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%) !important;
}

.dark-theme .data-table th,
html.dark-theme .data-table th {
    background: #3a3a3a !important;
    color: #e0e0e0 !important;
    border-bottom-color: #555 !important;
}

.dark-theme .data-table td,
html.dark-theme .data-table td {
    border-bottom-color: #404040 !important;
    color: #ccc !important;
}

.dark-theme .data-table tr:hover td,
html.dark-theme .data-table tr:hover td {
    background: #3a3a3a !important;
}

.dark-theme .player-nick,
html.dark-theme .player-nick {
    color: #66b0ff !important;
}

.dark-theme .player-points,
html.dark-theme .player-points {
    color: #5cb85c !important;
}

.dark-theme .player-games,
html.dark-theme .player-games {
    color: #aaa !important;
}

.dark-theme .player-status,
html.dark-theme .player-status {
    background: #1a4d66 !important;
    color: #66b0ff !important;
}

.dark-theme .player-status.captain,
html.dark-theme .player-status.captain {
    background: #665500 !important;
    color: #ffd966 !important;
}

.dark-theme .rank-cell,
.dark-theme .games-cell,
html.dark-theme .rank-cell,
html.dark-theme .games-cell {
    color: #66b0ff !important;
}

.dark-theme .games-label,
html.dark-theme .games-label {
    color: #aaa !important;
}

.dark-theme .team-status,
html.dark-theme .team-status {
    color: #aaa !important;
}

.dark-theme .avatar-wrapper,
html.dark-theme .avatar-wrapper {
    background: linear-gradient(135deg, #1a4d66 0%, #0d3d52 100%) !important;
}

.dark-theme .player-name h2,
.dark-theme .player-name .player-group,
html.dark-theme .player-name h2,
html.dark-theme .player-name .player-group {
    color: #e0e0e0 !important;
}

.dark-theme .player-stats,
html.dark-theme .player-stats {
    background: #3a3a3a !important;
    border-top-color: #404040 !important;
}

.dark-theme .stat-item,
html.dark-theme .stat-item {
    border-bottom-color: #404040 !important;
}

.dark-theme .stat-label,
html.dark-theme .stat-label {
    color: #aaa !important;
}

.dark-theme .stat-value,
html.dark-theme .stat-value {
    color: #e0e0e0 !important;
}

.dark-theme .info-card,
html.dark-theme .info-card {
    background: #2d2d2d !important;
}

.dark-theme .info-section,
html.dark-theme .info-section {
    border-bottom-color: #404040 !important;
}

.dark-theme .info-section h4,
html.dark-theme .info-section h4 {
    color: #e0e0e0 !important;
}

.dark-theme .info-item .label,
html.dark-theme .info-item .label {
    color: #aaa !important;
}

.dark-theme .info-item .value,
html.dark-theme .info-item .value {
    color: #e0e0e0 !important;
}

.dark-theme .info-item .value.badge,
html.dark-theme .info-item .value.badge {
    background: #1a4d66 !important;
    color: #66b0ff !important;
}

.dark-theme .social-icon.linked,
html.dark-theme .social-icon.linked {
    background: #1a4d66 !important;
}

.dark-theme .social-icon.unlinked,
html.dark-theme .social-icon.unlinked {
    background: #4a4a4a !important;
}

.dark-theme .team-card .team-header,
html.dark-theme .team-card .team-header {
    background: linear-gradient(135deg, #1a4d66 0%, #0d3d52 100%) !important;
}

.dark-theme .team-card .team-header.inactive,
html.dark-theme .team-card .team-header.inactive {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%) !important;
}

.dark-theme .team-name,
html.dark-theme .team-name {
    color: white !important;
}

.dark-theme .team-stats span,
.dark-theme .team-last-game,
html.dark-theme .team-stats span,
html.dark-theme .team-last-game {
    background: rgba(0,0,0,0.3) !important;
    color: #e0e0e0 !important;
}

.dark-theme .popup h3,
html.dark-theme .popup h3 {
    color: #66b0ff !important;
    border-bottom-color: #66b0ff !important;
}

.dark-theme .popup-content p,
html.dark-theme .popup-content p {
    background: #3a3a3a !important;
    color: #ddd !important;
}

.dark-theme .close,
html.dark-theme .close {
    background: #aa2e3c !important;
}

.dark-theme .close:hover,
html.dark-theme .close:hover {
    background: #8b2530 !important;
}

.dark-theme .game-info-badge,
html.dark-theme .game-info-badge {
    background: #5cb85c !important;
}

.dark-theme .btn-primary,
html.dark-theme .btn-primary {
    background: #1a4d66 !important;
}

.dark-theme .btn-success,
html.dark-theme .btn-success {
    background: #2d6a2d !important;
}

.dark-theme .btn-danger,
html.dark-theme .btn-danger {
    background: #aa2e3c !important;
}

.dark-theme .btn-secondary,
html.dark-theme .btn-secondary {
    background: #5a5a5a !important;
}

.dark-theme input[type="text"],
.dark-theme input[type="number"],
.dark-theme textarea,
html.dark-theme input[type="text"],
html.dark-theme input[type="number"],
html.dark-theme textarea {
    background-color: #3a3a3a !important;
    color: #e0e0e0 !important;
    border: 1px solid #555 !important;
}

.dark-theme input[type="submit"],
.dark-theme button:not(.theme-btn):not(.close),
html.dark-theme input[type="submit"],
html.dark-theme button:not(.theme-btn):not(.close) {
    background-color: #1a4d66 !important;
    color: white !important;
}

.dark-theme .userlinks,
html.dark-theme .userlinks {
    background: #2d2d2d !important;
    border-color: #4a4a4a !important;
    color: #e0e0e0 !important;
}

.dark-theme .userlinks a,
html.dark-theme .userlinks a {
    color: #66b0ff !important;
}

.dark-theme .maintitle,
html.dark-theme .maintitle {
    background-color: #1a4d66 !important;
    color: #e0e0e0 !important;
}

.dark-theme .row1,
.dark-theme .row2,
html.dark-theme .row1,
html.dark-theme .row2 {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

.dark-theme .ipbtable,
html.dark-theme .ipbtable {
    background-color: #2d2d2d !important;
}

.dark-theme .borderwrap,
html.dark-theme .borderwrap {
    background-color: #2d2d2d !important;
    border-color: #4a4a4a !important;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-bar {
        flex-direction: column;
    }
    
    .time-indicator {
        margin-left: 0;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .info-panel,
    .game-info {
        flex-direction: column;
        text-align: center;
    }
    
    .section-title h2 {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .theme-btn {
        margin: 5px;
    }
}
/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ТЕМНОЙ ТЕМЫ (ТЕКСТ) ===== */

/* Основной текст в карточках и блоках */
.dark-theme .card-body,
.dark-theme .level-body,
.dark-theme .team-body,
.dark-theme .info-section,
.dark-theme .level-content,
.dark-theme .hints-section,
.dark-theme .hint-item,
.dark-theme .hint-text,
.dark-theme .level-text-preview,
.dark-theme .keys-info,
.dark-theme .keys-info span,
.dark-theme .keys-info .label,
.dark-theme .hints-preview h4,
.dark-theme .level-actions,
html.dark-theme .card-body,
html.dark-theme .level-body,
html.dark-theme .team-body,
html.dark-theme .info-section,
html.dark-theme .level-content,
html.dark-theme .hints-section,
html.dark-theme .hint-item,
html.dark-theme .hint-text,
html.dark-theme .level-text-preview,
html.dark-theme .keys-info,
html.dark-theme .keys-info span,
html.dark-theme .keys-info .label,
html.dark-theme .hints-preview h4,
html.dark-theme .level-actions {
    color: #e0e0e0 !important;
}

/* Текст в подсказках и ключах */
.dark-theme .hint-time,
.dark-theme .level-badge,
.dark-theme .file-stats,
.dark-theme .game-badge,
html.dark-theme .hint-time,
html.dark-theme .level-badge,
html.dark-theme .file-stats,
html.dark-theme .game-badge {
    color: #66b0ff !important;
}

/* Левое меню и ссылки */
.dark-theme .userlinks,
.dark-theme .userlinks p,
.dark-theme .userlinks b,
html.dark-theme .userlinks,
html.dark-theme .userlinks p,
html.dark-theme .userlinks b {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
}

.dark-theme a:link,
.dark-theme a:visited,
.dark-theme a:active,
html.dark-theme a:link,
html.dark-theme a:visited,
html.dark-theme a:active {
    color: #fff !important;
}

/* ===== СТИЛИ ДЛЯ РЕДАКТОРА СЦЕНАРИЯ (scn.php) ===== */

/* Контейнер формы редактора */
.form-container {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0088cc;
    box-shadow: 0 0 0 2px rgba(0,136,204,0.1);
}

/* Ключи (две колонки) */
.key-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Блок подсказки */
.hint-block {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #fafafa;
}

.hint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.hint-header h4 {
    margin: 0;
    color: #0088cc;
}

/* Кнопки редактора */
.btn-submit {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-back {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.add-hint-btn {
    background: #0088cc;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    margin: 10px 0;
    transition: all 0.2s;
}

.add-hint-btn:hover {
    background: #0066aa;
    transform: translateY(-2px);
}

.remove-hint {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-hint:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.delete-btn {
    background: #dc3545;
    padding: 10px 20px;
}

/* Блок файлов */
.files-block {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}

.files-block h4 {
    margin-bottom: 15px;
    color: #0088cc;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.files-table th,
.files-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.files-table th {
    background: #e8f4f8;
    color: #333;
    font-weight: 600;
}

.files-table tr:hover td {
    background: #f0f0f0;
}

.copy-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #5a6268;
}

/* Подсказка по вставке файлов */
.insert-tip {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 12px;
    color: #856404;
}

.insert-tip code {
    background: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}

/* Уровень информации */
.level-info {
    background: #e8f4f8;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid #0088cc;
}

/* ===== СТИЛИ ДЛЯ TRUMBOWYG (WYSIWYG редактор) ===== */
.trumbowyg-box,
.trumbowyg-editor {
    margin: 0 auto;
}

.trumbowyg-editor {
    min-height: 200px;
    background: white;
}

.trumbowyg-button-pane button.trumbowyg-html-button {
    background: #f0f0f0;
}

.trumbowyg-button-pane button.trumbowyg-html-button.trumbowyg-active {
    background: #0088cc;
    color: white;
}

/* Адаптация Trumbowyg под темную тему */
.dark-theme .trumbowyg-box,
.dark-theme .trumbowyg-editor {
    background: #2d2d2d;
    border-color: #4a4a4a;
}

.dark-theme .trumbowyg-editor {
    color: #e0e0e0;
}

.dark-theme .trumbowyg-button-pane {
    background: #3a3a3a;
    border-bottom-color: #4a4a4a;
}

.dark-theme .trumbowyg-button-pane button {
    color: #e0e0e0;
}

.dark-theme .trumbowyg-button-pane button.trumbowyg-active {
    background: #1a4d66;
    color: white;
}

.dark-theme .trumbowyg-modal-box {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-theme .trumbowyg-modal-box input,
.dark-theme .trumbowyg-modal-box textarea {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #4a4a4a;
}

/* ===== СТИЛИ ДЛЯ PREVIEW И МЕДИА ===== */
.level-text-preview {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    border-left: 3px solid #0088cc;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.level-media-preview img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.media-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #e8f4f8;
    border-radius: 8px;
    font-size: 12px;
    color: #0088cc;
}

.media-icon span {
    font-size: 24px;
}

.file-stats {
    font-size: 11px;
    color: #0088cc;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
}

/* Адаптация для темной темы */
.dark-theme .form-container,
.dark-theme .files-block,
.dark-theme .hint-block {
    background: #2d2d2d !important;
    border-color: #4a4a4a !important;
}

.dark-theme .form-group label,
.dark-theme .hint-header h4 {
    color: #e0e0e0 !important;
}

.dark-theme .form-group input,
.dark-theme .form-group textarea {
    background: #3a3a3a !important;
    color: #e0e0e0 !important;
    border-color: #4a4a4a !important;
}

.dark-theme .files-table th {
    background: #3a3a3a !important;
    color: #e0e0e0 !important;
}

.dark-theme .files-table td {
    color: #ccc !important;
    border-bottom-color: #404040 !important;
}

.dark-theme .files-table tr:hover td {
    background: #3a3a3a !important;
}

.dark-theme .level-text-preview {
    background: #3a3a3a !important;
    color: #e0e0e0 !important;
}

.dark-theme .media-icon {
    background: #1a4d66 !important;
}

.dark-theme .insert-tip {
    background: #4a3f1a !important;
    border-color: #665500 !important;
    color: #ffd966 !important;
}

.dark-theme .insert-tip code {
    background: #2d2d2d !important;
    color: #ffd966 !important;
}

.dark-theme .level-info {
    background: #1a4d66 !important;
    color: #e0e0e0 !important;
}

/* Мобильная адаптация для редактора */
@media (max-width: 768px) {
    .form-container {
        padding: 15px;
    }
    
    .key-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .files-table {
        display: block;
        overflow-x: auto;
    }
    
    .files-table input[type="text"] {
        width: 200px !important;
    }
}

.dark-theme a:hover,
html.dark-theme a:hover {
    color: #99ccff !important;
}

/* Текст в таблицах старых стилей */
.dark-theme .ipbtable td,
.dark-theme .ipbtable b,
.dark-theme .row1 b,
.dark-theme .row2 b,
html.dark-theme .ipbtable td,
html.dark-theme .ipbtable b,
html.dark-theme .row1 b,
html.dark-theme .row2 b {
    color: #e0e0e0 !important;
}

.dark-theme td.row1,
.dark-theme td.row2,
html.dark-theme td.row1,
html.dark-theme td.row2 {
    color: #e0e0e0 !important;
}

/* Текст в модальных окнах */
.dark-theme .popup,
.dark-theme .popup p,
.dark-theme .popup b,
.dark-theme .popup strong,
.dark-theme .popup small,
html.dark-theme .popup,
html.dark-theme .popup p,
html.dark-theme .popup b,
html.dark-theme .popup strong,
html.dark-theme .popup small {
    color: #e0e0e0 !important;
}

.dark-theme .popup hr,
html.dark-theme .popup hr {
    border-color: #404040 !important;
}

/* Текст в форме ввода ключа */
.dark-theme form,
.dark-theme form table,
.dark-theme form td,
.dark-theme form b,
.dark-theme form .key-group label,
html.dark-theme form,
html.dark-theme form table,
html.dark-theme form td,
html.dark-theme form b,
html.dark-theme form .key-group label {
    color: #e0e0e0 !important;
}

.dark-theme .level-info,
html.dark-theme .level-info {
    background: #1a4d66 !important;
    color: #e0e0e0 !important;
}

.dark-theme .level-info strong,
html.dark-theme .level-info strong {
    color: white !important;
}

/* Текст в файловом блоке */
.dark-theme .files-block,
.dark-theme .files-block h4,
.dark-theme .files-block p,
.dark-theme .files-block label,
html.dark-theme .files-block,
html.dark-theme .files-block h4,
html.dark-theme .files-block p,
html.dark-theme .files-block label {
    color: #e0e0e0 !important;
}

.dark-theme .files-table th,
html.dark-theme .files-table th {
    background: #3a3a3a !important;
    color: #e0e0e0 !important;
}

.dark-theme .files-table td,
html.dark-theme .files-table td {
    border-bottom-color: #404040 !important;
    color: #ccc !important;
}

.dark-theme .insert-tip,
html.dark-theme .insert-tip {
    background: #4a3f1a !important;
    border-color: #665500 !important;
    color: #ffd966 !important;
}

.dark-theme .insert-tip code,
html.dark-theme .insert-tip code {
    background: #2d2d2d !important;
    color: #ffd966 !important;
}

/* Текст в сообщениях об ошибках и успехах */
.dark-theme [style*="background-color:#d4edda"],
html.dark-theme [style*="background-color:#d4edda"] {
    background-color: #1a4020 !important;
    color: #a8e0b0 !important;
}

.dark-theme [style*="background-color:#f8d7da"],
html.dark-theme [style*="background-color:#f8d7da"] {
    background-color: #4a1a1a !important;
    color: #ffb8b8 !important;
}

.dark-theme [style*="background-color:#fff3cd"],
html.dark-theme [style*="background-color:#fff3cd"] {
    background-color: #4a3f1a !important;
    color: #ffd966 !important;
}

.dark-theme [style*="background-color:#e7f3ff"],
html.dark-theme [style*="background-color:#e7f3ff"] {
    background-color: #1a3344 !important;
    color: #b8d9ff !important;
}

.dark-theme [style*="background-color:#f9f9f9"],
.dark-theme [style*="background-color:#f0f0f0"],
.dark-theme [style*="background: #f9f9f9"],
.dark-theme [style*="background: #f0f0f0"],
html.dark-theme [style*="background-color:#f9f9f9"],
html.dark-theme [style*="background-color:#f0f0f0"],
html.dark-theme [style*="background: #f9f9f9"],
html.dark-theme [style*="background: #f0f0f0"] {
    background-color: #3a3a3a !important;
    color: #e0e0e0 !important;
}

/* Текст в центрированных блоках */
.dark-theme center,
.dark-theme center b,
.dark-theme center p,
html.dark-theme center,
html.dark-theme center b,
html.dark-theme center p {
    color: #e0e0e0 !important;
}

/* Текст в таймере */
.dark-theme #gtimer,
.dark-theme #dt,
html.dark-theme #gtimer,
html.dark-theme #dt {
    color: #e0e0e0 !important;
}

/* Текст в админской панели сообщений */
.dark-theme #adm_msg_div,
.dark-theme #adm_msg_div p,
.dark-theme #adm_msg_div b,
.dark-theme #adm_msg_div th,
.dark-theme #adm_msg_div td,
html.dark-theme #adm_msg_div,
html.dark-theme #adm_msg_div p,
html.dark-theme #adm_msg_div b,
html.dark-theme #adm_msg_div th,
html.dark-theme #adm_msg_div td {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-color: #4a4a4a !important;
}

/* Текст в левых/правых блоках */
.dark-theme .left-div,
.dark-theme .center-div,
.dark-theme .right-div,
html.dark-theme .left-div,
html.dark-theme .center-div,
html.dark-theme .right-div {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

/* Текст в ссылках подсказок */
.dark-theme .hint-text a,
.dark-theme .level-content a,
html.dark-theme .hint-text a,
html.dark-theme .level-content a {
    color: #66b0ff !important;
}

.dark-theme .hint-text a:hover,
.dark-theme .level-content a:hover,
html.dark-theme .hint-text a:hover,
html.dark-theme .level-content a:hover {
    color: #99ccff !important;
}

/* Текст в статистике команд */
.dark-theme .veteran-table td,
.dark-theme .veteran-table th,
html.dark-theme .veteran-table td,
html.dark-theme .veteran-table th {
    color: #e0e0e0 !important;
}

.dark-theme .veteran-table thead tr,
html.dark-theme .veteran-table thead tr {
    background: #3a3a3a !important;
}

.dark-theme .veteran-table th,
html.dark-theme .veteran-table th {
    color: #e0e0e0 !important;
}

/* Текст в карточке игрока */
.dark-theme .player-name h2,
.dark-theme .player-name .player-group,
.dark-theme .stat-value,
.dark-theme .stat-label,
html.dark-theme .player-name h2,
html.dark-theme .player-name .player-group,
html.dark-theme .stat-value,
html.dark-theme .stat-label {
    color: #e0e0e0 !important;
}

/* Текст в подсказках профиля */
.dark-theme .social-icons ~ div,
html.dark-theme .social-icons ~ div {
    color: #aaa !important;
}
/* ===== УНИВЕРСАЛЬНОЕ ПЕРЕОПРЕДЕЛЕНИЕ ИНЛАЙН-СТИЛЕЙ ДЛЯ ТЕМНОЙ ТЕМЫ ===== */

/* Перекрываем все inline background-color */
.dark-theme [style*="background-color:white"],
.dark-theme [style*="background-color: white"],
.dark-theme [style*="background:white"],
.dark-theme [style*="background: white"],
.dark-theme [style*="background-color:#fff"],
.dark-theme [style*="background-color: #fff"],
.dark-theme [style*="background-color:#ffffff"],
.dark-theme [style*="background-color: #ffffff"],
.dark-theme [style*="background-color:#f9f9f9"],
.dark-theme [style*="background-color: #f9f9f9"],
.dark-theme [style*="background-color:#f0f0f0"],
.dark-theme [style*="background-color: #f0f0f0"],
.dark-theme [style*="background-color:#f8f9fa"],
.dark-theme [style*="background-color: #f8f9fa"],
html.dark-theme [style*="background-color:white"],
html.dark-theme [style*="background-color: white"],
html.dark-theme [style*="background:white"],
html.dark-theme [style*="background: white"],
html.dark-theme [style*="background-color:#f9f9f9"],
html.dark-theme [style*="background-color: #f9f9f9"],
html.dark-theme [style*="background-color:#f0f0f0"],
html.dark-theme [style*="background-color: #f0f0f0"] {
    background-color: #2d2d2d !important;
}

/* Перекрываем border цвет */
.dark-theme [style*="border:1px solid #ccc"],
.dark-theme [style*="border: 1px solid #ccc"],
.dark-theme [style*="border:1px solid #ddd"],
.dark-theme [style*="border: 1px solid #ddd"],
.dark-theme [style*="border:1px solid #e0e0e0"],
.dark-theme [style*="border:1px solid #eee"],
html.dark-theme [style*="border:1px solid #ccc"],
html.dark-theme [style*="border: 1px solid #ccc"],
html.dark-theme [style*="border:1px solid #ddd"],
html.dark-theme [style*="border: 1px solid #ddd"] {
    border-color: #4a4a4a !important;
}

/* Перекрываем цвет текста во всех вложенных элементах */
.dark-theme [style*="background-color:white"] *,
.dark-theme [style*="background-color: white"] *,
.dark-theme [style*="background:white"] *,
.dark-theme [style*="background: white"] *,
.dark-theme [style*="background-color:#f9f9f9"] *,
.dark-theme [style*="background-color:#f0f0f0"] *,
html.dark-theme [style*="background-color:white"] *,
html.dark-theme [style*="background-color: white"] *,
html.dark-theme [style*="background:white"] *,
html.dark-theme [style*="background: white"] * {
    color: #e0e0e0 !important;
}

/* Специально для заголовков h3 с инлайн-стилями */
.dark-theme h3[style*="color:#0D5980"],
.dark-theme h3[style*="color: #0D5980"],
.dark-theme [style*="color:#0D5980"],
.dark-theme [style*="color: #0D5980"],
html.dark-theme h3[style*="color:#0D5980"],
html.dark-theme h3[style*="color: #0D5980"] {
    color: #66b0ff !important;
}

/* Для блоков с подсказками */
.dark-theme div[style*="background-color:#fff3cd"],
.dark-theme div[style*="background-color: #fff3cd"],
html.dark-theme div[style*="background-color:#fff3cd"],
html.dark-theme div[style*="background-color: #fff3cd"] {
    background-color: #4a3f1a !important;
    color: #ffd966 !important;
}

.dark-theme div[style*="background-color:#e7f3ff"],
.dark-theme div[style*="background-color: #e7f3ff"],
html.dark-theme div[style*="background-color:#e7f3ff"],
html.dark-theme div[style*="background-color: #e7f3ff"] {
    background-color: #1a3344 !important;
    color: #b8d9ff !important;
}

.dark-theme div[style*="background-color:#d4edda"],
.dark-theme div[style*="background-color: #d4edda"],
html.dark-theme div[style*="background-color:#d4edda"],
html.dark-theme div[style*="background-color: #d4edda"] {
    background-color: #1a4020 !important;
    color: #a8e0b0 !important;
}

.dark-theme div[style*="background-color:#f8d7da"],
.dark-theme div[style*="background-color: #f8d7da"],
html.dark-theme div[style*="background-color:#f8d7da"],
html.dark-theme div[style*="background-color: #f8d7da"] {
    background-color: #4a1a1a !important;
    color: #ffb8b8 !important;
}

/* Для текста в кнопке проверки ключа */
.dark-theme input[type="submit"][style*="background:#0D5980"],
.dark-theme input[type="submit"][style*="background: #0D5980"],
html.dark-theme input[type="submit"][style*="background:#0D5980"],
html.dark-theme input[type="submit"][style*="background: #0D5980"] {
    background-color: #1a4d66 !important;
    color: white !important;
}
/* ===== ФИНАЛЬНЫЕ ПРАВИЛА ДЛЯ ТЕМНОЙ ТЕМЫ ===== */

/* Базовый цвет текста для всего body в темной теме */
.dark-theme,
.dark-theme body,
.dark-theme center,
.dark-theme center b,
.dark-theme center a,
.dark-theme center p,
.dark-theme b,
.dark-theme p,
.dark-theme span,
.dark-theme div:not([class*="swal"]),
html.dark-theme,
html.dark-theme body,
html.dark-theme center,
html.dark-theme center b,
html.dark-theme center a,
html.dark-theme center p,
html.dark-theme b,
html.dark-theme p,
html.dark-theme span,
html.dark-theme div {
    color: #e0e0e0 !important;
}

/* Специально для ссылок внутри center */
.dark-theme center a,
html.dark-theme center a {
    color: #66b0ff !important;
}

.dark-theme center a:hover,
html.dark-theme center a:hover {
    color: #99ccff !important;
}

/* Для текста "Вы не зачислены ни в одну из команд" */
.dark-theme br + br,
.dark-theme br + center,
.dark-theme br + b,
html.dark-theme br + br,
html.dark-theme br + center,
html.dark-theme br + b {
    color: #e0e0e0 !important;
}

/* Для всего контента, который выводится через echo */
.dark-theme .container *,
html.dark-theme .container * {
    color: #e0e0e0 !important;
}

/* Специально для текста "Игра уже идёт" */
.dark-theme center + br,
.dark-theme br + br + center,
.dark-theme br + br + b,
html.dark-theme center + br,
html.dark-theme br + br + center,
html.dark-theme br + br + b {
    color: #e0e0e0 !important;
}
