/* ==================================
    1. ZÁKLADNÍ NASTAVENÍ A PROMĚNNÉ
==================================
*/
:root {
    --bg-color: #060501;          /* tmavé pozadí jako body background */
    --card-bg: #170F04;           /* tmavě hnědé panely jako .news */
    --text-color: #FCE796;        /* světle zlatý text */
    --header-color: #725700;      /* hnědo-zlatá jako odkazy */
    --border-color: #725700;      /* ladí s border a odkazy */

    --btn-green: #C4A93D;         /* zde používám zlaté tóny místo zelené */
    --btn-green-hover: #DEBF0C;

    --btn-orange: #BBA355;       /* teplá hnědo-oranžová */
    --btn-orange-hover: #DE9C0C;

    --btn-blue: #8F7C3A;          /* utlumená zlatavě-hnědá (styl neobsahuje modrou) */
    --btn-blue-hover: #BBA355;

    --btn-red: #B06A24;           /* hnědo-červená */
    --btn-red-hover: #D87C2C;

    --btn-disabled: #5A4B2A;      /* tlumená hnědá na disabled */
}



body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: block; 
    min-height: 100vh;
    margin: 0;
    padding: 0; /* Padding řeší .container, ne body */
    box-sizing: border-box;
}

/* Obal pro herní stránky (game.php, login.php atd.) */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* ==================================
    2. HLAVNÍ KONTEJNER A KARTY (HRA)
==================================
*/
header, footer {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    color: var(--header-color);
    margin: 0;
}

header p {
    font-size: 1.1em;
    color: var(--text-color);
}

.game-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 800px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--header-color);
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
}

/* Responzivní mřížka statistik */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat span {
    font-weight: 400;
    color: #777;
    margin-right: 10px;
}

/* ==================================
    3. TLAČÍTKA A FORMULÁŘE
==================================
*/
/* Toto je základní styl pro <button> tag */
button {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--btn-green);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 10px;
}

button:hover:not(:disabled) {
    background-color: var(--btn-green-hover);
    transform: translateY(-1px);
}

button:disabled {
    background-color: var(--btn-disabled);
    cursor: not-allowed;
}

form {
    margin: 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 15px 0;
}

/* Barevné varianty (používají se i pro <a> tagy) */
.btn-sell { background-color: var(--btn-orange); }
.btn-sell:hover:not(:disabled) { background-color: var(--btn-orange-hover); }

.btn-work { background-color: var(--btn-blue); }
.btn-work:hover:not(:disabled) { background-color: var(--btn-blue-hover); }

.btn-logout { background-color: var(--btn-red); }
.btn-logout:hover { background-color: var(--btn-red-hover); }

.btn-highscore { background-color: var(--btn-orange); }
.btn-highscore:hover { background-color: var(--btn-orange-hover); }

.btn-back { background-color: var(--btn-blue); }
.btn-back:hover { background-color: var(--btn-blue-hover); }


/* ==================================
    4. KOMPONENTY (Zprávy, Login, Hlavička...)
==================================
*/

