/* Raft Buddies website.
   Built from the game's own look: river water, raft-wood buttons, the cream of
   the in-game panels, Lilita One (the game's font). One accent: the wood yellow.
   Radius rule: interactive things are pills, panels and images are 20px. */

:root {
  --water: #1a8fd0;
  --water-deep: #0b4f7a;
  --water-ink: #083a5a;
  --sky: #8fdcf6;
  --page: #eef8fd;
  --surface: #ffffff;
  --ink: #12324a;
  --ink-soft: #46647a;
  --line: #cfe6f2;
  --wood: #f7a823;
  --wood-light: #ffc85a;
  --wood-edge: #a85a12;
  --bark: #4a240c;
  --panel: #fff3d6;
  --panel-edge: #e9cf9a;
  --radius: 20px;
  --shadow: 0 14px 34px rgba(8, 58, 90, 0.16);
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #08202f;
    --surface: #0f2c3f;
    --ink: #e4f2fa;
    --ink-soft: #a9c6d8;
    --line: #1d4660;
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.6 var(--body);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--wood); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: 0.005em; text-wrap: balance; }
p { margin: 0; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 16px; }

/* Game-style headline: white fill with a brown drop, like the in-game titles. */
.title-game {
  color: #fff;
  text-shadow: 0 3px 0 var(--bark), 0 6px 14px rgba(74, 36, 12, 0.35);
}

