/* Mannyverse Games — stile del sito
   Il sito e' il mare del gioco visto dall'alto: acqua scura, pannelli color pergamena come la UI di Go Fishin!,
   un solo font (Balsamiq Sans, quello del gioco) e l'oro delle lettere "Manny" dell'intro. */

@font-face {
  font-family: "Balsamiq Sans";
  src: url("../fonts/BalsamiqSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Balsamiq Sans";
  src: url("../fonts/BalsamiqSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --abyss: #081426;      /* sfondo dell'intro Mannyverse */
  --night: #0e2a44;      /* acqua profonda */
  --lagoon: #3cc8c8;     /* acqua bassa: link e dettagli sul mare */
  --foam: #e9f7fa;       /* testo chiaro sul mare */
  --parchment: #fcf5e6;  /* pannelli della UI del gioco */
  --parchment-edge: #e8dcc2;
  --ink: #1e2a38;        /* testo sui pannelli */
  --ink-soft: #55606d;
  --gold: #ffb52e;       /* "Manny" dell'intro, premi, pulsante principale */
  --gold-deep: #c9811a;
  --coral: #e8947a;      /* errori */

  --radius-panel: 22px;
  --radius-control: 12px;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: 2.125rem;
  --step-4: clamp(2.6rem, 7vw, 4.5rem);
  --measure: 66ch;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Balsamiq Sans", "Comic Sans MS", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--foam);
  background: var(--abyss);
}

img { max-width: 100%; height: auto; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

a { color: var(--lagoon); text-underline-offset: 0.18em; }
a:hover { color: var(--foam); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--gold); color: var(--ink); padding: 0.5rem 1rem; border-radius: 8px;
  font-weight: 700; z-index: 10; text-decoration: none;
}
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- Il mare */

.sea {
  position: relative;
  overflow: hidden;
  background: var(--night);
  isolation: isolate;
}
.sea canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  z-index: -1;
  touch-action: pan-y;
}
.sea--home { min-height: 100svh; display: grid; place-items: center; padding: 4rem 1rem 4.5rem; }
.sea--strip { min-height: 300px; display: grid; place-items: center; padding: 3rem 1rem; }
.sea--still { min-height: 100svh; display: grid; place-items: center; padding: 2rem 1rem; text-align: center; }

.sea__hint {
  position: absolute; right: 1rem; top: 0.8rem;
  margin: 0; font-size: var(--step--1); color: rgb(233 247 250 / 0.75);
  pointer-events: none;
}
.sea__hint strong { color: var(--gold); }

/* ---------------------------------------------------------------- Wordmark */

.wordmark {
  margin: 0;
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--parchment);
  text-shadow: 0 4px 0 rgb(8 20 38 / 0.55);
}
.wordmark .accent { color: var(--gold); }
.wordmark span { display: inline-block; }
.wordmark--small { font-size: var(--step-2); text-shadow: none; }
.wordmark--small a { color: inherit; text-decoration: none; }

/* lettere che spuntano una alla volta, come l'intro del gioco */
.js .wordmark--intro span {
  opacity: 0;
  transform: translateY(0.35em) scale(0.6);
  animation: letter-pop 0.35s cubic-bezier(.2, 1.6, .4, 1) forwards;
  animation-delay: calc(0.35s + var(--i) * 0.07s);
}
@keyframes letter-pop {
  to { opacity: 1; transform: none; }
}

.tagline {
  margin: 1rem auto 0;
  max-width: 34ch;
  font-size: var(--step-1);
  color: var(--foam);
  text-shadow: 0 2px 0 rgb(8 20 38 / 0.6);
}

/* ---------------------------------------------------------------- Pannelli (la UI del gioco) */

