/* =========================================
   ZÁKLADNÍ NASTAVENÍ A PROMĚNNÉ
   ========================================= */
:root {
    /* Herní barvy (Temné téma) */
    --bg-dark: #0f172a;
    --panel-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-gold: #f59e0b;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --border-color: #334155;

    /* Admin barvy (Světlé téma) */
    --admin-bg: #f1f5f9;
    --admin-panel: #ffffff;
    --admin-text: #334155;
    
    /* UI prvky */
    --radius: 8px;
    --transition: all 0.2s ease-in-out;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* =========================================
   HERNÍ ROZHRANÍ (Frontend)
   ========================================= */
body.game-theme {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark); color: var(--text-main);
    line-height: 1.6; padding: 20px; display: flex; justify-content: center;
}

.app-layout { display: flex; gap: 20px; width: 100%; max-width: 900px; align-items: flex-start; }

.game-panel, .inventory-panel {
    background: var(--panel-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 25px; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.game-panel { flex: 2; min-width: 300px; }
.inventory-panel { flex: 1; min-width: 280px; position: sticky; top: 20px; }

/* Typografie hry */
.game-theme h1 { color: var(--accent-gold); font-size: 28px; margin-bottom: 10px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
.game-theme h2 { color: var(--accent-blue); font-size: 18px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.room-desc { font-size: 17px; margin-bottom: 20px; }
.action-result { color: var(--accent-blue); font-style: italic; min-height: 1.5em; margin-bottom: 20px; padding: 10px; background: rgba(59, 130, 246, 0.1); border-left: 3px solid var(--accent-blue); border-radius: 0 var(--radius) var(--radius) 0; }
.section-title { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin: 25px 0 10px 0; }

/* Tlačítka hry */
.btn {
    display: block; width: 100%; padding: 12px 15px; margin-bottom: 10px;
    border: 1px solid transparent; border-radius: var(--radius);
    font-family: inherit; font-size: 15px; font-weight: 600; text-align: left;
    cursor: pointer; transition: var(--transition); color: white;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

.choice-btn { background: #334155; border-color: #475569; }
.choice-btn:hover { background: #475569; border-color: var(--accent-gold); }

.item-row { display: flex; gap: 10px; margin-bottom: 10px; }
.item-btn { background: #1e3a8a; border-color: #1e40af; flex: 2; margin-bottom: 0; }
.item-btn:hover { background: #1e40af; border-color: var(--accent-blue); }
.pickup-btn { background: #059669; border-color: #047857; flex: 1; text-align: center; margin-bottom: 0; }
.pickup-btn:hover { background: #10b981; }

/* Inventář */
.inv-item { background: #0f172a; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: var(--radius); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; transition: var(--transition); }
.inv-item:hover { border-color: var(--accent-gold); }
.inv-name { cursor: help; font-weight: 600; }
.use-btn { background: var(--accent-red); color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: var(--transition); }
.use-btn:hover { background: #dc2626; transform: scale(1.05); }
.reset-btn { background: transparent; color: var(--text-muted); border: 1px solid var(--border-color); padding: 4px 8px; border-radius: 4px; font-size: 12px; cursor: pointer; transition: var(--transition); }
.reset-btn:hover { background: var(--accent-red); color: white; border-color: var(--accent-red); }

/* --- LORE SYSTÉM (Deník) --- */
.journal-item { background: #1e293b; padding: 10px 15px; border: 1px solid #475569; border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: var(--transition); border-left: 3px solid var(--accent-purple); }
.journal-item:hover { border-color: var(--accent-purple); background: #2e3b4e; }
.journal-name { font-weight: 600; color: #c4b5fd; display: flex; align-items: center; gap: 8px; }

/* --- KONEC HRY --- */
.end-game-msg { text-align: center; margin: 30px 0; font-size: 20px; color: var(--accent-gold); font-weight: bold; }
.end-game-btn { background: var(--accent-red); border-color: #b91c1c; font-size: 18px; padding: 15px; text-align: center; margin-top: 20px; }
.end-game-btn:hover { background: #dc2626; }

/* =========================================
   ADMINISTRACE (Backend)
   ========================================= */
body.admin-theme { font-family: 'Segoe UI', Roboto, sans-serif; background-color: var(--admin-bg); color: var(--admin-text); padding: 30px; }
.admin-header { margin-bottom: 30px; text-align: center; }

/* Vynuceny přesně 2 sloupce vedle sebe */
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 40px; }

.admin-card { background: var(--admin-panel); padding: 25px; border-radius: var(--radius); box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-top: 4px solid var(--accent-blue); }
.admin-card h2 { margin-bottom: 20px; font-size: 18px; }

/* Formuláře adminu */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; }
.form-control { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 4px; font-family: inherit; font-size: 14px; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
textarea.form-control { resize: vertical; min-height: 120px; }

.admin-btn { display: block; width: 100%; padding: 12px; background: var(--accent-blue); color: white; border: none; border-radius: 4px; font-weight: bold; font-size: 15px; cursor: pointer; transition: var(--transition); }
.admin-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.msg-success { background: #d1fae5; color: #065f46; padding: 15px; border-left: 4px solid #10b981; border-radius: 4px; margin-bottom: 25px; font-weight: 600; }

/* Tabulka Dashboard */
.dashboard-table { width: 100%; border-collapse: collapse; background: white; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-radius: 8px; overflow: hidden; margin-bottom: 40px; }
.dashboard-table th, .dashboard-table td { padding: 15px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top;}
.dashboard-table th { background: #334155; color: white; }
.dashboard-table tr:hover { background-color: #f8fafc; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; color: white; background: #94a3b8; }
.badge-collect { background: var(--accent-gold); }
.badge-lore { background: var(--accent-purple); }
.header-actions { position: absolute; top: 20px; right: 20px; }
.logout-btn { background: var(--text-muted); color: white; text-decoration: none; padding: 8px 15px; border-radius: 4px; font-size: 14px; transition: var(--transition); }
.logout-btn:hover { background: var(--accent-red); }

/* Tlačítka admin akcí */
.btn-delete { background: #fee2e2; color: #ef4444; border: 1px solid #f87171; padding: 2px 6px; border-radius: 4px; font-size: 11px; cursor: pointer; text-transform: uppercase; font-weight: bold; }
.btn-delete:hover { background: #ef4444; color: white; }
.btn-edit { background: #e0f2fe; color: var(--accent-blue); border: 1px solid #7dd3fc; padding: 2px 6px; border-radius: 4px; font-size: 11px; cursor: pointer; text-transform: uppercase; font-weight: bold; text-decoration: none; margin-left: 10px;}
.btn-edit:hover { background: var(--accent-blue); color: white; }
.btn-edit-item { background: #fef3c7; color: var(--accent-gold); border-color: #fcd34d; }
.btn-edit-item:hover { background: var(--accent-gold); color: white; }
.edit-card { border-top-color: var(--accent-blue); } .edit-card-item { border-top-color: var(--accent-gold); }
.admin-btn-cancel { background: #e2e8f0; color: #64748b; text-decoration: none; text-align: center; margin-top: 10px; }
.admin-btn-cancel:hover { background: #cbd5e1; color: #111; }
.opt-label { font-size: 12px; color: var(--text-muted); margin-top: -10px; margin-bottom: 5px; display: block; }

/* =========================================
   RESPONSIVITA
   ========================================= */
@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .inventory-panel { width: 100%; position: static; }
    .item-row { flex-direction: column; gap: 5px; }
    .item-btn, .pickup-btn { width: 100%; flex: none; margin-bottom: 5px;}
    body.admin-theme { padding: 15px; }
    .admin-grid { grid-template-columns: 1fr; } 
}
/* --- ZAMYKACÍ OBRAZOVKA (Heslo) --- */
.password-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--bg-dark); display: flex; justify-content: center; align-items: center; z-index: 5000;
}
.password-box {
    background: var(--panel-bg); padding: 40px; border-radius: var(--radius);
    text-align: center; border: 1px solid var(--border-color); box-shadow: 0 10px 25px rgba(0,0,0,0.5); width: 90%; max-width: 400px;
}
.password-box input {
    width: 100%; padding: 12px; border-radius: 4px; border: 1px solid var(--border-color);
    background: var(--bg-dark); color: var(--text-main); font-size: 16px; font-family: inherit;
}
.password-box input:focus { outline: none; border-color: var(--accent-blue); }

/* --- HODNOCENÍ PATIČKA --- */
.game-footer {
    margin-top: 20px; text-align: center; padding: 15px; background: var(--panel-bg);
    border: 1px solid var(--border-color); border-radius: var(--radius); display: flex; justify-content: center; align-items: center; gap: 10px;
}
.rate-btn {
    background: #334155; color: white; border: none; padding: 8px 15px; border-radius: 20px;
    font-size: 15px; cursor: pointer; transition: var(--transition); font-weight: bold; display: flex; align-items: center; gap: 5px;
}
.rate-btn:hover:not(:disabled) { background: #475569; transform: scale(1.05); }
.rate-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.rate-btn.voted { background: var(--accent-blue); opacity: 1; }
/* --- KLASICKÁ PATIČKA (Site Footer) --- */
.site-footer {
    margin-top: 40px;
    padding: 20px 10px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
}
.site-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition);
}
.site-footer a:hover {
    color: var(--accent-gold);
}