@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&family=Noto+Serif:wght@400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px;
}

.header {
    text-align: center;
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 50%, #FFD700 100%);
    color: #1a1a2e;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(184, 134, 11, 0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.header h1 {
    font-family: 'Noto Serif', serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.header p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.input-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(184, 134, 11, 0.2);
}

.input-panel h3 {
    color: #8B0000;
    font-family: 'Noto Serif', serif;
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.input-panel h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #B8860B, #FFD700);
    border-radius: 2px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2F4F4F;
    font-size: 0.95rem;
}

.input-group select,
.input-group input {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: #B8860B;
    box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.1);
    transform: translateY(-1px);
}

.control-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(184, 134, 11, 0.2);
}

.progress-info {
background: linear-gradient(135deg, #edbf0f 0%, #f0f8ff 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(65, 105, 225, 0.2);
}

.progress-bar {
    width: 100%;
    height: 28px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #bd880e 0%, #d9a421 50%, #fbd202 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.btn {
    padding: 14px 28px;
    margin: 8px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #ffa726 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.main-content {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.chart-panel {
    background: linear-gradient(45deg, #B8860B, #FFD700, #B8860B);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border: 2px solid rgba(184, 134, 11, 0.2);
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    /* Thêm smooth scroll */
    scroll-behavior: smooth;
}
.chart-panel::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    z-index: -1;
    border-radius: 26px;
    opacity: 0.5;
}

.chart-panel h3 {
    color: #8B0000;
    font-family: 'Noto Serif', serif;
    font-size: 1.6rem;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.chart-panel h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #8B0000, #DC143C);
    border-radius: 2px;
}
.download-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(184, 134, 11, 0.2);
    text-align: center;
}

