:root {
  --bg: #1d1836;
  --bg-2: #2a2250;
  --ink: #fff7ea;
  --ink-soft: #cfc6e8;
  --card: #2f2759;
  --line: rgba(255, 255, 255, 0.12);
  --glow: #ffd166;
  font-family: ui-rounded, 'SF Pro Rounded', 'Hiragino Maru Gothic ProN', 'PingFang SC', 'PingFang TC', 'Microsoft YaHei', 'Noto Sans CJK SC',
    system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: #15112a;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 143, 163, 0.22), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(95, 198, 216, 0.2), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(240, 182, 42, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg), #15112a);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

a {
  color: inherit;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 20px 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand img {
  display: block;
  border-radius: 10px;
}

.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.lang[hidden] {
  display: none;
}

.lang .globe {
  position: absolute;
  left: 14px;
  pointer-events: none;
  color: var(--ink-soft);
}

/* Arrow drawn in CSS, since the native one cannot be coloured. */
.lang::after {
  content: '';
  position: absolute;
  right: 16px;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
  pointer-events: none;
}

.lang select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  /* 16px keeps iOS from zooming in when the list opens. */
  font-size: 1rem;
  font-weight: 600;
  min-height: 44px;
  padding: 8px 38px 8px 40px;
  cursor: pointer;
}

/* The open list is drawn by the system; give it readable colours where the browser honours them. */
.lang option {
  color: #1d1836;
  background: #fff7ea;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

main {
  flex: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  padding: 44px 0 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.hero p {
  margin: 0;
  max-width: 40em;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.55;
}

.games {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 22px;
}

.games > li {
  display: flex;
}

.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  text-decoration: none;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  background: var(--bg-2);
  border-bottom: 3px solid var(--accent, var(--glow));
}

.body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 18px 20px 20px;
}

.card h2 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.tags {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags li {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.play {
  margin-top: auto;
  align-self: flex-start;
  padding: 11px 24px;
  border-radius: 999px;
  font-weight: 800;
  color: #1d1836;
  background: var(--accent, var(--glow));
}

.play::after {
  content: ' \2192';
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    border-color: var(--accent, var(--glow));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
}

.card:active {
  transform: scale(0.99);
}

.card:focus-visible,
.lang select:focus-visible,
.brand:focus-visible,
.foot a:focus-visible {
  outline: 3px solid var(--glow);
  outline-offset: 3px;
}

.foot {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 40px 20px 28px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.foot p {
  margin: 0 0 6px;
}

/* 404 page */
.lost {
  padding: 72px 0 40px;
  text-align: center;
}

.lost .hero p {
  margin: 0 auto;
}

.lost .play {
  display: inline-block;
  margin-top: 26px;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
}
