/* ============================================================
   TDS Toolkit & Wheel - Main Stylesheet
   ============================================================ */

/* --- Base / Body --- */
body { 
    background: #f0f4f8; 
    color: #1e293b; 
    font-family: Arial, sans-serif; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    padding: 0 0 40px 0; 
    margin: 0;
    overflow-x: hidden;
}

/* --- Full-width Tab Bar --- */
.chrome-tab-bar {
    display: flex;
    background: #dfe1e5;
    padding: 8px 16px 0 16px;
    width: 100%;
    box-sizing: border-box;
    gap: 4px;
    border-bottom: 1px solid #cbd5e1;
    margin-bottom: 30px;
}

.chrome-tab {
    background: transparent;
    color: #5f6368;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    position: relative;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.chrome-tab:hover {
    background: rgba(255, 255, 255, 0.4);
    color: #3c4043;
}

.chrome-tab.active {
    background: #f0f4f8; 
    color: #1a73e8;
    font-weight: bold;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    margin-bottom: -1px; 
    z-index: 2;
}

/* --- Content Views --- */
.content-view {
    display: none;
    width: 100%;
    max-width: 1050px;
    box-sizing: border-box;
    padding: 0 20px;
}

/* --- Wheel View Container Layout --- */
.wheel-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px; 
}

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center; 
    flex: 1;
}

#wheel { 
    background: #ffffff; 
    border-radius: 50%; 
    outline: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.button-group {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

.action-btn { 
    background: #d93838; 
    color: white; 
    border: none; 
    padding: 14px 28px; 
    font-size: 16px; 
    font-weight: bold; 
    border-radius: 8px; 
    cursor: pointer; 
    box-shadow: 0 4px 14px rgba(217, 56, 56, 0.3); 
    transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.action-btn:hover { transform: translateY(-1px); }
.action-btn:active { transform: translateY(1px); }

#skipBtn {
    background: #f43f5e; 
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

#result, #summary { 
    margin-top: 20px; 
    font-size: 18px; 
    font-weight: bold; 
    text-align: center;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

/* --- Shelf Wrapper (stacks shelf + exclude vertically) --- */
.shelf-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 380px;
    flex-shrink: 0;
}

/* --- Shelf Section --- */
.shelf-section {
    width: 100%;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

/* --- Collapsible Shelf Header --- */
.shelf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.shelf-header h2 {
    margin: 0;
    font-size: 20px;
    text-align: center;
    flex: 1;
    border-bottom: none;
    padding-bottom: 0;
}

.chevron {
    font-size: 14px;
    color: #94a3b8;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.chevron.collapsed {
    transform: rotate(-90deg);
}

/* --- Collapsible Shelf Body --- */
.shelf-body {
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    max-height: 2000px;
    padding-top: 0;
}

.shelf-body.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.shelf-row {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: 15px;
    border-left: 5px solid #64748b;
}

#shelf-map { border-left-color: #0ea5e9; }      
#shelf-mode { border-left-color: #a855f7; }     
#shelf-mods { border-left-color: #f59e0b; }     
#shelf-towers { border-left-color: #10b981; }   

.shelf-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
    color: #64748b;
    margin-bottom: 4px;
}

.shelf-content { font-size: 15px; font-weight: 600; }

/* --- Universal Panel Layout for Calculators --- */
.calc-panel {
    max-width: 850px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    color: #475569;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    background: #f8fafc;
}

.calc-results {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #1a73e8;
    margin-top: 25px;
    font-size: 16px;
}

/* --- Skill Tree Dashboard Styles --- */
.tree-dashboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-weight: bold;
    gap: 15px;
    flex-wrap: wrap;
}

.wallet-input-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #0369a1;
}

.wallet-input-zone input {
    width: 120px;
    padding: 6px 10px;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-weight: bold;
    font-size: 15px;
    color: #0c4a6e;
}

.wallet-balance-zone {
    font-size: 16px;
    color: #047857;
    background: #d1fae5;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
}

.tree-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .tree-grid { grid-template-columns: 1fr; }
}

.tree-branch {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
}

.branch-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Skill Card layout and colored branch styling --- */
.skill-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 6px solid #64748b;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}

.skill-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }

