@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: local('Inter');
}

:root {
    --color-primary: #4f46e5;
    --color-primary-dark: #4338ca;
    --color-accent: #f59e0b;
    --color-success: #16a34a;
    --color-bg: #f7f7fb;
    --color-surface: #ffffff;
    --color-text: #16162a;
    --color-text-muted: #667085;
    --color-border: #e5e7eb;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
    --max-width: 1080px;
}

html[data-theme="dark"] {
    --color-bg: #12121c;
    --color-surface: #1c1c2e;
    --color-text: #ececf5;
    --color-text-muted: #9a97b0;
    --color-border: #34344a;
    --color-primary-light: #a5b4fc;
}
html[data-theme="dark"] .lang-switcher-toggle:hover,
html[data-theme="dark"] .ranking-tab:hover,
html[data-theme="dark"] .casino-card-media { background: #292945; }

html[data-theme="dark"] .main-nav a { color: var(--color-primary-light); }
html[data-theme="dark"] .main-nav a:hover { color: #fff; }

html { transition: background-color 0.15s ease, color 0.15s ease; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { max-width: 100vw; overflow-x: hidden; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    margin: 0;
    color: var(--color-text);
    line-height: 1.6;
    background: var(--color-bg);
    font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.review-content a, .blog-content a { text-decoration: underline !important; text-underline-offset: 2px; }
.review-content a:hover, .blog-content a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.logo { font-weight: 800; font-size: 1.15rem; color: var(--color-text); display: inline-flex; align-items: center; }
.logo:hover { text-decoration: none; }
.site-logo-img { max-height: 76px; width: auto; display: block; }
.site-logo-dark { display: none; }
html[data-theme="dark"] .site-logo-light { display: none; }
html[data-theme="dark"] .site-logo-dark { display: block; }
.header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.main-nav { display: flex; gap: 16px; font-weight: 600; font-size: 0.9rem; flex-wrap: wrap; }
.lang-flag { font-style: normal; }
.lang-switcher-toggle {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-text);
}
.lang-switcher-toggle:hover { text-decoration: none; background: #eceaff; }
.lang-switcher-menu { right: 0; left: auto; min-width: 160px; max-height: 320px; overflow-y: auto; }
.lang-link.active { color: var(--color-primary); font-weight: 700; }

.header-auth-links { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.header-auth-links a { color: var(--color-text); }
.header-auth-links a:hover { color: var(--color-primary); }
.header-auth-username { color: var(--color-text-muted); font-weight: 600; }
.header-auth-logout { color: var(--color-text-muted) !important; font-weight: 400; }
.header-auth-register {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff !important;
}
.header-auth-register:hover { background: var(--color-primary-dark); }

/* Hamburger */
.hamburger-btn {
    display: none;
    background: none; border: none; cursor: pointer; padding: 6px;
    width: 34px; height: 34px; align-items: center; justify-content: center;
}
.hamburger-icon {
    display: block; width: 20px; height: 2px; background: var(--color-text); position: relative;
    transition: background 0.2s;
}
.hamburger-icon::before, .hamburger-icon::after {
    content: ''; display: block; width: 20px; height: 2px; background: var(--color-text);
    position: absolute; left: 0; transition: transform 0.2s;
}
.hamburger-icon::before { top: -6px; }
.hamburger-icon::after { top: 6px; }
.hamburger-btn[aria-expanded="true"] .hamburger-icon { background: transparent; }
.hamburger-btn[aria-expanded="true"] .hamburger-icon::before { top: 0; transform: rotate(45deg); }
.hamburger-btn[aria-expanded="true"] .hamburger-icon::after { top: 0; transform: rotate(-45deg); }

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px 14px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}
.mobile-nav:not([hidden]) { display: flex; }
.mobile-nav a {
    display: block; padding: 10px 12px; font-weight: 600; font-size: 0.9rem;
    color: var(--color-text); border-radius: var(--radius-sm);
}
.mobile-nav a:hover { background: var(--color-bg); text-decoration: none; }
.mobile-nav .nav-dropdown { width: 100%; }
.mobile-nav .nav-dropdown-menu {
    position: static; box-shadow: none; border: none; margin: 0; padding: 0 0 0 16px;
    background: transparent; min-width: 0;
}
.mobile-nav .nav-dropdown-menu a { font-weight: 500; padding: 8px 12px; }

.header-controls { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--color-bg);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--color-text);
}
.theme-toggle:hover { background: #eceaff; }
html[data-theme="dark"] .theme-toggle:hover { background: #292945; }
.theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: inline; }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle { display: inline-flex; align-items: center; gap: 4px; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    padding: 6px 0;
    z-index: 50;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 9px 16px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--color-bg); text-decoration: none; }

/* Breadcrumb */
.breadcrumb { max-width: var(--max-width); margin: 16px auto 0; padding: 0 20px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; font-size: 0.85rem; color: var(--color-text-muted); }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--color-border); }
.breadcrumb li[aria-current="page"] { color: var(--color-text); font-weight: 600; }

