/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0b1628 url('OVM.png') no-repeat center center fixed;
    background-size: cover;
    color: #d4dce8;
    line-height: 1.6;
    padding: 1rem;
    max-width: 840px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}
header h1 {
    font-size: 1.7rem;
    color: #5bcefa;
    letter-spacing: 0.02em;
}
.header-logo {
    height: 2.2rem;
    vertical-align: middle;
    margin-right: 0.4rem;
    filter: invert(1) drop-shadow(0 0 0.5px white) drop-shadow(0 0 0.5px white);
}
.subtitle {
    color: #7a8da6;
    font-size: 0.9rem;
}

/* ===== Cards ===== */
.card {
    background: rgba(18, 30, 51, 0.85);
    border: 1px solid #1e3050;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
}
.card h2 {
    font-size: 1.05rem;
    color: #5bcefa;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #1e3050;
    padding-bottom: 0.4rem;
}

/* ===== Form elements ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem 0.75rem;
}
label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: #8fa4be;
}
input, select {
    margin-top: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: #0b1628;
    border: 1px solid #2a3f5e;
    border-radius: 6px;
    color: #d4dce8;
    font-size: 0.9rem;
    max-width: 100%;
}
input:focus, select:focus {
    outline: none;
    border-color: #5bcefa;
    box-shadow: 0 0 0 2px rgba(91,206,250,0.2);
}

/* ===== Radio group ===== */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}
.radio-group label {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: #d4dce8;
}
input[type="radio"] {
    accent-color: #5bcefa;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-primary {
    background: #5bcefa;
    color: #0b1628;
}
.btn-primary:hover { background: #3abeef; }
.btn-secondary {
    background: #1e3050;
    color: #5bcefa;
    border: 1px solid #2a3f5e;
}
.btn-secondary:hover { background: #253d5e; }
.btn-danger {
    background: transparent;
    color: #f45b69;
    border: 1px solid #f45b6944;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
}
.btn-danger:hover { background: #f45b6922; }
.center { text-align: center; margin: 1.25rem 0; }

/* ===== Deco mix rows ===== */
.deco-mix-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.deco-mix-row label { flex: 1; min-width: 80px; }
.deco-mix-row .btn-danger { align-self: center; margin-top: 0.25rem; }

/* ===== Mix label ===== */
.mix-label {
    font-size: 0.85rem;
    color: #5bcefa;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ===== Hint ===== */
.hint {
    font-size: 0.8rem;
    color: #5a7090;
    margin-top: 0.3rem;
}

/* ===== Results table ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}
th, td {
    padding: 0.5rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid #1e3050;
}
th {
    background: #1a2d48;
    color: #5bcefa;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
td {
    font-size: 0.95rem;
}
tr:hover td {
    background: #15253e;
}

/* ===== Summary & Warnings ===== */
.summary {
    font-size: 0.9rem;
    color: #8fa4be;
    margin: 0.5rem 0;
    line-height: 1.8;
}
.summary strong { color: #d4dce8; }
.warnings {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #2a1520;
    border: 1px solid #f45b6944;
    border-radius: 8px;
    color: #f4a0a8;
    font-size: 0.85rem;
    display: none;
}
.warnings.visible { display: block; }
.warnings ul { list-style: disc inside; }

/* ===== Hidden utility ===== */
.hidden { display: none; }

/* ===== Toggle switch ===== */
.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: #d4dce8;
    font-size: 0.9rem;
    font-weight: 500;
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #3a2030;
    border: 1px solid #f45b6944;
    border-radius: 26px;
    transition: background 0.25s, border-color 0.25s;
}
.slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 2px;
    background: #c0c8d4;
    border-radius: 50%;
    transition: transform 0.25s, background 0.25s;
}
.switch input:checked + .slider {
    background: #1a3a4a;
    border-color: #5bcefa;
}
.switch input:checked + .slider::before {
    transform: translateX(23px);
    background: #5bcefa;
}

/* ===== Profile toggle ===== */
.profile-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 0.75rem;
}
.btn-toggle {
    padding: 0.4rem 1.2rem;
    border: 1px solid #2a3f5e;
    background: #0b1628;
    color: #5a7090;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.btn-toggle:first-child { border-radius: 6px 0 0 6px; }
.btn-toggle:last-child { border-radius: 0 6px 6px 0; }
.btn-toggle.active {
    background: #5bcefa;
    color: #0b1628;
    border-color: #5bcefa;
}

/* ===== Profile canvas ===== */
#profileCanvas {
    width: 100%;
    height: auto;
    border: 1px solid #1e3050;
    border-radius: 6px;
    cursor: crosshair;
    margin-top: 0.5rem;
}
.canvas-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}
.canvas-controls label {
    font-size: 0.8rem;
    min-width: 120px;
}
.canvas-controls input {
    width: 70px;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem 0 1rem;
    font-size: 0.8rem;
    color: #4a5f7a;
}
footer strong { color: #f45b69; }
footer h3 { color: #f45b69; }

/* ===== Responsive ===== */
@media (max-width: 500px) {
    .form-grid { grid-template-columns: 1fr; }
    .deco-mix-row { flex-direction: column; align-items: stretch; }
}
