 /* =========================================
       1. GLOBAL TOOLKIT STYLES (Light Theme)
       ========================================= */
    * { box-sizing: border-box; }
    html, body { overflow-x: hidden; width: 100%; }
    body { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; background: #f4f4f4; text-align: center; margin: 0; padding: 10px; color: #333; }

   /* NEW: Zoom Controls CSS */
    .zoom-controls { position: fixed; top: 15px; right: 15px; z-index: 9999; display: flex; gap: 5px; background: #121726; padding: 8px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); transition: opacity 0.3s; }
    .zoom-controls button { background: #2c3558; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 14px; transition: background 0.2s; }
    .zoom-controls button:hover { background: #4da6ff; color: #000; }
    
    .container { max-width: 900px; margin: auto; background: white; padding: 15px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
    h1 { margin-top: 5px; font-size: 24px; color: #222; }
    h2 { margin-top: 5px; color: #444; }
    
    .menu-btn { display: block; width: 100%; max-width: 280px; margin: 10px auto; padding: 12px; border: none; border-radius: 8px; background: #007bff; color: white; cursor: pointer; font-weight: bold; font-size: 15px; transition: background 0.2s, transform 0.1s; }
    .menu-btn:hover { background: #0056b3; transform: translateY(-1px); }
    .menu-btn:active { transform: translateY(1px); }
    
    .tool-input, .tool-select { display: block; width: 100%; max-width: 280px; margin: 10px auto; padding: 12px; border: 1px solid #ccc; border-radius: 6px; text-align: center; font-size: 14px; transition: border-color 0.2s; }
    .tool-input:focus, .tool-select:focus { outline: none; border-color: #007bff; }
    
    .tool { display: none; width: 100%; padding-bottom: 10px; }
    .guide { display: none; background: #eef; padding: 15px; border-radius: 6px; margin: 15px auto; font-size: 14px; max-width: 280px; border: 1px solid #ccd; text-align: left; }

    /* Expandable Sub-menus for Gem Tool */
    .adv-group { display: none; background: #fdfdfd; padding: 10px; border-radius: 6px; margin: -5px auto 15px auto; max-width: 280px; border: 1px dashed #bbb; animation: fadeIn 0.3s ease; }
    .adv-label { display: block; font-size: 11px; color: #888; font-weight: bold; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
    .adv-group .tool-input { margin: 6px auto; padding: 10px; }

    /* =========================================
       2. TROOP & CALC CSS
       ========================================= */
    .game-icon { height: 20px; width: auto; vertical-align: middle; background: #eee; border-radius: 3px; }
    .sticky-stats { position: sticky; top: 0; z-index: 10; background: #fff; padding: 10px 0; display: flex; justify-content: space-around; border-bottom: 2px solid #eee; margin-bottom: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
    .stat-item { display: flex; align-items: center; font-weight: 800; font-size: 16px; gap: 6px; color: #333; }
    .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; background: #f9f9f9; padding: 12px; border-radius: 8px; border: 1px solid #eee; }
    .input-group { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: left; }
    .input-group label { font-size: 10px; font-weight: 800; color: #666; text-transform: uppercase; margin-bottom: 4px; }
    .input-group input[type="number"] { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; margin: 0; }
    .input-group input[type="checkbox"] { width: 20px; height: 20px; margin: 8px 0; cursor: pointer; }
    .tier-row { border-bottom: 1px solid #eee; padding: 15px 0; }
    .tier-header { font-weight: 800; color: #007bff; margin-bottom: 10px; font-size: 14px; text-align: center; letter-spacing: 1px; } 
    .tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .troop-box input { width: 100%; padding: 8px 4px; margin: 0; font-size: 13px; text-align: center; border: 1px solid #ccc; border-radius: 4px; }
    .troop-box label { display: block; font-size: 10px; font-weight: bold; color: #888; text-align: center; margin-bottom: 3px; }
    .troop-img { width: 45px; height: 45px; object-fit: cover; border-radius: 4px; background: #eaeaea; display: block; margin: 0 auto 5px auto; border: 1px solid #ddd; }

    /* Result Overlay */
    .resultTab { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); justify-content: center; align-items: center; z-index: 1000; padding: 15px; animation: fadeIn 0.3s ease; }
    .resultBox { background: white; padding: 25px; border-radius: 12px; width: 100%; max-width: 360px; position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
    .closeBtn { position: absolute; right: 15px; top: 10px; font-weight: bold; cursor: pointer; color: red; font-size: 20px; transition: transform 0.2s; }
    .closeBtn:hover { transform: scale(1.1); }
    .resultGrid { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; margin-top: 15px; font-size: 15px; }
    .resultGrid div { text-align: left; display: flex; align-items: center; gap: 8px; font-weight: 500;}
    .totalRow { margin-top: 15px; padding-top: 10px; border-top: 2px solid #ccc; font-weight: 800; display: grid; grid-template-columns: 1fr auto; color: #007bff; font-size: 18px; }
    .precise-time { font-family: monospace; background: #222; color: #00ffcc; padding: 12px; border-radius: 6px; margin: 10px 0; font-size: 18px; text-align: center; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); }

    /* =========================================
       3. CHAOS ARENA CSS
       ========================================= */
    #chaosResult { margin-top:15px; text-align:left; background:#f9f9f9; padding:15px; border-radius:8px; border:1px solid #ccc; max-height:350px; overflow-y:auto; display:none; box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); }
    #chaosResult ul { list-style-type: none; padding-left: 0; margin: 10px 0; }
    #chaosResult li { padding: 6px 0; border-bottom: 1px solid #e0e0e0; font-size: 13px; color: #444; display: flex; justify-content: space-between; }
    #chaosResult h3 { margin-top: 0; color: #8e44ad; border-bottom: 2px solid #8e44ad; padding-bottom: 5px; font-size: 16px;}
    .chaos-summary { background: #e8f4fd; padding: 10px; border-radius: 6px; margin-top: 10px; border: 1px solid #bce0fd; }
    .chaos-summary strong { display: block; color: #0056b3; font-size: 14px; margin-bottom: 4px; }

    /* =========================================
       4. GEAR SIMULATOR CSS
       ========================================= */
    #gearTool {
      --bg: #0b0e17; --panel: #161b2e; --panel-2: #1e2540; --text: #e2e8f0; 
      --muted: #8e9bb0; --accent: #4da6ff; --accent-glow: rgba(77, 166, 255, 0.4); --border: rgba(255,255,255,0.08);
      --danger: #ff4d4d; --danger-dark: #cc0000; --sigil: #b08dff;
      background: var(--bg); color: var(--text); padding: 20px 15px; border-radius: 12px; margin-top: 10px; box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    }
    #gearTool .wrap { max-width: 1000px; margin: 0 auto; }
    #gearTool .top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 10px; flex-wrap: wrap; }
    #gearTool .tabs { display: flex; gap: 8px; background: rgba(0,0,0,0.3); padding: 5px; border-radius: 8px;}
    #gearTool .tab { padding: 8px 18px; background: transparent; border: none; color: var(--muted); border-radius: 6px; cursor: pointer; transition: all 0.2s; font-size:14px; font-weight: 600; font-family: inherit;}
    #gearTool .tab:hover { color: #fff; background: rgba(255,255,255,0.05); }
    #gearTool .tab.active { background: var(--accent); color: #000; box-shadow: 0 0 10px var(--accent-glow); }
    #gearTool .reset-all-btn { background: rgba(255, 77, 77, 0.1); color: var(--danger); border: 1px solid var(--danger); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 13px; transition: all 0.2s; font-family: inherit;}
    #gearTool .reset-all-btn:hover { background: var(--danger); color: white; box-shadow: 0 0 10px rgba(255, 77, 77, 0.4); }
    
    #gearTool .stats-container { background: var(--panel); border-radius: 10px; padding: 18px; margin-bottom: 20px; border: 1px solid var(--border); display: flex; gap: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
    #gearTool .stat-col { flex: 1; text-align: left; }
    #gearTool .stat-col-divider { width: 1px; background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.1), transparent); }
    #gearTool .stat-header { font-weight: 800; color: var(--accent); margin-bottom: 12px; font-size: 14px; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 6px; text-align: center; letter-spacing: 1px;}
    #gearTool .stat-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
    #gearTool .stat-row span { color: var(--muted); }
    #gearTool .stat-row strong { color: #fff; }
    
    #gearTool .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
    #gearTool .slot { background: var(--panel); border-radius: 10px; padding: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--border); height: 100%; min-height: 160px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); position: relative; overflow: hidden;}
    #gearTool .slot-label { color: var(--muted); font-weight: bold; text-transform: uppercase; font-size: 10px; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; letter-spacing: 0.5px;}
    #gearTool .img-box { width: 100%; aspect-ratio: 1/1; background: #1c223a; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); margin: 0 auto; position: relative; flex: 0 0 auto; transition: all 0.2s;}
    #gearTool .img-box img { width: 100%; height: 100%; object-fit: cover; }
    #gearTool .slot:has(img) .img-box { border-color: rgba(77, 166, 255, 0.3); box-shadow: 0 0 15px rgba(77, 166, 255, 0.1); }
    #gearTool .slot:has(img) .slot-label { color: var(--accent); }
    #gearTool .img-box.empty-box { cursor: pointer; border: 1px dashed rgba(255,255,255,0.2); background: rgba(0,0,0,0.2); }
    #gearTool .img-box.empty-box:hover { border-color: var(--accent); background: rgba(77, 166, 255, 0.05); transform: scale(1.02); }
    
    #gearTool .btn { cursor: pointer; border: none; border-radius: 5px; padding: 7px; font-size: 11px; font-weight: bold; color: #fff; background: #2c3558; transition: all 0.2s; width: 100%; margin:0; font-family: inherit;}
    #gearTool .btn:hover { background: #3d4975; transform: translateY(-1px); }
    #gearTool .btn:active { transform: translateY(0); }
    #gearTool .btn-plus { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); font-size: 24px; color: var(--muted); display: flex; align-items: center; justify-content: center; transition: all 0.2s;}
    #gearTool .empty-box:hover .btn-plus { background: var(--accent); color: #000; border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow);}
    
    #gearTool .actions-group { display: flex; flex-direction: column; gap: 5px; margin-top: auto; padding-top: 10px; width: 100%; }
    #gearTool .btn-clear { background: transparent; color: var(--danger); border: 1px solid rgba(255, 77, 77, 0.3); }
    #gearTool .btn-clear:hover { background: var(--danger); color: white; border-color: var(--danger); }

    /* Temper Select Dropdown Styling */
    #gearTool .temper-select { width: 100%; padding: 5px; border-radius: 4px; background: #1c223a; color: #4da6ff; border: 1px solid rgba(77, 166, 255, 0.3); font-size: 11px; font-family: inherit; font-weight: bold; cursor: pointer; outline: none; transition: all 0.2s;}
    #gearTool .temper-select:hover { border-color: #4da6ff; background: #222a46; }
    #gearTool .temper-select option { background: #121726; color: #fff; }

    /* Gear Modal CSS */
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

    .g-modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: none; z-index: 2000; padding: 20px; align-items: center; justify-content: center; font-family: 'Segoe UI', Tahoma, sans-serif; backdrop-filter: blur(3px); animation: fadeIn 0.2s ease;}
    .g-modal-wrap.open { display: flex; }
    .g-modal-box { background: #121726; width: 100%; max-width: 500px; max-height: 85vh; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; color:#fff; text-align: left; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);}
    .g-modal-header { padding: 18px 20px; background: #181e33; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.05);}
    .g-modal-body { padding: 15px 20px; overflow-y: auto; flex: 1; }
    
    .g-modal-body::-webkit-scrollbar { width: 6px; }
    .g-modal-body::-webkit-scrollbar-track { background: transparent; }
    .g-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
    .g-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

    .g-modal-body .card { background: #1c223a; padding: 12px; border-radius: 8px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.05); display: flex; align-items: flex-start; gap: 15px; cursor: pointer; transition: all 0.2s; }
    .g-modal-body .card:hover { border-color: var(--accent); background: #222a46; transform: translateX(2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2);}
    .g-modal-body .card img { width: 60px; height: 60px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); margin-top: 2px; object-fit: cover;}
    .g-modal-body .preview-area { background: #161b2e; padding: 15px; border-radius: 8px; margin-bottom: 15px; border-left: 4px solid var(--accent); font-size: 14px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);}
    .g-modal-body .jewel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .g-modal-body .sigil-box { display: flex; justify-content: center; margin-top: 5px; }
    .g-modal-body .socket { background: #1c223a; padding: 12px 8px; border-radius: 8px; font-size: 11px; cursor: pointer; text-align: center; border: 1px solid rgba(255,255,255,0.05); transition: all 0.2s; font-weight: 600;}
    .g-modal-body .socket:hover { border-color: var(--accent); background: #222a46; transform: translateY(-2px);}
    .g-modal-body .btn { cursor: pointer; border: none; border-radius: 6px; padding: 10px; font-size: 12px; font-weight: bold; color: white; background: #2c3558; width: 100%; transition: all 0.2s;}
    .g-modal-body .btn:hover { background: #3d4975; }

    /* Toast Notification */
    .toast-notif { position: fixed; top: 70%; left: 50%; transform: translate(-50%, -50%); background: rgba(18, 23, 38, 0.95); color: #4da6ff; padding: 15px 30px; border-radius: 30px; font-weight: 800; font-size: 16px; z-index: 3000; pointer-events: none; opacity: 0; transition: opacity 0.3s; box-shadow: 0 4px 20px rgba(0,0,0,0.5); border: 2px solid #4da6ff; letter-spacing: 1px;}
    .toast-notif.show { opacity: 1; }

    /* =========================================
/* =========================================
   5. COLOSSEUM ROTATION CSS
   ========================================= */
.colo-card { background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #ccc; margin-bottom: 15px; text-align: left; }
.colo-card-title { font-size: 12px; font-weight: bold; color: #888; text-transform: uppercase; margin-bottom: 5px; }
.colo-card-value { font-size: 20px; font-weight: 800; color: #fd7e14; margin-bottom: 10px; }
.colo-timers { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.colo-timers .timer-box { flex: 1; min-width: 120px; background: #222; color: #00ffcc; padding: 12px; border-radius: 6px; text-align: center; font-family: monospace; font-size: 16px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); }
.colo-timers .timer-box span { display: block; font-size: 10px; color: #aaa; text-transform: uppercase; margin-bottom: 3px; font-family: 'Segoe UI', sans-serif;}
.colo-list { list-style: none; padding: 0; margin: 15px 0 0 0; border: 1px solid #eee; border-radius: 8px; background: #f9f9f9; overflow: hidden; text-align: left; }
.colo-list li { padding: 12px 15px; border-bottom: 1px solid #eee; font-size: 14px; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s;}
.colo-list li:last-child { border-bottom: none; }
.colo-list li.active { background: #fd7e14; color: white; font-weight: bold; transform: scale(1.02); box-shadow: 0 4px 10px rgba(253, 126, 20, 0.3); border-radius: 6px;}
.colo-list li.active span { color: white; }
.colo-list li span { color: #666; font-size: 12px; font-weight: bold; }

    
    
    

    /* Mobile overrides */
    @media (max-width: 600px) {
        .container { padding: 10px; border-radius: 0; box-shadow: none; }
        .tier-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
        #gearTool { padding: 12px; }
        #gearTool .top-bar { justify-content: center; }
        #gearTool .stats-container { flex-direction: column; gap: 10px; padding: 12px;}
        #gearTool .stat-col-divider { width: 100%; height: 1px; background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent); margin: 5px 0; }
        #gearTool .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
        #gearTool .slot { padding: 8px; min-height: 130px; border-radius: 8px;}
        #gearTool .slot-label { font-size: 8px; margin-bottom: 6px; letter-spacing: 0;}
        #gearTool .img-box { border-radius: 6px; }
        #gearTool .btn { padding: 6px 2px; font-size: 9px; border-radius: 4px;}
        #gearTool .btn-plus { width: 30px; height: 30px; font-size: 20px; }
        #gearTool .actions-group { gap: 4px; padding-top: 6px;}
        .g-modal-box { max-height: 90vh; }
        .g-modal-body { padding: 12px; }
        
/* =========================================
   6. ADMIN SYNC PANEL CSS
   ========================================= */
.admin-btn { background: #dc3545; color: white; margin-top: 20px; width: 100%; padding: 12px; border-radius: 6px; border: none; font-weight: bold; cursor: pointer; }
.admin-panel { background: #f8d7da; border-color: #dc3545; margin-top: 10px; }
.admin-label { font-size: 12px; font-weight: bold; margin-top: 10px; display: block; color: #333; }
.admin-input { width: 100%; padding: 10px; margin-bottom: 10px; border-radius: 4px; border: 1px solid #ccc; font-size: 14px; box-sizing: border-box; }
.admin-save-btn { background: #28a745; color: white; width: 100%; padding: 12px; border-radius: 6px; border: none; font-weight: bold; font-size: 16px; cursor: pointer; }
        
    }
