
/* Base UI */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to Globe by default */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header / HUD */
.game-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-board, .timer {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.game-logo {
    height: 44px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}

.game-logo:hover {
    transform: scale(1.05);
}

.mode-switch button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.mode-switch button:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

/* Question Bank (Right Panel) */
.question-bank {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    pointer-events: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    transition: height 0.3s;
}

.question-bank.collapsed {
    height: auto;
}

.bank-header {
    padding: 15px;
    background: #f5f5f7;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.bank-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.bank-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.category-tabs {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.category-tabs button {
    border: none;
    background: none;
    padding: 6px 12px;
    margin-right: 5px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    color: #666;
    transition: all 0.2s;
}

.category-tabs button.active {
    background: #2196F3;
    color: white;
}

.draggable-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.draggable-item {
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
    user-select: none;
}

.draggable-item:hover {
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.draggable-item:active {
    cursor: grabbing;
}

/* Original Controls (Demo Mode) - Reusing similar styles */
#landocean-controls {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 300px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    pointer-events: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#landocean-drag-handle {
    padding: 15px;
    background: #f5f5f7;
    border-bottom: 1px solid #ddd;
}

#landocean-drag-handle h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

#landocean-controls-content {
    padding: 15px;
    overflow-y: auto;
}

.control-section {
    margin-bottom: 15px;
}

.control-section h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #444;
    cursor: pointer;
}

.checkbox-grid input {
    margin-right: 6px;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
::-webkit-scrollbar-track {
    background: transparent;
}

/* Feedback Message */
.feedback-msg {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease-out;
    pointer-events: none;
    text-align: center;
    min-width: 200px;
}

.feedback-msg.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: 2px solid #a5d6a7;
}

.feedback-msg.error {
    background: linear-gradient(135deg, #FF5252, #f44336);
    border: 2px solid #ffcdd2;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Reset Buttons */
.reset-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    padding: 0 5px;
    transition: color 0.2s;
}

.reset-btn:hover {
    color: #2196F3;
    transform: rotate(180deg);
}

.reset-btn-small {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
    padding: 0;
    transition: color 0.2s;
}

.reset-btn-small:hover {
    color: #2196F3;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    height: 80px;
    margin-bottom: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #2196F3;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Rotation Control */
.rotation-control {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    z-index: 1000;
}

.rotation-control button {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rotation-control button:hover {
    background: rgba(33, 150, 243, 0.8);
    transform: scale(1.1);
}

/* Knowledge Card */
.knowledge-card {
    position: absolute;
    top: 100px;
    left: 20px;
    width: 280px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    pointer-events: auto;
    z-index: 1100;
    animation: slideRight 0.3s ease-out;
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.close-card {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0 5px;
}

.close-card:hover {
    color: #000;
}

.card-header {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

.card-category {
    font-size: 12px;
    text-transform: uppercase;
    color: #2196F3;
    font-weight: bold;
    letter-spacing: 1px;
}

.card-header h3 {
    margin: 5px 0 0 0;
    font-size: 22px;
    color: #333;
}

.card-body p {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* Globe Labels */
.globe-label-wrapper {
    pointer-events: auto !important;
    cursor: pointer !important;
    /* No transition here to prevent drift */
}

.globe-label-text {
    text-shadow: 0 0 3px black;
    transition: transform 0.2s, text-shadow 0.2s, color 0.2s;
    display: inline-block; /* Required for transform */
}

.globe-label-wrapper:hover .globe-label-text {
    transform: scale(1.2);
    text-shadow: 0 0 8px #2196F3;
    color: #2196F3 !important;
    z-index: 10000;
}

/* Game Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    pointer-events: auto; /* Ensure overlay captures clicks */
}

.game-modal {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    animation: zoomIn 0.3s ease-out;
    pointer-events: auto; /* Ensure modal content is interactive */
    position: relative; /* Ensure z-index works properly */
    z-index: 2001;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.game-modal h2 {
    color: #333;
    margin-top: 0;
    font-size: 28px;
}

.modal-body {
    text-align: left;
    margin: 30px 0;
    color: #555;
}

.modal-body ul {
    list-style: none;
    padding: 0;
}

.modal-body li {
    margin: 10px 0;
    font-size: 16px;
}

.start-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}
