/* Shared shell for dashboard hub + service subpages (tarot, …) */
:root {
  --modal-bg: rgba(14, 11, 8, 0.97);
  --bg-deep: #0a0705;
  --gold: #c9a227;
  --gold-soft: rgba(201, 162, 39, 0.35);
  --text: rgba(245, 240, 230, 0.92);
  --text-muted: rgba(245, 240, 230, 0.72);
  --card-bg: rgba(22, 18, 14, 0.94);
  --card-border: rgba(201, 162, 39, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text-muted);
  background: var(--bg-deep);
}
html[lang="fa"] body { font-family: "Vazirmatn", system-ui, sans-serif; }
html[lang="en"] body,
html[lang="de"] body { font-family: "Inter", system-ui, sans-serif; }

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg-deep) url("/images/coffee-cup-bg.png") center center / cover no-repeat;
}
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 70% at 50% 38%, rgba(10, 7, 5, 0.1) 0%, rgba(10, 7, 5, 0.75) 55%, rgba(5, 3, 2, 0.94) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 52rem;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 1.5rem);
  padding-bottom: clamp(2.5rem, 8vh, 4rem);
}

.db-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 4vw, 1.75rem);
}

.db-brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.db-back-hub {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(236, 208, 120, 0.9);
  text-decoration: none;
  border: 1px solid rgba(201, 162, 39, 0.35);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}
.db-back-hub:hover {
  border-color: rgba(201, 162, 39, 0.55);
  background: rgba(201, 162, 39, 0.08);
}

.db-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  filter: drop-shadow(0 0 12px var(--gold-soft));
}

.db-brand {
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 0 0 24px var(--gold-soft);
}

.db-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.db-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.db-btn:hover {
  border-color: rgba(201, 162, 39, 0.65);
  background: rgba(201, 162, 39, 0.1);
}
.db-btn--ghost {
  border-color: rgba(255, 255, 255, 0.12);
}
.db-btn--logout {
  border-color: rgba(196, 92, 92, 0.45);
  color: rgba(255, 200, 200, 0.95);
}
.db-btn--logout:hover {
  border-color: rgba(196, 92, 92, 0.75);
  background: rgba(196, 92, 92, 0.12);
}

.lang-globe-btn {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold);
  cursor: pointer;
}
.lang-globe-btn svg { width: 1.25rem; height: 1.25rem; }

.db-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(32, 26, 20, 0.98) 0%, var(--card-bg) 100%);
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  margin-bottom: 0.85rem;
}

.db-avatar {
  flex-shrink: 0;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 0 24px var(--gold-soft);
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold);
}
.db-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.db-profile-name {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.db-profile-email {
  margin: 0;
  font-size: 0.86rem;
  opacity: 0.75;
  word-break: break-all;
}

.db-free-banner {
  position: relative;
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  padding: 0.85rem 1.35rem;
  border-radius: 14px;
  background: linear-gradient(
    125deg,
    rgba(55, 42, 28, 0.92) 0%,
    rgba(95, 72, 32, 0.88) 45%,
    rgba(42, 32, 22, 0.94) 100%
  );
  border: 1px solid rgba(201, 162, 39, 0.4);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 240, 200, 0.1);
  overflow: hidden;
}
.db-free-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 75%
  );
  pointer-events: none;
}
.db-free-banner__text {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.55;
  color: rgba(255, 248, 230, 0.96);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.db-credits-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 1.05rem 1.15rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(32, 26, 20, 0.98) 0%, var(--card-bg) 100%);
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
}
.db-credits-card[hidden] {
  display: none !important;
}
.db-credits-card__half {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  text-align: center;
}
.db-credits-card__divider {
  width: 1px;
  flex-shrink: 0;
  background: rgba(201, 162, 39, 0.22);
  align-self: stretch;
}
.db-credits-card__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}
.db-credits-card__value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.db-credits-card__value--unlimited {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  color: rgba(236, 208, 120, 0.98);
}

.ds-hub {
  margin-bottom: 2rem;
}
.ds-hub-title {
  margin: 0 0 1.15rem;
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.03em;
}
.ds-hub-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .ds-hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 960px) {
  .ds-hub-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.db-credits-card--hub {
  flex-wrap: wrap;
  row-gap: 0.75rem;
}
.db-credits-card--hub .db-credits-card__half {
  flex: 1 1 12%;
  min-width: 3.85rem;
}

@media (max-width: 640px) {
  .db-credits-card--hub {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 0.85rem 0.65rem;
    gap: 0;
    justify-content: flex-start;
  }
  .db-credits-card--hub .db-credits-card__divider {
    flex-shrink: 0;
  }
  .db-credits-card--hub .db-credits-card__half {
    flex: 0 0 auto;
    min-width: 5.25rem;
    max-width: 6.5rem;
    padding-inline: 0.15rem;
  }
  .db-credits-card--hub .db-credits-card__label {
    font-size: 0.62rem;
    line-height: 1.25;
    letter-spacing: 0.04em;
  }
  .db-credits-card--hub .db-credits-card__value {
    font-size: 1.15rem;
  }
  .db-credits-card--hub .db-credits-card__value--unlimited {
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
  }
}

.ds-hub-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: linear-gradient(165deg, rgba(32, 26, 20, 0.96) 0%, rgba(14, 11, 8, 0.92) 100%);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.ds-hub-card-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.15rem 1.25rem;
  min-height: 0;
}

