:root {
    --bg-dark: #0f111a;
    --panel-bg: rgba(25, 28, 41, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary: #00ffcc;
    --primary-glow: rgba(0, 255, 204, 0.4);
    --danger: #ff3366;
    --success: #00e676;
    --text-main: #ffffff;
    --text-muted: #8b949e;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ── Background effects ─────────────────────────────────── */
.background-effects, .login-bg-effects {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1; overflow: hidden; pointer-events: none;
}
.glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.5; }
.circle-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: rgba(0, 255, 204, 0.15); }
.circle-2 { bottom: -20%; right: -10%; width: 60vw; height: 60vw; background: rgba(138, 43, 226, 0.15); }

/* ══════════════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════════════ */
#login-screen {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-dark);
}

.login-card {
    width: 100%; max-width: 420px; padding: 2.5rem 2rem;
    animation: fadeInUp 0.4s ease;
}

.login-logo {
    text-align: center; margin-bottom: 2rem;
}
.login-logo h1 { font-size: 1.6rem; font-weight: 700; margin: 0.8rem 0 0.3rem; }
.login-logo .highlight { color: var(--primary); }
.login-subtitle { color: var(--text-muted); font-size: 0.85rem; }

.login-field {
    margin-bottom: 1.2rem;
}
.login-field label {
    display: block; font-size: 0.8rem; color: var(--text-muted);
    margin-bottom: 0.5rem; font-weight: 600;
}
.login-field label i { margin-right: 0.4rem; }
.login-field input {
    width: 100%; padding: 0.85rem 1rem;
    background: rgba(0,0,0,0.35); border: 1px solid var(--panel-border);
    border-radius: 8px; color: white; font-family: var(--font-ui);
    font-size: 0.95rem; outline: none; transition: border-color 0.2s;
}
.login-field input:focus { border-color: var(--primary); }

.toggle-pw {
    position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 0.2rem; font-size: 0.9rem; transition: color 0.2s;
}
.toggle-pw:hover { color: var(--primary); }

.login-error {
    background: rgba(255, 51, 102, 0.1); border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 6px; padding: 0.6rem 0.9rem; font-size: 0.85rem;
    color: var(--danger); margin-bottom: 1rem;
}

.login-btn { width: 100%; margin-top: 0.5rem; padding: 0.9rem; font-size: 1rem; }

.login-footer {
    text-align: center; margin-top: 1.5rem;
    font-size: 0.8rem; color: var(--text-muted);
}

/* ── User badge in header ── */
.user-badge {
    background: rgba(0,0,0,0.3); padding: 0.4rem 0.8rem;
    border-radius: 50px; font-size: 0.85rem; font-weight: 600;
    border: 1px solid var(--panel-border); display: flex;
    align-items: center; gap: 0.4rem;
}

/* ── Observer notice ── */
.observer-notice {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(139, 148, 158, 0.1); border: 1px solid rgba(139, 148, 158, 0.2);
    border-radius: 8px; padding: 0.6rem 1rem; font-size: 0.85rem;
    color: var(--text-muted); margin-top: 0.5rem;
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD — estilos originales
══════════════════════════════════════════════════════════ */
.dashboard-container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px; padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; padding: 1rem 2rem;
}
.logo { display: flex; align-items: center; gap: 1rem; }
.logo h1 { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.5px; }
.logo .highlight { color: var(--primary); }

.status-badge {
    display: flex; align-items: center; gap: 0.75rem;
    background: rgba(0,0,0,0.3); padding: 0.5rem 1rem; border-radius: 50px;
    font-weight: 600; font-size: 0.9rem;
}
.indicator { width: 10px; height: 10px; border-radius: 50%; background: #ffcc00; box-shadow: 0 0 10px #ffcc00; }
.status-badge.online  .indicator { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-badge.offline .indicator { background: var(--danger);  box-shadow: 0 0 10px var(--danger); }

.grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; }
.column { display: flex; flex-direction: column; gap: 2rem; min-width: 0; }

h2 {
    font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.5rem;
}

/* Metrics */
.metric { margin-bottom: 1.5rem; }
.metric-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; }
.progress-bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.5s ease-out; box-shadow: 0 0 10px var(--primary-glow); }
.metric-footer { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; text-align: right; }

