* { box-sizing: border-box; font-family: system-ui, sans-serif; }
body { background: #f0f4f8; margin: 0; padding: 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 20px; }
.navbar { background: #1e2f5e; color: white; padding: 0 20px; position: sticky; top: 0; z-index: 100; }
.nav-container { display: flex; justify-content: space-between; align-items: center; max-width: 1280px; margin: 0 auto; }
.logo { font-size: 1.5rem; font-weight: bold; padding: 12px 0; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: white; text-decoration: none; font-weight: 500; padding: 12px 0; cursor: pointer; }
.nav-links a:hover { opacity: 0.8; }
.burger { display: none; }
.card { background: white; border-radius: 28px; padding: 20px 24px; margin-bottom: 28px; box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
h2 { color: #1e2f5e; margin-top: 0; }
.form-group { margin-bottom: 18px; }
label { font-weight: 600; display: block; margin-bottom: 6px; color: #2c3e66; }
input, select, button { padding: 12px 16px; border: 1px solid #cfdfed; border-radius: 28px; width: 100%; font-size: 16px; background: white; }
button { background: #1e2f5e; color: white; font-weight: bold; cursor: pointer; border: none; }
button:hover { background: #0e1a3a; }
.btn-timer { background: #28a745; cursor: default; }
.btn-timer:hover { background: #28a745; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 20px 0; }
.metric { background: #f8fafd; padding: 14px; border-radius: 24px; text-align: center; }
.score { font-size: 32px; font-weight: 800; margin: 8px 0 4px; }
.chart-container { overflow-x: auto; margin: 20px 0; }
canvas { max-width: 100%; height: auto; background: #fff; border-radius: 24px; padding: 8px; }
.legend-item { cursor: pointer; }
.quarter-comments { margin-top: 16px; }
.legend { display: flex; gap: 24px; justify-content: center; margin: 16px 0 8px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 10px; background: #f0f2f5; padding: 6px 14px; border-radius: 40px; cursor: pointer; user-select: none; }
.legend-color { width: 24px; height: 24px; border-radius: 4px; }
.legend-item.disabled { background: #e0e4e9; opacity: 0.6; }
.legend-item.disabled .legend-color { filter: grayscale(0.5); position: relative; }
.legend-item.disabled .legend-color::after { content: "✖"; position: absolute; color: #d32f2f; font-size: 18px; margin-left: 6px; }
.token-bar { display: flex; gap: 12px; align-items: center; background: #f0f4fa; padding: 12px; border-radius: 40px; margin: 16px 0; flex-wrap: wrap; }
.token-bar input { flex: 1; margin: 0; }
.token-bar button { width: auto; padding: 10px 20px; }
.alert { background: #fee2e2; border-left: 5px solid #d32f2f; padding: 12px; border-radius: 16px; margin: 16px 0; }
footer { text-align: center; margin-top: 32px; padding: 16px; font-size: 13px; color: #6c86a3; background: #f0f4f8; }
.stars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin-top: 20px; }
.star-card { background: #f8fafd; border-radius: 24px; padding: 16px; }
.page { display: none; }
.page.active { display: block; }
.buy-link, .graph-link { display: inline-block; margin-top: 16px; background: #f0ad4e; color: #1e2f5e; text-align: center; border-radius: 40px; padding: 10px 20px; text-decoration: none; font-weight: bold; cursor: pointer; }
.graph-link { background: #5bc0de; }
.comment-block {
    background: #f8fafd;
    padding: 18px 20px;
    border-radius: 24px;
    margin: 20px 0;
    border-left-width: 5px;
    border-left-style: solid;
    border-left-color: #1e2f5e;
}
.narrative-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #1e2f5e;
    background: #f8fafd;
    padding: 24px;
    border-radius: 28px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.narrative-text p { margin: 0 0 16px 0; }
.narrative-text ul { margin: 12px 0; padding-left: 24px; }
.narrative-text li { margin-bottom: 10px; font-size: inherit; line-height: inherit; }
.narrative-text strong { font-weight: 700; color: #1e2f5e; }
.rating-excellent { color: #2ecc71; font-weight: bold; font-size: 1.1em; }
.rating-strong { color: #27ae60; font-weight: bold; font-size: 1.1em; }
.rating-good { color: #f39c12; font-weight: bold; font-size: 1.1em; }
.rating-moderate { color: #e67e22; font-weight: bold; font-size: 1.1em; }
.rating-challenging { color: #e74c3c; font-weight: bold; font-size: 1.2em; background: #fee; padding: 2px 6px; border-radius: 20px; display: inline-block; }
.graph-narrative-link {
    display: inline-block;
    background: #5bc0de;
    color: white !important;
    padding: 10px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: bold;
    margin-right: 12px;
    transition: background 0.2s;
}
.graph-narrative-link:hover { background: #31b0d5; text-decoration: none; }
.biorhythm-advice {
    background: #f0f7ff;
    border-radius: 24px;
    padding: 20px;
    margin-top: 20px;
    font-size: 1.05rem;
    line-height: 1.5;
    color: #1e2f5e;
    border-left: 5px solid #1e2f5e;
}
.biorhythm-advice p { margin: 0 0 12px 0; }
.biorhythm-advice strong { color: #1e2f5e; }
.biorhythm-footer { font-style: italic; margin-top: 16px; padding-top: 8px; border-top: 1px solid #cfdfed; font-size: 0.95rem; color: #5a7a9a; }
.archetype-banner {
    background: #eef2ff !important;
    color: #1e2f5e !important;
    padding: 16px 24px;
    border-radius: 32px;
    margin-bottom: 28px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    border-left: 6px solid #1e2f5e;
}
.comment-block {
    background: #f8fafd;
    padding: 18px 20px;
    border-radius: 24px;
    margin: 20px 0;
    font-size: 1.05rem;
    line-height: 1.55;
    border-left: 5px solid #1e2f5e;
}
.graph-header {
    background: transparent !important;
    padding: 0 0 16px 0 !important;
    text-align: left !important;
    color: #1e2f5e !important;
    border-bottom: 2px solid #cfdfed;
}
.back-home-btn {
    background: #5bc0de;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.2s;
}
.back-home-btn:hover { background: #31b0d5; }
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.custom-modal-content {
    background: #ffffff;
    border-radius: 28px;
    padding: 24px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border: 1px solid #cfdfed;
}
.custom-modal-content p { color: #1e2f5e; font-size: 1.1rem; margin-bottom: 24px; }
.modal-buttons button {
    background: #1e2f5e;
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
    margin: 0 8px;
    transition: background 0.2s;
}
.modal-buttons button:hover { background: #0e1a3a; }
#modalCancelBtn { background: #95a5a6; }
#modalCancelBtn:hover { background: #7f8c8d; }
@media print {
    body * { visibility: hidden; }
    #compatResult, #compatResult * { visibility: visible; }
    #compatResult { position: absolute; top: 0; left: 0; width: 100%; margin: 0; padding: 20px; }
    button, .graph-link, .graph-narrative-link { display: none !important; }
}
#graphResult, .chart-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
#graphResult canvas, .chart-container canvas {
    min-width: 600px;
    width: 100%;
    height: auto;
}