/* --- Reset i Nowa Czerwona Paleta --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-main: #0B0707; /* Ultra ciemny burgund/czarny */
    --bg-surface: #140E0E; /* Głębokie, ciemnoczerwone tło elementów */
    --bg-card: #1F1414; /* Jasniejszy odcień dla kart */
    --primary: #FF2E44; /* Jasny, krwisty, neonowy czerwony */
    --primary-hover: #E0162B;
    --accent: #FF7686; /* Pastelowy czerwony/różowy do podświetleń */
    --text-main: #F5EAEB; /* Bardzo jasny popielaty z nutą czerwieni */
    --text-muted: #A39293;
    --border-color: #331C1E; /* Ciemnoczerwone obramowania */
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-stack);
    line-height: 1.5;
    overflow-x: hidden;
}

/* --- Nagłówek --- */
.main-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(255, 46, 68, 0.4);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

/* --- Przyciski (Dynamiczne, Czerwone) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    font-size: 14px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--primary);
    color: #FFF;
    box-shadow: 0 4px 15px rgba(255, 46, 68, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 20px rgba(255, 46, 68, 0.4);
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

/* --- Sekcja Główna (Hero) --- */
.hero-section {
    max-width: 1200px;
    margin: 25px auto;
    padding: 0 20px;
}

.game-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    background-color: var(--bg-surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.iframe-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Oryginalny Panel Widgetu --- */
.stats-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stats-panel h3 {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.live-badge {
    background-color: rgba(255, 46, 68, 0.15);
    color: var(--primary);
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid rgba(255, 46, 68, 0.3);
}

.widget-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Przełączniki strategii */
.strategy-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 15px;
}

.strat-btn {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.15s ease;
}

.strat-btn:hover {
    border-color: var(--primary);
    color: #FFF;
}

.strat-btn.active {
    background-color: var(--primary);
    color: #FFF;
    border-color: var(--primary);
}

/* Wyniki kalkulatora */
.calculator-results {
    background-color: var(--bg-surface);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.calc-row:last-child { margin-bottom: 0; }
.text-red { color: var(--primary); font-size: 15px; }

/* Wykres */
.chart-container {
    background-color: var(--bg-surface);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.chart-title {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 65px;
}

.chart-bar {
    flex: 1;
    background-color: #2D1A1C;
    border-radius: 2px 2px 0 0;
    height: 30%;
    transition: height 0.25s ease, background 0.25s ease;
}

.chart-bar.active {
    background: linear-gradient(180deg, var(--primary) 0%, rgba(255,46,68,0.1) 100%);
}

/* --- KONTENER NA TREŚĆ (Automatyczne inteligentne style) --- */
.content-section {
    max-width: 1200px;
    margin: 35px auto;
    padding: 0 20px;
}

.seo-content-container {
    background-color: var(--bg-surface);
    padding: 35px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.seo-content-container h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 18px;
    color: #FFF;
}

.seo-content-container h2 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 12px;
    color: #FFF;
}

.seo-content-container h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 22px;
    margin-bottom: 10px;
    color: var(--accent);
}

.seo-content-container p {
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 15px;
    line-height: 1.6;
}

.seo-content-container ul {
    margin-bottom: 18px;
    padding-left: 20px;
}

.seo-content-container ul li {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-main);
}

/* Automatyczna stylizacja tabel */
.seo-content-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: var(--bg-card);
    border-radius: 6px;
    overflow: hidden;
}

.seo-content-container th, 
.seo-content-container td {
    padding: 12px 14px;
    text-align: left;
    font-size: 14px;
}

.seo-content-container th {
    background-color: #2D1719;
    color: #FFF;
    font-weight: 600;
}

.seo-content-container tr {
    border-bottom: 1px solid var(--border-color);
}

.seo-content-container tr:last-child {
    border-bottom: none;
}

/* Blok wyróżniony */
.cta-box {
    background: linear-gradient(90deg, #241315 0%, #140E0E 100%);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 0 6px 6px 0;
    margin: 25px 0;
}

.cta-box h3 { margin-top: 0; color: #FFF; }
.cta-box .btn { margin-top: 12px; }

/* --- Sekcja Autora --- */
.author-section {
    max-width: 1200px;
    margin: 35px auto;
    padding: 0 20px;
}

.author-container {
    background-color: var(--bg-surface);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
    align-items: center;
}

.author-avatar img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.author-info h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #FFF;
}

.author-info p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Stopka --- */
.main-footer {
    background-color: #080505;
    padding: 25px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

.main-footer p {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 850px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Pełna responsywność i WebView App Fix --- */
@media (max-width: 992px) {
    .game-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .seo-content-container { padding: 20px; }
    .seo-content-container h1 { font-size: 22px; }
    .author-container { flex-direction: column; text-align: center; }
    .seo-content-container table { display: block; overflow-x: auto; }
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}