/* ---------- Brand colors: change these to restyle the whole site ---------- */
:root {
  --main: #280E4F;
  --main-dark: #1A0835;
  --main-soft: #3B1A6E;
  --accent: #D8385E;
  --accent-dark: #A82446;
  --text: #2B2240;
  --muted: #6B6380;
  --bg: #FFFFFF;
  --bg-soft: #F6F3FB;
  --radius: 24px;
  --header-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3 {
  font-family: "Fredoka", "Nunito", sans-serif;
  color: var(--main);
  line-height: 1.15;
}

h2 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--main);
  transition: box-shadow .25s;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(20, 5, 45, .35); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img { height: 44px; width: auto; }

.site-nav { display: flex; gap: 40px; }
.site-nav a {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .25s;
}
.site-nav a:hover::after,
.site-nav a.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.nav-toggle span {
  display: block;
  height: 3px;
  border-radius: 3px;
  background: #fff;
  transition: transform .25s, opacity .25s;
}

/* ---------- Hero ---------- */
.hero { background: var(--main); }
.hero-img {
  width: 100%;
  max-height: 78vh;
  object-fit: cover;
  object-position: center;
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }

.about { text-align: center; }
.about p {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

/* ---------- Games ---------- */
.games { background: var(--bg-soft); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 1rem;
}

.game-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(40, 14, 79, .08);
  display: flex;
  flex-direction: column;
  transition: transform .3s, box-shadow .3s;
}
.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(40, 14, 79, .16);
}

/* The image keeps its own shape, so any resolution shows in full without cropping */
.game-img { overflow: hidden; background: var(--main); }
.game-img img {
  width: 100%; height: auto;
  transition: transform .5s;
}
.game-card:hover .game-img img { transform: scale(1.04); }

.game-body {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.game-body h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: .4rem; text-align: center; }
.game-body .btn { align-self: center; }
.game-body p { color: var(--muted); font-size: .95rem; margin-bottom: 1.2rem; flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 10px 32px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--accent-dark);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--accent-dark); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-dark); }
.btn-big { font-size: 1.2rem; padding: 14px 44px; }

/* ---------- Contact ---------- */
.contact { background: var(--main); color: #fff; text-align: center; }
.contact h2 { color: #fff; }
.contact .lead { font-size: 1.15rem; opacity: .85; margin-bottom: 2.5rem; }

.contact-form { display: grid; gap: 18px; text-align: left; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-form label {
  display: grid;
  gap: 6px;
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-family: "Nunito", sans-serif;
  font-weight: 400;
  color: #fff;
  background: var(--main-soft);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  resize: vertical;
  transition: border-color .2s;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .btn { justify-self: center; margin-top: 8px; }

.form-status { text-align: center; min-height: 1.5em; font-weight: 600; }
.form-status.ok { color: var(--accent); }

.contact-alt { margin-top: 2rem; opacity: .8; }
.contact-alt a { color: var(--accent); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--main-dark); color: rgba(255, 255, 255, .7); padding: 48px 0; }
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.footer-logo { height: 40px; width: auto; }
.footer-nav { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--accent); }
.copyright { font-size: .9rem; }

/* ---------- Legal pages (Terms of Service, Privacy Policy) ---------- */
.legal { padding: 72px 0 96px; background: var(--bg-soft); }
.legal-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(40, 14, 79, .08);
  padding: 56px 64px;
}
.legal .title {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
  color: var(--main);
  text-align: center;
  line-height: 1.15;
}
.legal .date {
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
  margin: .5rem 0 2.5rem;
}
.legal .section-heading {
  font-family: "Fredoka", sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--main);
  margin: 2.5rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}
.legal .subsection-heading {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--main-soft);
  margin: 1.5rem 0 .5rem;
}
.legal p { margin: .75rem 0; text-align: justify; }
.legal .list-item { position: relative; margin: .4rem 0 .4rem 1.5rem; text-align: left; }
.legal .list-item::before {
  content: "";
  position: absolute;
  left: -1.1rem; top: .65em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.legal .contact-info { margin-left: 1.5rem; font-style: italic; }
.legal-back { text-align: center; margin-top: 2.5rem; }

/* ---------- Scroll-in animation ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Tablets: games in 2 columns ---------- */
@media (max-width: 1000px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); max-width: 640px; margin-left: auto; margin-right: auto; }
}

/* ---------- Phones: games become a sideways swipe row ---------- */
@media (max-width: 560px) {
  .game-grid {
    display: flex;
    gap: 16px;
    max-width: none;
    margin: 1rem -16px 0;
    padding: 0 16px 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .game-grid::-webkit-scrollbar { display: none; }
  .game-card { flex: 0 0 72%; scroll-snap-align: center; }
  .game-card:hover { transform: none; }
}

/* ---------- Phones & tablets ---------- */
@media (max-width: 800px) {
  .section { padding: 64px 0; }
  .legal { padding: 40px 0 64px; }
  .legal-card { padding: 32px 20px; }
  .legal p { text-align: left; }
  .container { padding: 0 16px; }

  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--main);
    padding: 8px 16px 20px;
    box-shadow: 0 12px 24px rgba(20, 5, 45, .35);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 0; font-size: 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .site-nav a::after { display: none; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

  .contact-form .row { grid-template-columns: 1fr; }
}
