/* Spaten — the website.
   One stylesheet for every page. Felt green and cream, the game's own
   Londrina Solid for headings, and playing cards drawn in CSS. */

:root {
  --felt: #1f7a4d;
  --felt-deep: #0f4a2f;
  --felt-light: #2e9a63;
  --cream: #fbf5e9;
  --paper: #fffdf8;
  --ink: #1d1b16;
  --muted: #5f5a4e;
  --line: #e6dccb;
  --red: #d7312b;
  --gold: #f2b33d;
  --gold-deep: #c98a12;
  --sky: #86bfcf;

  --display: "Londrina Solid", "Trebuchet MS", sans-serif;
  --body: "Nunito", system-ui, -apple-system, sans-serif;

  --radius: 18px;
  --shadow: 0 10px 30px rgba(15, 74, 47, 0.18);
  --wrap: 1120px;

  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--felt);
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 0.4em;
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
}

h3 {
  font-size: 1.55rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 20px;
}

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

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 74, 47, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--cream);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  opacity: 0.9;
}

.nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.nav .nav-hide {
  display: none;
}

@media (min-width: 720px) {
  .nav .nav-hide {
    display: inline;
  }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 30px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(2px);
}

.btn-play {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--gold-deep), 0 12px 24px rgba(0, 0, 0, 0.25);
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--gold-deep), 0 16px 28px rgba(0, 0, 0, 0.28);
}

.btn-play:active {
  box-shadow: 0 3px 0 var(--gold-deep), 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-small {
  font-size: 1.05rem;
  padding: 8px 18px;
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  box-shadow: inset 0 0 0 2px rgba(251, 245, 233, 0.6);
}

.btn-ghost:hover {
  box-shadow: inset 0 0 0 2px var(--cream);
  background: rgba(251, 245, 233, 0.08);
}

.btn-felt {
  background: var(--felt);
  color: var(--cream);
  box-shadow: 0 5px 0 var(--felt-deep);
}

.btn-felt:hover {
  background: var(--felt-light);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: var(--cream);
  background:
    radial-gradient(ellipse at 70% 40%, rgba(255, 255, 255, 0.12), transparent 60%),
    radial-gradient(ellipse at 10% 100%, rgba(0, 0, 0, 0.25), transparent 55%),
    var(--felt);
  padding-block: 56px 90px;
}

/* A faint felt weave, so the green reads as cloth rather than a flat fill. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.025) 0 2px,
      transparent 2px 6px
    );
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.05fr 1fr;
  }
}

.eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(3.6rem, 12vw, 6.4rem);
  margin-bottom: 0.15em;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.18);
}

.hero .lede {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  max-width: 32ch;
  opacity: 0.95;
  margin-bottom: 30px;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.stores[hidden] {
  display: none;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
}

.store[hidden] {
  display: none;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
  opacity: 0.9;
}

.hero-facts li::before {
  content: "♠ ";
  color: var(--gold);
}

/* The wavy edge where the felt meets the page. */
.hero-edge {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  bottom: -1px;
  height: 48px;
  color: var(--cream);
}

/* ---------- playing cards ---------- */

.table {
  position: relative;
  height: 340px;
  display: grid;
  place-items: center;
}

.hand {
  position: relative;
  width: 300px;
  height: 260px;
}

.card {
  --w: 132px;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--w);
  aspect-ratio: 5 / 7;
  margin-left: calc(var(--w) / -2);
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08), 0 12px 24px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-family: var(--display);
  transform-origin: 50% 120%;
  transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px));
  transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
  user-select: none;
}

.card.red {
  color: var(--red);
}

.card .corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
  font-size: 1.5rem;
  font-weight: 900;
}

.card .corner small {
  font-size: 1.15rem;
}

.card .corner.tl {
  top: 8px;
  left: 10px;
}

.card .corner.br {
  bottom: 8px;
  right: 10px;
  transform: rotate(180deg);
}

.card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.6rem;
}

.card.back {
  background:
    repeating-linear-gradient(45deg, var(--red) 0 6px, #b8231e 6px 12px);
  border: 6px solid var(--paper);
}

.hand .card:nth-child(1) { --r: -32deg; }
.hand .card:nth-child(2) { --r: -16deg; }
.hand .card:nth-child(3) { --r: 0deg; }
.hand .card:nth-child(4) { --r: 16deg; }
.hand .card:nth-child(5) { --r: 32deg; }

.hand:hover .card:nth-child(1) { --r: -42deg; }
.hand:hover .card:nth-child(2) { --r: -21deg; }
.hand:hover .card:nth-child(4) { --r: 21deg; }
.hand:hover .card:nth-child(5) { --r: 42deg; }

.hand .card:hover {
  --y: -26px;
}

/* The winning card: the one that takes the last trick. */
.hand .card.winner::after {
  content: "👑";
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  font-size: 1.8rem;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3));
}

.chip {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--c, var(--gold)) 0 42%, transparent 43%),
    repeating-conic-gradient(var(--c, var(--gold)) 0 20deg, var(--paper) 20deg 40deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 0 0 4px var(--c, var(--gold));
  animation: bob 4s ease-in-out infinite;
}

