/* ==========================================================================
   PokerSensei Responsive Dark Architecture 2026 (Fixed Grid + Stable Dropdown)
   ========================================================================== */

:root {
    --bg-main: #090d16;
    --bg-card: #0f172a;
    --bg-elevated: #1e293b;
    --border-color: #334155;
    --border-light: #475569;
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.25);
    --accent: #38bdf8;
    --warning: #eab308;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Announcement Bar */
.top-announcement-bar {
    background: linear-gradient(90deg, #1e1b4b 0%, #311042 100%);
    border-bottom: 1px solid rgba(234, 179, 8, 0.2);
    padding: 8px 16px;
    font-size: 13px;
    text-align: center;
}
.announcement-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.announcement-content .badge {
    background: var(--warning);
    color: #000;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}
.announcement-content .cta-link {
    color: var(--warning);
    font-weight: 600;
    text-decoration: underline;
}

/* Main Header */
.main-header {
    background-color: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.brand-logo .logo-icon {
    color: var(--primary);
    font-size: 22px;
}
.brand-logo .accent-text {
    color: var(--primary);
}

/* Desktop Navigation & Seamless Dropdowns */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
    border-radius: var(--radius);
    transition: var(--transition);
}
.nav-link:hover {
    color: #fff;
    background: var(--bg-elevated);
}

.nav-dropdown {
    position: relative;
    padding-bottom: 6px; /* Невидимый мостик */
}
.dropdown-toggle {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.dropdown-toggle .arrow {
    font-size: 9px;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.nav-dropdown:hover .dropdown-toggle {
    color: #fff;
    background: var(--bg-elevated);
}
.nav-dropdown:hover .dropdown-toggle .arrow {
    transform: rotate(180deg);
}

/* Выпадающее меню без разрывов */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    padding: 8px;
    display: none;
    z-index: 2000;
}
.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: #cbd5e1;
    border-radius: var(--radius);
    transition: var(--transition);
}
.dropdown-menu a:hover {
    color: #fff;
    background: #1e293b;
    padding-left: 18px;
}
.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}
.btn-primary {
    background-color: var(--primary);
    color: #000;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 16px var(--primary-glow);
}
.btn-glow {
    background-color: var(--primary);
    color: #000;
    box-shadow: 0 0 20px var(--primary-glow);
}
.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.4);
}

/* Mobile Toggle Hamburger */
.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    transition: var(--transition);
}
.mobile-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-toggle.open span:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer Menu */
.mobile-menu {
    display: none;
    background: #0b1120;
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}
.mobile-menu.active {
    display: block;
}
.mobile-nav-group {
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}
.mobile-group-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.mobile-nav-link {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    color: #cbd5e1;
    font-weight: 500;
}
.mobile-nav-link:hover {
    color: #fff;
}

/* Main Layout & Container */
.main-content {
    flex: 1;
    padding: 32px 0 60px;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 32px;
}
.hero-section h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    color: #fff;
}
.hero-section .subtitle {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* Tool Wrapper */
.tool-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Selects & Inputs */
.custom-select {
    width: 100%;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: #fff;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.custom-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Button Groups / Presets */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pos-btn {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.pos-btn:hover {
    color: #fff;
    border-color: var(--border-light);
}
.pos-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* Stats Panel */
.matrix-stats-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 20px;
}
.stat-box {
    flex: 1;
    min-width: 140px;
}
.stat-title {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.stat-value.highlight {
    color: var(--primary);
}

/* ==========================================================================
   13x13 PREFLOP MATRIX GRID (Главная страница)
   ========================================================================== */
.matrix-container-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
}
.chart-matrix-grid {
    display: grid;
    grid-template-columns: repeat(13, minmax(36px, 1fr));
    gap: 4px;
    max-width: 680px;
    margin: 20px auto;
    user-select: none;
}
.matrix-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    transition: transform 0.1s ease, filter 0.1s ease;
    cursor: default;
}
.matrix-cell:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.cell-raise {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #000;
}
.cell-fold {
    background: #1e293b;
    color: #64748b;
}
.matrix-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 14px;
    font-size: 13px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* CTA Action Card */
.action-cta-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
}
.cta-text h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 6px;
}
.cta-text p {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.5;
}

/* SEO Article */
.seo-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    color: #cbd5e1;
    line-height: 1.7;
}
.seo-article h2 {
    color: #fff;
    font-size: 22px;
    margin-bottom: 14px;
}
.seo-article h3 {
    color: var(--accent);
    font-size: 17px;
    margin: 20px 0 8px;
}
.seo-article p {
    margin-bottom: 14px;
    font-size: 14.5px;
}

/* 4-Column Footer */
.main-footer {
    background: #060911;
    border-top: 1px solid var(--border-color);
    padding: 48px 0 0;
    font-size: 13.5px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}
.about-col .footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
}
.about-col .footer-desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}
.disclaimer-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.5;
}
.disclaimer-badge span {
    color: var(--danger);
    font-weight: 800;
    margin-right: 4px;
}
.footer-heading {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
}
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a {
    color: var(--text-muted);
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--primary);
    padding-left: 4px;
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 40px;
    padding: 18px 0;
    color: #64748b;
    font-size: 12px;
}
.bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
@media (max-width: 992px) {
    .desktop-nav {
        display: none;
    }
    .mobile-toggle {
        display: flex;
    }
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 10px 16px;
    }
    .tool-wrapper {
        padding: 16px;
    }
    .hero-section h1 {
        font-size: 22px;
    }
    .hero-section .subtitle {
        font-size: 14px;
    }
    .chart-matrix-grid {
        gap: 2px;
    }
    .matrix-cell {
        font-size: 10px;
    }
    .action-cta-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    .matrix-stats-panel {
        flex-direction: column;
    }
}


/* ==========================================================================
   POKER MATRIX 13x13 STYLES (EXACT SELECTORS)
   ========================================================================== */
.matrix-container {
    width: 100%;
    overflow-x: auto;
    padding: 10px 0;
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.poker-matrix {
    display: grid !important;
    grid-template-columns: repeat(13, 1fr) !important;
    gap: 3px !important;
    width: 100% !important;
    max-width: 650px !important;
    user-select: none;
}

.matrix-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.matrix-cell:hover {
    transform: scale(1.18);
    z-index: 10;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.matrix-cell.raise {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #000000 !important;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
}

.matrix-cell.fold {
    background-color: #1e293b !important;
    color: #64748b !important;
}

/* Легенда матрицы */
.legend-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 18px 0 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.box-legend {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.box-legend.raise {
    background: #10b981;
}

.box-legend.fold {
    background: #1e293b;
}

.legend-tip {
    width: 100%;
    text-align: center;
    font-size: 11.5px;
    color: #64748b;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .poker-matrix {
        gap: 2px !important;
        min-width: 440px; /* Горизонтальный скролл на узких телефонах */
    }
    .matrix-cell {
        font-size: 9.5px;
    }
}

/* FAQ and Structured SEO Blocks */
.seo-example-box {
    background: #0d1527;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 18px 0;
}
.seo-example-box h4 {
    color: var(--primary);
    font-size: 15px;
    margin-bottom: 8px;
}
.faq-section {
    margin-top: 32px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}
.faq-item {
    background: #0d1527;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-question {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.faq-question::-webkit-details-marker {
    display: none;
}
.faq-question::after {
    content: "+";
    font-size: 18px;
    color: var(--accent);
    font-weight: 700;
    transition: transform 0.2s;
}
details[open] .faq-question::after {
    content: "−";
    color: var(--primary);
}
.faq-answer {
    padding: 0 18px 16px;
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1.6;
}
