/* Huggle Games — site styles */

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --purple-900: #3d0262;
  --purple-800: #5a0386;
  --purple-700: #6a039a;
  --purple-600: #7c05a5;
  --purple-500: #9005b7;
  --purple-400: #be00e0;
  --yellow: #ffc928;
  --cream: #fff3e6;
  --ink: #1f1030;
  --ink-soft: #4a3d5c;
  --line: #ece6f2;
  --white: #ffffff;

  --bg-gradient: radial-gradient(ellipse 130% 95% at 50% 105%, #c400e6 0%, #9a06c0 32%, #7a04a8 62%, #5a0386 100%);

  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;

  --radius: 14px;
  --focus: 0 0 0 3px rgba(255, 201, 40, 0.85);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--white);
  background-color: var(--purple-700);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Home ---------- */

.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(20px, 4vh, 36px);
  padding: clamp(24px, 6vh, 64px) 0;
}

.hero__logo {
  width: min(620px, 84vw);
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(40, 0, 70, 0.35));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Two equal columns, each badge hugging the center line, so the gap is exactly centered */
.badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badges li:first-child {
  justify-self: end;
}

.badges li:last-child {
  justify-self: start;
}

.badge {
  position: relative;
  display: block;
  height: 56px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  transition: transform 0.18s ease, filter 0.18s ease;
  filter: drop-shadow(0 8px 18px rgba(30, 0, 50, 0.35));
}

.badge:hover {
  transform: translateY(-2px);
}

.badge picture {
  display: block;
  height: 100%;
}

.badge img {
  display: block;
  width: auto;
  height: 100%;
}

.social {
  display: grid;
  grid-template-columns: repeat(2, 48px);
  justify-content: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a,
.social button {
  position: relative;
  padding: 0;
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.social a:hover,
.social button:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--purple-800);
  transform: translateY(-2px);
}

.social svg {
  width: 22px;
  height: 22px;
}

/* "Coming soon" bubble shown above badges and icons that aren't live yet */
.soon-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 2;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--purple-800);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(30, 0, 50, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px) scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.soon-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--yellow);
}

.soon-bubble.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ---------- Footer (shared) ---------- */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.82);
}

/* Two equal columns, aligned toward the middle, so the gap sits on the center line */
.site-footer nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  width: 100%;
}

.site-footer nav a:first-child {
  justify-self: end;
}

.site-footer nav a:last-child {
  justify-self: start;
}

.site-footer nav a {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.site-footer nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer p {
  margin: 0;
}

.site-footer .location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-footer .location svg {
  width: 14px;
  height: 14px;
}

/* ---------- Legal pages ---------- */

.legal {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.legal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 0 20px;
}

.legal__header img {
  width: 150px;
  height: auto;
}

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}

.legal__back:hover {
  background: rgba(255, 255, 255, 0.24);
}

.doc {
  width: 100%;
  max-width: 860px;
  margin: 0 auto 28px;
  padding: clamp(24px, 5vw, 56px);
  background: var(--white);
  color: var(--ink);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(30, 0, 50, 0.35);
}

.doc h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.6rem);
  line-height: 1.15;
  color: var(--purple-800);
}

.doc .meta {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.doc .summary {
  margin: 0 0 28px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: #faf5ff;
  border: 1px solid #eadcf7;
}

.doc .summary p:last-child,
.doc .summary ul:last-child {
  margin-bottom: 0;
}

.doc .summary h2 {
  margin-top: 0;
  font-size: 1.05rem;
  border: 0;
  padding: 0;
}

.doc h2 {
  margin: 40px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 800;
  color: var(--purple-800);
  scroll-margin-top: 16px;
}

.doc h3 {
  margin: 24px 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.doc p,
.doc ul,
.doc ol {
  margin: 0 0 14px;
}

.doc ul,
.doc ol {
  padding-left: 1.3em;
}

.doc li {
  margin-bottom: 6px;
}

.doc a {
  color: #7a10b0;
  font-weight: 700;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.doc a:hover {
  color: var(--purple-400);
}

.doc strong {
  font-weight: 800;
}

.toc {
  margin: 0 0 8px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.toc h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.toc ol {
  margin: 0;
  columns: 2 260px;
  column-gap: 32px;
}

.toc li {
  break-inside: avoid;
  margin-bottom: 4px;
}

.toc a {
  font-weight: 600;
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

.table-wrap {
  margin: 0 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.doc th,
.doc td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.doc th {
  background: #faf5ff;
  font-weight: 800;
  color: var(--purple-800);
}

.doc tr:last-child td {
  border-bottom: 0;
}

.company {
  margin: 0 0 14px;
  padding: 16px 20px;
  border-left: 4px solid var(--yellow);
  background: #fffbef;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: normal;
  line-height: 1.7;
}

/* ---------- 404 ---------- */

.notfound h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem);
}

.notfound a.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--purple-800);
  font-weight: 800;
  text-decoration: none;
}

/* ---------- Responsive tweaks ---------- */

@media (max-width: 420px) {
  .badge {
    height: 48px;
  }
  .badges {
    gap: 10px;
  }
  .legal__header img {
    width: 120px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .hero__logo {
    width: min(380px, 52vw);
  }
  .hero {
    padding: 16px 0;
  }
  .hero {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .legal__header,
  .site-footer {
    display: none;
  }
  .doc {
    box-shadow: none;
    padding: 0;
  }
}

@media (max-width: 360px) {
  .badge {
    height: 42px;
  }
}

/* Stack legal tables into cards on small screens */
@media (max-width: 640px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }
  .doc table {
    min-width: 0;
  }
  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
    width: 100%;
  }
  .doc thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .doc tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .doc td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
  }
  .doc tr:last-child td {
    border-bottom: 1px solid var(--line);
  }
  .doc tr td:last-child {
    border-bottom: 0;
  }
  .doc td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--purple-600);
  }
  .doc td:first-child {
    background: #faf5ff;
    font-weight: 700;
  }
}

/* Under the round icons the bubble opens downward, so it never covers the store badges */
.social .soon-bubble {
  bottom: auto;
  top: calc(100% + 12px);
  transform: translate(-50%, -6px) scale(0.92);
}

.social .soon-bubble.is-visible {
  transform: translate(-50%, 0) scale(1);
}

.social .soon-bubble::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--yellow);
}