/* ---------- Header ---------- */
.bar {
  position: absolute; inset: 0 0 auto; z-index: 10;
  padding: 14px 0;
}
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-family: var(--display); font-size: 1.25rem; text-shadow: 0 2px 0 rgba(74, 36, 12, 0.6); }
.bar-brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 4px 10px rgba(8, 58, 90, 0.3); }
.bar-links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 4px; border-radius: 999px; background: rgba(8, 58, 90, 0.35); backdrop-filter: blur(8px); }
.bar-links a { display: block; padding: 7px 14px; border-radius: 999px; color: #fff; text-decoration: none; font-weight: 800; font-size: 0.92rem; }
.bar-links a:hover { background: rgba(255, 255, 255, 0.18); }
.bar-links a[aria-current="page"] { background: #fff; color: var(--water-ink); }
@media (max-width: 600px) {
  .bar-brand span { display: none; }
  .bar-links a { padding: 7px 10px; font-size: 0.86rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 26px;
  border-radius: 999px; border: 0; cursor: pointer;
  font: 1.15rem/1 var(--display); letter-spacing: 0.02em; white-space: nowrap;
  text-decoration: none;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); }
.btn img { width: 22px; height: 22px; }
.btn-wood {
  color: var(--bark);
  background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 60%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 5px 0 var(--wood-edge), 0 12px 20px rgba(168, 90, 18, 0.35);
}
.btn-wood:active { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 2px 0 var(--wood-edge); }
.btn-line { color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85); background: rgba(8, 58, 90, 0.25); }
.btn-line:hover { background: rgba(8, 58, 90, 0.4); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(760px, 100dvh);
  display: grid; align-items: center;
  padding: 104px 0 96px;
  background: url("../img/scenery.jpg") center 35% / cover no-repeat;
  color: #fff;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8, 58, 90, 0.72) 0%, rgba(8, 58, 90, 0.35) 48%, rgba(8, 58, 90, 0) 75%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: 24px; }
.hero-logo { width: min(400px, 88%); margin: 0 0 22px -8px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3)); }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); max-width: 12ch; }
.hero-sub { margin-top: 16px; max-width: 30ch; font-size: 1.18rem; font-weight: 700; text-shadow: 0 1px 6px rgba(8, 58, 90, 0.6); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-art { position: relative; margin-right: -40px; }
.hero-art img { width: 100%; filter: drop-shadow(0 26px 30px rgba(8, 58, 90, 0.45)); transform-origin: 50% 80%; }
.hero-edge { position: absolute; left: 0; bottom: -1px; width: 100%; height: 64px; color: var(--page); }
@media (max-width: 880px) {
  .hero { padding: 96px 0 72px; min-height: 0; }
  .hero::before { background: linear-gradient(180deg, rgba(8, 58, 90, 0.7), rgba(8, 58, 90, 0.25)); }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-logo { margin: 0 auto 18px; }
  .hero h1, .hero-sub { margin-inline: auto; }
  .hero-ctas { justify-content: center; }
  .hero-art { margin: 8px auto 0; max-width: 520px; }
}

/* ---------- How it plays ---------- */
.play { padding: 88px 0 96px; }
.play-grid { display: grid; grid-template-columns: 360px 1fr; gap: 72px; align-items: center; }
.phone {
  position: relative; border-radius: 40px; padding: 10px;
  background: #0d1f2c; box-shadow: var(--shadow), inset 0 0 0 2px #2b4558;
  rotate: -3deg;
}
.phone img { border-radius: 31px; width: 100%; aspect-ratio: 9 / 20; object-fit: cover; }
.play h2 { font-size: clamp(2rem, 4vw, 3rem); }
.play-lead { margin-top: 12px; color: var(--ink-soft); font-size: 1.12rem; max-width: 46ch; }
.how { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 30px 36px; }
.how li { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; }
.how img { width: 56px; height: 56px; object-fit: contain; }
.how h3 { font-size: 1.25rem; margin-bottom: 4px; }
.how p { color: var(--ink-soft); font-size: 0.98rem; }
@media (max-width: 900px) {
  .play-grid { grid-template-columns: 1fr; gap: 48px; }
  .phone { width: min(300px, 80%); margin: 0 auto; }
}
@media (max-width: 560px) { .how { grid-template-columns: 1fr; } }

/* ---------- What's in the water ---------- */
.water {
  position: relative; overflow: hidden;
  padding: 88px 0 100px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(11, 79, 122, 0.25), rgba(8, 58, 90, 0.55)),
    url("../img/water/strip.jpg") left center / auto 100% repeat-x;
}
.water-head { max-width: 560px; }
.water-head h2 { font-size: clamp(2rem, 4vw, 3rem); }
.water-head p { margin-top: 12px; font-size: 1.1rem; font-weight: 700; text-shadow: 0 1px 4px rgba(8, 58, 90, 0.6); }
.hazards { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 28px; }
.hazards li { text-align: center; }
.hazards li:nth-child(even) { transform: translateY(36px); }
.hazards figure { margin: 0 auto 10px; height: 130px; display: grid; place-items: center; }
.hazards img { max-height: 130px; width: auto; filter: drop-shadow(0 10px 10px rgba(8, 58, 90, 0.35)); }
.hazards h3 { font-size: 1.3rem; text-shadow: 0 2px 0 rgba(8, 58, 90, 0.6); }
.hazards p { font-size: 0.95rem; font-weight: 700; max-width: 24ch; margin: 4px auto 0; text-shadow: 0 1px 3px rgba(8, 58, 90, 0.7); }
.hazards .good h3::after {
  content: "Bonus"; margin-left: 8px; vertical-align: 3px;
  padding: 2px 9px; border-radius: 999px; font: 800 0.7rem/1.4 var(--body); text-shadow: none;
  background: var(--wood); color: var(--bark);
}
@media (max-width: 860px) { .hazards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .hazards li:nth-child(even) { transform: none; }
  .hazards figure { height: 100px; }
  .hazards img { max-height: 100px; }
}

