/*!
 * table-grid (http://mdo.github.io/table-grid)
 * Released under MIT, (c) 2014 Mark Otto
 */

html {
    font-size: 14px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

*,
*:before,
*:after {
    -webkit-box-sizing: inherit;
    -moz-box-sizing: inherit;
    box-sizing: inherit;
}

@media (min-width: 600px) {
    html {
        font-size: 14px;
    }
}

/* --- Palace Group Borders (Tứ Sinh / Tứ Mộ) --- */
/* Common properties for border overlay */
[cung-id='3'],
[cung-id='6'],
[cung-id='9'],
[cung-id='12'],
[cung-id='2'],
[cung-id='5'],
[cung-id='8'],
[cung-id='11'] {
    position: relative !important;
}

[cung-id='3']::after,
[cung-id='6']::after,
[cung-id='9']::after,
[cung-id='12']::after,
[cung-id='2']::after,
[cung-id='5']::after,
[cung-id='8']::after,
[cung-id='11']::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 5;
    /* Ensure it's above .daiHan background */
    box-shadow: inset 0 0 0 3px;
    /* Color defined below */
}

/* Tứ Sinh: Dần (3), Tỵ (6), Thân (9), Hợi (12) - Dark Green */
[cung-id='3']::after,
[cung-id='6']::after,
[cung-id='9']::after,
[cung-id='12']::after {
    box-shadow: inset 0 0 0 3px #006400 !important;
}

/* Tứ Mộ: Sửu (2), Thìn (5), Mùi (8), Tuất (11) - Dark Orange */
[cung-id='2']::after,
[cung-id='5']::after,
[cung-id='8']::after,
[cung-id='11']::after {
    box-shadow: inset 0 0 0 3px #FF8C00 !important;
}

body {
    margin: 0;
    padding-bottom: 3rem;
    font-family: "Noto Serif", "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-align: center;
    background-color: #fff;
}

.container {
    max-width: 54rem;
    /*padding: 0 1rem;*/
}

a {
    color: #1874cd;
    text-decoration: none;
}

a:hover {
    color: #104e8b;
}

h1,
h2,
h3 {
    margin-top: 0;
    margin-bottom: .5rem;
    font-weight: 500;
    line-height: 1.1;
    color: #333;
}

h1 {
    font-size: 3rem;
}

h1 small {
    font-size: 80%;
    color: #777;
}

h2 {
    margin-top: 3rem;
    font-size: 2rem;
}

p {
    margin-top: 0;
}

.container>p {
    margin: .5rem auto 1rem;
    max-width: 800px;
}

hr {
    max-width: 100px;
    margin: 3rem auto;
    border: 0;
    border-top: .1rem solid #eee;
}

code {
    padding: .15rem .3rem;
    font-family: Menlo, "Courier New", monospace;
    font-size: 90%;
    color: #cd3333;
    background-color: #f5f5f5;
    border-radius: .15rem;
}


/* Display utility classes */

.inline-block {
    display: inline-block;
}


/* Masthead */

.masthead {
    padding: 4rem 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, .65);
    text-align: center;
    /*background-color: #b94a48;*/
}

.masthead a,
.masthead strong {
    font-weight: normal;
    color: #fff;
}

.masthead p {
    font-size: 1.25rem;
}


/* Make it red for easy views */

.grid-example {
    margin-bottom: 1rem;
}

.grid-example .col {
    line-height: 3;
    text-align: center;
    color: #333;
    /*background-color: rgba(255, 0, 0, .15);*/
}


/* Nested grid examples need outdenting because padding. */

.grid-example .grid-example {
    margin-top: .5rem;
    margin-bottom: 0;
}


/* Increase height of vertically centered example */

.grid-example .grid-align-middle {
    height: 200px;
}

.grid-example.grid-align-middle .col {
    min-height: 3rem;
    line-height: 1.5;
}

