/* Option 1: Sticker book.
   Thick ink outlines, hard offset shadows, cutouts slapped on like stickers. */
:root {
  --ink: #2b2140;
  --sand: #f6dfa8;
  --foam: #fffbf0;
  --surf: #2fa4d9;
  --sunset: #ff7a2e;
  --reef: #ffd23f;
  --palm: #3fae6a;
  --line: 4px solid var(--ink);
  --pop: 6px 6px 0 var(--ink);
  font-size: 17px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 700;
  color: var(--ink);
  background: #7cc8e8;
  line-height: 1.5;
  padding: 0 16px 48px;
}
/* Fixed background layer (background-attachment: fixed is broken on phones).
   The gradient shows until/unless island-bg.jpg exists. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url('../img/island-bg.jpg') center / cover no-repeat,
    linear-gradient(180deg, #8fd3f4 0%, #bfe8f7 38%, #2fa4d9 39%, #1d86b8 52%, #f6dfa8 53%, #edc77d 100%);
}

a { color: inherit; }
:focus-visible { outline: 4px solid var(--sunset); outline-offset: 3px; border-radius: 8px; }

/* ---------- logo ---------- */
.top { text-align: center; padding-top: 20px; }
.logo { margin: 0 auto; max-width: 560px; }
.logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 0 rgba(43, 33, 64, .35)); }
.logo-text { display: none; }
.logo.noimg img { display: none; }
.logo.noimg .logo-text {
  display: inline-block;
  font-family: 'Lilita One', 'Nunito', sans-serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1;
  color: var(--reef);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-3deg);
  padding: 12px 8px 20px;
}

/* ---------- card ---------- */
.card {
  position: relative;
  max-width: 860px;
  margin: 70px auto 0;
  background: var(--foam);
  border: var(--line);
  border-radius: 32px;
  box-shadow: 10px 10px 0 var(--ink);
  padding: 0 clamp(18px, 4vw, 44px) 36px;
}

/* stickers break over the top edge of the card */
.stickers {
  display: flex;
  justify-content: center;
  gap: clamp(4px, 2vw, 18px);
  margin: -64px 0 8px;
}
.pic { margin: 0; width: clamp(64px, 15vw, 128px); aspect-ratio: 1; display: grid; place-items: center; }
.pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* white sticker outline around a transparent cutout */
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(4px 5px 0 var(--ink));
}
.pic-alt { display: none; }
.pic.noimg img { display: none; }
.pic.noimg .pic-alt {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(2rem, 6vw, 3.4rem);
  background: var(--reef);
  border: var(--line);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--ink);
}
.pic:nth-child(1) { transform: rotate(-8deg); }
.pic:nth-child(2) { transform: rotate(4deg) translateY(-10px); }
.pic:nth-child(3) { transform: rotate(-3deg) translateY(4px); }
.pic:nth-child(4) { transform: rotate(7deg) translateY(-6px); }
.pic:nth-child(5) { transform: rotate(-5deg); }
.pic.noimg:nth-child(2) .pic-alt { background: var(--sunset); }
.pic.noimg:nth-child(3) .pic-alt { background: var(--sand); }
.pic.noimg:nth-child(4) .pic-alt { background: var(--palm); }
.pic.noimg:nth-child(5) .pic-alt { background: var(--surf); }

/* the one bit of motion: stickers slap on at load */
@media (prefers-reduced-motion: no-preference) {
  .pic { animation: slap .45s cubic-bezier(.2, 1.6, .4, 1) both; }
  .pic:nth-child(2) { animation-delay: .08s; }
  .pic:nth-child(3) { animation-delay: .16s; }
  .pic:nth-child(4) { animation-delay: .24s; }
  .pic:nth-child(5) { animation-delay: .32s; }
  @keyframes slap { from { scale: 1.6; opacity: 0; } to { scale: 1; opacity: 1; } }
}

/* ---------- hero / download ---------- */
.hero { text-align: center; padding: 8px 0 28px; border-bottom: 4px dashed var(--sand); }
.pitch { max-width: 34em; margin: 0 auto 22px; font-size: 1.1rem; }
.dl-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 40px 14px;
  background: var(--sunset);
  color: #fff;
  text-decoration: none;
  border: var(--line);
  border-radius: 999px;
  box-shadow: var(--pop);
  transition: transform .12s, box-shadow .12s;
}
.dl-btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.dl-btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.dl-main {
  font-family: 'Lilita One', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  line-height: 1.1;
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 var(--ink);
}
.dl-sub { font-size: .95rem; color: var(--ink); background: var(--reef); border-radius: 999px; padding: 0 12px; }
.dl-btn.is-disabled { filter: grayscale(.7); }
.hero-links { margin: 18px 0 0; }
.hero-links a { font-weight: 800; text-decoration-thickness: 3px; text-decoration-color: var(--surf); text-underline-offset: 4px; }
.demo-note { margin: 14px auto 0; display: inline-block; font-size: .85rem; background: var(--sand); border-radius: 10px; padding: 4px 12px; }