.download-panel h3 {
    color: #8B0000;
    font-family: 'Noto Serif', serif;
    font-size: 1.4rem;
    margin-bottom: 20px;
}
.thien-ban-info {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.thien-ban-info div:first-child {
    background: linear-gradient(135deg, #B8860B 0%, #FFD700 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
    font-size: 14px;
}

.thien-ban-info div:not(:first-child) {
    margin: 6px 0;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
    background: rgba(248, 249, 250, 0.8);
    border-left: 3px solid #B8860B;
}

.thien-ban-info div:not(:first-child):hover {
    background: rgba(184, 134, 11, 0.1);
    transform: translateX(2px);
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.bg-svg {
    width: 100%;
    height: 100%;
    min-width: 100vw;
    min-height: 100vh;
    object-fit: cover;
}

.floating-elements {
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
.header-main {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 50%, #FFD700 100%);
    color: #1a1a2e;
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.3);
    position: relative;
    z-index: 100;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-family: 'Noto Serif', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.home-btn {
    background: rgba(255,255,255,0.2);
    color: #1a1a2e;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.home-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.page-container {
    min-height: calc(100vh - 120px);
    padding: 7px;
}
.hidden {
    display: none !important;
}

.progress-phase {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.welcome-header {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 25px;
    margin-bottom: 40px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border: 2px solid rgba(184, 134, 11, 0.2);
}

.welcome-header h1 {
    font-family: 'Noto Serif', serif;
    font-size: 2.5rem;
    color: #8B0000;
    margin-bottom: 20px;
}

.input-form {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border: 2px solid rgba(184, 134, 11, 0.2);
}

.phase-container {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;    margin-top: 50px;
}

.hidden {
    display: none !important;
}

/* Phase 1: Welcome with Yin-Yang */
.welcome-yinyang {
    text-align: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(15px);
    padding: 60px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 3px solid #fff;
}

.yinyang-symbol {
    margin-bottom: 30px;
}

.yinyang-symbol svg {
    width: 100px;
    height: 100px;
}

.welcome-title {
    font-family: 'Noto Serif', serif;
    font-size: 3rem;
    color: #8B0000;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

/* Phase 2: Input Form Centered */
.input-form-centered {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(15px);
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 3px solid rgba(184, 134, 11, 0.3);
    max-width: 900px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.input-form-centered h2 {
    text-align: center;
    color: #8B0000;
    font-family: 'Noto Serif', serif;
    font-size: 2rem;
    margin-bottom: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

/* Phase 3: Progress Only */
.progress-only {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(15px);
    padding: 60px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 3px solid rgba(184, 134, 11, 0.3);
    text-align: center;
    min-width: 500px;
}

.progress-only h2 {
    color: #8B0000;
    font-family: 'Noto Serif', serif;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.progress-only .progress-info {
background: linear-gradient(135deg, #edbf0f 0%, #f0f8ff 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(65, 105, 225, 0.2);
}

/* Phase 4: Adjust main page */
#mainPage.page-container {
    position: relative;
    z-index: 50;
    padding-top: 10px;
}

.header-main {
    position: relative;
    z-index: 100;
}.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2F4F4F;
    font-size: 1rem;
}

.form-group input,
.form-group select {
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #B8860B;
    box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.1);
    transform: translateY(-2px);
}

.btn-main {
    background: linear-gradient(135deg, #B8860B 0%, #FFD700 100%);
    color: #1a1a2e;
    padding: 18px 40px;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    box-shadow: 0 8px 25px rgba(184, 134, 11, 0.3);
}

.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(184, 134, 11, 0.4);
}

.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

.footer a {
    color: #FFD700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #B8860B;
}
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.notification-success {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

.notification-error {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
}

.notification-info {
    background: linear-gradient(135deg, #2196f3 0%, #42A5F5 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
.cung-grid {
    display: grid;
    grid-template-columns: repeat(4, 320px);
    grid-template-rows: repeat(4, 320px);
    gap: 0;
    margin: 20px auto;
    justify-content: center;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    min-width: 1280px;
    min-height: 1280px; /* Thêm min-height để ổn định */
}
.cung {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    font-size: 12px;
    overflow: hidden;
    border: none;
    transition: all 0.3s ease;
}

.cung:hover {
    background: linear-gradient(135deg, #fff9e6 0%, #fef7e0 100%);
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 8px 25px rgba(184, 134, 11, 0.3);
}

/* Enhanced cung borders with Eastern aesthetics */
.cung[data-cung="6"] { 
    border-right: 2px solid #B8860B;
    border-bottom: 2px solid #B8860B;
    border-top: 4px solid #8B0000;
    border-left: 4px solid #8B0000;
    border-top-left-radius: 15px;
}

.cung[data-cung="7"] { 
    border-right: 2px solid #B8860B;
    border-bottom: 2px solid #B8860B;
    border-top: 4px solid #8B0000;
}

.cung[data-cung="8"] { 
    border-right: 2px solid #B8860B;
    border-bottom: 2px solid #B8860B;
    border-top: 4px solid #8B0000;
}

.cung[data-cung="9"] { 
    border-bottom: 2px solid #B8860B;
    border-top: 4px solid #8B0000;
    border-right: 4px solid #8B0000;
    border-top-right-radius: 15px;
}

.cung[data-cung="5"] { 
    border-right: 2px solid #B8860B;
    border-bottom: 2px solid #B8860B;
    border-left: 4px solid #8B0000;
}

.cung[data-cung="10"] { 
    border-bottom: 2px solid #B8860B;
    border-right: 4px solid #8B0000;
}

.cung[data-cung="4"] { 
    border-right: 2px solid #B8860B;
    border-bottom: 2px solid #B8860B;
    border-left: 4px solid #8B0000;
}

.cung[data-cung="11"] { 
    border-bottom: 2px solid #B8860B;
    border-right: 4px solid #8B0000;
}

.cung[data-cung="3"] { 
    border-right: 2px solid #B8860B;
    border-bottom: 4px solid #8B0000;
    border-left: 4px solid #8B0000;
    border-bottom-left-radius: 15px;
}

.cung[data-cung="2"] { 
    border-right: 2px solid #B8860B;
    border-bottom: 4px solid #8B0000;
}

.cung[data-cung="1"] { 
    border-right: 2px solid #B8860B;
    border-bottom: 4px solid #8B0000;
}

.cung[data-cung="12"] { 
    border-bottom: 4px solid #8B0000;
    border-right: 4px solid #8B0000;
    border-bottom-right-radius: 15px;
}

.cung-header {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 10px;
    font-weight: 600;
    color: #8B0000;
    font-size: 13px;
    border-bottom: 2px solid rgba(184, 134, 11, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 50px;
    position: relative;
}

.cung-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #B8860B, #FFD700, #B8860B);
}

.cung-chi {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.cung-ten {
    font-size: 14px;
    color: #8B0000;
    text-align: center;
    margin-top: 3px;
    font-weight: 700;
    font-family: 'Noto Serif', serif;
}

.cung-content {
    padding: 10px;
    height: calc(100% - 50px);
    position: relative;
}

.cung-main-star {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    min-height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px dotted rgba(184, 134, 11, 0.5);
    padding: 5px 0;
    font-family: 'Noto Serif', serif;
    border-radius: 8px;
}

.cung-main-star:not(:empty) {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(255, 215, 0, 0.1) 100%);
}
.cung-stars {
    display: flex;
    height: calc(100% - 70px);
}

.star-column {
    flex: 1;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.star-column-left {
    border-right: 2px dotted rgba(184, 134, 11, 0.4);
    padding-right: 6px;
}

.star-column-right {
    padding-left: 6px;
}

.sao {
    font-size: 12px;
    line-height: 1.4;
    padding: 3px 4px;
    text-align: center;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sao:hover {
    background: rgba(184, 134, 11, 0.1);
    border-color: rgba(184, 134, 11, 0.3);
    transform: scale(1.05);
}

.menh-cung {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%) !important;
    border-color: #B8860B !important;
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.4);
}

.than-cung {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%) !important;
    border-color: #4caf50 !important;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

.thien-ban {
    grid-column: 2/4;
    grid-row: 2/4;
    border: 4px solid #8B0000;
    background: linear-gradient(135deg, #f9f9f9 0%, #e8e8e8 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 14px;
    padding: 20px;
    position: relative;
    border-radius: 15px;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.1);
}

.thien-ban::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #B8860B, #FFD700, #B8860B);
    z-index: -1;
    border-radius: 17px;
}

.thien-ban-title {
    font-size: 18px;
    font-weight: 700;
    color: #8B0000;
    margin-bottom: 15px;
    font-family: 'Noto Serif', serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.thien-ban-info {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.thien-ban-info div {
    margin: 4px 0;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.thien-ban-info div:hover {
    background: rgba(184, 134, 11, 0.1);
}

.current-step {
    font-weight: 700;
    color: #000;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.tips {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.95) 0%, rgba(240, 242, 247, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    margin-top: 20px;
    border-left: 5px solid #B8860B;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.tips h4 {
    color: #8B0000;
    margin-bottom: 15px;
    font-family: 'Noto Serif', serif;
    font-size: 1.3rem;
}

.tips p {
    font-size: 14px;
    color: #555;
    margin: 8px 0;
    line-height: 1.6;
}

.corner-label {
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 6px;
    z-index: 10;
}

.tuan-corner {
    background: linear-gradient(135deg, #000 0%, #333 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.triet-corner {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dai-han-label {
    position: absolute;
    bottom: 3px;
    right: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    background: linear-gradient(135deg, #4caf50 0%, #66BB6A 100%);
    color: white;
    border-radius: 6px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tieu-han-label {
    position: absolute;
    bottom: 3px;
    left: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    background: linear-gradient(135deg, #2196f3 0%, #42A5F5 100%);
    color: white;
    border-radius: 6px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.trang-sinh-stars {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #8B4513;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    padding: 4px 8px;
    border-radius: 8px;
    border: 2px solid #B8860B;
    z-index: 8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.tam-hop-line {
    position: absolute !important;
    background: #000000 !important;
    height: 1px !important;
    z-index: 5;
    pointer-events: none;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.cung-grid {
    display: grid;
    grid-template-columns: repeat(4, 320px);
    grid-template-rows: repeat(4, 320px);
    gap: 0;
    margin: 20px auto;
    justify-content: center;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    min-width: 1280px; /* Fixed minimum width */
}

/* Mobile Responsive - Remove scaling, use scroll */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }
.header-content{flex-direction: column;}
.header-content h1{font-size: 1.5rem;margin-bottom: 10px;}
.welcome-yinyang{margin:10px;padding: 20px;}
.input-form-centered h2{font-size:1.5rem}
.input-form-centered{padding:15px}
.form-grid{gap:5px;grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));}
.form-group{margin-bottom:5px}
.form-group input, .form-group select{padding:10px}
.form-group label {
    font-size: 0.8rem;
}
.welcome-title{font-size:2.5rem}
    .header {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
.progress-only{min-width:250px!important;margin: 10px;    padding: 20px;}
.progress-only h2{font-size:1.5rem}
    .input-panel, .control-panel {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .main-content {
        flex-direction: column;
    }

    .chart-panel {
        padding: 15px;
        overflow-x: auto;
    }

    .cung-grid {
        /* Keep original size, don't scale */
        margin: 10px 0;
        justify-content: flex-start;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
        margin: 5px;
    }

    .tips {
        padding: 20px 15px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .input-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        flex-direction: column;
    }

    .chart-panel {
        overflow-x: auto;
    }

    .cung-grid {
        justify-content: flex-start;
        margin: 20px 0;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .cung-grid {
        grid-template-columns: repeat(4, 360px);
        grid-template-rows: repeat(4, 360px);
    }

    .cung-main-star {
        font-size: 18px;
    }

    .sao {
        font-size: 13px;
    }

    .thien-ban {
        font-size: 16px;
        padding: 25px;
    }
}

/* Dark mode for night usage */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    }

    .input-panel, .control-panel, .chart-panel {
        background: linear-gradient(135deg, rgba(30,30,30,0.95) 0%, rgba(40,40,40,0.95) 100%);
        color: #e0e0e0;
    }

    .cung {
        background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
        color: #e0e0e0;
    }

    .cung-header {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        color: #FFD700;
    }

    .thien-ban {
        background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
        color: #e0e0e0;
    }

    .thien-ban-title {
        color: #FFD700;
    }
}



.search-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(184, 134, 11, 0.2);
}

.search-panel h3 {
    color: #8B0000;
    font-family: 'Noto Serif', serif;
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.search-panel h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #B8860B, #FFD700);
    border-radius: 2px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.search-input-group input:focus {
    outline: none;
    border-color: #B8860B;
    box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.1);
}

.search-result {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #4169E1;
    min-height: 40px;
    font-size: 14px;
    color: #555;
}

.search-result.found {
    border-left-color: #4CAF50;
    color: #2E7D32;
}

.search-result.not-found {
    border-left-color: #f44336;
    color: #C62828;
}
.cung.highlighted {
    background: linear-gradient(135deg, #ffeb3b 0%, #fff59d 100%) !important;
    border-color: #f57f17 !important;
    box-shadow: 0 0 30px rgba(245, 127, 23, 0.6) !important;
    animation: pulse 1s ease-in-out 3;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}