*, *::before, *::after {
  box-sizing: border-box;
  justify-content: center;
}

:root {
  --bg-color: #f4f4f4;
  --border-color: #c9c9c9;
  --box-shadow: 0 2px 4px 0 rgba(0,0,0,0.02);
  --btn-color: #db0000;
  --btn-text-color: #fff;
  --highlight-color: #00b20038;

  --wood: #4CAF50;
  --fire: #F44336;
  --earth: #795548;
  --metal: #607D8B;
  --water: #2196F3;
}

.wood  { color: var(--wood);  }
.fire  { color: var(--fire);  }
.earth { color: var(--earth); }
.metal { color: var(--metal); }
.water { color: var(--water); }

tspan.wood  { fill: var(--wood);  }
tspan.fire  { fill: var(--fire);  }
tspan.earth { fill: var(--earth); }
tspan.metal { fill: var(--metal); }
tspan.water { fill: var(--water); }

html {
  touch-action: manipulation;
  -ms-overflow-style: none;  /* IE и Edge */
  scrollbar-width: none;     /* Firefox */
  height: 100%;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.content-section,
.content-section.active::-webkit-scrollbar {
  display: none;
}

body {
  background: var(--bg-color);  /* #f4f4f4; */
  font-weight: 300;
  -webkit-overflow-scrolling: touch;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  overscroll-behavior: none;
  touch-action: pan-y;
}

body, input, textarea, button, select {
  font-family: 'Noto Sans TC', Arial, sans-serif;
}

.content {
  margin: 0 auto;
  padding-bottom: 100px;
  box-sizing: border-box;
}

.content-section.active {
  display: block;
}


/* ===== Typography ===== */

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 500;
}

/* ===== ТАБЛИЦЫ ===== */

table {
  margin: 0 auto 0 auto; /* top | right | bottom | left */
  width: 100%;
  max-width: 500px;
  table-layout: fixed;
  text-align: center;
}

th {
  font-size: clamp(8px, 2vw, 10px);
  font-weight: 300;
  color: #555;
}

td {
  border: 0.5px solid var(--border-color);
  border-radius: 8px;
}

.table-personal, .table-today {
    font-size: clamp(2rem, 10vw, 3rem);
}

.table-personal {
  padding-top: 70px;
}

.table-personal td,
.table-today td,
.table-lucky td,
.yearsOfTakts td,
.chinese-table td {
  background: linear-gradient(25deg, var(--bg-color), #f3f7f166);
  box-shadow: var(--box-shadow);
}

.table-personal td:hover,
.table-today > tbody > tr:first-child > td:hover {
  border-color: #1d943357;
  background: linear-gradient(180deg, var(--bg-color), #7de78314);
  box-shadow: var(--box-shadow);
  cursor: pointer;
}

.table-personal .sns,
.table-today .sns {
  font-size: clamp(10px, 5vw, 16px);
}

.emptyborder{
  border: none;
  background: none !important;
  width: 5px !important;
  box-shadow: none;
  pointer-events: none;
}

/* --------------------------------- */
/* Фазы и Звезды
/* --------------------------------- */

.phase-item, .star-item {
  font-size: clamp(8px, 2vw, 10px);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  cursor: pointer;
}

.phaseTable td,
.table-stars td {
  border: none;
}

.table-stars {
  margin-block: 10px;
  padding-inline: 5px;
  text-align: left;
}
.phase-item, .star-item {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.phase-high {
  color: #db0000;
  background-color: #fff1f1;
}

.phase-high:hover {
  background-color: #ffe3e3;
}

.phase-low {
  color: #666;
  background-color: #eeeeee;
}

.phase-low:hover {
  background-color: #e6e5e5;
}

.phase-med {
  color: #0000cf;
  background-color: #eeeeff;
}

.phase-med:hover {
  background-color: #e4e4ff;
}

.star-item:hover {
  color: #db0000;
}




/* Lucky Table
========================== */

.table-lucky {
  font-size: 1.5rem;
  margin-top: 20px;
}

.table-lucky .sns {
  font-size: clamp(8px, 2vw, 10px);
}

.yearsOfTakts {
  font-size: clamp(7px, 0.8vw, 9px);
  white-space: nowrap;
  color: #777;
}




/* --------------------------------------- */
/* Выделение текущего такта и года
/* --------------------------------------- */

td.highlight,
td.highlight-column
 {
  border: 2px solid var(--highlight-color);
  background-color: var(--highlight-color);
  box-shadow: 0 1px 10px 0 var(--highlight-color);
}

th.highlight-column {
  background-color: var(--highlight-color);
  border-radius: 5px;
}




/* Контейнер SVG */

.svg-container {
  display: flex; 
  flex-wrap: wrap;
}

.svg-item {
  flex: 1;
  min-width: 300px;
  max-width: 400px;
  width: 100%;
}



/* стили для информации дня */

.info-day-container {
    max-width: 500px;
    margin: 0px auto;
}

.info-day-block h2 {
    color: #2a4fa9;
    font-weight: 600;
    font-size: clamp(10px, 5vw, 13px);
    margin-block: 5px;
}

.info-day-block p {
    margin: 0px auto;
    line-height: 1.4;
    font-size: clamp(12px, 5vw, 13px);
}

.info-day-block div {
    margin-bottom: 20px;
    background: #ffffff7d;
    border-radius: 10px;
    padding: 10px 20px;
    border: 1px solid #d1d1d1;
    box-shadow: 0 2px 12px #5b83e00f;
    backdrop-filter: blur(1px);
}

.info-day-block span {
    display: inline-block;
    margin: 5px auto;
    padding-left: 20px;
    font-size: 0.7em;
    color: #8e939d;
}


/* Базовые стили Font Awesome */

.fas {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Шрифт для solid иконок */
@font-face {
    font-family: 'fontsToMenu';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-solid-900.woff2") format("woff2");
}

.fas {
  font-family: 'fontsToMenu';
}

/* Конкретные иконки */
.fa-calendar-day:before { content: "\f783"; }
.fa-list-alt:before { content: "\f2b9"; }
.fa-book:before { content: "\f02d"; }
.fa-gear:before { content: "\f013"; }
.fa-plus:before { content: "\2b"; }
.fa-trash-alt:before { content: "\f2ed"; }
.fa-edit:before { content: "\f044"; }
.fa-arrow-right:before { content: "\f061"; }
.fa-arrow-left:before { content: "\f060"; }