/* --- Layout & Reset --- */
body { margin: 0; overflow: hidden; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: #333; background: #e0e0e0; display: flex; height: 100vh; width: 100vw; }
#three-container { flex: 70%; position: relative; height: 100%; outline: none; background: #d9d9d9; overflow: hidden; cursor: default; }
#sidebar { flex: 30%; height: 100%; background: #f8f9fa; display: flex; flex-direction: column; border-left: 1px solid #ccc; box-shadow: -2px 0 10px rgba(0,0,0,0.05); z-index: 10; box-sizing: border-box; }

/* --- Sidebar UI --- */
.sidebar-header { padding: 20px; background: #fff; border-bottom: 1px solid #eee; }
h1 { font-size: 1.3rem; margin: 0 0 5px 0; color: #0056b3; }
.subtitle { font-size: 0.85rem; color: #666; margin: 0; }
#sidebar-content { flex-grow: 1; overflow-y: auto; padding: 20px; }
.category-title { font-size: 0.9rem; font-weight: 700; margin: 15px 0 10px 0; color: #555; text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-footer { padding: 20px; background: #fff; border-top: 2px solid #ddd; font-size: 1.2rem; font-weight: bold; display: flex; justify-content: space-between; margin-top: auto; }

/* --- Option Buttons --- */
.option-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; margin-bottom: 8px; background: #fff; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; text-align: left; transition: all 0.1s ease; font-size: 0.9rem; position: relative; }
.option-btn:hover:not(.disabled):not(.selected), .option-btn.cross-hover:not(.disabled):not(.selected) { border-color: #3498db; background: #f0f7ff; }
.option-btn.selected { background: #e6ffed; border-color: #28a745; color: #155724; font-weight: 600; }
.option-btn.disabled { background: #f0f0f0; border-color: #eee; color: #999; cursor: not-allowed; }
.btn-details { display: flex; flex-direction: column; }
.rule-note { font-size: 0.75rem; color: #dc3545; margin-top: 2px; font-weight: normal; font-style: italic;}

/* --- Overlays --- */
#tooltip { position: absolute; z-index: 100; background: rgba(255, 255, 255, 0.95); border: 1px solid #ccc; padding: 6px 10px; border-radius: 4px; box-shadow: 2px 2px 5px rgba(0,0,0,0.2); pointer-events: none; opacity: 0; font-size: 0.85rem; top:0; left:0; transition: opacity 0.1s ease-in-out;}
#loading-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(240,240,240,1.0); z-index: 200; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.5s ease-out; }
.spinner { border: 4px solid #f3f3f3; border-top: 4px solid #3498db; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin-bottom: 15px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Debug Toggle & Overlay --- */
#debug-container { position: absolute; bottom: 10px; left: 10px; z-index: 90; display: flex; align-items: flex-end; }
#debug-toggle { background: #fff; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; font-size: 1.2rem; padding: 4px 6px; color: #555; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
#debug-toggle:hover { background: #f0f0f0; color: #333; }
#debug-overlay { margin-left: 10px; background: rgba(255,255,255,0.9); padding: 8px; border-radius: 4px; font-family: 'Consolas', 'Monaco', monospace; font-size: 0.75rem; color: #333; pointer-events: none; white-space: pre; line-height: 1.2; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* --- Instructions Overlay --- */
#instructions-overlay {
    position: absolute; top: 10px; left: 10px; z-index: 80;
    background: rgba(255,255,255,0.8); padding: 6px 10px; border-radius: 4px;
    font-size: 0.75rem; color: #555; pointer-events: none; user-select: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}