.container {
    max-width: 940px;
    margin-right: auto;
    margin-left: auto;
}

.laso {
    width: 800px;
    height: 1069px;
    /* 4 * 260 + 2px borders */
    margin-right: auto;
    margin-left: auto;
    overflow: hidden;
    background-image: url('texture.jpg');
    position: relative;
}

.cung-top,
cung-bottom {
    height: 25px;
    margin: 2px 2px 0 0;
}

.cung-middle {
    height: 220px;
    position: relative;
}

.cung-middle ul,
li {
    list-style-type: none;
}

.hanhKim {
    color: #9E9E9E;
}

.hanhMoc {
    color: #4CAF50;
}

.hanhThuy {
    color: #000100;
}

.hanhHoa {
    color: #a71a14;
}

.hanhTho {
    color: #e6bd37;
}

.chinhTinh {
    min-height: 35px;
    padding-bottom: 3px;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.1;
    /* Tighter line height */
}

.chinhTinh li {
    margin-bottom: 2px;
    /* Minimal margin */
}

.cungChu {
    text-transform: uppercase;
    font-size: 1.1em;
    padding-bottom: 0.2em;
}

.cungThan {
    background-color: darkred;
    font-size: 0.8em;
    /* Smaller font */
    padding: 2px;
    /* User preferred padding */
    vertical-align: middle;
    display: inline-block;
    border-radius: 2px;
}

.cungThan-container {
    text-align: center;
    margin-bottom: 5px;
    /* Spacing handled by container */
}

.xungChieu {
    background-color: #D7CCC8;
}

.diaCung {
    width: 200px;
    height: 260px;
    /*background-color: #f3f6ef;*/
}

.thienBan {
    width: auto;
    height: 535px;
    position: relative;
}

.thienBan .noidung {
    padding: 5px 10px 10px 10px;
    text-align: justify;
}

.thienBan .noidung .header {
    text-align: center;
    font-weight: bold;
    padding-bottom: 1rem;
}

.thienBan .noidung .sinhkhac {
    text-align: center;
    font-weight: bold;
    padding-top: 1rem;
}

.thienBan .noidung .cotTrai {
    text-align: left;
    font-weight: bold;
}

.thienBan .noidung .cotPhai {
    text-align: left;
    line-height: 1.5em;
}

.thienBan .mausac {
    position: absolute;
    height: 100px;
    bottom: 0;
}

.thienBan .mausac .gioithieuhanh {
    /*    width: 50px;*/
    font-weight: bold;
}

input {
    padding: .5em .6em;
    display: inline-block;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 3px #ddd;
    border-radius: 4px;
    vertical-align: middle;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

form {
    color: #000;
    text-align: left;
}

label {
    padding-right: 2rem;
}

select {
    height: 2.25em;
    border: 1px solid #ccc;
    background-color: #fff;
}

.grid .left {
    width: 30%;
    text-align: right;
}

.grid .right {
    width: 70%;
}

.formborder {
    border: 1px solid #c92424;
    padding: 10px;
}

.border {
    border: thin #a8a8a8 solid;
}

.border-right {
    border-right: thin #a8a8a8 solid;
}

.border-left {
    border-left: thin #a8a8a8 solid;
}

.border-bottom {
    border-bottom: thin #a8a8a8 solid;
}

.border-top {
    border-top: thin #a8a8a8 solid;
}

.inset-border {
    box-sizing: border-box;
}

.button {
    cursor: pointer;
    display: inline-block;
    min-height: 1em;
    outline: 0;
    border: none;
    vertical-align: baseline;
    background: #E0E1E2;
    color: rgba(0, 0, 0, .6);
    font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
    margin: 0 .25em 0 0;
    padding: .78571429em 1.5em;
    text-transform: none;
    text-shadow: none;
    font-weight: 700;
    line-height: 1em;
    font-style: normal;
    text-align: center;
    text-decoration: none;
    border-radius: .28571429rem;
    box-shadow: 0 0 0 1px transparent inset, 0 0 0 0 rgba(34, 36, 38, .15) inset;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transition: opacity .1s ease, background-color .1s ease, color .1s ease, box-shadow .1s ease, background .1s ease;
    transition: opacity .1s ease, background-color .1s ease, color .1s ease, box-shadow .1s ease, background .1s ease;
    will-change: '';
    -webkit-tap-highlight-color: transparent;
}

input.primary:hover {
    background-color: #1678c2;
    color: #FFF;
    text-shadow: none;
}

#namsinh {
    width: 100px;
}

