/**
 * Game Map Styles — Illustration Map + Duolingo-style Area Detail
 *
 * @package Ubitto_Program_Creator
 * @since 3.13.0
 */

/* ===================================================
   FULL-SCREEN GAME MODE
   =================================================== */

body.ubitto-gm-fullscreen {
    overflow: hidden !important;
}
body.ubitto-gm-fullscreen #masthead,
body.ubitto-gm-fullscreen .site-header,
body.ubitto-gm-fullscreen .site-footer,
body.ubitto-gm-fullscreen #wpadminbar,
body.ubitto-gm-fullscreen .admin-bar,
body.ubitto-gm-fullscreen #colophon {
    display: none !important;
}

/* === Wrapper === */
.ubitto-gm-wrapper {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: #1a2a3a;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* === Fade-in transition === */
.ubitto-gm-fadein {
    animation: ubitto-gm-fade 0.4s ease-out;
}
@keyframes ubitto-gm-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===================================================
   HUD — Top Bar
   =================================================== */

.ubitto-gm-hud {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    z-index: 2;
    gap: 16px;
    flex-shrink: 0;
}

.ubitto-gm-exit-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}
.ubitto-gm-exit-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.ubitto-gm-hud-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 0;
}

.ubitto-gm-island-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ubitto-gm-island-theme {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.ubitto-gm-hud-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.ubitto-gm-hud-stat {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.ubitto-gm-hud-stat strong {
    font-weight: 700;
}

.ubitto-gm-hud .ubitto-gm-day-badge {
    background: rgba(255, 152, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

/* ===================================================
   PROGRESS BAR
   =================================================== */

.ubitto-gm-island-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 20px;
    background: rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.ubitto-gm-progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.ubitto-gm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #a5d6a7);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.ubitto-gm-progress-text {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

/* ===================================================
   VIEW 1 — WORLD MAP (SVG)
   =================================================== */

.ubitto-gm-map-viewport {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.ubitto-gm-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 12px;
}

/* Area hotspot hover */
.ubitto-gm-area-hotspot {
    transition: opacity 0.2s;
}
.ubitto-gm-area-hotspot:hover {
    opacity: 0.9;
    filter: brightness(1.1);
}

/* Pulsing rectangle border for current area */
@keyframes ubitto-gm-rect-pulse {
    0%   { opacity: 0.5; stroke-width: 4; }
    50%  { opacity: 0.15; stroke-width: 6; }
    100% { opacity: 0.5; stroke-width: 4; }
}
.ubitto-gm-rect-pulse {
    animation: ubitto-gm-rect-pulse 2.2s ease-in-out infinite;
}

/* ===================================================
   VIEW 2 — AREA DETAIL (Duolingo-style path)
   =================================================== */

.ubitto-gm-area-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    transition: background 0.4s ease;
}

/* Area banner */
.ubitto-gm-area-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #43a047, #2e7d32);
}

.ubitto-gm-area-back {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.ubitto-gm-area-back:hover {
    background: rgba(255, 255, 255, 0.35);
}

.ubitto-gm-area-banner-text {
    flex: 1;
}

.ubitto-gm-area-section {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ubitto-gm-area-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Scrollable node path */
.ubitto-gm-node-path {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 60px;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* When using map layout, clip any overflow (map may be taller than screen) */
.ubitto-gm-area-detail:has(.ubitto-gm-node-path-map) {
    overflow: hidden;
}

/* Map-illustration layout: nodes positioned absolutely over background image */
/* JS sets width: 100% and derives height from image aspect ratio */
.ubitto-gm-node-path.ubitto-gm-node-path-map {
    display: block;
    position: relative;
    padding: 0;
    gap: 0;
    background-size: 100% 100%;
    background-position: center top;
    background-repeat: no-repeat;
    overflow: hidden;
}

.ubitto-gm-node-path-map .ubitto-gm-path-node {
    z-index: 2;
}
/* Semi-transparent nodes on map so the illustration shows through */
.ubitto-gm-node-path-map .ubitto-gm-path-ring-active {
    opacity: 0.7;
}
.ubitto-gm-node-path-map .ubitto-gm-path-node-completed .ubitto-gm-path-ring {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
    opacity: 0.7;
}

.ubitto-gm-node-path-map .ubitto-gm-path-label {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}
/* Label above node for nodes near bottom edge */
.ubitto-gm-node-path-map .ubitto-gm-path-label-top {
    order: -1;
}

/* Admin reposition bar */
.ubitto-gm-reposition-bar {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: #1a1a2e;
    flex-shrink: 0;
    z-index: 10;
}

.ubitto-gm-reposition-btn,
.ubitto-gm-reposition-save,
.ubitto-gm-reposition-cancel {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ubitto-gm-reposition-btn {
    background: #ff9800;
    color: #fff;
}

.ubitto-gm-reposition-save {
    background: #4caf50;
    color: #fff;
}

.ubitto-gm-reposition-cancel {
    background: #666;
    color: #fff;
}

/* Reposition mode: allow overflow so admin can drag nodes to edges */
.ubitto-gm-reposition-mode.ubitto-gm-node-path-map {
    overflow: visible;
}

/* Reposition mode: draggable nodes */
.ubitto-gm-reposition-mode .ubitto-gm-path-node.ubitto-gm-draggable {
    cursor: grab;
    outline: 2px dashed #ff9800;
    outline-offset: 4px;
    border-radius: 50%;
}

.ubitto-gm-reposition-mode .ubitto-gm-path-node.ubitto-gm-dragging {
    cursor: grabbing;
    outline-color: #4caf50;
    z-index: 100 !important;
    opacity: 0.85;
}

/* Individual node on the path */
.ubitto-gm-path-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
}

.ubitto-gm-path-node:not(.ubitto-gm-path-node-locked):hover {
    transform: translate(var(--offset, 0), var(--offset-y, 0)) scale(1.08) !important;
}
.ubitto-gm-path-node:not(.ubitto-gm-path-node-locked):active {
    transform: translate(var(--offset, 0), var(--offset-y, 0)) scale(0.95) !important;
}
/* Map layout: nodes use translate(-50%, -50%) for centering */
.ubitto-gm-node-path-map .ubitto-gm-path-node:not(.ubitto-gm-path-node-locked):hover {
    transform: translate(-50%, -50%) scale(1.08) !important;
}
.ubitto-gm-node-path-map .ubitto-gm-path-node:not(.ubitto-gm-path-node-locked):active {
    transform: translate(-50%, -50%) scale(0.95) !important;
}

/* Ring (outer hexagon) */
.ubitto-gm-path-ring {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.ubitto-gm-path-ring-active {
    animation: ubitto-gm-ring-pulse 2s ease-in-out infinite;
}
@keyframes ubitto-gm-ring-pulse {
    0%, 100% { filter: drop-shadow(0 0 0px rgba(255, 152, 0, 0.4)); }
    50%      { filter: drop-shadow(0 0 10px rgba(255, 152, 0, 0.6)); }
}

/* Inner hexagon */
.ubitto-gm-path-circle {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.ubitto-gm-path-icon {
    font-size: 24px;
    line-height: 1;
}

.ubitto-gm-lock-icon {
    background: rgba(0, 0, 0, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* Completed node extra glow */
.ubitto-gm-path-node-completed .ubitto-gm-path-ring {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
    filter: drop-shadow(0 4px 10px rgba(76, 175, 80, 0.6));
}

/* Unlocked node glow */
.ubitto-gm-path-node-unlocked .ubitto-gm-path-ring,
.ubitto-gm-path-node-in_progress .ubitto-gm-path-ring {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
    filter: drop-shadow(0 4px 12px rgba(255, 152, 0, 0.7));
}

/* Locked node dim */
.ubitto-gm-path-node-locked {
    opacity: 0.75;
}

/* Node label */
.ubitto-gm-path-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-align: center;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ubitto-gm-path-node-completed .ubitto-gm-path-label { color: #2e7d32; }
.ubitto-gm-path-node-unlocked .ubitto-gm-path-label,
.ubitto-gm-path-node-in_progress .ubitto-gm-path-label { color: #e65100; font-weight: 700; }
.ubitto-gm-path-node-locked .ubitto-gm-path-label { color: #bbb; }

/* ===================================================
   DESKTOP OVERRIDES
   =================================================== */

@media (min-width: 769px) {
    /* Fit vertical map within viewport height, center horizontally */
    .ubitto-gm-map-viewport {
        align-items: center;
        overflow: hidden;
    }
    .ubitto-gm-svg {
        width: auto;
        height: 100%;
        max-height: 100%;
        max-width: 100%;
    }
    .ubitto-gm-node-path-map {
        margin: 0 auto;
    }
}

/* ===================================================
   QUIZ MODAL
   =================================================== */

.ubitto-gm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ubitto-gm-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.ubitto-gm-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: ubitto-gm-modal-in 0.25s ease-out;
}
@keyframes ubitto-gm-modal-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ubitto-gm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
}
.ubitto-gm-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}
.ubitto-gm-modal-close {
    font-size: 18px;
    padding: 4px 8px;
    line-height: 1.1;
    background-color: unset;
    border: 1px solid #dcdfe6;
    color: #7f8fa4;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.ubitto-gm-modal-close:hover {
    color: #1a84ee !important;
    border-color: #1a84ee !important;
    background-color: #ecf5ff !important;
}

.ubitto-gm-modal-body { padding: 24px; overflow-y: auto; overflow-x: hidden; }
.ubitto-gm-quiz-viewer { min-height: 400px; max-width: 100% !important; width: 100% !important; box-sizing: border-box; }

/* Quiz-viewer compatibility overrides inside the Adventure modal.
   Different quiz viewers set their own height/overflow. Make sure nothing clips. */
.ubitto-gm-modal-body .ubitto-image-words-viewer,
.ubitto-gm-modal-body .ubitto-image-words-viewer #page-start,
.ubitto-gm-modal-body .ubitto-image-words-viewer #page-main { overflow: visible !important; width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
.ubitto-gm-modal-body .ubitto-image-words-viewer #canvas { max-width: 100% !important; }
.ubitto-gm-modal-body .ubitto-image-words-viewer #preview-image { max-width: 100% !important; height: auto !important; }

/* ===================================================
   LOADING SPINNER
   =================================================== */

.ubitto-gm-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #4a90d9;
    border-radius: 50%;
    margin: 0 auto;
    animation: ubitto-gm-spin 0.7s linear infinite;
}
@keyframes ubitto-gm-spin {
    to { transform: rotate(360deg); }
}

/* ===================================================
   TOAST
   =================================================== */

.ubitto-gm-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.ubitto-gm-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.ubitto-gm-toast-icon {
    font-size: 20px;
    color: #4caf50;
}

/* ===================================================
   DASHBOARD COMPACT CARD (Overview tab)
   =================================================== */

.ubitto-gm-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}
.ubitto-gm-card-header { margin-bottom: 16px; }
.ubitto-gm-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.ubitto-gm-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0;
    flex: 1;
}
.ubitto-gm-card-badge {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}
.ubitto-gm-card-subtitle { font-size: 13px; color: #888; margin: 0; }

.ubitto-gm-card-progress { margin-bottom: 14px; }
.ubitto-gm-card-progress-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.ubitto-gm-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.ubitto-gm-card-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.ubitto-gm-card-islands {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.ubitto-gm-card-island {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
}
.ubitto-gm-card-island-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 2px solid #ccc;
    transition: all 0.3s;
}
.ubitto-gm-card-island.complete .ubitto-gm-card-island-dot {
    background: #4caf50;
    border-color: #388e3c;
}
.ubitto-gm-card-island.current .ubitto-gm-card-island-dot {
    background: #ff9800;
    border-color: #f57c00;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25);
}
.ubitto-gm-card-island-name {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    white-space: nowrap;
}
.ubitto-gm-card-island.complete .ubitto-gm-card-island-name { color: #4caf50; }
.ubitto-gm-card-island.current .ubitto-gm-card-island-name { color: #f57c00; font-weight: 600; }

.ubitto-gm-card-island-connector {
    width: 20px;
    height: 2px;
    background: #e0e0e0;
    margin-bottom: 18px;
}
.ubitto-gm-card-island-connector.active { background: #4caf50; }

.ubitto-gm-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}
.ubitto-gm-card-btn:hover {
    background: linear-gradient(135deg, #ffa726, #fb8c00);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 768px) {
    .ubitto-gm-hud { padding: 8px 14px; gap: 10px; }
    .ubitto-gm-exit-btn { width: 36px; height: 36px; font-size: 20px; align-items: center; }
    .ubitto-gm-island-name { font-size: 15px; }
    .ubitto-gm-island-theme { font-size: 10px; }
    .ubitto-gm-hud-right { gap: 8px; }
    .ubitto-gm-hud-stat { font-size: 12px; }

    .ubitto-gm-map-viewport {
        padding: 4px 8px;
    }

    .ubitto-gm-area-banner { padding: 12px 16px; gap: 10px; }
    .ubitto-gm-area-title { font-size: 17px; }
    .ubitto-gm-area-back { width: 34px; height: 34px; font-size: 18px; }
    .ubitto-gm-node-path { padding: 30px 16px 50px; }
    .ubitto-gm-path-icon { font-size: 20px; }

    .ubitto-gm-modal-content { max-width: 100%; max-height: 90vh; border-radius: 12px; }
    .ubitto-gm-modal-body { padding: 16px; }
    .ubitto-gm-toast { bottom: 65px; font-size: 13px; padding: 10px 20px; }

    .ubitto-gm-card-islands { gap: 0; }
    .ubitto-gm-card-island { min-width: 50px; }
    .ubitto-gm-card-island-name { font-size: 8px; }
}

@media (max-width: 480px) {
    .ubitto-gm-hud { padding: 6px 10px; gap: 6px; }
    .ubitto-gm-island-name { font-size: 13px; }
    .ubitto-gm-hud-right { gap: 6px; }
    .ubitto-gm-hud-stat { font-size: 11px; }
    .ubitto-gm-hud .ubitto-gm-day-badge { font-size: 10px; padding: 2px 8px; }

    .ubitto-gm-island-progress { padding: 4px 10px; }
    .ubitto-gm-map-viewport { padding: 2px 4px; }

    .ubitto-gm-area-banner { padding: 10px 12px; }
    .ubitto-gm-area-title { font-size: 15px; }
    .ubitto-gm-node-path { padding: 24px 12px 40px; gap: 8px; }

    .ubitto-gm-modal { padding: 10px; }
    .ubitto-gm-modal-header { padding: 12px 16px; }
    .ubitto-gm-modal-title { font-size: 16px; }
}

/* ===================================================
   ADMIN INLINE EDITING (admin-only controls)
   =================================================== */

/* Edit button on island (SVG) */
.ubitto-gm-admin-edit-btn { opacity: 0.7; transition: opacity 0.2s; }
.ubitto-gm-admin-edit-btn:hover { opacity: 1; }

/* Edit button on island banner */
.ubitto-gm-admin-banner-edit {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-left: auto;
}
.ubitto-gm-admin-banner-edit:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Edit button on each node */
.ubitto-gm-admin-node-edit {
    position: absolute;
    top: -4px;
    right: -4px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
    line-height: 1;
}
.ubitto-gm-admin-node-edit:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.15);
}

/* Add Node button */
.ubitto-gm-admin-add-node {
    background: rgba(0, 0, 0, 0.6);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
    z-index: 1;
}
.ubitto-gm-admin-add-node:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Admin modals (dark-themed to match the game map) */
.ubitto-gm-admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ubitto-gm-admin-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.ubitto-gm-admin-modal-box {
    position: relative;
    background: #2a2a3a;
    border-radius: 16px;
    padding: 24px 28px;
    max-width: 440px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
    animation: ubitto-gm-modal-in 0.25s ease-out;
}

.ubitto-gm-admin-modal-box h3 {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ubitto-gm-admin-modal-box label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #bbb;
    margin-bottom: 12px;
}

.ubitto-gm-admin-modal-box input[type="text"],
.ubitto-gm-admin-modal-box input[type="number"],
.ubitto-gm-admin-modal-box select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 12px;
    background-color: #1a1a2a !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff !important;
    color-scheme: dark;
    font-size: 14px;
    box-sizing: border-box;
}
.ubitto-gm-admin-modal-box select {
    cursor: pointer;
}
.ubitto-gm-admin-modal-box select option {
    background-color: #1a1a2a;
    color: #fff;
}
.ubitto-gm-admin-modal-box input:focus,
.ubitto-gm-admin-modal-box select:focus {
    outline: none;
    border-color: #ff9800;
}
/* Boss quiz code checkboxes */
.ubitto-gm-admin-modal-box .gm-admin-node-codes-cb {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
}

.ubitto-gm-admin-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-direction: row !important;
}
.ubitto-gm-admin-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Focus area multi-select dropdown */
.gm-admin-multi-dropdown {
    position: relative;
    margin-bottom: 12px;
}
.gm-admin-multi-selected {
    background: #1e2d3d !important;
    color: #ccc !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 32px 8px 10px;
    font-size: 13px;
    cursor: pointer;
    min-height: 36px;
    line-height: 1.4;
    position: relative;
    color-scheme: dark;
}
.gm-admin-multi-selected::after {
    content: '▾';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #999;
    pointer-events: none;
}
.gm-admin-multi-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e2d3d;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 10;
    max-height: 180px;
    overflow-y: auto;
    padding: 6px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.gm-admin-focus-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #ccc;
    margin-bottom: 0 !important;
    cursor: pointer;
    padding: 6px 10px;
    transition: background 0.15s;
}
.gm-admin-focus-label:hover {
    background: rgba(255, 255, 255, 0.08);
}
.gm-admin-focus-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.ubitto-gm-admin-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ubitto-gm-admin-btn-save {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
}
.ubitto-gm-admin-btn-save:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.ubitto-gm-admin-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.ubitto-gm-admin-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ubitto-gm-admin-btn-delete {
    background: rgba(214, 54, 56, 0.8);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-left: auto;
    transition: background 0.2s;
}
.ubitto-gm-admin-btn-delete:hover {
    background: rgba(214, 54, 56, 1);
}

/* Admin modal responsive */
@media (max-width: 480px) {
    .ubitto-gm-admin-modal-box {
        padding: 18px 20px;
    }
    .ubitto-gm-admin-modal-box h3 {
        font-size: 16px;
    }
}