.chip.one { top: 6%; left: 8%; }
.chip.two { bottom: 10%; right: 4%; --c: var(--red); animation-delay: -1.2s; width: 48px; height: 48px; }
.chip.three { top: 16%; right: 12%; --c: var(--sky); animation-delay: -2.4s; width: 40px; height: 40px; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-12px) rotate(20deg); }
}

@media (prefers-reduced-motion: reduce) {
  .chip { animation: none; }
  .card { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */

.section {
  padding-block: 80px;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
}

.section-head p {
  color: var(--muted);
  font-size: 1.1rem;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.tile {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 8px 0 var(--line);
}

.tile .icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  border-radius: 16px;
  margin-bottom: 14px;
  background: var(--cream);
}

.tile p {
  color: var(--muted);
  margin: 0;
}

.tile .big {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--felt);
  line-height: 1;
  margin-bottom: 6px;
}

/* How it plays: three numbered steps. */
.steps {
  counter-reset: step;
}

.steps .tile {
  position: relative;
  padding-top: 34px;
}

.steps .tile::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -18px;
  left: 22px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--felt);
  color: var(--cream);
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--felt-deep);
}

/* The points table. */
.points {
  margin-top: 40px;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.points .tile {
  background: var(--felt);
  color: var(--cream);
  border-color: var(--felt-deep);
  box-shadow: 0 5px 0 var(--felt-deep);
}

.points .tile:hover {
  box-shadow: 0 9px 0 var(--felt-deep);
}

.points table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.05rem;
}

.points td {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(251, 245, 233, 0.25);
}

.points tr:last-child td {
  border-bottom: 0;
}

.points td:last-child {
  text-align: right;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
}

.points .tile p.note {
  color: var(--cream);
  margin: 14px 0 0;
  font-size: 0.95rem;
  opacity: 0.85;
}

.callout {
  margin: 30px auto 0;
  max-width: 760px;
  text-align: center;
  background: var(--paper);
  border: 2px dashed var(--red);
  border-radius: var(--radius);
  padding: 18px 22px;
}

.callout strong {
  color: var(--red);
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

/* Rewards sit on a warmer band. */
.band {
  background: #f3e7cf;
}

.band .grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.band .tile {
  border-color: #e3d2b0;
  box-shadow: 0 4px 0 #e3d2b0;
}

/* ---------- the suggestion box ---------- */

.contact {
  display: grid;
  gap: 40px;
  align-items: start;
}

@media (min-width: 900px) {
  .contact {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.contact-intro .mailbox {
  font-size: 4.5rem;
  line-height: 1;
  margin-bottom: 10px;
}

.form {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.form .row {
  display: grid;
  gap: 18px;
}

@media (min-width: 560px) {
  .form .row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.field legend {
  font-weight: 800;
  font-size: 0.95rem;
}

.field .hint {
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--felt);
  background: var(--paper);
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

fieldset.field {
  border: 0;
  margin: 0;
  padding: 0;
}

.kinds {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kinds input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
}

.kinds label {
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--cream);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.kinds input:checked + label {
  background: var(--felt);
  border-color: var(--felt);
  color: var(--cream);
}

.kinds input:focus-visible + label {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* The honeypot: present for bots, absent for people. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}

.count {
  color: var(--muted);
  font-size: 0.9rem;
}

.status {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
}

.status[hidden] {
  display: none;
}

.status.ok {
  background: #e3f4ea;
  color: var(--felt-deep);
}

.status.bad {
  background: #fbe4e2;
  color: #8f1f1a;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--felt-deep);
  color: var(--cream);
  padding-block: 44px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: var(--cream);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-weight: 700;
}

.studio {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.9;
}

.studio svg {
  width: 64px;
  height: auto;
}

.studio strong {
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 1.1rem;
}

/* ---------- inner pages ---------- */

.page-hero {
  background: var(--felt);
  color: var(--cream);
  padding-block: 56px 46px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2.8rem, 8vw, 4.4rem);
}

.page-hero p {
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.15rem;
  opacity: 0.95;
}

.credits {
  display: grid;
  gap: 40px;
  max-width: 860px;
  margin: 0 auto;
}

.credits h2 {
  font-size: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.credits ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.credit {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  display: grid;
  gap: 2px;
}

.credit .name {
  font-weight: 800;
  font-size: 1.08rem;
}

.credit .by {
  color: var(--muted);
}

.credit .license {
  display: inline-block;
  justify-self: start;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.thanks {
  text-align: center;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- the web build ---------- */

.play-page {
  background: var(--felt-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.play-page .site-header {
  position: static;
}

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 20px;
}

.game-frame {
  position: relative;
  width: min(100%, calc((100vh - 140px) * 9 / 16));
  aspect-ratio: 9 / 16;
  max-height: calc(100vh - 110px);
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--felt);
}

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--felt);
  color: var(--cream);
  text-align: center;
  padding: 24px;
}

.loading[hidden] {
  display: none;
}

.loading .hand-mini {
  font-size: 3rem;
  letter-spacing: 6px;
  animation: deal 1.6s ease-in-out infinite;
}

@keyframes deal {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.bar {
  width: 220px;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.play-tools {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding-bottom: 20px;
}

.play-tools[hidden],
.game-frame[hidden] {
  display: none;
}

.soon {
  max-width: 460px;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.soon[hidden] {
  display: none;
}

.soon .emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 10px;
}

.soon .stores {
  justify-content: center;
}