main { max-width: var(--max-width); margin: 0 auto; padding: 24px 20px 64px; }

/* Homepage */
.home-hero { padding: 12px 0 28px; }
.home-hero h1 { font-size: 1.75rem; margin: 0 0 8px; }
.home-hero p { color: var(--color-text-muted); margin: 0; font-size: 1.02rem; }

.ranking-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ranking-tab {
    padding: 8px 16px; border-radius: 999px; background: var(--color-surface);
    border: 1px solid var(--color-border); color: var(--color-text-muted); font-weight: 600; font-size: 0.88rem;
}
.ranking-tab:hover { text-decoration: none; background: #eceaff; }
.ranking-tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.filters-bar {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px;
}
.filters-bar .search-input, .filters-bar select {
    padding: 9px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    font-size: 0.9rem; min-height: 42px; flex: 1 1 160px; max-width: 100%; box-sizing: border-box;
}
.filters-bar button {
    background: var(--color-primary); color: #fff; border: none; padding: 9px 18px;
    border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; min-height: 42px;
}
.filters-bar button:hover { background: var(--color-primary-dark); }
.clear-filters { display: inline-block; margin-bottom: 16px; font-size: 0.85rem; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pagination-page, .pagination-arrow {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 8px;
    border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem;
    text-decoration: none; color: var(--color-text); border: 1px solid var(--color-border);
    background: var(--color-surface); transition: background .15s, border-color .15s;
}
.pagination-page:hover, .pagination-arrow:hover:not(.disabled) {
    background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.pagination-page.active {
    background: var(--color-primary); color: #fff; border-color: var(--color-primary);
    pointer-events: none;
}
.pagination-arrow.disabled { opacity: .35; pointer-events: none; }
.pagination-ellipsis { display: inline-flex; align-items: center; min-width: 24px; justify-content: center; color: var(--color-text-muted); font-size: 0.9rem; }

.casino-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .casino-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .casino-grid { grid-template-columns: repeat(3, 1fr); } }

.casino-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    color: inherit;
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid var(--color-border);
}
.casino-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.casino-card-media { position: relative; background: #eceaff; aspect-ratio: 3 / 2; }
.casino-card-media img { width: 100%; height: 100%; object-fit: cover; }
.casino-card-media-logo { display: flex; align-items: center; justify-content: center; padding: 20px; }
.casino-card-media-logo img { width: auto; height: auto; max-width: 80%; max-height: 80%; object-fit: contain; }
.casino-card-body { padding: 16px; }
.casino-card h2 { font-size: 1.05rem; margin: 0 0 8px; }
.user-rating { display: block; font-size: 0.82rem; color: var(--color-text-muted); margin-top: 6px; }

/* Karta zamknietego kasyna: czerwony akcent + wygaszona grafika */
.casino-card--closed { border-color: #f0a3a3; }
.casino-card--closed .casino-card-media { background: #fef2f2; }
.casino-card--closed .casino-card-media img { filter: grayscale(0.35); opacity: 0.85; }
.closed-badge--card {
    font-size: 0.62rem;
    padding: 3px 9px;
    margin: 0 0 8px;
}

/* Score badge */
.score-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    background: #166534;
    color: #fff;
    font-weight: 800;
    font-size: 1.3rem;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
}
.score-badge span { font-size: 0.85rem; font-weight: 700; color: #fff; }
.score-badge.small { font-size: 0.85rem; padding: 4px 10px; }

/* Review page — above the fold */
.review-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}
@media (min-width: 768px) { .review-hero { grid-template-columns: 1.1fr 1fr; align-items: center; } }
.review-hero img, .screenshot-pending {
    border-radius: var(--radius-md);
}
.screenshot-pending {
    background: var(--color-bg);
    padding: 48px 20px;
    text-align: center;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
}
.review-hero-logo-media {
    max-width: 220px;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}
.review-hero-info h1 { font-size: 1.6rem; margin: 0 0 10px; }
.cta-button {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    margin-top: 12px;
}
.cta-button:hover { background: var(--color-primary-dark); text-decoration: none; }
.cta-button--disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* Wiersz z wynikiem + przyciskiem CTA */
.review-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.review-hero-actions .cta-button,
.review-hero-actions .score-badge { margin-top: 0; }

/* Kasyno zamkniete: subtelny czerwony akcent zamiast krzykliwej ramki */
.review-hero--closed {
    border: 1.5px solid #f0a3a3;
    background:
        linear-gradient(180deg, rgba(220, 38, 38, 0.05), rgba(220, 38, 38, 0.015)),
        var(--color-surface);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.06);
}
.closed-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    background: #dc2626;
    color: #fff;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    margin: 0 0 12px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}
.closed-notice {
    margin-top: 14px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
}
.score-badge--muted {
    background: #9ca3af;
    box-shadow: none;
}

.review-date {
    margin: 10px 0 0;
    font-size: 0.78rem;
    color: var(--color-muted);
}
.review-date time { font-variant-numeric: tabular-nums; }

.facts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 28px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    table-layout: fixed;
    contain: layout style;
}
.facts-table th, .facts-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; word-wrap: break-word; }
.facts-table tr:last-child th, .facts-table tr:last-child td { border-bottom: none; }
.facts-table th { width: 42%; color: var(--color-text-muted); font-weight: 600; }