.panel {
  background: var(--parchment);
  color: var(--ink);
  border-radius: var(--radius-panel);
  box-shadow: 0 6px 0 var(--parchment-edge), 0 18px 40px rgb(0 0 0 / 0.35);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.panel a { color: #1b7a86; }
.panel a:hover { color: var(--ink); }
.panel h2, .panel h3 { color: var(--ink); }

/* ---------------------------------------------------------------- Home */

.home {
  width: min(560px, 100%);
  text-align: center;
}
.home .panel { margin-top: 2.25rem; text-align: left; }

.links { list-style: none; margin: 0; padding: 0; }
.links li + li { border-top: 2px dashed var(--parchment-edge); }
.links a, .links .soon {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  align-items: center;
  gap: 0.25rem 0.9rem;
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--ink);
}
.links a:hover { background: #f3e8cf; color: var(--ink); }
.links .title { font-weight: 700; font-size: var(--step-1); line-height: 1.2; }
.links .sub { grid-column: 2; font-size: var(--step--1); color: var(--ink-soft); line-height: 1.35; }
.links .soon { color: var(--ink-soft); }
.links .soon .title { font-weight: 700; }

.links .ico {
  grid-row: span 2;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--ink);
}
.links .ico img { width: 1.6rem; height: 1.6rem; }
.links .ico--mask span {
  width: 1.45rem; height: 1.45rem; background: var(--parchment);
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.links .ico--game { background: var(--gold); }
.links .ico--game img, .links .ico--muted img { width: auto; height: 2rem; }
.links .ico--muted { background: #fff; }
.links .ico--muted img { filter: grayscale(1) contrast(1.1); }

.links .soon--steam {
  position: relative;
  margin-top: 0.6rem;
  background: #111;
  color: #fff;
  border: 2px solid #fff;
  outline: 2px solid #111;
}
.links .soon--steam .sub { color: #cfcfcf; }
.links .soon--steam .badge {
  position: absolute; top: -0.75rem; right: 0.75rem;
  padding: 0.15rem 0.6rem;
  background: #d62828; color: #fff;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 6px;
  transform: rotate(-3deg);
  box-shadow: 0 2px 0 #7a1010;
}

/* ---------------------------------------------------------------- Pagine interne */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: min(1040px, 100% - 2rem);
  margin: 0 auto;
  padding: 1rem 0;
}
.topbar nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.topbar nav a { color: var(--foam); text-decoration: none; font-weight: 700; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--gold); }

.page {
  width: min(1040px, 100% - 2rem);
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  display: grid;
  gap: 2.5rem;
}

.game-logo { width: min(640px, 92%); display: block; margin: 0 auto; filter: drop-shadow(0 6px 0 rgb(8 20 38 / 0.5)); }
.game-lead { margin: 1.25rem auto 0; max-width: 46ch; text-align: center; font-size: var(--step-1); text-shadow: 0 2px 0 rgb(8 20 38 / 0.6); }

.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }

.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-control);
  font: inherit; font-weight: 700; font-size: var(--step-0);
  text-decoration: none;
  border: 0; cursor: pointer;
  background: var(--gold); color: var(--ink);
  box-shadow: 0 4px 0 var(--gold-deep);
  transition: transform 0.08s, box-shadow 0.08s;
}
.button:hover { color: var(--ink); background: #ffc24f; }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-deep); }
.button--ghost { background: transparent; color: var(--foam); box-shadow: inset 0 0 0 2px rgb(233 247 250 / 0.5); }
.button--ghost:hover { background: rgb(233 247 250 / 0.08); color: var(--foam); }
.button[aria-disabled="true"] { opacity: 0.65; cursor: default; pointer-events: none; }
.panel .button--ghost { color: var(--ink); box-shadow: inset 0 0 0 2px var(--parchment-edge); }

/* sezioni del gioco */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}
.about figure { margin: 0; }
.about figure img { border-radius: 16px; display: block; width: 100%; }
.about figcaption { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.5rem; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.75rem; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1rem; }
.prose { max-width: var(--measure); }
.prose > :last-child { margin-bottom: 0; }

.features { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.7rem; }
.features li { display: grid; grid-template-columns: 34px 1fr; gap: 0.75rem; align-items: start; }
.features .sprite {
  width: 34px; height: 34px;
  background-image: url("../img/fishes.png");
  background-size: calc(34px * 12) calc(34px * 12);
  image-rendering: pixelated;
}

/* press kit */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; margin: 0 0 1.5rem; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }

.press-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem 2.5rem; }

.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.downloads a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.7rem; border-radius: var(--radius-control);
  background: #f3e8cf; color: var(--ink); text-decoration: none; font-weight: 700;
}
.downloads a:hover { background: #eadbb9; }
.downloads img { width: 44px; height: 44px; object-fit: contain; background: var(--night); border-radius: 8px; }
.downloads small { display: block; font-weight: 400; color: var(--ink-soft); }

.copybox {
  background: #f3e8cf; border-radius: var(--radius-control);
  padding: 0.9rem 1rem; margin: 0 0 1rem;
}
.copybox p { margin: 0; }

/* modulo bug */
.form { display: grid; gap: 1rem; max-width: 640px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 700; }
.field .help { font-size: var(--step--1); color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink);
  background: #fffdf8;
  border: 2px solid var(--parchment-edge);
  border-radius: var(--radius-control);
  padding: 0.6rem 0.75rem;
  width: 100%;
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #1b7a86; outline: none; box-shadow: 0 0 0 3px rgb(60 200 200 / 0.35); }
.form-status { margin: 0; font-weight: 700; min-height: 1.5em; }
.form-status.ok { color: #1b7a86; }
.form-status.err { color: #b4472e; }
.hp { display: none; }

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

.footer {
  width: min(1040px, 100% - 2rem);
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
  font-size: var(--step--1);
  color: rgb(233 247 250 / 0.7);
  border-top: 2px dashed rgb(233 247 250 / 0.15);
}
.footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer a { color: rgb(233 247 250 / 0.85); }
.footer--home {
  position: absolute; left: 0; right: 0; bottom: 0;
  border-top: 0; justify-content: center; padding: 1rem;
}

/* ---------------------------------------------------------------- Privacy */

.legal h2 { font-size: var(--step-2); margin-top: 2rem; }
.legal h2:first-of-type { margin-top: 0; }
.legal ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.legal li + li { margin-top: 0.35rem; }
.legal .updated { color: var(--ink-soft); font-size: var(--step--1); }
.lang-switch { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------- 404 */
.lost .panel { width: min(480px, 100%); text-align: center; }
.lost .panel img { width: 96px; margin: 0 auto 0.5rem; display: block; }

/* ---------------------------------------------------------------- Mobile */
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 0.1rem; }
  .facts dd { margin-bottom: 0.6rem; }
  .sea__hint { display: none; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .js .wordmark--intro span { animation: none; opacity: 1; transform: none; }
  .button { transition: none; }
}
