/* Khai báo biến nội bộ */
.height-neo-wrapper {
    --bg-white: #ffffff;
    --border-ink: 3px solid #111111;
    --shadow-solid: 5px 5px 0px #111111;
    --shadow-push: 2px 2px 0px #111111;
    
    /* Palette Trẻ em & Y khoa */
    --clr-boy: #caf0f8;      /* Xanh pastel bé trai */
    --clr-boy-active: #00b4d8;
    --clr-girl: #ffddd2;     /* Hồng pastel bé gái */
    --clr-girl-active: #e29578;
    --clr-btn: #ffd166;      /* Vàng cam nút bấm */
    --clr-khamis-bg: #e9ecef;/* Xám nhạt khu vực Khamis */
    --clr-good: #a7f3d0;     /* Xanh ngọc cho chiều cao max */

    max-width: 750px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, sans-serif;
    color: #111111;
    background: #fafafa;
    padding: 20px;
    border: var(--border-ink);
    border-radius: 16px;
    box-shadow: 8px 8px 0px #111;
}

.height-neo-wrapper * { box-sizing: border-box; }

.height-neo-header {
    background: #fff;
    border: var(--border-ink);
    box-shadow: var(--shadow-solid);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
    background-image: repeating-linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0), repeating-linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}
.height-neo-header h2 { margin: 0 0 10px 0; font-size: 1.8rem; font-weight: 900; background: #fff; display: inline-block; padding: 5px 15px; border: 2px solid #111; border-radius: 8px;}
.height-neo-header p { margin: 0; font-weight: 600; background: #fff; padding: 5px; border-radius: 5px; }

/* Form Styles */
.height-neo-form { display: flex; flex-direction: column; gap: 20px; }
.height-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.height-group { display: flex; flex-direction: column; gap: 8px; }
.height-group label { font-weight: 800; font-size: 1.05rem; }

.height-neo-wrapper input[type="number"] {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border: var(--border-ink);
    border-radius: 12px;
    background: var(--bg-white);
    box-shadow: 4px 4px 0px #111;
    outline: none;
    transition: all 0.2s;
}
.height-neo-wrapper input[type="number"]:focus {
    box-shadow: var(--shadow-solid);
    background: #fffcce;
}

/* Radio Buttons */
.height-radio-grid, .height-method-grid { display: flex; gap: 15px; }
.height-radio-grid .radio-neo, .height-method-grid .radio-neo { flex: 1; cursor: pointer; }
.height-neo-wrapper input[type="radio"] { display: none; }
.height-neo-wrapper .neo-content {
    display: block;
    text-align: center;
    padding: 14px;
    font-weight: 800;
    border: var(--border-ink);
    border-radius: 12px;
    background: var(--bg-white);
    box-shadow: 4px 4px 0px #111;
    transition: all 0.15s;
}

/* Tương tác Radio Giới tính */
.radio-boy input:checked + .neo-content { background: var(--clr-boy-active); color: #fff; box-shadow: var(--shadow-push); transform: translate(2px, 2px); }
.radio-girl input:checked + .neo-content { background: var(--clr-girl-active); color: #fff; box-shadow: var(--shadow-push); transform: translate(2px, 2px); }

/* Tương tác Radio Method */
.height-method-grid input:checked + .neo-content { background: #111; color: #fff; box-shadow: var(--shadow-push); transform: translate(2px, 2px); }

/* Khamis-Roche Box */
.khamis-box {
    background: var(--clr-khamis-bg);
    border: 2px dashed #111;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.khamis-alert { background: #fff; padding: 10px; border: 2px solid #111; border-radius: 8px; font-weight: 600; font-size: 0.9rem; }
.khamis-box .height-form-grid { grid-template-columns: 1fr 1fr 1fr; }

/* Button */
.height-neo-btn {
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 900;
    background: var(--clr-btn);
    color: #111;
    border: var(--border-ink);
    border-radius: 12px;
    box-shadow: var(--shadow-solid);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s;
}
.height-neo-btn:hover { background: #f4a261; }
.height-neo-btn:active { box-shadow: var(--shadow-push); transform: translate(3px, 3px); }

/* Results */
.height-neo-result {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 4px dotted #111;
}
.height-neo-result.active {
    display: block !important;
    animation: heightPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.height-highlight {
    background: #fff;
    border: var(--border-ink);
    box-shadow: var(--shadow-solid);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 25px;
}
.height-highlight h3 { margin: 0; font-size: 1.1rem; text-transform: uppercase; }
.height-total { font-size: 4rem; font-weight: 900; margin: 5px 0; color: #111; line-height: 1;}
.height-method-used { display: inline-block; margin-top: 10px; background: #111; color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; }

.height-range-box {
    background: #fff;
    border: var(--border-ink);
    box-shadow: var(--shadow-solid);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}
.height-range-box h4 { margin: 0 0 15px 0; text-align: center; font-size: 1.1rem; }
.range-visual { display: flex; gap: 15px; justify-content: space-between; }
.range-card {
    flex: 1;
    border: 2px solid #111;
    border-radius: 10px;
    padding: 20px 10px;
    text-align: center;
    position: relative;
    box-shadow: 3px 3px 0px #111;
}
.range-card .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 2px 10px; font-size: 0.75rem; font-weight: 800; border-radius: 10px; border: 2px solid #111; white-space: nowrap; }
.range-card .val { font-size: 1.8rem; font-weight: 900; display: block; margin-bottom: 5px; }

.card-min { background: #ffddd2; }
.card-target { background: #fff; border-width: 3px; transform: scale(1.05); }
.card-max { background: var(--clr-good); }

.height-note { background: #fff8e7; border: 2px solid #111; border-radius: 8px; padding: 12px; font-size: 0.9rem; }

@keyframes heightPop {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .height-form-grid, .khamis-box .height-form-grid { grid-template-columns: 1fr; gap: 15px; }
    .range-visual { flex-direction: column; gap: 20px; }
    .card-target { transform: scale(1); }
}