/* ==========================================================================
   Poker Room Rating - Main CSS
   ========================================================================== */

:root {
    --purple-600: #9333ea;
    --purple-700: #7e22ce;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-themed: #111827;
    --text-secondary-themed: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --success: #16a34a;
    --warning: #f59e0b;
    --error: #dc2626;
}

/* Dark Mode Variables */
html.dark-mode,
html[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #111827; /* Темнее для секций */
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-themed: #f3f4f6;
    --text-secondary-themed: #d1d5db;
    --border-color: #374151;
    --card-bg: #1f2937;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; scrollbar-gutter: stable; }
[id]{ scroll-margin-top: 88px; }

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background 0.3s, color 0.3s;
}

/* Prevent header layout shift (font swap) */
body > header, body > header *{font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;}
/* Typography / Content spacing (prevents "stuck" headings) */
main.container h1,
main.container h2,
main.container h3,
main.container h4 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}
main.container h1:first-child,
main.container h2:first-child,
main.container h3:first-child,
main.container h4:first-child {
    margin-top: 0;
}
main.container p {
    margin: 0 0 1rem 0;
}
main.container p + p {
    margin-top: 0.25rem;
}
main.container ul,
main.container ol {
    margin: 0 0 1rem 1.25rem;
    padding: 0;
}
main.container li { margin: 0.25rem 0; }
main.container .table-wrap { margin: 0.75rem 0 1.5rem; }
main.container table { margin: 0.75rem 0 1.5rem; }
main.container hr { margin: 2rem 0; }

/* Keep tight layouts (hero/cards) intact */
.hero h1 { margin-top: 0; }
.card > h1:first-child,
.card > h2:first-child,
.card > h3:first-child { margin-top: 0; }



/* Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
.content-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
    background: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
}

.nav-content { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }

.logo {
    display: flex;
    line-height: 0;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--purple-600);
    text-decoration: none;
}
.logo-img{height:40px;width:auto;display:block;}

/* Brand logo frame (marketplace-like alignment) */
.brand-logo-box{
  width: 150px;
  height: 56px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  box-sizing: border-box;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-logo-box picture{
  display: block;
  width: 100%;
  height: 100%;
}

.brand-logo-box img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 640px){
  .brand-logo-box{
    width: 118px;
    height: 44px;
    padding: 6px 8px;
    border-radius: 10px;
  }
}

.brand-logo-box picture{display:block;}
.brand-logo-box img{
  display:block;
  max-height: 34px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* Ensure mobile menu is never shown on desktop even if Tailwind fails */
@media (min-width: 768px){
  .mobile-menu{display:none !important;}
}
/* Slightly compact on small screens */
@media (max-width: 640px){
  .brand-logo-box{width: 120px; height: 48px; border-radius: 10px;}
  .brand-logo-box img{max-height: 30px;}
}

/* Navigation */
.nav-menu { display: flex; gap: 1.5rem; }
.nav-link { color: var(--text-secondary-themed); text-decoration: none; font-weight: 500; }
.nav-link:hover { color: var(--purple-600); }

/* Mobile Menu */
.mobile-menu-button { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 8px; border-radius: 10px; }
.mobile-menu-button:hover{background: var(--bg-secondary);}
.mobile-menu-button svg{width:24px;height:24px; display:block;}
.mobile-menu { display: none; background: var(--card-bg); border-top: 1px solid var(--border-color); }

.mobile-menu.active { display: block; }
.mobile-menu-inner{padding: .75rem 0;}
.mobile-menu a{display:block; padding:.65rem 0; text-decoration:none;}
.mobile-menu a + a{border-top:1px solid var(--border-color);}

@media (max-width: 768px) {
    .nav-menu { display: none; }
    .mobile-menu-button { display: block; }
    /* При открытии JS ставит display: block */
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; font-weight: 800; }
.hero-subtitle { font-size: 1.125rem; opacity: 0.95; color: white; }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    color: var(--text-themed);
}
.room-card { transition: transform 0.2s; position: relative; }
.room-card:hover { transform: translateY(-5px); }

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    text-align: center;
}
.btn-primary, .btn-purple { background: var(--purple-600); color: white; }
.btn-primary:hover, .btn-purple:hover { background: var(--purple-700); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-outline { background: transparent; border: 2px solid var(--purple-600); color: var(--purple-600); }

/* Theme Switch */
.theme-switch { position: relative; display: inline-block; width: 40px; height: 24px; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s; border-radius: 24px;
}
.slider:before {
    position: absolute; content: "";
    height: 16px; width: 16px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--purple-600); }
