* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

h1 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 2.2em;
}

.subtitle {
    color: #999;
    margin-bottom: 25px;
    font-size: 1em;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 15px;
    background: #1f1f1f;
    border-radius: 8px;
    align-items: center;
}

.legend-title {
    font-weight: 600;
    color: #fff;
    margin-right: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 40px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-color.need {
    background: rgba(255, 183, 77, 0.6);
}

.legend-color.want {
    background: rgba(255, 235, 156, 0.7);
}

.legend-color.splurge {
    background: rgba(138, 43, 226, 0.5);
}

.legend-color.have {
    background: rgba(100, 100, 100, 0.5);
}

.legend-color.acquired {
    background: rgba(102, 126, 234, 0.5);
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #555;
    background: #333;
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #444;
    border-color: #666;
}

.filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #2a2a2a;
}

th {
    background: #1f1f1f;
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 12px 10px;
    font-size: 13px;
    border-bottom: 2px solid #444;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #333;
    font-size: 14px;
    vertical-align: top;
}

tr:hover {
    background: #333;
}

tr.tier-need {
    background: rgba(255, 183, 77, 0.25);
}

tr.tier-need:hover {
    background: rgba(255, 183, 77, 0.35);
}

tr.tier-want {
    background: rgba(255, 235, 156, 0.20);
}

tr.tier-want:hover {
    background: rgba(255, 235, 156, 0.30);
}

tr.tier-splurge {
    background: rgba(138, 43, 226, 0.18);
}

tr.tier-splurge:hover {
    background: rgba(138, 43, 226, 0.25);
}

tr.tier-have {
    background: rgba(100, 100, 100, 0.25);
}

tr.tier-have:hover {
    background: rgba(100, 100, 100, 0.35);
}

tr.fully-purchased {
    background: rgba(102, 126, 234, 0.25);
}

tr.fully-purchased:hover {
    background: rgba(102, 126, 234, 0.35);
}

.priority-cell {
    font-weight: bold;
    color: #667eea;
    text-align: center;
    width: 60px;
}

.component-cell {
    color: #ffd93d;
    font-weight: 600;
    min-width: 100px;
}

.item-cell {
    min-width: 200px;
    font-weight: 700;
}

.price-cell {
    color: #6bcf7f;
    font-weight: 600;
    min-width: 70px;
}

.target-price-cell {
    color: #ff9d73;
    font-weight: 600;
    min-width: 80px;
}

.note-cell {
    color: #bbb;
    font-size: 13px;
    max-width: 300px;
    line-height: 1.4;
}

.need-cell,
.purchased-cell {
    text-align: center;
    min-width: 70px;
}

.who-cell {
    color: #ff6b6b;
    font-weight: 600;
    min-width: 80px;
}

td.who-cell:empty::after {
    content: "-";
    color: #ffffff;
}

.link-cell {
    min-width: 80px;
}

.link-btn {
    display: inline-block;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.link-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.purchased-yes {
    color: #6bcf7f;
    font-weight: bold;
}

.purchased-no {
    color: #ffffff;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

@media (max-width: 1200px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    th, td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .note-cell {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.5em;
    }

    th, td {
        padding: 8px 5px;
        font-size: 11px;
    }

    .link-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}
