*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #0f0f1a; color: #e0e0e0; overflow: hidden; height: 100vh; }

/* Login */
.login-card { max-width: 400px; margin: 120px auto; padding: 40px; background: #1a1a2e; border-radius: 12px; text-align: center; }
.login-card h1 { color: #FFD700; margin-bottom: 8px; font-size: 28px; }
.login-card .form-group { margin: 16px 0; text-align: left; }
.login-card label { display: block; margin-bottom: 4px; color: #aaa; font-size: 13px; }
.login-card input { width: 100%; padding: 10px 12px; background: #0f0f1a; border: 1px solid #333; border-radius: 6px; color: #e0e0e0; font-size: 14px; }
.login-card input:focus { border-color: #FFD700; outline: none; }
.login-card .btn-primary { width: 100%; padding: 10px; margin-top: 12px; background: #FFD700; color: #000; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-card .btn-primary:hover { background: #FFC107; }
.login-card .msg { margin-top: 8px; font-size: 13px; }
.muted { color: #888; } .small { font-size: 11px; }

/* Top bar */
.top-bar { display: flex; align-items: center; padding: 8px 16px; background: #1a1a2e; border-bottom: 1px solid #2a2a4a; gap: 16px; }
.top-bar .title { color: #FFD700; font-weight: 700; font-size: 16px; }
.top-bar .player-info { color: #aaa; font-size: 12px; flex: 1; }
.top-bar .status { font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.top-bar .connected { color: #4CAF50; background: rgba(76,175,80,.15); }
.top-bar .disconnected { color: #FF9800; background: rgba(255,152,0,.15); }
.top-bar .watching { color: #2196F3; background: rgba(33,150,243,.15); }
.btn-link { background: none; border: none; color: #F44336; cursor: pointer; font-size: 12px; }

/* Layout */
.main-layout { display: flex; height: calc(100vh - 300px); }
.panel-left { width: 220px; padding: 8px; background: #12121f; border-right: 1px solid #2a2a4a; overflow-y: auto; }
.panel-center { flex: 1; display: flex; align-items: center; justify-content: center; background: #0f0f1a; }
.panel-right { width: 260px; padding: 8px; background: #12121f; border-left: 1px solid #2a2a4a; overflow-y: auto; }
.col-resize { width: 4px; cursor: col-resize; background: #2a2a4a; }
.col-resize:hover { background: #FFD700; }
.resize-handle-h { height: 4px; cursor: row-resize; background: #2a2a4a; }
.resize-handle-h:hover { background: #FFD700; }
.resize-handle { height: 4px; cursor: row-resize; background: #2a2a4a; }
.resize-handle:hover { background: #FFD700; }

/* Panel headers */
.panel-header { color: #FFD700; font-size: 13px; font-weight: 600; padding: 4px 0; border-bottom: 1px solid #2a2a4a; margin-bottom: 8px; }

/* Player list */
.cm-player-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; cursor: pointer; border-radius: 4px; font-size: 12px; }
.cm-player-row:hover { background: rgba(255,215,0,.1); }
.cm-player-eid { color: #888; font-family: monospace; font-size: 10px; width: 64px; }
.cm-player-job { color: #FFD700; width: 24px; font-weight: 600; text-align: center; }
.cm-player-name { flex: 1; color: #e0e0e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-player-hp { width: 40px; text-align: right; font-weight: 600; }

/* Map */
#cmMap { display: block; }

/* Map config */
.map-config { font-size: 11px; }
.map-config label { display: block; margin: 4px 0; color: #aaa; }
.map-config input, .map-config select { background: #0f0f1a; border: 1px solid #333; color: #e0e0e0; padding: 2px 4px; border-radius: 3px; width: 100%; font-size: 11px; }
.btn-small { background: #333; border: none; color: #e0e0e0; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; width: 100%; margin-top: 6px; }
.btn-small:hover { background: #444; }

/* Detail */
.detail-content { font-size: 12px; }
.detail-content > div { margin: 4px 0; }
.cm-detail-header { margin-bottom: 8px; }
.cm-detail-header strong { display: block; color: #FFD700; font-size: 14px; }
.cm-detail-header span { font-size: 11px; color: #888; }

/* Log panel */
.log-panel { height: 280px; display: flex; flex-direction: column; background: #12121f; border-top: 1px solid #2a2a4a; }
.log-header { display: flex; align-items: center; padding: 6px 12px; gap: 8px; flex-wrap: wrap; background: #1a1a2e; border-bottom: 1px solid #2a2a4a; }
.log-header input { background: #0f0f1a; border: 1px solid #333; color: #e0e0e0; padding: 3px 8px; border-radius: 4px; font-size: 12px; width: 120px; }
.log-header select, .log-header button { background: #333; border: none; color: #e0e0e0; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; }
.log-header button:hover { background: #444; }
.log-header label { font-size: 11px; color: #aaa; display: inline-flex; align-items: center; gap: 2px; }

.log-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.cm-log-tab { padding: 2px 10px; background: #1a1a2e; border: 1px solid #2a2a4a; border-radius: 4px; cursor: pointer; font-size: 11px; color: #aaa; }
.cm-log-tab.active { background: #FFD700; color: #000; border-color: #FFD700; font-weight: 600; }

.log-list { flex: 1; overflow-y: auto; font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 12px; padding: 4px 8px; }
.cm-log-line { padding: 1px 0; white-space: pre-wrap; word-break: break-all; }

.detail-log { display: flex; flex-direction: column; height: 150px; border-top: 1px solid #2a2a4a; margin-top: 8px; }
.detail-log .log-header { padding: 4px 8px; }
.detail-log .log-list { flex: 1; font-size: 10px; }
.log-search { display: flex; gap: 4px; padding: 4px 8px; }
.log-search input { background: #0f0f1a; border: 1px solid #333; color: #e0e0e0; padding: 2px 6px; border-radius: 3px; font-size: 10px; flex: 1; }
.log-search label { font-size: 10px; color: #aaa; white-space: nowrap; }
.log-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }

.placeholder { color: #555; font-size: 12px; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: #1a1a2e; padding: 24px; border-radius: 12px; max-width: 480px; width: 90%; }
.modal-content h3 { color: #FFD700; margin-bottom: 12px; }
.modal-content input { width: 100%; padding: 8px; background: #0f0f1a; border: 1px solid #333; color: #e0e0e0; border-radius: 4px; margin-bottom: 8px; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.modal-btns .btn { padding: 6px 16px; border: none; border-radius: 4px; cursor: pointer; }
.modal-btns .btn-primary { background: #FFD700; color: #000; }
.modal-btns .btn:not(.btn-primary) { background: #333; color: #e0e0e0; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f0f1a; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
