/* ============== Тогуз коргоол · Авторский UI в стиле игры ==============
   Палитра: тёмное дерево + золото + терракота + кость
   Идея: степной премиум, кыргызский орнамент, доска и коргоолы (шарики)
*/
:root {
    /* Палитра под Тогуз коргоол */
    --wood-darkest: #1a100a;
    --wood-dark: #2b1810;
    --wood: #3d2418;
    --wood-light: #5c3a25;
    --gold: #d4a017;
    --gold-light: #f0c14b;
    --gold-dark: #b8860b;
    --terracotta: #c97954;
    --crimson: #8b3a1f;
    --ivory: #faf3e0;
    --cream: #f5e9cf;
    --parchment: #f0e2c2;
    --text-dark: #2a1f15;
    --text-muted: #7a6850;

    /* Поверхности */
    --bg-app: var(--cream);
    --bg-content: linear-gradient(180deg, #faf6ec 0%, #f0e2c2 100%);
    --card-bg: #fffdf6;
    --card-shadow: 0 4px 20px rgba(43, 24, 16, 0.08), 0 1px 3px rgba(43, 24, 16, 0.05);
    --card-shadow-hover: 0 12px 32px rgba(43, 24, 16, 0.16);
    --card-border: 1px solid rgba(212, 160, 23, 0.18);

    /* Градиенты */
    --gradient-gold: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
    --gradient-warm: linear-gradient(135deg, #c97954 0%, #8b3a1f 100%);
    --gradient-wood: linear-gradient(180deg, #2b1810 0%, #3d2418 50%, #1a100a 100%);
    --gradient-sunset: linear-gradient(135deg, #f0c14b 0%, #c97954 60%, #8b3a1f 100%);
    --gradient-emerald: linear-gradient(135deg, #4a7c59 0%, #2d5a3d 100%);
    --gradient-ivory: linear-gradient(135deg, #faf3e0 0%, #e8d9b5 100%);

    --radius: 14px;
    --radius-sm: 8px;
    --sidebar-w: 270px;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Manrope', 'Inter', -apple-system, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: 'Playfair Display', 'Manrope', serif;
    letter-spacing: -0.01em;
}

/* ============== Кыргызский орнамент SVG (паттерн фона) ============== */
.ornament-bg {
    position: relative;
    overflow: hidden;
}
.ornament-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4a017' stroke-width='1' opacity='0.08'%3E%3Cpath d='M40 8 L52 20 L40 32 L28 20 Z'/%3E%3Cpath d='M40 48 L52 60 L40 72 L28 60 Z'/%3E%3Cpath d='M8 40 L20 28 L20 52 Z'/%3E%3Cpath d='M72 40 L60 28 L60 52 Z'/%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
    pointer-events: none;
}

/* ============== Layout ============== */
.app-layout { min-height: 100vh; background: var(--bg-content); }

/* ============== Sidebar — тёмное дерево с золотым орнаментом ============== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--gradient-wood);
    color: var(--cream);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 3px solid var(--gold-dark);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
}
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4a017' stroke-width='1' opacity='0.06'%3E%3Cpath d='M30 5 L40 15 L30 25 L20 15 Z'/%3E%3Cpath d='M5 30 L15 20 L15 40 Z'/%3E%3Cpath d='M55 30 L45 20 L45 40 Z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.25);
    margin-bottom: 18px;
    text-decoration: none;
}
.sidebar-brand-icon {
    width: 50px; height: 50px;
    border-radius: 14px;
    background: var(--gradient-gold);
    display: grid; place-items: center;
    box-shadow: 0 6px 18px rgba(212, 160, 23, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    border: 1px solid var(--gold-light);
}
.sidebar-brand-title { color: var(--gold-light); font-weight: 700; font-size: 1.1rem; line-height: 1.15; font-family: 'Playfair Display', serif; }
.sidebar-brand-sub { color: rgba(245, 233, 207, 0.65); font-size: 0.72rem; letter-spacing: 0.05em; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-section { color: rgba(212, 160, 23, 0.6); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; padding: 14px 14px 8px; font-weight: 600; }

.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    color: rgba(250, 243, 224, 0.78);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.93rem;
    font-weight: 500;
    transition: all 0.18s;
    position: relative;
}
.sidebar-link:hover { background: rgba(212, 160, 23, 0.1); color: var(--ivory); }
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(212, 160, 23, 0.22), rgba(212, 160, 23, 0.05));
    color: var(--gold-light);
    box-shadow: inset 3px 0 0 var(--gold);
}
.sidebar-link i { font-size: 1.1rem; width: 22px; text-align: center; opacity: 0.85; }
.sidebar-link.active i { opacity: 1; color: var(--gold); }

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(212, 160, 23, 0.25);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--gradient-warm);
    display: grid; place-items: center;
    color: var(--ivory); font-weight: 700;
    border: 2px solid var(--gold);
}
.sidebar-user { flex: 1; line-height: 1.2; }
.sidebar-user-name { color: var(--ivory); font-size: 0.86rem; font-weight: 600; }
.sidebar-user-role { color: rgba(212, 160, 23, 0.7); font-size: 0.72rem; text-transform: capitalize; }
.sidebar-logout { color: rgba(250, 243, 224, 0.55); text-decoration: none; font-size: 1.15rem; transition: color 0.15s; }
.sidebar-logout:hover { color: var(--gold-light); }

/* ============== Main ============== */
.main { margin-left: var(--sidebar-w); padding: 30px 38px 60px; min-width: 0; position: relative; min-height: 100vh; }
.main::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 280px; height: 280px;
    background-image: url("data:image/svg+xml,%3Csvg width='280' height='280' viewBox='0 0 280 280' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4a017' stroke-width='1.2' opacity='0.07'%3E%3Ccircle cx='140' cy='140' r='130'/%3E%3Ccircle cx='140' cy='140' r='100'/%3E%3Cpath d='M140 30 L170 70 L140 110 L110 70 Z'/%3E%3Cpath d='M140 170 L170 210 L140 250 L110 210 Z'/%3E%3Cpath d='M30 140 L70 110 L70 170 Z'/%3E%3Cpath d='M250 140 L210 110 L210 170 Z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.7;
}
.main > * { position: relative; z-index: 1; }

.page-header {
    display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px;
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.18);
    position: relative;
    z-index: 50;
}

.dropdown-menu { z-index: 1100; }
.dropdown.show { position: relative; z-index: 1100; }
.page-title { font-size: 1.75rem; font-weight: 700; margin: 0; color: var(--wood-dark); font-family: 'Playfair Display', serif; }
.page-subtitle { color: var(--text-muted); margin: 6px 0 0; font-size: 0.92rem; }

/* ============== Cards ============== */
.card-x {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    border: var(--card-border);
    transition: all 0.22s;
    overflow: hidden;
}
.card-x:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.card-x-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.15);
    font-weight: 600;
    background: linear-gradient(180deg, #fffdf6, #faf3e0);
    color: var(--wood-dark);
    display: flex; justify-content: space-between; align-items: center;
}
.card-x-body { padding: 22px; }

/* Stat-карточки — стилизованные под коргоолы (шарики на доске) */
.stat-card {
    border-radius: var(--radius);
    padding: 24px;
    color: var(--ivory);
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.25s;
    border: 1px solid rgba(212, 160, 23, 0.3);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.stat-card::after {
    content: '';
    position: absolute;
    right: -30px; bottom: -30px;
    width: 130px; height: 130px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    border-radius: 50%;
}
.stat-card-icon {
    position: absolute;
    right: 18px; top: 18px;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: grid; place-items: center;
    font-size: 1.5rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
}
.stat-card-label { font-size: 0.78rem; opacity: 0.92; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-card-value { font-size: 2.5rem; font-weight: 800; line-height: 1.1; margin: 8px 0 6px; font-family: 'Playfair Display', serif; }
.stat-card-link { color: rgba(255, 255, 255, 0.92); text-decoration: none; font-size: 0.84rem; position: relative; z-index: 2; }
.stat-card-link:hover { color: #fff; }

.bg-grad-primary { background: var(--gradient-gold); }
.bg-grad-success { background: var(--gradient-emerald); }
.bg-grad-warm { background: var(--gradient-warm); }
.bg-grad-cool { background: var(--gradient-sunset); }
.bg-grad-gold { background: linear-gradient(135deg, #f0c14b 0%, #d4a017 60%, #b8860b 100%); color: var(--wood-dark); }
.bg-grad-gold .stat-card-label, .bg-grad-gold .stat-card-link { color: var(--wood-dark); }

/* ============== Buttons ============== */
.btn { font-weight: 600; border-radius: var(--radius-sm); padding: 0.55rem 1.05rem; transition: all 0.18s; border: 1px solid transparent; letter-spacing: 0.01em; }
.btn-primary { background: var(--gradient-gold); border: 1px solid var(--gold-dark); color: var(--wood-darkest); }
.btn-primary:hover { background: var(--gradient-gold); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212, 160, 23, 0.4); color: var(--wood-darkest); border-color: var(--gold); }
.btn-success { background: var(--gradient-emerald); border: 1px solid #2d5a3d; color: #fff; }
.btn-success:hover { background: var(--gradient-emerald); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(74, 124, 89, 0.4); color: #fff; }
.btn-danger { background: var(--gradient-warm); border: 1px solid var(--crimson); color: #fff; }
.btn-danger:hover { background: var(--gradient-warm); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(139, 58, 31, 0.4); color: #fff; }
.btn-outline-primary { color: var(--wood-dark); border-color: var(--gold-dark); background: transparent; }
.btn-outline-primary:hover { background: var(--gold); color: var(--wood-darkest); border-color: var(--gold); }
.btn-outline-secondary { color: var(--text-muted); border-color: rgba(122, 104, 80, 0.4); background: transparent; }
.btn-outline-secondary:hover { background: rgba(122, 104, 80, 0.1); color: var(--wood-dark); border-color: var(--wood-light); }
.btn-outline-success { color: #2d5a3d; border-color: #4a7c59; background: transparent; }
.btn-outline-success:hover { background: var(--gradient-emerald); color: #fff; }
.btn-outline-danger { color: var(--crimson); border-color: var(--crimson); background: transparent; }
.btn-outline-danger:hover { background: var(--crimson); color: #fff; }
.btn-outline-warning { color: var(--gold-dark); border-color: var(--gold-dark); background: transparent; }
.btn-outline-warning:hover { background: var(--gold); color: var(--wood-darkest); }
.btn-warning { background: var(--gold); border-color: var(--gold-dark); color: var(--wood-darkest); }
.btn-warning:hover { background: var(--gold-light); color: var(--wood-darkest); }

.btn-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn-sm { padding: 0.32rem 0.72rem; font-size: 0.85rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1.05rem; }

/* ============== Tables ============== */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table-modern thead th {
    background: linear-gradient(180deg, #f5e9cf 0%, #ead9b3 100%);
    color: var(--wood-dark);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 18px;
    border-bottom: 2px solid var(--gold-dark);
    text-align: left;
}
.table-modern tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.12);
    font-size: 0.94rem;
    vertical-align: middle;
}
.table-modern tbody tr { transition: background 0.12s; }
.table-modern tbody tr:hover { background: rgba(212, 160, 23, 0.06); }
.table-modern tbody tr:last-child td { border-bottom: none; }

.medal { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 700; font-size: 0.86rem; box-shadow: 0 2px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.4); }
.medal-gold { background: linear-gradient(135deg, #fde047, #d4a017); color: var(--wood-darkest); border: 2px solid var(--gold-dark); }
.medal-silver { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #1e293b; border: 2px solid #94a3b8; }
.medal-bronze { background: linear-gradient(135deg, #d4a574, #8b4513); color: #fff; border: 2px solid #8b4513; }

/* ============== Badges ============== */
.badge-soft {
    background: rgba(212, 160, 23, 0.14);
    color: var(--wood-dark);
    font-weight: 600;
    padding: 0.38em 0.75em;
    border-radius: 999px;
    font-size: 0.78rem;
    display: inline-block;
    border: 1px solid rgba(212, 160, 23, 0.25);
}
.badge-soft-success { background: rgba(74, 124, 89, 0.14); color: #2d5a3d; border-color: rgba(74, 124, 89, 0.3); }
.badge-soft-warning { background: rgba(240, 193, 75, 0.2); color: var(--wood-dark); border-color: rgba(212, 160, 23, 0.35); }
.badge-soft-info { background: rgba(201, 121, 84, 0.15); color: var(--crimson); border-color: rgba(201, 121, 84, 0.3); }
.badge-soft-danger { background: rgba(139, 58, 31, 0.12); color: var(--crimson); border-color: rgba(139, 58, 31, 0.3); }
.badge-soft-secondary { background: rgba(122, 104, 80, 0.12); color: var(--text-muted); border-color: rgba(122, 104, 80, 0.25); }

/* ============== Forms ============== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(122, 104, 80, 0.25);
    padding: 0.6rem 0.9rem;
    background: #fffdf6;
    color: var(--text-dark);
    transition: all 0.18s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.18);
    background: #fff;
}
.form-label { font-weight: 600; color: var(--wood-dark); font-size: 0.88rem; margin-bottom: 0.4rem; }

/* ============== Alerts ============== */
.alert-soft {
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-weight: 500;
    border-left: 4px solid;
    background: #fffdf6;
}
.alert-soft.alert-success { background: rgba(74, 124, 89, 0.1); color: #2d5a3d; border-color: #4a7c59; }
.alert-soft.alert-danger { background: rgba(139, 58, 31, 0.1); color: var(--crimson); border-color: var(--crimson); }
.alert-soft.alert-warning { background: rgba(212, 160, 23, 0.12); color: var(--wood-dark); border-color: var(--gold); }
.alert-soft.alert-info { background: rgba(201, 121, 84, 0.1); color: var(--crimson); border-color: var(--terracotta); }

/* ============== Login ============== */
.auth-bg {
    min-height: 100vh;
    background: var(--gradient-wood);
    display: grid; place-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4a017' stroke-width='1.5' opacity='0.08'%3E%3Cpath d='M60 10 L80 30 L60 50 L40 30 Z'/%3E%3Cpath d='M60 70 L80 90 L60 110 L40 90 Z'/%3E%3Cpath d='M10 60 L30 40 L30 80 Z'/%3E%3Cpath d='M110 60 L90 40 L90 80 Z'/%3E%3Ccircle cx='60' cy='60' r='5'/%3E%3Ccircle cx='60' cy='60' r='15'/%3E%3C/g%3E%3C/svg%3E");
}
/* Декоративные «коргоолы» — шарики */
.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(212, 160, 23, 0.18), transparent 30%),
                radial-gradient(circle at 80% 70%, rgba(201, 121, 84, 0.15), transparent 30%),
                radial-gradient(circle at 50% 90%, rgba(212, 160, 23, 0.1), transparent 25%);
    pointer-events: none;
}

.auth-card {
    width: 100%; max-width: 440px;
    background: var(--ivory);
    border-radius: 22px;
    padding: 40px 36px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 160, 23, 0.3);
    position: relative;
    z-index: 1;
    border: 1px solid var(--gold-light);
}
.auth-card::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(212, 160, 23, 0.35);
    border-radius: 16px;
    pointer-events: none;
}
.auth-logo {
    width: 88px; height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--gradient-gold);
    display: grid; place-items: center;
    box-shadow: 0 10px 30px rgba(212, 160, 23, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.3);
    border: 3px solid var(--gold-light);
    position: relative;
}

/* ============== Брендовый SVG-логотип (доска Тогуз коргоол) ============== */
.brand-svg { width: 28px; height: 28px; }
.brand-svg-lg { width: 56px; height: 56px; }
.brand-svg .hole { fill: var(--wood-darkest); }
.brand-svg .ball { fill: var(--gold-light); }
.brand-svg .kazan { fill: var(--wood-dark); stroke: var(--gold); stroke-width: 1.5; }

/* ============== Round / Match cards ============== */
.match-card {
    background: var(--card-bg);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 56px 1fr auto 1fr 90px;
    align-items: center;
    gap: 14px;
    transition: all 0.18s;
    position: relative;
    overflow: hidden;
}
.match-card:hover { border-color: var(--gold); box-shadow: 0 6px 18px rgba(212, 160, 23, 0.15); transform: translateX(2px); }
.match-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity 0.18s;
}
.match-card:hover::before { opacity: 1; }

.match-board {
    font-weight: 700;
    color: var(--gold-dark);
    font-size: 0.72rem;
    text-align: center;
    background: var(--gradient-ivory);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
    border: 1px solid rgba(212, 160, 23, 0.3);
    line-height: 1.1;
}
.match-board strong { display: block; font-size: 1.4rem; color: var(--wood-dark); margin-top: 2px; font-family: 'Playfair Display', serif; }
.match-player { font-weight: 600; color: var(--wood-dark); }
.match-player.left { text-align: right; }
.match-vs { font-weight: 700; color: var(--gold-dark); font-style: italic; font-family: 'Playfair Display', serif; }
.match-result { font-weight: 700; text-align: center; min-width: 90px; }

.round-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.round-tab {
    padding: 9px 18px;
    background: var(--card-bg);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.18s;
}
.round-tab:hover { border-color: var(--gold); color: var(--gold-dark); transform: translateY(-1px); }
.round-tab.active { background: var(--gradient-gold); color: var(--wood-darkest); border-color: var(--gold-dark); box-shadow: 0 4px 12px rgba(212, 160, 23, 0.35); }

/* ============== Декоративные «коргоолы» ============== */
.korgool-row {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.korgool {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--gradient-gold);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.4);
    display: inline-block;
}

/* ============== Misc ============== */
.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(212, 160, 23, 0.4), transparent); margin: 18px 0; }
.text-muted-2 { color: var(--text-muted); }
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3.5rem; opacity: 0.4; color: var(--gold-dark); }

.breadcrumb-link { color: var(--text-muted); text-decoration: none; font-size: 0.86rem; transition: color 0.15s; }
.breadcrumb-link:hover { color: var(--gold-dark); }

.text-primary { color: var(--gold-dark) !important; }
.text-warning { color: var(--gold-dark) !important; }
.text-success { color: #2d5a3d !important; }
.text-danger { color: var(--crimson) !important; }
.text-info { color: var(--terracotta) !important; }

a { color: var(--gold-dark); }
a:hover { color: var(--wood-dark); }

code { background: var(--parchment); color: var(--wood-dark); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(212, 160, 23, 0.2); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(212, 160, 23, 0.05); }
::-webkit-scrollbar-thumb { background: rgba(212, 160, 23, 0.4); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

@media (max-width: 992px) {
    .sidebar { width: 78px; }
    .sidebar-brand-title, .sidebar-brand-sub, .sidebar-section, .sidebar-user, .sidebar-link span { display: none; }
    .sidebar-link { justify-content: center; }
    .sidebar-brand { justify-content: center; padding-bottom: 18px; }
    .sidebar-footer .sidebar-user { display: none; }
    .main { margin-left: 78px; padding: 22px; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.35s ease; }

@keyframes drop {
    0% { transform: translateY(-20px); opacity: 0; }
    60% { transform: translateY(4px); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}
.drop-in { animation: drop 0.5s ease; }

/* ============== Страница правил — стилизация ============== */
.rules-hero {
    background: var(--gradient-wood);
    color: var(--ivory);
    border-radius: var(--radius);
    padding: 36px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gold-dark);
}
.rules-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4a017' stroke-width='1' opacity='0.1'%3E%3Cpath d='M50 10 L65 25 L50 40 L35 25 Z'/%3E%3Cpath d='M50 60 L65 75 L50 90 L35 75 Z'/%3E%3Cpath d='M10 50 L25 35 L25 65 Z'/%3E%3Cpath d='M90 50 L75 35 L75 65 Z'/%3E%3C/g%3E%3C/svg%3E");
}
.rules-hero > * { position: relative; z-index: 1; }
.rules-hero h1 { color: var(--gold-light); font-size: 2.4rem; margin-bottom: 12px; font-family: 'Playfair Display', serif; }
.rules-hero p { color: rgba(245, 233, 207, 0.85); font-size: 1.05rem; max-width: 720px; }

.rule-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    position: relative;
}
.rule-card h2 {
    color: var(--wood-dark);
    font-size: 1.5rem;
    margin: 0 0 16px;
    padding-left: 18px;
    border-left: 4px solid var(--gold);
}
.rule-card h3 { color: var(--wood); font-size: 1.15rem; margin: 22px 0 10px; }
.rule-card p, .rule-card li { line-height: 1.7; color: var(--text-dark); }
.rule-card ol, .rule-card ul { padding-left: 22px; }
.rule-card li { margin-bottom: 6px; }
.rule-card strong { color: var(--wood-dark); }

/* Доска Тогуз коргоол — SVG визуализация */
.toguz-board {
    background: linear-gradient(180deg, #5c3a25 0%, #3d2418 100%);
    border-radius: 14px;
    padding: 18px;
    margin: 20px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 2px solid var(--gold-dark);
}

.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 20px 0; }
.fact-tile {
    background: var(--gradient-ivory);
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(212, 160, 23, 0.3);
    text-align: center;
}
.fact-tile-icon { font-size: 2rem; color: var(--gold-dark); margin-bottom: 6px; }
.fact-tile-value { font-size: 1.4rem; font-weight: 700; color: var(--wood-dark); font-family: 'Playfair Display', serif; }
.fact-tile-label { font-size: 0.84rem; color: var(--text-muted); margin-top: 4px; }
