* { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --page: #080f1d;
  --surface: #121f34;
  --ink: #f1f6ff;
  --body: #c1d1e5;
  --blue: #b1deff;
  --line: #b1cee639;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.6 "Segoe UI", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid #9ce2ff; outline-offset: 4px; }
.container { width: min(calc(100% - 32px), 1280px); margin-inline: auto; }

.skip {
  position: fixed;
  z-index: 5;
  inset: 10px auto auto 12px;
  padding: 8px 13px;
  border-radius: 7px;
  background: #f6d789;
  color: #21180d;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

.site-header { background: #0b1425; border-bottom: 1px solid var(--line); }
.header-content { display: flex; min-height: 68px; justify-content: space-between; align-items: center; gap: 10px; }

.wordmark {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark img { width: 27px; height: 30px; }

.language-switcher {
  display: flex;
  gap: 3px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #12223a;
}

.language-switcher[hidden] { display: none; }
.language-switcher button {
  min-block-size: 44px;
  min-inline-size: 44px;
  padding-inline: 8px;
  color: var(--body);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.language-switcher button[aria-pressed="true"] { color: #12243a; background: #e0efff; font-weight: 750; }

.apps-directory {
  margin-block: clamp(16px, 3vw, 30px) 0;
  padding: clamp(20px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: clamp(15px, 2.6vw, 26px);
  background:
    radial-gradient(ellipse at 83% 10%, #2e507d 0, transparent 58%),
    linear-gradient(125deg, #182b44, #0b1429 68%);
}
.apps-directory h1 {
  margin: 0;
  font-size: clamp(2.05rem, 5.25vw, 4.35rem);
  line-height: 1.17;
  letter-spacing: -.035em;
  text-wrap: balance;
}
html[lang="th"] .apps-directory h1 { line-height: 1.35; }
.apps-directory > p { margin-block: .65rem 0; color: #d2deed; font-size: clamp(17px, 2vw, 21px); }

.directory-nav { display: flex; flex-wrap: wrap; gap: .48rem .7rem; margin-block: 1.15rem 0; }
.directory-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: .25rem .72rem;
  border: 1px solid #b2cdea73;
  border-radius: 8px;
  background: #d7e9ff16;
  color: #e9f3ff;
  font-weight: 660;
  text-decoration: none;
}
.directory-nav a:hover { background: #d7e9ff2e; }

.spotlights {
  display: grid;
  gap: 12px;
  margin-block: clamp(19px, 3.5vw, 36px) 0;
  padding: 0;
  list-style: none;
}
.spotlight {
  display: grid;
  grid-template-columns: minmax(70px, 34%) 1fr;
  align-items: center;
  min-width: 0;
  height: 100%;
  gap: .65rem;
  padding: .6rem;
  border: 1px solid #b5cde74d;
  border-radius: 12px;
  background: radial-gradient(ellipse at 0 0, #3a5175, #13213a 78%);
  text-decoration: none;
}
.spotlight-3-lagna { background: radial-gradient(ellipse at 0 0, #52567a, #152642 74%); }
.spotlight-moonlight-tarot { background: radial-gradient(ellipse at 0 0, #544475, #1a2340 74%); }
.spotlight-japan-vintage-tarot { background: radial-gradient(ellipse at 0 0, #664953, #22223c 74%); }
.spotlight:hover { border-color: #c9e3f4; }
.spotlight-image { aspect-ratio: 4 / 5; border-radius: 7px; overflow: hidden; background: #0c1627; }
.spotlight-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.spotlight-copy { display: grid; gap: 4px; min-width: 0; }
.spotlight-copy strong { font-size: 1.08rem; line-height: 1.35; overflow-wrap: anywhere; }
.spotlight-copy > span { color: var(--body); font-size: 16px; line-height: 1.45; }
.spotlight-copy .spotlight-cue { color: var(--blue); }
.spotlight:hover .spotlight-cue { text-decoration: underline; text-underline-offset: .18em; }

.app-collection { margin-block-start: clamp(25px, 6vw, 62px); scroll-margin-top: 18px; }
.collection-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 15px;
  color: var(--ink);
  font-size: clamp(1.4rem, 3.5vw, 2.35rem);
  line-height: 1.3;
}
.collection-symbol {
  display: grid;
  flex: 0 0 40px;
  min-height: 40px;
  place-items: center;
  border-radius: 9px;
  border: 1px solid #b3d5ec52;
  background: #142a44;
  color: #aeddff;
}
#astrology-and-tarot .collection-symbol { background: #2b2545; color: #f7d596; border-color: #f7d59661; }

.app-grid { display: grid; gap: 12px; }
.app-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(130deg, #17263d, #101c30 72%);
}
.app-card:hover, .app-card:focus-within { border-color: #a3c7e686; }
.app-card-select {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  text-decoration: none;
}
.app-card-heading { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; }
.app-icon { display: block; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #203652; }
.app-card h3 { margin: 0; color: #f6f9ff; font-size: 1.19rem; line-height: 1.3; overflow-wrap: anywhere; }
.app-card p { margin: 10px 0 4px; color: var(--body); font-size: 17px; line-height: 1.48; }
.app-card-cue {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: .4rem;
  margin-block-start: auto;
  color: var(--blue);
  font-size: 16px;
  font-weight: 700;
}
.app-card-select:hover .app-card-cue { text-decoration: underline; text-underline-offset: .18em; }

.store-link {
  display: inline-flex;
  min-height: 44px;
  max-width: 100%;
  align-items: center;
  gap: .4rem;
  padding: 4px 10px;
  border: 1px solid #cfb06b9e;
  border-radius: 8px;
  color: #ffe2a7;
  background: #332b258d;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
.store-link:hover { background: #493923; color: #fff0cd; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1rem;
  margin-block-start: 32px;
  padding-block: 14px 20px;
  border-top: 1px solid var(--line);
  color: var(--body);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 .8rem; }
.site-footer a { display: inline-flex; min-height: 44px; align-items: center; text-underline-offset: .18em; }

@media (min-width: 620px) {
  .app-grid, .spotlights { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width: 920px) {
  .app-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1100px) {
  .spotlights, .app-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .spotlight-image img { transition: transform .35s ease; }
  .spotlight:hover .spotlight-image img, .spotlight:focus-visible .spotlight-image img { transform: scale(1.035); }
  @supports (animation-timeline: view()) {
    .spotlight-image { animation: art-in linear both; animation-timeline: view(); animation-range: entry 0% cover 24%; }
    @keyframes art-in { from { opacity: .64; transform: translateY(9px); } to { opacity: 1; transform: none; } }
  }
}
@media (forced-colors: active) {
  .language-switcher button[aria-pressed="true"] { border: 2px solid ButtonText; }
  .app-card-cue, .store-link, .directory-nav a { text-decoration: underline; }
}
