/* Tier indicators */
.tier-indicators {
    display: flex;
    gap: 2px;
    align-items: center;
    margin-left: auto;
    --stat-color: currentColor;
}

.tier-dot {
    width: 1px;
    height: 16px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--stat-color) 20%, var(--border-default));
    flex-shrink: 0;
    transition: all 0.2s;
    margin-left: -2px;
    margin-right: 4px;
}

.tier-dot:first-child {
    margin-left: 0;
}

.tier-dot.active {
    background: var(--stat-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--stat-color) 30%, transparent);
}

.tier-dot.passed {
    background: color-mix(in srgb, var(--stat-color) 50%, var(--bg-card));
}

.tier-indicator {
    display: inline-block;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    background: color-mix(in srgb, var(--stat-color) 8%, var(--bg-card));
    color: var(--text-muted);
    border: 1px solid color-mix(in srgb, var(--stat-color) 20%, var(--border-default));
    line-height: 1.4;
    white-space: nowrap;
    transition: all 0.2s;
}

.tier-indicator.active {
    background: color-mix(in srgb, var(--stat-color) 15%, var(--bg-card));
    color: var(--stat-color);
    border: 2px solid var(--stat-color);
}

.tier-indicator.passed {
    background: color-mix(in srgb, var(--stat-color) 15%, var(--bg-card));
    color: color-mix(in srgb, var(--stat-color) 60%, var(--text-secondary));
    border-color: color-mix(in srgb, var(--stat-color) 40%, var(--border-default));
}

/* Stats header with capital */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats-header h2 {
    margin-bottom: 0;
}

.capital-display {
    font-size: 16px;
    padding: 8px 16px;
    background: var(--bg-input);
    border-radius: 4px;
    color: var(--text-primary);
}

.capital-display span {
    font-weight: bold;
}

#capital-remaining {
    color: var(--color-success);
}

#capital-remaining.negative {
    color: var(--color-danger);
}

/* Stats Table */
.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table > tbody > tr > td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--bg-input);
    border-left: 3px solid transparent;
    width: 50%;
    vertical-align: top;
}

.stats-table > tbody > tr > td.invested {
    border-left-color: var(--color-accent);
    background: var(--bg-invested);
}

.stats-table > tbody > tr:last-child > td {
    border-bottom: none;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.stat-icon {
    width: 18px;
    height: 18px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

/* Stat increment/decrement buttons */
.stat-buttons {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.stat-buttons button {
    flex: 1;
    padding: 4px 2px;
    font-size: 11px;
    border: 1px solid var(--border-default);
    background: var(--bg-input);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.stat-buttons button:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.stat-buttons button[data-delta^="-"] {
    color: var(--color-danger);
}

.stat-buttons button[data-delta^="-"]:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* Stats header controls */
.stats-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-cost-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--border-default);
    background: var(--bg-input);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.toggle-cost-btn:hover {
    border-color: var(--color-accent);
    color: var(--text-primary);
}

.toggle-cost-btn.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

/* Cost info hidden by default */
.cost-table,
.stat-cost-info {
    display: none;
}

.show-cost-tables .cost-table {
    display: table;
}

.show-cost-tables .stat-cost-info {
    display: block;
}

/* Current cost info */
.stat-cost-info {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-cost-current {
    color: var(--text-primary);
    font-weight: bold;
}

/* Cost tier table */
.cost-table {
    margin-top: 8px;
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.cost-table th {
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 3px 6px;
    text-align: left;
    font-weight: normal;
    border-bottom: 1px solid var(--border-default);
}

.cost-table td {
    padding: 3px 6px;
    border-bottom: 1px solid var(--border-table);
    width: auto;
}

.cost-table tbody tr {
    transition: background 0.2s;
}

.cost-table tbody tr.active-tier {
    background: var(--bg-active-tier);
    font-weight: bold;
}

.cost-table tbody tr.active-tier td {
    color: var(--color-success);
}
