/* ===========================================================
   POOPY POOP FRIENDS
   Palette:
     --porcelain : #FDF6E9  (general background, porcelain white)
     --poop      : #6B4423  (main accent, warm poop brown)
     --flush     : #3E8FA3  (flush blue, links / CTA)
     --gold      : #F2A93B  (toilet-paper gold, highlights / winners)
     --ink       : #2D2A26  (main text)
     --mint      : #8FBC94  (secondary accent, success)
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;700&family=Nunito:wght@400;600;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  --porcelain: #FDF6E9;
  --poop: #6B4423;
  --poop-dark: #4A2F17;
  --flush: #3E8FA3;
  --gold: #F2A93B;
  --ink: #2D2A26;
  --mint: #8FBC94;
  --radius-lg: 28px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
  background-color: var(--porcelain);
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.mobile-hero-bg {
  display: none;
}

/* --- Page backgrounds ---------------------------------------------------
   Replace each background-image URL with your own image:
   background-image: url('images/fond-accueil.jpg');
   (drop your files into the images/ folder with these names,
   or change the file name below) */

body.page-accueil {
  background-image: url('images/fond-accueil.jpg');
}

body.page-checker {
  background-image: url('images/fond-wallet-checker.jpg');
}

body.page-trailer {
  background-image: url('images/fond-trailer.jpg');
}

/* --- Header ------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  background: #fffdf8ee;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  border: 2px solid #ffffffcc;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  box-shadow: 0 4px 0 var(--poop-dark);
}

.brand-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.1;
  color: var(--poop-dark);
}

nav.main-nav {
  display: flex;
  gap: 6px;
  background: #ffffffaa;
  padding: 6px;
  border-radius: 999px;
  border: 2px solid #ffffffcc;
}

nav.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

nav.main-nav a:hover { background: var(--poop); color: #fff; }
nav.main-nav a.active { background: var(--flush); color: #fff; }

/* --- OpenSea button -------------------------------------------------- */

.header-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.x-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 3px 0 #000;
  transition: transform 0.12s ease;
}

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

.opensea-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 220px;
  height: 92px;
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  background-image: url('images/opensea-collection.jpg');
  background-size: cover;
  background-position: center 20%;
  background-color: var(--poop);
  box-shadow: 0 4px 0 #000, 0 6px 16px rgba(0,0,0,0.25);
  border: 3px solid #fff;
  transition: transform 0.12s ease;
}

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

.opensea-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.75) 100%);
}

.opensea-banner span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 10px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* --- General layout -------------------------------------------------- */

main {
  max-width: 440px;
  margin: 0 auto 0 4vw;
  padding: 32px 0 80px;
}

.card {
  background: #fffdf8ee;
  border: 3px solid #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 10px 0 #e9dcc3, 0 12px 30px rgba(74,47,23,0.15);
  margin-bottom: 28px;
}

h1.page-title {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 6px;
}

.page-lead {
  font-size: 1.05rem;
  color: #55483a;
  max-width: 60ch;
  margin: 0 0 24px;
}

.cursed-gif {
  display: block;
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius-md);
  border: 4px solid #fffdf8;
  box-shadow: 0 8px 20px rgba(74,47,23,0.3);
}

.trailer-card {
  padding: 24px;
}

.trailer-video {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  border: 4px solid #fffdf8;
  box-shadow: 0 8px 20px rgba(74,47,23,0.3);
  background: #000;
}

.opensea-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease;
}

.opensea-card:hover { transform: translateY(-3px); }

.opensea-card-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.opensea-card-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.25rem;
  margin: 0;
  color: var(--flush);
}

/* --- Draw wheel -------------------------------------------------------- */

.wheel-zone {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.wheel-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  flex-shrink: 0;
}

#wheel-svg {
  width: 100%;
  height: 100%;
  transition: transform 1.3s cubic-bezier(0.22, 0.9, 0.16, 1);
  filter: drop-shadow(0 8px 16px rgba(74,47,23,0.25));
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--ink);
  z-index: 2;
}

.wheel-panel { flex: 1; min-width: 240px; }

.btn {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  color: #fff;
  background: var(--flush);
  box-shadow: 0 4px 0 #2a6b7a;
  transition: transform 0.1s ease;
}

.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2a6b7a; }
.btn:hover { filter: brightness(1.05); }

.btn.secondary { background: var(--poop); box-shadow: 0 4px 0 var(--poop-dark); }
.btn.secondary:active { box-shadow: 0 1px 0 var(--poop-dark); }

.wheel-result {
  margin-top: 16px;
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  min-height: 28px;
}

.wheel-result strong { color: var(--flush); }

/* --- Latest draw summary --------------------------------------------- */

.latest-draw {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.draw-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.stat { min-width: 120px; }
.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a6a56;
  font-weight: 700;
}
.stat-value {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  color: var(--poop);
}

/* --- Tables / winner lists -------------------------------------- */

table.winners {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
}

table.winners th, table.winners td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #ecdfc4;
}

table.winners th {
  font-family: 'Nunito', sans-serif;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #7a6a56;
}

.draw-group summary {
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  padding: 14px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.draw-group summary::-webkit-details-marker { display: none; }

.draw-group summary .chevron { transition: transform 0.2s ease; }
.draw-group[open] summary .chevron { transform: rotate(90deg); }

.draw-group { border-bottom: 2px dashed #ecdfc4; }
.draw-group:last-child { border-bottom: none; }

.badge {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--flush);
  text-decoration: none;
  margin: 12px 0 4px;
}

.download-link:hover { text-decoration: underline; }

/* --- Wallet checker ------------------------------------------------------ */

.checker-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.checker-form input {
  flex: 1;
  min-width: 240px;
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  padding: 14px 18px;
  border-radius: 999px;
  border: 2px solid #ecdfc4;
  background: #fffdf8;
}

.checker-form input:focus {
  outline: none;
  border-color: var(--flush);
}

#checker-result { min-height: 60px; }

.result-box {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-family: 'Nunito', sans-serif;
}

.result-box.win {
  background: #eaf6ea;
  border: 2px solid var(--mint);
}

.result-box.lose {
  background: #f5efe3;
  border: 2px solid #ecdfc4;
}

.result-box h3 {
  margin: 0 0 8px;
  font-family: 'Fredoka', sans-serif;
}

/* --- Footer --------------------------------------------------------------- */

footer {
  text-align: center;
  padding: 30px 24px 50px;
  font-size: 0.8rem;
  color: #7a6a56;
}

@media (max-width: 640px) {
  .site-header { justify-content: center; text-align: center; }
  nav.main-nav { order: 3; width: 100%; justify-content: center; }
  .wheel-zone { justify-content: center; text-align: center; }
  main { max-width: 100%; margin: 0; padding: 24px 16px 60px; }

  /* On mobile, show the background image full-screen first — it's a
     normal block in the document flow (not absolutely positioned), so
     the header and cards that follow it are naturally pushed below and
     only appear once the visitor scrolls past it. */
  body.page-accueil,
  body.page-checker,
  body.page-trailer {
    background-image: none;
  }

  .mobile-hero-bg {
    display: block;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-repeat: no-repeat;
  }

  body.page-accueil .mobile-hero-bg {
    background-image: url('images/fond-accueil.jpg');
    background-position: center 30%;
  }

  body.page-checker .mobile-hero-bg {
    background-image: url('images/fond-wallet-checker.jpg');
    background-position: center 42%;
  }

  body.page-trailer .mobile-hero-bg {
    background-image: url('images/fond-trailer.jpg');
    background-position: center 30%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #wheel-svg { transition: none; }
}