.ds-hub-card-thumb {
  width: 100%;
  margin: 0 0 0.55rem;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(201, 162, 39, 0.18);
  background: rgba(0, 0, 0, 0.2);
  line-height: 0;
}
.ds-hub-card-thumb img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}
/* Same frame as other hub thumbs (256×170 style); square/tall art is cropped, not stretched */
.ds-hub-card-thumb--fixed {
  aspect-ratio: 256 / 170;
  position: relative;
}
.ds-hub-card-thumb--fixed img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.ds-hub-card-thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(28, 22, 18, 0.95) 0%, rgba(10, 8, 6, 0.98) 100%);
}
.ds-hub-card-thumb--icon .ds-hub-card-icon {
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: 0;
}

.ds-hub-card-ribbon {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 0.62rem 1rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 15px 15px 0 0;
  overflow: hidden;
  isolation: isolate;
}
.ds-hub-card-ribbon__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 45%,
    transparent 70%
  );
  opacity: 0.85;
}
.ds-hub-card-ribbon__text {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  unicode-bidi: isolate;
}
.ds-hub-card-ribbon--paid {
  background: linear-gradient(
    135deg,
    rgba(120, 85, 28, 0.95) 0%,
    rgba(201, 162, 39, 0.88) 40%,
    rgba(160, 118, 36, 0.92) 100%
  );
  border-bottom: 1px solid rgba(236, 208, 120, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 248, 220, 0.18);
  color: rgba(20, 14, 8, 0.96);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.35);
}
.ds-hub-card-ribbon--paid .ds-hub-card-ribbon__text {
  color: rgba(18, 12, 6, 0.98);
}
.ds-hub-card-ribbon--free {
  background: linear-gradient(
    135deg,
    rgba(15, 80, 45, 0.92) 0%,
    rgba(22, 120, 65, 0.88) 45%,
    rgba(12, 65, 38, 0.94) 100%
  );
  border-bottom: 1px solid rgba(74, 222, 128, 0.38);
  box-shadow: inset 0 1px 0 rgba(187, 247, 208, 0.12);
}
.ds-hub-card-ribbon--free .ds-hub-card-ribbon__text {
  color: rgba(220, 252, 231, 0.98);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.ds-hub-card:hover .ds-hub-card-ribbon--paid {
  filter: brightness(1.06);
}
.ds-hub-card:hover .ds-hub-card-ribbon--free {
  filter: brightness(1.05);
}
.ds-hub-card:hover {
  border-color: rgba(201, 162, 39, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.ds-hub-card-icon {
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.75rem;
  color: var(--gold);
  flex-shrink: 0;
}
.ds-hub-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
}
.ds-hub-card-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  opacity: 0.9;
  flex: 1;
}
.ds-hub-card-cta {
  margin-top: 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(236, 208, 120, 0.95);
}

.ds-placeholder {
  padding: 1.35rem 1.2rem;
  border-radius: 16px;
  border: 1px dashed rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 40rem;
}

footer.db-foot {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.45;
}

/* Bottom nav — match dashboard */
:root {
  --mnav-active: #22c55e;
  --mnav-bg: rgba(10, 12, 18, 0.97);
  --mnav-muted: rgba(200, 205, 215, 0.55);
}
.db-mnav {
  display: none;
}
@media (max-width: 768px) {
  .db-nav-desktop {
    display: none !important;
  }
  body.has-bottom-nav .shell {
    padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
  }
  .db-mnav {
    display: flex;
    position: fixed;
    z-index: 99980;
    left: 0;
    right: 0;
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    min-height: 4.1rem;
    background: var(--mnav-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
  }
  .db-mnav__item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.45rem 0.35rem 0.5rem;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--mnav-muted);
    font: inherit;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .db-mnav__item .db-mnav__icon {
    width: 1.45rem;
    height: 1.45rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .db-mnav__item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .db-mnav__item.is-active {
    color: var(--mnav-active);
  }
  .db-mnav__item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2rem;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--mnav-active);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
  }
  .lang-globe-btn.lang-desktop-only {
    display: none !important;
  }
}

.lang-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lang-backdrop.is-open { opacity: 1; visibility: visible; }
.lang-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 201;
  transform: translate(-50%, -48%) scale(0.96);
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(70vh, 24rem);
  padding: 0;
  border-radius: 16px;
  background: var(--modal-bg);
  border: 1px solid rgba(201, 162, 39, 0.2);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}
.lang-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.lang-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.lang-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
}
.lang-modal-close {
  border: none;
  background: transparent;
  color: rgba(245, 240, 230, 0.65);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}
.lang-modal-list {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: start;
}
.lang-option:hover {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.06);
}
.lang-option[aria-selected="true"] {
  border-color: rgba(201, 162, 39, 0.5);
  background: rgba(201, 162, 39, 0.1);
}
.lang-flag img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}
.lang-check {
  width: 1.1rem;
  height: 1.1rem;
  margin-inline-start: auto;
  opacity: 0;
  color: var(--gold);
}
.lang-option[aria-selected="true"] .lang-check {
  opacity: 1;
}

body.modal-open {
  overflow: hidden;
}