.branch-green .skill-card { border-left-color: #22c55e; }
.branch-blue .skill-card { border-left-color: #3b82f6; }
.branch-red .skill-card { border-left-color: #ef4444; }
.branch-purple .skill-card { border-left-color: #a855f7; }

.skill-meta { flex: 1; padding-right: 15px; }
.skill-name { font-weight: bold; font-size: 15px; color: #0f172a; margin-bottom: 1px; }
.skill-cap { font-size: 12px; color: #64748b; font-weight: 500; margin-bottom: 2px; }
.skill-cost { font-size: 12px; font-weight: bold; color: #b45309; }

.skill-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-actions button {
    background: #e2e8f0;
    border: none;
    color: #334155;
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.skill-actions button:hover { background: #cbd5e1; }
.skill-actions button:active { transform: scale(0.95); }

.skill-val {
    font-size: 15px;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

/* ============================================================
   MOBILE RESPONSIVE STYLES
   ============================================================ */

/* --- Tablets & Small Screens (up to 900px) --- */
@media (max-width: 900px) {
    .wheel-container {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .shelf-wrapper {
        width: 100%;
        max-width: 500px;
    }

    .shelf-section {
        width: 100%;
        max-width: 500px;
    }

    .chrome-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .calc-panel {
        padding: 20px;
    }
}

/* --- Mobile Phones (up to 600px) --- */
@media (max-width: 600px) {
    body {
        padding: 0 0 30px 0;
    }

    .chrome-tab-bar {
        padding: 6px 8px 0 8px;
        gap: 2px;
        margin-bottom: 20px;
    }

    .chrome-tab {
        padding: 8px 10px;
        font-size: 11px;
        border-radius: 6px 6px 0 0;
        white-space: nowrap;
    }

    .content-view {
        padding: 0 10px;
    }

    .wheel-container {
        gap: 20px;
    }

    .wheel-section h1 {
        font-size: 18px;
    }

    #wheel {
        max-width: 100%;
        height: auto;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .action-btn {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
        max-width: 280px;
    }

    #result, #summary {
        font-size: 15px;
        padding: 12px;
    }

    .shelf-section {
        width: 100%;
        padding: 15px;
    }

    .shelf-section h2 {
        font-size: 17px;
    }

    .shelf-row {
        padding: 10px 12px;
        margin-top: 10px;
    }

    .shelf-content {
        font-size: 13px;
    }

    /* Exclude Towers on mobile */
    .exclude-tower-btn {
        font-size: 10px;
        padding: 4px 7px;
    }

    /* DPS Calculator */
    .calc-panel {
        padding: 15px;
    }

    .calc-panel h2 {
        font-size: 18px;
    }

    .input-group label {
        font-size: 13px;
    }

    .input-group input {
        padding: 10px;
        font-size: 14px;
    }

    .calc-results {
        padding: 15px;
        font-size: 14px;
    }

    /* Skill Tree */
    .tree-dashboard {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 15px;
        gap: 10px;
    }

    .wallet-input-zone {
        font-size: 14px;
        flex-wrap: wrap;
    }

    .wallet-input-zone input {
        width: 100px;
    }

    .wallet-balance-zone {
        font-size: 14px;
        text-align: center;
    }

    .tree-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tree-branch {
        padding: 12px;
    }

    .branch-title {
        font-size: 13px;
    }

    .skill-card {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .skill-meta {
        padding-right: 8px;
        min-width: 0;
    }

    .skill-name {
        font-size: 13px;
    }

    .skill-cap {
        font-size: 11px;
    }

    .skill-cost {
        font-size: 11px;
    }

    .skill-actions button {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .skill-val {
        font-size: 13px;
        min-width: 20px;
    }
}

/* --- Exclude Towers Section --- */
.exclude-section {
    margin-top: 0;
}

.exclude-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 2px 0;
}

.exclude-tower-btn {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    white-space: nowrap;
    line-height: 1.4;
}

.exclude-tower-btn:hover {
    background: #bae6fd;
    border-color: #7dd3fc;
}

/* --- Excluded state: bold red border, grayed out, with ✕ prefix --- */
.exclude-tower-btn.excluded {
    background: #fef2f2;
    border: 1.5px solid #dc2626;
    color: #991b1b;
    text-decoration: line-through;
    opacity: 0.65;
}

.exclude-tower-btn.excluded::before {
    content: "✕ ";
    font-size: 10px;
    font-weight: bold;
    color: #dc2626;
}

.exclude-tower-btn.excluded:hover {
    background: #fecaca;
    border-color: #b91c1c;
    opacity: 0.85;
}

.exclude-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
}

/* --- Very Small Phones (up to 380px) --- */
@media (max-width: 380px) {
    .chrome-tab {
        padding: 6px 6px;
        font-size: 10px;
    }

    .action-btn {
        padding: 10px 16px;
        font-size: 13px;
        max-width: 240px;
    }

    .shelf-section {
        padding: 10px;
    }
}
