/* Home page (the same stylesheet that used to be inside the old index.html). */
:root {
  --background: #0b0f17;
  --panel: rgba(19, 26, 38, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --gold: #e5b842;
  --gold-light: #f3d279;
  --font-title: 'Playfair Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --radius: 20px;
  --gutter: clamp(16px, 4vw, 40px);
  --pattern: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96"%3E%3Cg fill="%23ffffff" fill-opacity="0.04" font-family="Arial, sans-serif" font-size="22" text-anchor="middle"%3E%3Ctext x="24" y="32" transform="rotate(-12 24 24)"%3E%E2%99%A0%3C/text%3E%3Ctext x="72" y="32" transform="rotate(12 72 24)"%3E%E2%99%A5%3C/text%3E%3Ctext x="24" y="80" transform="rotate(12 24 72)"%3E%E2%99%A6%3C/text%3E%3Ctext x="72" y="80" transform="rotate(-12 72 72)"%3E%E2%99%A3%3C/text%3E%3C/g%3E%3C/svg%3E');
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(24, 131, 85, 0.35), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(163, 16, 42, 0.25), transparent 60%),
    var(--pattern),
    var(--background);
  padding: env(safe-area-inset-top) var(--gutter) env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #3a2600;
  font-size: 20px;
  box-shadow: 0 0 18px rgba(229, 184, 66, 0.35);
}

.brand b {
  color: var(--gold);
}

/* Language as in King: only the flag, in a circle, with a menu */
.language-box {
  position: relative;
}

.language {
  width: 38px;
  height: 38px;
  padding: 4px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.flag {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #131a26;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.language-menu[hidden] {
  display: none;
}

.language-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 600 14px var(--font-body);
  cursor: pointer;
  text-align: left;
}

.language-menu button:hover,
.language-menu button:focus-visible,
.language-menu button[aria-current='true'] {
  background: rgba(229, 184, 66, 0.14);
  outline: none;
}

.language-menu .flag {
  width: 22px;
  height: 22px;
}

main {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding: clamp(32px, 8vw, 88px) 0 clamp(28px, 5vw, 56px);
}

.suits {
  font-size: 20px;
  letter-spacing: 0.6em;
  color: var(--muted);
  margin-bottom: 18px;
}

.suits .red-suit {
  color: #e03131;
}

h1 {
  font-family: var(--font-title);
  font-size: clamp(36px, 6.5vw, 68px);
  line-height: 1.05;
  margin: 0 auto 16px;
  max-width: 14ch;
}

h1 em {
  font-style: normal;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  max-width: 52ch;
  margin: 0 auto;
  line-height: 1.6;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Gallery: tall cards, like playing cards */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 22px;
  padding-bottom: 64px;
}

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.game--card:hover,
.game--card:focus-within {
  transform: translateY(-6px) rotate(-0.6deg);
  border-color: rgba(229, 184, 66, 0.55);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(229, 184, 66, 0.18);
  outline: none;
}

.game-art {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: var(--art, linear-gradient(160deg, #a3102a, #4a0614));
  overflow: hidden;
}

.game-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--pattern);
  opacity: 0.9;
}

.game-art svg {
  position: relative;
  width: 46%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  transition: transform 0.35s ease;
}

.game--card:hover .game-art svg {
  transform: scale(1.06) rotate(-3deg);
}

.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 20px;
}

.game-name {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  margin: 0;
}

.game-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.play {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 800;
  color: #3a2600;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
}

/* The game link fills the card above the store badges. */
.game-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  outline: none;
}

/* App store badges under "Play": the row is always there (empty on the cards without links), so the cards and
   their "Play" buttons line up. The official badges keep their own proportions; only the height is set. */
.stores {
  display: flex;
  justify-content: center;
  gap: 16px;
  min-height: 50px; /* 30px of badges + the bottom padding */
  padding: 0 20px 20px;
}

.store {
  display: block;
  border-radius: 6px;
}

.store img {
  display: block;
  height: 30px;
  width: auto;
}

.store:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.game--card .stores {
  margin-top: -6px;
}

.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  color: inherit;
}
.footer {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.menu { max-width: 1120px; width: 100%; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.menu a { padding: 6px 12px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 999px; color: #94a3b8; font-size: 13px; font-weight: 700; text-decoration: none; }
.menu a:hover, .menu a[aria-current='page'] { color: #e5b842; border-color: rgba(229, 184, 66, 0.4); }
.about { max-width: 760px; margin: 48px auto 0; color: #cbd5e1; font-size: 15px; line-height: 1.6; }
.about h2 { font-family: 'Playfair Display', Georgia, serif; color: #f1f5f9; font-size: 24px; margin: 0 0 12px; }
.about-links { display: flex; flex-wrap: wrap; gap: 16px; }
.about-links a { color: #e5b842; font-weight: 700; }

/* Vue: #app does not count for the layout (the body is still the flex column). */
#app {
  display: contents;
}

/* The language menu now has links (one per language) instead of buttons. */
.language-menu a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font: 600 14px var(--font-body);
  text-decoration: none;
}

.language-menu a:hover,
.language-menu a:focus-visible,
.language-menu a[aria-current='true'] {
  background: rgba(229, 184, 66, 0.14);
  outline: none;
}

/* "Games" menu: a <details> with the list of games, looking like the other menu buttons. */
.menu-games { position: relative; }
.menu-games summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.menu-games summary::-webkit-details-marker { display: none; }
.menu-games summary::after { content: '▾'; font-size: 11px; transition: transform 0.2s ease; }
.menu-games[open] summary::after { transform: rotate(180deg); }
.menu-games summary:hover,
.menu-games summary:focus-visible,
.menu-games[open] summary,
.menu-games summary[aria-current='page'] { color: #e5b842; border-color: rgba(229, 184, 66, 0.4); outline: none; }
.menu-list {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #131a26;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 10;
}
.menu-list li { margin: 0; }
.menu .menu-list a {
  display: block;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.menu .menu-list a:hover,
.menu .menu-list a:focus-visible,
.menu .menu-list a[aria-current='page'] { background: rgba(229, 184, 66, 0.14); color: #f1f5f9; outline: none; }
.social-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.social-links a {
  display: inline-flex;
}

/* Sticky header (brand, language and menu): stays at the top while scrolling and gets compact once the page is
   scrolled (useCompactHeader). Opaque background instead of backdrop-filter, which glitches on Chrome Android. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: calc(-1 * env(safe-area-inset-top)) calc(-1 * var(--gutter)) 0;
  padding: env(safe-area-inset-top) var(--gutter) 0;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header .top { transition: padding 0.2s ease; }
.site-header .brand { transition: font-size 0.2s ease; }
.site-header .brand-icon { transition: width 0.2s ease, height 0.2s ease, font-size 0.2s ease; }
.site-header .menu { padding-bottom: 4px; transition: padding 0.2s ease; }
.site-header--compact {
  background: var(--background);
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.site-header--compact .top { padding: 8px 0 6px; }
.site-header--compact .brand { font-size: 18px; }
.site-header--compact .brand-icon { width: 28px; height: 28px; font-size: 16px; border-radius: 8px; }
.site-header--compact .language { width: 32px; height: 32px; }
.site-header--compact .flag { width: 22px; height: 22px; }
.site-header--compact .menu { padding-bottom: 0; }
.site-header--compact .menu a,
.site-header--compact .menu-games summary { padding-top: 4px; padding-bottom: 4px; }
.site-header--compact .menu .menu-list a { padding-top: 8px; padding-bottom: 8px; }
/* Links to an anchor (#gallery, ...) stop below the sticky header. */
html { scroll-padding-top: 110px; }