/* ---------- sections ---------- */
.block { padding-top: 26px; }
.block h2 {
  font-family: 'Lilita One', sans-serif;
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1.1;
  margin: 0 0 14px;
  display: inline-block;
  background: var(--surf);
  color: #fff;
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 var(--ink);
  border: var(--line);
  border-radius: 14px;
  padding: 4px 16px;
  transform: rotate(-1.5deg);
}
.empty { margin: 0; color: #6b5f80; }

/* online */
.server-state { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--ink); background: #e04a3f; flex: none; }
.server-state.up .dot { background: var(--palm); }
.online-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.online-player {
  background: var(--reef);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
.online-player .name { font-weight: 800; }
.online-player .since { font-size: .85rem; margin-left: 6px; }

/* players */
.players { display: grid; gap: 0; }
.player { padding: 18px 0; border-top: 3px dashed var(--sand); }
.player:first-child { border-top: 0; padding-top: 4px; }
.player-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.player-name { font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 1.6rem; margin: 0; }
.player-tag { font-size: .85rem; color: #6b5f80; }
.player-tag.is-online { color: var(--ink); background: var(--palm); color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 0 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 8px; margin: 10px 0; }
.stat { background: var(--sand); border-radius: 14px; padding: 6px 12px; }
.stat dt { font-size: .8rem; font-weight: 700; }
.stat dd { margin: 0; font-family: 'Lilita One', sans-serif; font-size: 1.3rem; }
.stat-play_seconds { background: var(--surf); color: #fff; }
.stats-empty { margin: 8px 0; color: #6b5f80; }
.badges { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 2px 12px 2px 3px;
  font-size: .85rem;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: help;
}
.badge-icon {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--c);
  border: 2px solid var(--ink);
  color: #fff;
  font-family: 'Lilita One', sans-serif;
  font-size: .8rem;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}
.badge-more { font-size: .85rem; color: #6b5f80; font-style: italic; }

/* changelog */
.release { padding: 0 0 14px 16px; border-left: 4px solid var(--sunset); margin-bottom: 14px; }
.release-ver { margin: 0; font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 1.25rem; display: inline; }
.release-date { margin-left: 10px; font-size: .85rem; color: #6b5f80; }
.release-notes { margin: 6px 0 0; padding-left: 20px; }
.release-notes li { margin: 2px 0; }

.foot { text-align: center; margin-top: 28px; color: #fff; text-shadow: 0 2px 0 var(--ink); }

/* ---------- account page bits (account.html uses this sheet) ---------- */
.forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 8px; }
.form { background: var(--sand); border-radius: 20px; padding: 18px; }
.form h2 { margin: 0 0 4px; font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 1.6rem; }
.top a { text-decoration: none; }
.account .note { margin-top: 4px; }
.form label { display: block; font-size: .9rem; margin: 10px 0 4px; }
.form input {
  width: 100%;
  font: inherit;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
}
.form .hint { font-size: .8rem; color: #6b5f80; margin: 4px 0 0; font-weight: 500; }
.btn {
  margin-top: 16px;
  font: inherit;
  font-family: 'Lilita One', sans-serif;
  font-size: 1.2rem;
  padding: 8px 24px;
  border: var(--line);
  border-radius: 999px;
  background: var(--surf);
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}
.btn.alt { background: var(--sunset); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled] { opacity: .6; cursor: wait; }
.msg { min-height: 1.5em; margin: 10px 0 0; font-size: .9rem; }
.msg.bad { color: #c0392b; }
.note { background: var(--reef); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 16px; margin: 0 0 8px; }
.me-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }

@media (max-width: 520px) {
  :root { font-size: 16px; }
  .card { border-radius: 24px; box-shadow: 6px 6px 0 var(--ink); margin-top: 56px; }
  .stickers { margin-top: -44px; }
  .dl-btn { padding: 14px 24px 12px; width: 100%; }
}

/* "Overheard at the campfire" - a rotating hint under the download button */
.rumour {
  margin: 1.1rem auto 0;
  max-width: 34rem;
  font-style: italic;
  font-size: 0.98rem;
  opacity: 0.85;
}
.rumour-label {
  font-style: normal;
  font-weight: 800;
  color: #e8601c;
}
[data-rumour] { transition: opacity 0.4s ease; }