input:checked + .slider:before { transform: translateX(16px); }

/* Utility & Text */
.text-themed { color: var(--text-themed); }
.text-secondary-themed { color: var(--text-secondary-themed); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-4 { gap: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); color: var(--text-themed); }
th { font-weight: 700; background: rgba(0,0,0,0.02); }

/* Footer */
footer { background: #1f2937; color: #9ca3af; padding: 3rem 0; margin-top: 3rem; }
footer a { color: var(--purple-600); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { color: var(--purple-700); }

/* Modals */
.modal {
    display: none; position: fixed; z-index: 200;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); overflow: auto;
}
.modal-content {
    background-color: var(--card-bg); margin: 5% auto;
    padding: 0; border-radius: 1rem; width: 90%; max-width: 800px;
    position: relative; color: var(--text-themed);
}
.close-modal {
    float: right; font-size: 28px; font-weight: bold;
    color: #aaa; cursor: pointer; padding: 1rem; background: none; border: none;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-themed); }

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-themed);
    font: inherit;
}

textarea { min-height: 140px; resize: vertical; }

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--purple-600);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }

/* Anti-spam */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}


/* Content blocks */
.content { padding: 2rem 0; }
.content-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Contact */
.contact-method {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    margin: 1rem 0;
}
.contact-method .icon { font-size: 1.5rem; line-height: 1; }

/* Review helpers */
.success-box {
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-themed);
}
.success-box h3 { margin-top: 0; }

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .pros-cons { grid-template-columns: 1fr; }
}

