* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    margin: 0;
    padding: 1rem;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 1rem;
}

h3 {
    font-size: clamp(1.3rem, 3vw, 1.75rem);
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.75rem;
}

p {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.intro {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f0f4f8;
    border-radius: 12px;
    border: 1px solid #d1d9e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.intro p {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    line-height: 1.8;
    margin-bottom: 1rem;
    color: #2d3748;
}

.intro p.key-scale {
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    line-height: 1.5;
    white-space: nowrap;
    overflow-x: auto;
}

.question {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-left: 5px solid #667eea;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.question:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-left-color: #764ba2;
}

.question label:first-child {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    line-height: 1.6;
}

.radio-group {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.radio-group label {
    flex: 0 0 calc((100% - (6 * 0.75rem)) / 7);
    text-align: center;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: white;
    position: relative;
}

.radio-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-group label:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.radio-group label:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    transform: translateY(-1px);
}

button {
    width: 100%;
    max-width: 300px;
    margin: 2rem auto 0;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: block;
    min-height: 48px;
}

button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.result {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.scoring-scale {
    margin: 2rem auto;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-width: 600px;
}

.scoring-scale h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.scale-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.scale-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: #f7fafc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
    min-width: 150px;
}

.scale-item:hover {
    transform: translateY(-2px);
}

.scale-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}

.scale-color.high { background: #48bb78; }
.scale-color.moderate { background: #f6e05e; }
.scale-color.low { background: #f56565; }

.scale-item p {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.scale-note {
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    line-height: 1.6;
    color: #4a5568;
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.scale-note-list {
    list-style-type: disc;
    margin-top: 1rem;
    padding: 1rem 1rem 1rem 2rem;
    background: #f7fafc;
    border-radius: 8px;
}

.scale-note-list li {
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    line-height: 1.7;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.scale-note-list li:last-child {
    margin-bottom: 0;
}

.score-line {
    margin: 1rem 0;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    padding: 1rem;
    background: white;
    border-radius: 10px;
    border-left: 5px solid #48bb78;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    font-weight: 500;
}

.score-line:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.charts-container {
    margin: 2rem auto;
    background: white;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chart-tabs {
    display: flex;
    overflow-x: auto;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.chart-tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: auto;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    max-width: none;
}

.chart-tab:hover {
    background: #edf2f7;
    transform: none;
    box-shadow: none;
}

.chart-tab.active {
    border-bottom-color: #667eea;
    color: #2d3748;
    background: white;
}

.chart-views {
    position: relative;
}

.chart-view {
    display: none;
    padding: 1rem;
}

.chart-view.active {
    display: block;
}

.chart-container {
    width: 100%;
    max-width: 450px;
    margin: 1rem auto;
    background: white;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    height: auto;
    min-height: 300px;
    max-height: 400px;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
}

#interpretation {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f0f4f8;
    border-radius: 12px;
    border: 1px solid #d1d9e6;
}

#interpretation h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

#interpretation p, #interpretation li {
    font-size: clamp(1.05rem, 2.3vw, 1.2rem);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

#interpretation ul {
    list-style-type: disc;
    padding-left: 20px;
}

@media screen and (max-width: 700px) {
    .radio-group {
        gap: 0.5rem;
    }
    .radio-group label {
        flex: 0 0 calc((100% - (6 * 0.5rem)) / 7);
        height: 55px;
        font-size: 1rem;
    }
}

@media screen and (max-width: 600px) {
    .container { padding: 1rem; }
    .question { padding: 1rem; }
    .chart-container { padding: 0.75rem; min-height: 220px; max-height: 300px; }
    .scale-container {
        flex-direction: column;
        align-items: center;
    }
    .scale-item {
        width: 100%;
        max-width: 280px;
    }
}

@media screen and (max-width: 450px) {
    .radio-group {
        gap: 0.4rem;
    }
    .radio-group label {
        flex: 0 0 calc((100% - (6 * 0.4rem)) / 7);
        height: 50px;
        font-size: 0.95rem;
    }
}
