:root {
  --accent-color: #5ec8e8;
  --text-color: #ffffff;
  --muted-color: rgba(255, 255, 255, 0.72);
  --card-bg: rgba(8, 36, 72, 0.78);
  --card-border: rgba(94, 200, 232, 0.55);
}

html,
body {
  background: #061428;
  color: var(--text-color);
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.page-bg {
  position: fixed;
  inset: 0;
  background-color: #061428;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
  transition: background-image 0.35s ease;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  box-sizing: border-box;
}

.back-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(180deg);
  cursor: pointer;
  z-index: 2;
}

.back-btn img {
  width: 1.2rem;
  height: 1.2rem;
}

.date-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-color);
  margin: 0.4rem 0 0.6rem;
}

.zodiac-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.8rem;
}

.zodiac-wheel {
  position: relative;
  width: 9.5rem;
  height: 9.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zodiac-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

.zodiac-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-color);
  font-size: 0.95rem;
  backdrop-filter: blur(6px);
}

.zodiac-switch img {
  width: 1rem;
  height: 1rem;
}

/* Card frame */
.card-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
}

.card-border {
  display: block;
  width: 100%;
  line-height: 0;
  position: relative;
  z-index: 2;
}

.card-border img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: -1px;
  margin-bottom: -1px;
  padding: 0.7rem 0.85rem 1rem;
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.tabs {
  display: flex;
  align-items: stretch;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
  box-sizing: border-box;
}

.tab-item {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--muted-color);
  font-size: 0.78rem;
  line-height: 1.25;
  padding: 0.5rem 0.15rem 0.65rem;
  position: relative;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-item.active {
  color: var(--text-color);
  font-weight: 600;
}

.tab-item.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2.2rem;
  height: 2px;
  background: var(--text-color);
  border-radius: 2px;
  transform: translateX(-50%);
}

.stats-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  align-items: flex-start;
}

.luck-level {
  flex: 0 0 34%;
  max-width: 34%;
  min-width: 0;
}

.luck-percent {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
}

.luck-label,
.lucky-label,
.qg-title {
  color: var(--accent-color);
  font-size: 0.72rem;
  word-break: break-word;
}

.category-stars {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.star-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--muted-color);
  width: 100%;
  min-width: 0;
}

.star-row > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stars {
  display: flex;
  align-items: center;
  gap: 0.08rem;
  flex: 0 0 auto;
}

.stars img {
  width: 0.8rem;
  height: 0.8rem;
}

.quick-glance {
  margin-bottom: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.qg-frame {
  position: relative;
  width: 100%;
}

.qg-top,
.qg-bottom {
  display: block;
  width: 100%;
  height: auto;
}

.qg-body {
  padding: 0.55rem 0.7rem;
  box-sizing: border-box;
  text-align: center;
}

.qg-title {
  margin-bottom: 0.3rem;
}

.qg-body p,
.overall-section p {
  margin: 0;
  line-height: 1.55;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.88);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.lucky-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.lucky-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 0.45rem;
  padding: 0.65rem 0.4rem;
  text-align: center;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.35s ease;
}

.lucky-value {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  min-height: 1.3rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.overall-section {
  width: 100%;
  box-sizing: border-box;
}

.overall-section h3 {
  color: var(--accent-color);
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.detail-sections {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

.detail-block {
  padding: 0.7rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 0.45rem;
  box-sizing: border-box;
  transition: border-color 0.35s ease;
}

.detail-block h3 {
  color: var(--accent-color);
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.detail-block p {
  margin: 0;
  line-height: 1.55;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.88);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ad-slot {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 1rem auto 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.empty {
  width: 100%;
  height: 2rem;
}

html[dir="rtl"] .stats-row,
html[dir="rtl"] .star-row,
html[dir="rtl"] .tabs {
  direction: rtl;
}

html[dir="rtl"] .back-btn {
  left: auto;
  right: 1rem;
  transform: rotate(0deg);
}

body[data-theme="blue"] .page-bg {
  background-image: url("../img/blueModel.jpg");
}

body[data-theme="blue"] {
  --accent-color: #5ec8e8;
  --card-bg: rgba(8, 36, 72, 0.78);
  --card-border: rgba(94, 200, 232, 0.55);
}

body[data-theme="green"] .page-bg {
  background-image: url("../img/greenModel.jpg");
}

body[data-theme="green"] {
  --accent-color: #6fd6a0;
  --card-bg: rgba(8, 48, 36, 0.78);
  --card-border: rgba(111, 214, 160, 0.55);
}

body[data-theme="pink"] .page-bg {
  background-image: url("../img/pinkModel.jpg");
}

body[data-theme="pink"] {
  --accent-color: #f08cb8;
  --card-bg: rgba(56, 18, 48, 0.78);
  --card-border: rgba(240, 140, 184, 0.55);
}

body[data-theme="yellow"] .page-bg {
  background-image: url("../img/yellowModel.jpg");
}

body[data-theme="yellow"] {
  --accent-color: #f5c85c;
  --card-bg: rgba(56, 40, 12, 0.78);
  --card-border: rgba(245, 200, 92, 0.55);
}