input.warning {
    background-color: #f0ad4e;
    color: #FFF;
    text-shadow: none;
}

input.primary {
    background-color: #2185D0;
    color: #FFF;
    text-shadow: none;
}


/*.phuTinh .col{
    padding-bottom: 0.2em;
}*/

.phuTinh .saotot {
    width: 46%;
    line-height: 1.3em;
    text-align: left;
    display: inline-block;
    white-space: nowrap;
    vertical-align: top;
    max-height: 120px;
    font-weight: bold;
    font-size: x-small;
}

.phuTinh .saoxau {
    width: 46%;
    line-height: 1.3em;
    display: inline-block;
    text-align: right;
    white-space: nowrap;
    vertical-align: top;
    font-weight: bold;
    font-size: x-small;
}

.blocks {
    width: 46%;
    white-space: nowrap;
    display: inline-block;
    /*overflow: hidden;
    text-overflow: ellipsis;*/
    line-height: 1.2em;
    font-size: 14px;
}


/*.blocks:nth-child(odd){
    text-align: left;
}
.blocks:nth-child(even){
    text-align: right;
}*/

.anlaso {
    display: none !important;
}

.hide {
    width: 46%;
    white-space: nowrap;
    display: inline-block;
    line-height: 1.2em;
    font-size: 14px;
    height: 0;
    overflow: hidden;
}


/*@media (min-width: 600px) {*/

.grid {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.col {
    display: table-cell;
}

.thongtin {
    padding-bottom: 1rem;
}

.grid-padded {
    margin-left: -1rem;
    margin-right: -1rem;
}


/*.grid-padded .grid {
    border-spacing: 1rem 0;
}*/

.label {
    display: inline;
    padding: .2em .6em .3em;
    font-size: 90%;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25em;
}

.label-tuan {
    background-color: #3E2723;
}

.label-triet {
    background-color: #263238;
}

.tuanTriet {
    position: absolute;
    bottom: 5px;
    width: 100%;
    text-align: center;
    /* align-self: center; */
    /* flex-direction: column; */
    /* justify-content: center; */
}


/*}*/


/*@media (min-width: 600px) {*/

.col-1 {
    width: 8.333333%;
}

.col-2 {
    font-size: 8pt;
    width: 25%;
}

.col-3 {
    width: 25%;
}

.col-4 {
    width: 33.333333%;
}

.col-5 {
    width: 41.666667%;
}

.col-6 {
    width: 50%;
}

.col-7 {
    width: 58.333333%;
}

.col-8 {
    width: 66.666667%;
}

.col-9 {
    width: 75%;
}

.col-10 {
    width: 83.333333%;
}

.col-11 {
    width: 91.666667%;
}

.grid-align-middle .col {
    vertical-align: middle;
}

.grid-reverse {
    direction: rtl;
}

.grid-reverse .col {
    direction: ltr;
}

.Zebra_Tooltip {
    position: absolute;
    z-index: 8000;
    background: transparent;
}

.Zebra_Tooltip .Zebra_Tooltip_Message {
    position: relative;
    padding: 15px;
    font-size: inherit;
    text-align: left;
    font-weight: normal;
    line-height: inherit;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    /* *margin-right: 0; */
    /* _width: expression(document.body.clientWidth > 250 ? '250px': 'auto'); */
    /* max-width for IE6 */
}

/* View Mode Toggles */
body.hide-lnc .star-lnc,
body.hide-lnc .star-indicator {
    display: none !important;
}

body.hide-th .star-th {
    display: none !important;
}

body.hide-luu .luuSao {
    display: none !important;
}

body.hide-lines #connectLines {
    display: none !important;
}

/* Mệnh Chủ Toggles */
body.hide-mc-nam .mc-nam {
    display: none !important;
}

body.hide-mc-cung .mc-cung {
    display: none !important;
}

/* Hide separator if either is hidden */
body.hide-mc-nam .mc-sep,
body.hide-mc-cung .mc-sep {
    display: none !important;
}

.star-indicator {
    font-size: 1.2em !important;
    font-weight: bold !important;
    text-align: center;
    width: 1.6em;
    height: 1.6em;
    line-height: 1.6em;
    border-radius: 50%;
    margin: 5px 2px 0 2px;
    display: inline-block;
    color: #fff;
    /* Default white text */
}

/* Specific Indicator Element Backgrounds */
.indicator-hanhKim {
    background-color: #9E9E9E;
}

.indicator-hanhMoc {
    background-color: #4CAF50;
}

.indicator-hanhThuy {
    background-color: #000100;
}

.indicator-hanhHoa {
    background-color: #a71a14;
}

.indicator-hanhTho {
    background-color: #e6bd37;
    color: #000;
}

/* Black text for yellow bg */

.Zebra_Tooltip .Zebra_Tooltip_Arrow {
    position: absolute;
    height: 10px;
    width: 20px;
    overflow: hidden;
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow_Bottom {
    bottom: 0;
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow_Top {
    top: 0
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow div {
    position: absolute;
    border-style: solid;
    border-width: 10px;
    height: 0;
    width: 0;
    left: 0;
    _border-left-color: pink;
    _border-right-color: pink;
    _filter: chroma(color=pink);
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow_Bottom div {
    top: 0;
    _border-bottom-color: pink;
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow_Top div {
    bottom: 0;
    _border-top-color: pink;
}

.Zebra_Tooltip .Zebra_Tooltip_Close {
    text-decoration: none;
    color: #FFF;
    position: absolute;
    right: 8px;
    top: 1px;
    font-size: inherit;
    font-weight: bold;
}

.Zebra_Tooltip .Zebra_Tooltip_Close:hover {
    color: #C40000;
}

.tooltips {
    cursor: help;
}

.daiHan {
    background-color: #E0F2F1;
    /* Light teal background */
    font-weight: bold;
}

.luuSao {
    font-style: italic;
    color: #673AB7;
    /* Deep purple */
    font-weight: bold;
    font-size: x-small;
}

/* Star Rank Styling */
.sao-loai-2 {
    font-weight: 700 !important;
    /* Bold for General Auxiliary stars (Tả Hữu, etc.) */
}

/* Important Good Stars (Cát / Phúc Tinh) - Extra Bold if possible */
.sao-loai-3,
.sao-loai-4,
.sao-loai-5,
.sao-loai-6,
.sao-loai-7,
.sao-loai-8 {
    font-weight: 700 !important;
}

/* Bad Stars */
.sao-loai-11,
.sao-loai-12,
.sao-loai-13,
.sao-loai-14,
.sao-loai-15 {
    font-weight: 700;
}

/* Luu Stars */
.luuSao {
    font-weight: 700;
}

/* SVG Overlay for connecting lines */
#connectLines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

line.connect-line {
    stroke-width: 2;
    opacity: 0.6;
}

line.line-tam-hop {
    stroke: red;
}

line.line-xung-chieu {
    stroke: blue;
    /* Or darker red/black as per preference, sticking to blue for contrast or dashed red */
    stroke: #D32F2F;
    /* Darker red */
    stroke-dasharray: 5, 5;
}

#vungThienBan {
    position: relative;
}