/* ---------- Crew picker ---------- */
.crew { padding: 96px 0; }
.crew-top { max-width: 600px; margin-bottom: 40px; }
.crew-top h2 { font-size: clamp(2rem, 4vw, 3rem); }
.crew-top p { margin-top: 12px; color: var(--ink-soft); font-size: 1.12rem; }
.crew-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: stretch; }
.stage {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center;
  padding: 32px; border-radius: var(--radius);
  background: var(--panel); border: 4px solid var(--panel-edge); color: var(--bark);
  box-shadow: var(--shadow);
}
.stage-img { height: 230px; display: grid; place-items: center; }
.stage-img img { max-height: 230px; width: auto; filter: drop-shadow(0 12px 12px rgba(74, 36, 12, 0.25)); }
.stage-rarity {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-weight: 800; font-size: 0.8rem; color: #fff; background: #7a8794;
}
.stage-rarity[data-r="Rare"] { background: #2f7fd6; }
.stage-rarity[data-r="Epic"] { background: #8a4fd0; }
.stage-rarity[data-r="Legendary"] { background: #d98a0b; }
.stage-rarity[data-r="Rescued"] { background: #17927a; }
.stage h3 { font-size: 2.2rem; margin: 10px 0 2px; }
.stage-trait { font-family: var(--display); font-size: 1.15rem; color: var(--wood-edge); }
.stage-skill { margin-top: 10px; font-size: 1.05rem; font-weight: 700; }
.roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-content: center; }
.roster button {
  width: 100%; aspect-ratio: 4 / 5; padding: 6px;
  display: grid; place-items: center; gap: 2px;
  border: 3px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); cursor: pointer;
  font: 800 0.8rem/1 var(--body);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s;
}
.roster button img { height: 64px; width: auto; object-fit: contain; }
.roster button:hover { transform: translateY(-3px); border-color: var(--water); }
.roster button[aria-pressed="true"] { border-color: var(--wood); background: var(--panel); color: var(--bark); }
@media (max-width: 960px) { .crew-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .stage { grid-template-columns: 1fr; text-align: center; padding: 24px; }
  .stage-img { height: 180px; }
  .stage-img img { max-height: 180px; }
  .roster { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .roster button span { display: none; }
}

/* ---------- Rivers ladder ---------- */
.rivers { padding: 24px 0 104px; }
.rivers-top { display: grid; gap: 12px; max-width: 640px; margin-bottom: 40px; }
.rivers-top h2 { font-size: clamp(2rem, 4vw, 3rem); }
.rivers-top p { color: var(--ink-soft); font-size: 1.12rem; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; }
.tier {
  --c: #3bb273;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px 18px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, #fff) 0%, var(--c) 100%);
  box-shadow: var(--shadow);
}
.tier:nth-child(1) { --c: #3aa865; min-height: 220px; }
.tier:nth-child(2) { --c: #e8a317; min-height: 260px; }
.tier:nth-child(3) { --c: #e46a1c; min-height: 300px; }
.tier:nth-child(4) { --c: #cf3540; min-height: 340px; }
.tier:nth-child(5) { --c: #3b2a8c; min-height: 380px; background: linear-gradient(180deg, #6a4fd1 0%, #1b1450 100%); }
.tier-count { font-family: var(--display); font-size: 3.2rem; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); }
.tier h3 { font-size: 1.35rem; margin: 6px 0 10px; }
.tier p { font-size: 0.9rem; font-weight: 700; line-height: 1.45; opacity: 0.95; }
.endless {
  margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 20px 26px; border-radius: var(--radius);
  background: var(--surface); border: 2px dashed var(--line);
}
.endless strong { font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.endless span { color: var(--ink-soft); font-weight: 700; }
@media (max-width: 860px) {
  .ladder { grid-template-columns: 1fr; }
  .tier, .tier:nth-child(n) { min-height: 0; display: grid; grid-template-columns: 76px 1fr; column-gap: 16px; align-items: center; }
  .tier-count { grid-row: span 2; font-size: 2.8rem; text-align: center; }
  .tier h3 { margin: 0; }
}

/* ---------- Outfits marquee ---------- */
.outfits {
  padding: 84px 0 80px; overflow: hidden;
  background: var(--panel); color: var(--bark);
  border-block: 4px solid var(--panel-edge);
}
.outfits-top { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.outfits-top h2 { font-size: clamp(2rem, 4vw, 3rem); }
.outfits-top p { margin-top: 12px; font-size: 1.1rem; font-weight: 700; }
.marquee { display: flex; width: max-content; gap: 34px; animation: drift 40s linear infinite; }
.marquee img { height: 150px; width: auto; filter: drop-shadow(0 10px 8px rgba(74, 36, 12, 0.22)); }
.marquee-row { mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-row:hover .marquee { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(-50%); } }

/* ---------- FAQ ---------- */
.faq { padding: 96px 0; }
.faq h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 36px; }
.faq dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 34px 56px; }
.faq dt { font-weight: 800; font-size: 1.12rem; }
.faq dd { margin: 6px 0 0; color: var(--ink-soft); }
@media (max-width: 760px) { .faq dl { grid-template-columns: 1fr; gap: 26px; } }

/* ---------- Final call ---------- */
.final {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  padding: 110px 0 120px;
  background: url("../img/scenery.jpg") center 70% / cover no-repeat;
}
.final::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--page) 0%, rgba(8, 58, 90, 0.35) 30%, rgba(8, 58, 90, 0.65) 100%); }
.final .wrap { position: relative; display: grid; justify-items: center; gap: 18px; }
.final img.icon { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 14px 30px rgba(8, 58, 90, 0.45); }
.final h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.final p { font-size: 1.15rem; font-weight: 700; text-shadow: 0 1px 4px rgba(8, 58, 90, 0.7); }
.final .btn { margin-top: 8px; }

/* ---------- Inner pages ---------- */
.page-top {
  position: relative; color: #fff;
  padding: 120px 0 56px;
  background: url("../img/scenery.jpg") center 30% / cover no-repeat;
}
.page-top::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 58, 90, 0.55), rgba(8, 58, 90, 0.75)); }
.page-top .wrap { position: relative; }
.page-top h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); }
.page-top p { margin-top: 10px; font-size: 1.12rem; font-weight: 700; max-width: 56ch; }

