/* Sparkia website: the page is a slice through a realm. Sky on top, then dirt, stone, a crystal cave, and bedrock
   at the bottom. All the pixel art is the game's own. */
@font-face { font-family: "Poppins"; src: url(fonts/poppins-regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(fonts/poppins-medium.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url(fonts/poppins-bold.woff) format("woff"); font-weight: 700; font-display: swap; }
:root {
  --ink: #08202d;
  --deep: #0e2b40;
  --edge: #3b8ac2;
  --sky-top: #3fa6e6;
  --sky-low: #a6e6ff;
  --gold: #ffc93c;
  --leaf: #6cc24a;
  --cloud: #f2fbff;
  --text: #eaf6ff;
  --muted: #a9cbe3;
  --tile: 64px;
  /* Poppins: the closest free match to the game's own Century Gothic Bold */
  --display: "Poppins", "Century Gothic", system-ui, sans-serif;
  --body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: #1b1410; overflow-x: clip; }
body { overflow-x: clip; }
body { margin: 0; color: var(--text); font: 400 16px/1.7 var(--body); background: var(--ink); }
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--gold); }
a:focus-visible, .chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* outlined game lettering, like the buttons in Sparkia */
.lettering {
  font-family: var(--display); font-weight: 700; color: #fff; letter-spacing: 0;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; letter-spacing: .5px;
  text-shadow: 0 5px 0 var(--ink);
}

/* ---------------------------------------------------------------- sky */
.sky {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(var(--sky-top), var(--sky-low) 78%);
  padding: 56px 16px 0;
}
.sky .logo { width: min(620px, 92vw); height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 6px 0 rgba(8,32,45,.35)); }
.sky h1 { font-size: clamp(24px, 3.6vw, 38px); line-height: 1.15; margin: 18px auto 0; max-width: 18em; }
.sky .lede { max-width: 34em; margin: 14px auto 0; color: var(--ink); font-weight: 500; font-size: 17px; position: relative; z-index: 1; }
.chips { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 24px 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px 14px; border-radius: 16px;
  font: 700 19px/1 var(--display); color: #fff; text-decoration: none; letter-spacing: .3px;
  background: linear-gradient(#5cc4ff, #1f86d6); border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 0 5px 0 var(--ink);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
}
.chip.soon { background: linear-gradient(#ffd75e, #f2a51c); }
.chip:hover { filter: brightness(1.08); }
.chip img, .chip svg { width: 24px; height: 24px; flex: none; }
.chip.green { background: linear-gradient(#8fe05a, #3f9e22); }
.chip.small { font-size: 16px; padding: 9px 16px 11px; background: #fff; color: var(--ink); -webkit-text-stroke: 0; box-shadow: 0 4px 0 var(--ink); cursor: default; }
.chip.small:hover { filter: none; }
.soon-line { margin: 16px 0 0; }

.clouds { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.sky > :not(.clouds) { position: relative; z-index: 1; }
.clouds img { position: absolute; width: 128px; opacity: .9; animation: drift linear infinite; }
.clouds img:nth-child(1) { top: 10%; animation-duration: 90s; animation-delay: -20s; }
.clouds img:nth-child(2) { top: 26%; width: 96px; animation-duration: 120s; animation-delay: -70s; opacity: .75; }
.clouds img:nth-child(3) { top: 6%; width: 160px; animation-duration: 140s; animation-delay: -110s; }
@keyframes drift { from { transform: translateX(-200px); left: 0; } to { transform: translateX(calc(100vw + 40px)); left: 0; } }

/* the surface: a strip of grass with you and your friends on it */
.surface { position: relative; height: 300px; margin: 10px -16px 0; }
.surface .props { position: absolute; left: 50%; bottom: var(--tile); width: 1100px; height: 280px; transform: translateX(-50%); }
.surface .props img { position: absolute; bottom: 0; }
/* (the scenery is only to look at: it never covers the buttons above it) */
.surface, .surface * { pointer-events: none; }
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tile);
  background: url(assets/grass.png) repeat-x left top / var(--tile) var(--tile);
}

/* ---------------------------------------------------------------- the layers underground */
.layer {
  position: relative; padding: 72px 16px 80px;
  background-size: var(--tile) var(--tile);
}
.layer::before { content: ""; position: absolute; inset: 0; background: rgba(6,18,28,.5); }
.layer > * { position: relative; }
.dirt { background-image: url(assets/dirt.png); }
.dirt::before { background: linear-gradient(rgba(20,10,4,.25), rgba(20,10,4,.55)); }
.stone { background-image: url(assets/stone.png); }
.stone::before { background: rgba(10,18,26,.55); }
.cave { background-image: url(assets/cave_wall.png); }
.cave::before { background: rgba(14,10,30,.45); }

.feature {
  max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px;
}
.feature.flip .sign { order: 2; }
.sign {
  background: rgba(8,32,45,.92); border: 3px solid var(--ink); border-radius: 20px; padding: 26px 30px 28px;
  box-shadow: inset 0 0 0 3px var(--edge), 0 8px 0 rgba(0,0,0,.35);
}
.sign h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; margin: 0; }
.sign p { margin: 0 0 10px; color: var(--text); max-width: 36em; }
.sign p:last-child { margin-bottom: 0; }
.scene { position: relative; height: 400px; }
.scene img { position: absolute; }

/* ---------------------------------------------------------------- bedrock */
.bedrock {
  position: relative; background: url(assets/bedrock.png) 0 0 / var(--tile) var(--tile); padding: 48px 16px 40px; text-align: center;
}
.bedrock::before { content: ""; position: absolute; inset: 0; background: rgba(4,4,10,.62); }
.bedrock > * { position: relative; }
.bedrock .mark { width: 220px; height: auto; }
.bedrock nav { display: flex; gap: 10px 28px; justify-content: center; flex-wrap: wrap; margin: 18px 0 14px; font-weight: 500; }
.bedrock nav a { color: #fff; text-decoration: none; border-bottom: 2px solid var(--gold); padding-bottom: 1px; }
.bedrock nav a:hover { color: var(--gold); }
.bedrock small { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- the rules pages */
.page { background: url(assets/stone.png) 0 0 / var(--tile) var(--tile); position: relative; padding: 0 0 64px; min-height: 100vh; }
.page::before { content: ""; position: absolute; inset: 0; background: rgba(8,22,32,.72); }
.page > * { position: relative; }
.topbar { background: linear-gradient(var(--sky-top), var(--sky-low)); border-bottom: 4px solid var(--ink); padding: 14px 16px; }
.topbar .in { max-width: 820px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar img { width: 170px; height: auto; display: block; }
.topbar nav { display: flex; gap: 6px 18px; flex-wrap: wrap; font-weight: 500; }
.topbar nav a { color: var(--ink); text-decoration: none; }
.topbar nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.paper {
  max-width: 820px; margin: 36px auto 0; background: var(--cloud); color: #1d2b36; border: 3px solid var(--ink);
  border-radius: 20px; padding: 34px clamp(18px, 4vw, 44px) 40px; box-shadow: 0 8px 0 rgba(0,0,0,.35);
}
.paper h1 { font: 700 clamp(28px, 4vw, 38px)/1.15 var(--display); color: var(--ink); margin: 0 0 6px; }
.paper h2 { font: 700 21px/1.25 var(--display); color: #1f6fae; margin: 30px 0 8px; }
.paper .updated { color: #5b7385; margin: 0 0 22px; }
.paper a { color: #1f6fae; }
.paper .box { background: #ffffff; border: 2px solid #cfe6f5; border-radius: 12px; padding: 12px 16px; }
.paper table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15.5px; }
.paper th, .paper td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid #d8e8f3; }
.paper th { background: #e3f3fd; }
.paper li { margin: 4px 0; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 820px) {
  :root { --tile: 48px; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 18px; }
  .feature.flip .sign { order: 0; }
  .scene { height: 260px; order: -1; }
  .lettering { -webkit-text-stroke-width: 4px; text-shadow: 0 3px 0 var(--ink); }
  .surface { height: 230px; }
  .surface .props { transform: translateX(-50%) scale(.6); transform-origin: bottom center; }
  .layer { padding: 48px 14px 56px; }
}
@media (prefers-reduced-motion: reduce) { .clouds img { animation: none; left: 10%; } .clouds img:nth-child(2) { left: 60%; } .clouds img:nth-child(3) { left: 78%; } }

/* a scene: real game pieces on a ledge, at 4x (one game pixel = 4 screen pixels) */
.stage { position: absolute; left: 50%; bottom: 0; width: 512px; height: 400px; transform: translateX(-50%) scale(var(--s, 1)); transform-origin: bottom center; }
.stage img { position: absolute; }
.stage.wide { width: 590px; }      /* (room for the Crystal Dragon past the ledge) */
.surface { --tile: 128px; height: 400px; }
.surface .props { height: 400px; }
@media (max-width: 820px) {
  .stage { --s: .62; }
  .stage.wide { --s: .58; }
  .surface { --tile: 96px; height: 300px; }
}

/* contact page */
.email-big { font: 700 clamp(20px, 3.4vw, 28px)/1.2 var(--display); margin: 18px 0; word-break: break-all; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 22px; }
button.chip { cursor: pointer; font: 700 19px/1 var(--display); }
.paper .chip { color: #fff; text-decoration: none; }
