/* ═══════════════════════════════════════════════════
   KINDERGARTEN ADMIN — Map Editor
   ═══════════════════════════════════════════════════ */

.kga-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kga-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.kga-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #16213e, #0f3460);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.kga-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    flex: 1;
}
.kga-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.kga-screen-count-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kga-screen-count-label select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.85rem;
}

/* Buttons */
.kga-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.kga-btn:hover { transform: scale(1.05); }
.kga-btn--add {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    box-shadow: 0 2px 8px rgba(46,204,113,0.3);
}
.kga-btn--save {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    box-shadow: 0 2px 8px rgba(52,152,219,0.3);
}
.kga-btn--danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 2px 8px rgba(231,76,60,0.3);
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* Body layout */
.kga-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Map preview area */
.kga-map-preview {
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px;
    gap: 8px;
    background: rgba(0,0,0,0.3);
}
.kga-map-preview::-webkit-scrollbar { height: 6px; }
.kga-map-preview::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.kga-screen {
    flex: 0 0 max(300px, calc(60vw / var(--screen-count, 3)));
    height: 100%;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.15);
    min-height: 300px;
}
.kga-screen-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
}
.kga-screen-label {
    position: absolute;
    top: 6px; left: 50%;
    transform: translateX(-50%);
    padding: 3px 12px;
    background: rgba(0,0,0,0.6);
    border-radius: 8px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 5;
}
.kga-screen-nodes {
    position: absolute;
    inset: 30px 0 0 0;
    z-index: 10;
}

/* Admin nodes */
.kga-node {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4fc3f7, #0288d1);
    border: 3px solid #fff;
    transform: translate(-50%, -50%);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    transition: box-shadow 0.2s;
    z-index: 15;
}
.kga-node:active { cursor: grabbing; }
.kga-node:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
.kga-node--selected {
    box-shadow: 0 0 0 3px #f1c40f, 0 4px 14px rgba(0,0,0,0.5);
    z-index: 20;
}
.kga-node--star {
    border-radius: 0;
    background: linear-gradient(145deg, #ffd54f, #ff8f00);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border: none;
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}
.kga-node--boss {
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, #ef5350, #b71c1c);
    border-color: #ffd54f;
    border-width: 3px;
}
.kga-node-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* Sidebar */
.kga-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
}

/* Edit panel */
.kga-edit-panel {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.kga-edit-panel--empty { text-align: center; padding: 24px 16px; }
.kga-edit-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}
.kga-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.kga-edit-row label {
    min-width: 70px;
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    font-weight: 600;
}
.kga-edit-row select,
.kga-edit-row input {
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.8rem;
}
.kga-edit-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

/* Node list */
.kga-node-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.kga-list-title {
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
}
.kga-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    transition: background 0.15s;
}
.kga-list-item:hover { background: rgba(255,255,255,0.08); }
.kga-list-item--selected {
    background: rgba(52,152,219,0.2);
    border: 1px solid rgba(52,152,219,0.3);
}
.kga-list-icon {
    font-size: 0.7rem;
    width: 18px;
    text-align: center;
    color: #4fc3f7;
}
.kga-list-screen {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    color: rgba(255,255,255,0.5);
}
.kga-list-game {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .kga-body { flex-direction: column; }
    .kga-sidebar { width: 100%; max-height: 40vh; border-left: none; border-top: 1px solid rgba(255,255,255,0.1); }
    .kga-map-preview { min-height: 45vh; }
}