/* Blog layout — in critical CSS to prevent CLS */
.blog-post-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius-md); margin: 16px 0; aspect-ratio: 1024 / 572; }
.blog-layout { display: grid; grid-template-columns: 1fr 240px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .blog-layout { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .blog-post-cover { aspect-ratio: auto; } }

@media (max-width: 768px) {
    .site-header-inner { padding: 10px 14px; gap: 6px; flex-wrap: nowrap; }
    .site-logo-img { max-height: 40px; }
    .header-right { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
    .main-nav { display: none; }
    .hamburger-btn { display: inline-flex; }
    .header-controls { width: auto; gap: 6px; }
    .header-auth-links { font-size: 0.75rem; gap: 4px; }
    .header-auth-links a { white-space: nowrap; }
    .header-auth-register { padding: 4px 8px; font-size: 0.75rem; }
    .lang-toggle-label { display: none; }
    .lang-switcher-toggle { padding: 5px 8px; font-size: 1.1rem; line-height: 1; }
    .lang-switcher-menu .lang-label { display: inline; }
    .theme-toggle { width: 30px; height: 30px; font-size: 0.9rem; }
    .filters-bar { flex-direction: column; gap: 8px; padding: 10px; box-sizing: border-box; max-width: 100%; overflow: hidden; }
    .filters-bar .search-input, .filters-bar select, .filters-bar button { flex: none; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; }
    main { padding: 16px 14px 48px; }
    .wrap { padding: 0 14px; }
    .home-hero h1 { font-size: 1.4rem; }
    .home-hero p { font-size: 0.92rem; }
    .breadcrumb { padding: 0 14px; font-size: 0.8rem; }
    .breadcrumb ol { overflow: hidden; text-overflow: ellipsis; }
    .review-hero { padding: 14px; }
    .review-hero-info h1 { font-size: 1.25rem; }
    .facts-table th, .facts-table td { padding: 10px 12px; font-size: 0.85rem; }
    .facts-table th { width: auto; }
    .score-badge { font-size: 1.1rem; padding: 5px 12px; }
    .nav-dropdown-menu { left: auto; right: 0; min-width: 170px; }
    .casino-card h2 { font-size: 0.95rem; }
    .footer-groups { gap: 20px; flex-direction: column; align-items: flex-start; }
    .footer-group-wide { min-width: 0; width: 100%; }
    .footer-group-columns { column-count: 1; }
    .footer-group { min-width: 0; width: 100%; }
    .site-footer-inner { padding: 20px 14px; }
}
