:root {
  --card-background: #333333;
}

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

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

.container {
    max-width: 1600px;
    margin: 0 auto;
}

img {
  vertical-align: middle;
  width: 32px;
  margin-bottom: 4px;
}

h1 {
    color: #fff;
    margin-bottom: 30px;
    text-align: center;
    font-size: 32px;
    text-shadow: 0 2px 4px rgba(0, 35, 102, 0.5);
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.save-load-buttons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: auto;
    padding: 10px 20px;
    background: linear-gradient(135deg, #002366 0%, #003d99 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 35, 102, 0.4);
}

.icon-btn:active {
    transform: translateY(0);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.random-btn {
    background: linear-gradient(135deg, #660066 0%, #990099 100%);
}

.random-btn:hover {
    box-shadow: 0 10px 20px rgba(102, 0, 102, 0.4);
}

@media (max-width: 768px) {
    .header-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .save-load-buttons {
        width: 100%;
    }
    
    .icon-btn {
        flex: 1;
        justify-content: center;
    }
}


.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 30px;
    border: 1px solid #2a2a2a;
}

.summary-card {
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 40px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
}

h2 {
    color: #ffffff;
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group.hidden {
    display: none;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #b0b0b0;
    font-weight: 600;
    font-size: 13px;
}

select, input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #2a2a2a;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
    font-family: inherit;
    background: #0f0f0f;
    color: #ffffff;
}

select:focus, input:focus {
    outline: none;
    border-color: #002366;
}

input[type="number"] {
    appearance: textfield;
}

button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #002366 0%, #003d99 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 35, 102, 0.4);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #2a2a2a;
}

.component-card {
    background: #252525;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    border-left: 4px solid #002366;
}

.summary-card .component-card {
    border-left: 4px solid #660000;
}

.component-card h3 {
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 17px;
}

.component-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    color: #b0b0b0;
    font-size: 13px;
}

.component-info span {
    font-weight: 600;
    color: #ffffff;
}

.empty-state {
    text-align: center;
    color: #666666;
    padding: 30px 20px;
    font-style: italic;
    font-size: 14px;
}

.delete-btn {
    background: #990000;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 10px;
    transition: background 0.2s;
}

.summary-card .delete-btn {
    display: none;
}

.delete-btn:hover {
    background: #cc0000;
}

.score-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}



.score-item {
    background: #252525;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid #002366;
}

.score-item h3 {
    color: #b0b0b0;
    font-size: 14px;
    margin-bottom: 10px;
}

.score-item .score-value {
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
}

.total-score {
    background: linear-gradient(135deg, #002366 0%, #003d99 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-top: 30px;
}

.total-score h3 {
    font-size: 18px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.total-score .score-value {
    font-size: 48px;
    font-weight: bold;
}



@media (max-width: 1400px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

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