@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

.hidden { display: none !important; }

.ph-neo-wrapper {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 800px; margin: 30px auto; background: #fff;
    border: 4px solid #000; border-radius: 16px; box-shadow: 10px 10px 0px #000;
    padding: 25px; box-sizing: border-box;
}
.ph-neo-wrapper * { box-sizing: border-box; }

.ph-header {
    background: #fdfd96; padding: 15px 20px; border-radius: 12px;
    border: 3px solid #000; box-shadow: 4px 4px 0px #000; margin-bottom: 25px; text-align: center;
}
.ph-header h2 { margin: 0 0 5px 0; font-size: 1.8rem; font-weight: 900; text-transform: uppercase; color: #ff595e;}
.ph-header p { margin: 0; font-weight: 800; font-size: 0.95rem; color: #333;}

/* TABS */
.ph-tabs { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px;}
.ph-tab {
    flex: 1; max-width: 250px; padding: 12px; font-size: 1.1rem; font-weight: 900;
    background: #f4f4f4; border: 3px solid #000; border-radius: 8px;
    box-shadow: 4px 4px 0px #000; cursor: pointer; transition: 0.1s;
}
.ph-tab:active { transform: translate(2px, 2px); box-shadow: 0px 0px 0px #000; }
.ph-tab.active { background: #1982c4; color: #fff; }

/* CƠ BẢN: GRID 4 Ô */
.ph-grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 15px; }
.ph-input-group { border: 3px solid #000; border-radius: 10px; padding: 15px; box-shadow: 4px 4px 0px #000; }
.bg-red { background: #ffb7b2; }
.bg-blue { background: #c6e2ff; }
.bg-yellow { background: #ffdfba; }
.bg-green { background: #baffc9; }

.ph-input-group label { display: block; font-size: 1.1rem; font-weight: 900; margin-bottom: 8px; text-transform: uppercase;}
.ph-input, .ph-select {
    width: 100%; padding: 12px; font-size: 1.3rem; font-weight: 900; font-family: 'Courier New', monospace;
    border: 3px dashed #000; border-radius: 6px; outline: none; background: #fff; transition: 0.1s;
}
.ph-input:focus, .ph-select:focus { border-style: solid; border-color: #ff595e; box-shadow: inset 2px 2px 0px rgba(0,0,0,0.1); }
.ph-hint { text-align: center; font-weight: 700; color: #555; font-size: 0.95rem; }

/* NÂNG CAO */
.ph-adv-grid { display: grid; grid-template-columns: 1fr; gap: 15px; margin-bottom: 20px;}
.ph-btn-calc {
    width: 100%; padding: 15px; font-size: 1.4rem; font-weight: 900; background: #ffca3a; color: #000;
    border: 3px solid #000; border-radius: 10px; cursor: pointer; box-shadow: 6px 6px 0px #000; transition: 0.1s; text-transform: uppercase;
}
.ph-btn-calc:active { transform: translate(4px, 4px); box-shadow: 0px 0px 0px #000; }

.neo-divider { border: 0; height: 4px; background: #000; margin: 30px 0; border-radius: 2px; }

/* THANH CHỈ THỊ MÀU PH */
.ph-visualizer-box { background: #fff; border: 3px dashed #000; border-radius: 12px; padding: 25px; text-align: center; }
.ph-vis-title { margin: 0 0 40px 0; font-size: 1.4rem; font-weight: 900; text-transform: uppercase;}

.ph-scale-wrapper { position: relative; height: 30px; margin-bottom: 10px; padding: 0 10px; }
.ph-scale-bar {
    width: 100%; height: 100%; border: 3px solid #000; border-radius: 15px;
    background: linear-gradient(to right, #ea3a3a 0%, #ff9800 20%, #ffeb3b 40%, #8bc34a 50%, #4caf50 60%, #03a9f4 80%, #3f51b5 100%);
    box-shadow: inset 0px 0px 10px rgba(0,0,0,0.3);
}

.ph-marker {
    position: absolute; top: -35px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#phMarkerVal {
    background: #000; color: #fff; padding: 4px 10px; border-radius: 6px; font-weight: 900; font-family: monospace; font-size: 1.1rem;
    box-shadow: 2px 2px 0px #ff595e; margin-bottom: 2px;
}
.ph-marker-arrow {
    width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 10px solid #000;
}

.ph-scale-labels { display: flex; justify-content: space-between; font-weight: 800; font-size: 0.9rem; color: #555; padding: 0 10px; margin-bottom: 15px;}
.ph-status-text { display: inline-block; background: #e2f0cb; border: 3px solid #000; padding: 10px 20px; border-radius: 30px; font-weight: 900; font-size: 1.3rem; box-shadow: 3px 3px 0px #000;}

@media (max-width: 600px) {
    .ph-grid-4 { grid-template-columns: 1fr; }
    .ph-tabs { flex-direction: column; }
    .ph-tab { max-width: 100%; }
}