/* Players */
.players-info { text-align: center; margin: 2rem 0; }
.big-number { font-size: 4rem; font-weight: 700; color: var(--primary); line-height: 1; text-shadow: 0 0 20px var(--primary-glow); }
.max-players { font-size: 1.5rem; color: var(--text-muted); }
.players-info p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }
.player-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; justify-content: center; }
.player-tag { background: rgba(0, 255, 204, 0.1); border: 1px solid rgba(0, 255, 204, 0.3); padding: 0.3rem 0.8rem; border-radius: 50px; font-size: 0.85rem; color: var(--primary); transition: transform 0.2s; }
.player-tag:hover { transform: scale(1.05); }

/* Controls */
.controls { display: flex; gap: 1rem; }
.btn {
    flex: 1; padding: 0.8rem; border: none; border-radius: 8px;
    font-family: var(--font-ui); font-weight: 600; font-size: 1rem;
    cursor: pointer; transition: all 0.2s;
    display: flex; justify-content: center; align-items: center; gap: 0.5rem;
}
.btn-primary { background: var(--primary); color: #000; box-shadow: 0 0 15px var(--primary-glow); }
.btn-primary:hover { background: #00e6b8; transform: translateY(-2px); box-shadow: 0 5px 20px var(--primary-glow); }
.btn-primary:disabled { background: #333; color: #666; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-danger { background: rgba(255, 51, 102, 0.1); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; transform: translateY(-2px); box-shadow: 0 5px 20px rgba(255, 51, 102, 0.4); }

/* Console */
.console-panel { display: flex; flex-direction: column; max-height: calc(100vh - 140px); min-width: 0; overflow: hidden; }
.pulse-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 10px var(--success); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.console-window {
    flex: 1; background: #090a0f; border-radius: 8px; padding: 1rem;
    overflow-y: auto; overflow-x: auto;
    font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.5;
    color: #a5b1c2; border: 1px solid #1e2233; margin-bottom: 1rem; min-height: 200px;
}
.console-window::-webkit-scrollbar { width: 8px; height: 8px; }
.console-window::-webkit-scrollbar-track { background: #0d0e16; border-radius: 4px; }
.console-window::-webkit-scrollbar-thumb { background: rgba(0, 255, 204, 0.3); border-radius: 4px; }
.console-window pre { white-space: pre-wrap; word-wrap: break-word; }

.log-info { color: #4b7bec; }
.log-warn { color: #fed330; }
.log-error { color: #eb3b5a; }
.log-success { color: #2bcbba; }

.console-input {
    display: flex; align-items: center; gap: 0.8rem; background: #090a0f;
    padding: 0.8rem 1rem; border-radius: 8px; border: 1px solid #1e2233;
}
.console-input i { color: var(--primary); }
.console-input input { flex: 1; background: transparent; border: none; outline: none; color: #fff; font-family: var(--font-mono); font-size: 0.9rem; }

/* Guide */
.guide-step { background: rgba(0,0,0,0.2); border-radius: 6px; margin-bottom: 0.4rem; overflow: hidden; cursor: pointer; transition: background 0.2s; }
.guide-step:hover { background: rgba(0,0,0,0.35); }
.step-header { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; font-size: 0.85rem; font-weight: 600; }
.step-num { background: var(--primary); color: #000; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex: none; }
.step-arrow { margin-left: auto; font-size: 0.65rem; color: var(--text-muted); transition: transform 0.3s; }
.guide-step.open .step-arrow { transform: rotate(90deg); }
.step-body { max-height: 0; overflow: hidden; padding: 0 0.8rem; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; transition: max-height 0.3s ease, padding 0.3s ease; }
.guide-step.open .step-body { max-height: 150px; padding: 0 0.8rem 0.7rem; }

/* Island builder */
.island-type-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 0.5rem 0.3rem; color: var(--text-muted); font-size: 0.78rem; cursor: pointer; transition: all 0.25s ease; font-family: 'Inter', sans-serif; }
.island-type-btn:hover { background: rgba(0,230,118,0.1); border-color: rgba(0,230,118,0.3); color: var(--success); transform: translateY(-2px); }
.island-type-btn.active { background: rgba(0,230,118,0.15); border-color: var(--success); color: var(--success); font-weight: 600; box-shadow: 0 0 12px rgba(0,230,118,0.2); }
#btn-build-island:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,230,118,0.3); }

/* Modal */
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; margin-bottom: 15px; }
.close { color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; transition: color 0.2s; }
.close:hover { color: white; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
    .console-panel { min-height: 400px; }
    .login-card { margin: 1rem; }
    header { padding: 1rem; flex-wrap: wrap; gap: 0.5rem; }
}