.legal { width: min(760px, 100% - 32px); margin: 0 auto; padding: 48px 0 88px; }
.legal p, .legal ul, .legal table { margin: 0 0 1em; }
.legal h2 { font-size: 1.6rem; margin: 2em 0 0.6em; }
.legal ul { padding-left: 1.3em; }
.legal li { margin-bottom: 0.45em; }
.legal a { color: var(--water); font-weight: 700; }
@media (prefers-color-scheme: dark) { .legal a { color: var(--sky); } }
.meta { color: var(--ink-soft); font-weight: 700; }
.summary {
  margin: 24px 0 32px !important; padding: 20px 24px; border-radius: var(--radius);
  background: var(--panel); border: 3px solid var(--panel-edge); color: var(--bark);
}
.table-wrap { overflow-x: auto; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: start; padding: 56px 0 96px; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.form { display: grid; gap: 18px; padding: 30px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 800; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--page);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--water); }
.field textarea { min-height: 160px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-soft); opacity: 0.8; }
.hint { margin-top: 6px; font-size: 0.9rem; color: var(--ink-soft); }
.form-status { font-weight: 800; color: var(--water); min-height: 1.2em; }
.help { display: grid; gap: 28px; }
.help h2 { font-size: 1.35rem; margin-bottom: 6px; }
.help p { color: var(--ink-soft); }
.help a { color: var(--water); font-weight: 800; word-break: break-all; }
@media (prefers-color-scheme: dark) { .help a, .form-status { color: var(--sky); } }

/* ---------- Footer ---------- */
.foot { background: var(--water-ink); color: #cfe6f3; padding: 34px 0; font-size: 0.95rem; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
.foot a { color: #fff; text-decoration: none; font-weight: 700; }
.foot a:hover { color: var(--wood-light); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-art img { animation: float 5.5s ease-in-out infinite; }
  .hazards figure img { animation: bob 4s ease-in-out infinite; }
  .hazards li:nth-child(2n) figure img { animation-delay: -1.3s; }
  .hazards li:nth-child(3n) figure img { animation-delay: -2.6s; }
  .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--i, 0) * 80ms); }
  .reveal.in { opacity: 1; transform: none; }
  .stage-img img.swap { animation: pop 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee img[aria-hidden="true"] { display: none; }
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-12px) rotate(1deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.92); } to { opacity: 1; transform: none; } }