/* Zprávy (Success, Error, Info) */
.messages {
    margin-bottom: 20px;
}
.message {
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-weight: 500;
    border: 1px solid transparent;
}
.message.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.message.error { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.message.info { background-color: #cce5ff; color: #004085; border-color: #b8daff; }

/* Login / Register */
.login-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    text-align: center;
    padding-top: 20px; 
}
.login-container .card { text-align: left; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #555; }
.form-group input {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
}
.form-actions { margin-top: 20px; }
.form-actions button { width: 100%; }
.info { margin-top: 20px; font-size: 0.9em; color: #777; }
.info a { color: var(--btn-blue); text-decoration: none; font-weight: 600; }
.info a:hover { text-decoration: underline; }

/* Herní Hlavička (game.php, how_to_play.php atd.) */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}
.header-bar h1 { margin: 0; }
.user-info { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.9em; }

/* Oprava tlačítek <a> v hlavičce */
.user-info a.btn-logout,
.user-info a.btn-highscore, 
.user-info a.btn-back,
.user-info a.btn-work,
.user-info a.btn-sell {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: 600;
    color: #ffffff !important; 
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

/* ==================================
    5. SPECIFICKÉ STRÁNKY (Highscore, How-to-Play)
==================================
*/

/* Highscore Tabulka */
.highscore-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.highscore-table th,
.highscore-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }

/* Zarovná nadpis "Net Worth 💰" */
.highscore-table th:last-child {
    text-align: center;
}
.highscore-table th:first-child { text-align: left; } /* Pojistka */

.highscore-table td:first-child { font-weight: 700; color: var(--header-color); width: 60px; }

/* Zarovná čísla ve sloupci */
.highscore-table td:last-child { /* Net Worth */
    text-align: center;
    font-weight: 600;
}
.current-user-row { background-color: var(--bg-color); font-weight: 700; }

/* How-to-Play Seznam */
.how-to-play-list { list-style: none; padding-left: 10px; }
.how-to-play-list li { font-size: 1.1em; padding: 5px 0; }
.net-worth-formula {
    text-align: center;
    font-weight: 600;
    font-size: 1.1em;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    color: var(--header-color);
}

/* ==================================
    6. RESPONSIVNÍ ÚPRAVY (Mobile First)
==================================
*/

/* Oprava tabulky (Highscore) */
.table-wrapper {
    width: 100%;
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.highscore-table {
    width: 100%;
    min-width: 500px; 
    border: none; 
}

/* Oprava herní hlavičky */
@media (max-width: 700px) {
    .header-bar {
        flex-direction: column;
        align-items: center; 
        gap: 10px;
    }
    .user-info {
        justify-content: center;
        flex-wrap: wrap; 
    }
}

/* Drobná kosmetika pro velmi malé obrazovky */
@media (max-width: 420px) {
    .container {
        padding: 10px;
    }
    .card {
        padding: 15px;
    }
    .btn-sell, .btn-work, button {
        font-size: 0.9em;
        padding: 10px 12px;
    }
}

/* ==================================
    7. STYLY PRO LANDING PAGE (index.html)
==================================
*/

/* Kontejner pro obsah landing page (řeší překryv) */
.landing-container {
    padding: 0; /* Landing page nemá padding */
    max-width: 960px;
    margin-top: -80px; /* Překryv pro desktop */
    position: relative;
    z-index: 2;
}
/* Musíme zajistit, že .container uvnitř .landing-container má padding */
.landing-container .container {
    padding: 20px;
}


/* Hero sekce */
.landing-header {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    color: #ffffff;
    overflow: hidden;
    background-image: url('farm_wallpaper.jpg'); /* VÁŠ OBRÁZEK */
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); 
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.5em; 
    color: #ffffff;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.hero-content .tagline {
    font-size: 1.4em;
    color: #f0f0f0;
    margin: 10px 0 30px 0;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Větší CTA tlačítka */
.btn-cta {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    color: #ffffff !important; 
    margin-top: 0 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Sekundární CTA tlačítka (menší) */
.btn-cta-secondary {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 0 !important;
}

/* "Features" sekce */
.feature-card {
    text-align: center;
}

.cta-section {
    text-align: center;
    margin-top: 20px;
}
.cta-section h2 {
    border: none; 
}

/* Patička */
.landing-footer {
    width: 100%;
    text-align: center;
    padding: 30px 20px;
    margin-top: 30px;
    color: #777;
    font-size: 0.9em;
}

/* Responzivita pro Hero sekci (OPRAVA PŘEKRÝVÁNÍ) */
@media (max-width: 600px) {
    .hero-content h1 {
        font-size: 2.5em;
    }
    .hero-content .tagline {
        font-size: 1.1em;
    }
    .hero-actions {
        flex-direction: column;
    }
    .btn-cta {
        width: 100%;
        box-sizing: border-box; 
    }
    
    /* ZDE JE TA OPRAVA */
    .landing-header {
        min-height: 300px; /* Zmenšíme hlavičku */
        height: 50vh; /* Menší výška na mobilu */
    }
    .landing-container {
        margin-top: 0; /* A ZRUŠÍME ten ošklivý překryv na mobilu */
    }
}