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

:root {
  --bg-color: #f4f4f4;
  --border-color: #bbb;
  --box-shadow: 0 2px 4px 0 rgba(0,0,0,0.02);
  
  --highlight-color: #00b20038;
  --header-height: 60px;

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

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

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%;
  width: 100%;
}

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

body {
  margin: 0 auto;
  padding: 15px;
  
  background: var(--bg-color);
  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: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.content {
  margin: 0 auto;
  padding-bottom: 100px;
  max-width: 500px;
  margin: 10px auto;
}

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

.content-section1 {
  padding-top: var(--header-height);
}

.fixed {
    position: fixed;
    transition: all 0.3s ease;
}

.hidden, .addCardBtn.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

h1, h2 {
    text-align: center;
    color: #2c3e50;
    font-size: clamp(1rem, 4vw, 2rem);
    font-weight: 500;
}

h3 {
  font-size: 12px;
  color: #495362;
  margin: 0;
  /* font-style: italic; */
}

/* --------------------------------------- */
/* Таблицы
/* --------------------------------------- */

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: 400;
  color: #555;
  border-radius: 6px;
}

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

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

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

.table-personal td,
.table-today td,
.table-lucky td,
.yearsOfTakts td,
.chinese-table td {
  background: linear-gradient(145deg, #f8f9fa, #f8f9fa);
}

.table-personal td:hover,
.table-today > tbody > tr:first-child > td:hover {
  border-color: #888;
  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 {
  margin-block: 5px;
}

.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: #b91c1c;
  background-color: #fee2e2;
}

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

.phase-low {
  color: #5c5c5c;
  background-color: #f5f5f4;
}

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

.phase-med {
  color: #1e40af;
  background-color: #e6edff;
}

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

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




/* --------------------------------------- */
/* Такты и года
/* --------------------------------------- */

.table-lucky {
  font-size: 1.5rem;
  /* border-collapse: collapse; */
}

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

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

td.highlight,
td.highlight-column
 {
  border: 1.5px solid var(--highlight-color);
  background-color: var(--highlight-color);
  box-shadow: 0 2 4px 0 var(--highlight-color);
  font-weight: 400;
}


th.highlight-column {
  font-weight: 700;
  position: relative;
}

th.highlight-column::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--highlight-color);
}


/* --------------------------------------- */
/* Основные контейнеры
/* --------------------------------------- */

.content-block {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    padding: 18px 20px;
    border: 1.5px solid #ebe9f5;
    box-shadow: 0 2px 5px rgb(91 184 224 / 10%);
    /* backdrop-filter: blur(8px); */
}

/* .content-block:hover {
  background: #ffd1d1;
} */

.content-block h2 {
    color: #2d3748;
    line-height: 1.2;
    font-size: clamp(10px, 5vw, 13px);
    margin-block: 5px;
    font-weight: 600;
    text-align: left;
}

.content-block p,
.content-block li {
    color: #666;
    margin: 0px auto;
    line-height: 1.3;
    font-size: clamp(10px, 5vw, 13px);
    font-weight: 400;
}

.content-block ul {
  padding-left: 20px;
}

.content-block strong {
  display: inline-block;
  margin-top: 10px;
}

.content-block .content-wrapper {
  margin: 0px;
  background: transparent;
  padding: 5px 10px 15px 15px;
  border: 0;
  flex-grow: 1;
  box-shadow: none;
}

.header-title {
  display: inline-block;
  margin-block: 30px 8px;
  padding-left: 20px;
  font-weight: 600;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  
  background: linear-gradient(145deg, #1f4190, #5d3d8a, #8f3a6f);
  /* background: linear-gradient(145deg, #911f4b, #b83b6b, #cf6f8f); */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.header-title span {
  color: #93989d;
  font-weight: 400;
  margin-left: 5px;
  font-size: 1em;
  text-transform: none;
  letter-spacing: 0.01em;
  font-style: italic;
}



/* Фон загрузки */
        .loader-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.95);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        /* Классический спиннер */
        .loader {
            width: 60px;
            height: 60px;
            border: 5px solid #f3f3f3;
            border-top: 5px solid #db0000;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        /* Анимация вращения */
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }