:root {
            --meta-blue: #0084ff;
            --meta-blue-soft: #e7f3ff;
            --sidebar-bg: #ffffff;
            --text-main: #1c1e21;
            --bg-light: #f0f2f5;
            --sidebar-width: 220px;
            --sidebar-collapsed-width: 70px;
        }

        body {
            font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
            margin: 0;
            display: flex;
            height: 100vh;
            background-color: var(--bg-light);
            color: var(--text-main);
            overflow: hidden;
        }

        /* --- MENÚ LATERAL --- */
        .sidebar {
            width: var(--sidebar-width);
            background-color: var(--sidebar-bg);
            border-right: 1px solid #ddd;
            display: flex;
            flex-direction: column;
            padding: 25px 0;
            transition: width 0.3s ease;
            position: relative;
            z-index: 900;
        }

        .sidebar.collapsed { width: var(--sidebar-collapsed-width); }

        .menu-item {
            padding: 12px 22px;
            margin: 4px 8px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
            display: flex;
            align-items: center;
            font-size: 14px;
            color: #4b4f56;
            font-weight: 500;
        }

        .menu-item.active { background-color: var(--meta-blue-soft); color: var(--meta-blue); }

        /* --- BOTÓN TOGGLE --- */
        .toggle-container {
            position: fixed;
            top: 20px;
            left: calc(var(--sidebar-width) - 15px);
            z-index: 1000;
            transition: left 0.3s ease;
        }

        .sidebar.collapsed + .main-content .toggle-container { left: calc(var(--sidebar-collapsed-width) - 15px); }

        .btn-toggle {
            width: 30px; height: 30px;
            background: var(--meta-blue);
            color: white; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; border: none;
        }

        /* --- CONTENIDO --- */
        .main-content {
            flex-grow: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
        }

        .seccion { display: none; width: 100%; height: 100%; overflow-y: auto; padding: 20px; box-sizing: border-box; }
        .seccion.activa { display: flex; flex-direction: column; align-items: center; }

        /* --- CONTENEDORES --- */
        .contenedor {
            background: white;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.05);
            width: 350px;
            text-align: center;
            margin: auto;
        }

        input, select {
            width: 100%;
            padding: 12px;
            margin: 8px 0;
            border: 1px solid #dddfe2;
            border-radius: 10px;
            font-size: 15px;
            background: #f5f6f7;
            box-sizing: border-box;
        }

        /* --- BASE DE DATOS E HISTORIAL --- */
        .contenedor-db {
            background: white;
            padding: 30px;
            border-radius: 20px;
            width: 95%;
            max-width: 1100px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        }

        .db-header {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
            gap: 15px;
            border-bottom: 2px solid var(--bg-light);
            padding-bottom: 15px;
        }

        .game-section { margin-bottom: 30px; background: #fff; border-radius: 15px; }
        .game-title { font-size: 1.4rem; color: var(--meta-blue); font-weight: bold; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; padding-left: 5px; }
        .db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
        .db-card { background: #f8f9fa; padding: 12px 15px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #eee; position: relative; }
        .db-card.dragging { opacity: 0.5; border: 2px dashed var(--meta-blue); }
        .btn-settings { cursor: pointer; opacity: 0.5; font-size: 14px; }
        .btn-settings:hover { opacity: 1; }
        .mini-menu { display: none; position: absolute; right: 5px; top: 40px; background: white; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 100; padding: 5px; gap: 5px; }
        .mini-menu.show { display: flex; }
        .opt { cursor: pointer; padding: 5px; border-radius: 4px; }
        .opt:hover { background: #f0f2f5; }

        /* --- SUGERENCIAS --- */
        .suggestions { position: absolute; background: white; border: 1px solid #ddd; border-radius: 10px; width: 100%; left: 0; top: 75px; z-index: 100; box-shadow: 0 5px 15px rgba(0,0,0,0.1); display: none; text-align: left; }
        .suggestion-item { padding: 10px 15px; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
        .suggestion-item:hover { background: var(--meta-blue-soft); color: var(--meta-blue); }

        .main-btn { background-color: var(--meta-blue); color: white; border: none; padding: 14px; border-radius: 10px; cursor: pointer; font-weight: bold; width: 100%; transition: opacity 0.2s; }
        .main-btn:active { opacity: 0.8; }
        .delete-game { color: #ff4d4d; cursor: pointer; font-size: 14px; font-weight: normal; }

        /* --- ANIMACIÓN DEL HISTORIAL --- */
        .detalles-fila {
            max-height: 0;
            overflow: hidden;
            background-color: #fafbfc;
            transition: all 0.3s ease-in-out;
            padding: 0 20px;
            opacity: 0;
        }
        .detalles-fila.show {
            max-height: 100px; /* Suficiente espacio para que baje el texto */
            padding: 15px 20px;
            border-top: 1px dashed #ddd;
            opacity: 1;
        }