.pros, .cons {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.pros ul, .cons ul { margin: 0.75rem 0 0; padding-left: 1.25rem; }
.pros li, .cons li { margin-bottom: 0.5rem; }


/* ==========================================================================
   SEO / Content components (breadcrumbs, TOC, tables, footer)
   ========================================================================== */

.nav-links{
  display:flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.nav-link{
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  opacity: .9;
}
.nav-link:hover{ color: var(--purple-600); opacity: 1; }
.nav-link.active{ color: var(--purple-600); opacity: 1; }

.breadcrumbs{
  font-size: .9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.breadcrumbs a{ color: var(--purple-600); text-decoration: none; }
.breadcrumbs a:hover{ text-decoration: underline; }
.breadcrumbs .sep{ margin: 0 .35rem; opacity: .8; }

.hero-row{
  display:flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.hero-logo{
  height: 64px;
  width: auto;
  display:block;
}
.hero-sub{
  margin-top: .35rem;
  color: var(--text-secondary-themed);
}
.hero-sub--rating{
  color: #fde047;
  font-weight: 600;
}
.hero-desc{
  margin-top: .75rem;
  max-width: 60ch;
}
.hero-quicklinks{
  color: rgba(255,255,255,0.86);
}
.hero-quicklinks a{
  color: rgba(255,255,255,0.95);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero-quicklinks a:hover{
  color: #ffffff;
}


.toc{
  margin-top: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}
.toc h3{ margin: 0 0 .5rem 0; font-size: 1rem; }
.toc ul{ margin: 0; padding-left: 1.2rem; }
.toc li{ margin: .25rem 0; }
.toc a{ color: var(--purple-600); text-decoration: none; }
.toc a:hover{ text-decoration: underline; }

.table-wrap{ overflow-x: auto; }
.kv-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.kv-table th,
.kv-table td{
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}
.kv-table th{
  width: 38%;
  text-align: left;
  color: var(--text-primary);
  font-weight: 700;
}
.kv-table td{ color: var(--text-secondary); }

.note{
  margin-top: 1rem;
  font-size: .95rem;
  color: var(--text-secondary-themed);
}
.note a{ color: var(--purple-600); text-decoration: none; }
.note a:hover{ text-decoration: underline; }

.related-links{
  list-style: none;
  padding-left: 0;
  margin: .5rem 0 0 0;
}
.related-links li{
  margin: .4rem 0;
}
.related-links a{
  color: var(--purple-600);
  text-decoration: none;
  font-weight: 600;
}
.related-links a:hover{ text-decoration: underline; }

.faq{
  display: grid;
  gap: .75rem;
}
.faq-item{
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: .5rem .75rem;
  background: var(--bg-secondary);
}
.faq-item summary{
  cursor: pointer;
  font-weight: 700;
  color: var(--text-primary);
  list-style: none;
}
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-answer{
  margin-top: .5rem;
  color: var(--text-secondary);
}

.footer-grid{
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 2rem 0 1rem;
}
@media (min-width: 900px){
  .footer-grid{ grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-title{ font-size: 1rem; margin: 0 0 .75rem; }
.footer-links{ list-style: none; padding: 0; margin: 0; }
.footer-links li{ margin: .4rem 0; }
.footer-links a{
  color: var(--text-secondary-themed);
  text-decoration: none;
}
.footer-links a:hover{ color: var(--purple-600); text-decoration: underline; }
.footer-text{ color: var(--text-secondary-themed); font-size: .9rem; margin: .5rem 0; }
.footer-bottom{
  border-top: 1px solid var(--border-color);
  padding: 1rem 0 2rem;
  color: var(--text-secondary-themed);
  font-size: .9rem;
}


/* Accessibility */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}


/* Image optimization: keep <picture> wrappers layout-neutral */
picture{display:inline-block;}
picture img{display:block;}


/* --- UI FIX: align rake table & center useful links --- */
#rake table tbody td{vertical-align:middle;}
#rake table tbody td:not(:first-child){text-align:center;}
#rake table tbody td:not(:first-child) .inline-flex,
#rake table tbody td:not(:first-child) span{margin-left:auto;margin-right:auto;}



/* Rake comparison table: stabilize first column and cell alignment */
#rake table td:first-child{
  min-width: 260px;
}
#rake table td:first-child .brand-cell{
  display: flex;
  align-items: center;
  gap: 12px;
}
#rake table td:first-child .brand-cell .brand-name{
  white-space: nowrap;
}




/* Keep brand titles readable and prevent odd wrapping in tight rows */
.brand-title{
  line-height: 1.15;
}
@media (max-width: 480px){
  .brand-title{
    font-size: 16px;
  }
}




/* Link contrast fixes */
.hero a{
  color: rgba(255,255,255,0.92);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero a:hover{ color:#ffffff; }
.hero a:visited{ color: rgba(255,255,255,0.92); }

footer .logo-img{ height:40px; }
.footer-links a{ color: #cbd5e1; }
.footer-links a:hover{ color:#ffffff; }

/* Reviews block (brand pages) */
.brand-reviews .subtext{ margin-top: .25rem; color: var(--text-secondary-themed); }
.reviews-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.review-card{
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  background: var(--card-bg);
}
.review-head{ display:flex; gap: .75rem; align-items:center; }
.review-avatar{
  width: 40px; height: 40px;
  border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  font-weight: 800;
  background: rgba(124,58,237,0.12);
  color: var(--purple-600);
}
.review-name{ font-weight: 700; line-height: 1.1; }
.review-meta{ font-size: .85rem; color: var(--text-secondary-themed); margin-top: .125rem; }
.review-stars{ margin-top: .5rem; letter-spacing: 1px; color: #f59e0b; }
.review-text{ margin-top: .5rem; color: var(--text-primary); }

@media (max-width: 900px){
  .reviews-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .reviews-grid{ grid-template-columns: 1fr; }
}

/* --- Fixes: navigation spacing + logo normalization + rake table --- */
.space-x-6 > :not([hidden]) ~ :not([hidden]){ margin-left: 1.5rem; }

.brand-logo-box{ overflow: hidden; }
.brand-logo-box img{
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.rake-table .brand-logo-box{
  width: 84px;
  height: 44px;
  border-radius: 10px;
}

.rake-table td:first-child{
  width: 320px;
}

/* ui-fixes */
.footer-brand-text{display:none!important;}


/* Layout safety */
img { max-width: 100%; height: auto; }
html, body { overflow-x: hidden; }


/* Go pages */
.cta-row{display:flex;gap:12px;justify-content:center;align-items:center;flex-wrap:wrap;margin-top:1rem;}


/* Mobile: hide hero trust badges to reduce above-the-fold height */
@media (max-width: 767px){
  .trust-row{display:none !important;}
}
