:root {
  color-scheme: dark;
  --ink: #f4f2ee;
  --muted: #9c9994;
  --accent: #ffd63f;
  --page-gutter: clamp(1rem, 2.3vw, 3rem);
  --game-size: min(56vw, calc(100dvh - 2rem), 1000px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #000;
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #000;
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
  line-height: 1.48;
}

body::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: var(--stone-end, 100vh);
  background-image:
    linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, .1) 58%, #000 100%),
    url("assets/stone.jpg");
  background-repeat: no-repeat, repeat;
  background-size: 100% 100%, 800px 800px;
  content: "";
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--game-size) minmax(0, 1fr);
  column-gap: clamp(1.25rem, 2.25vw, 3.2rem);
  align-items: start;
  width: min(100%, 1920px);
  margin: 0 auto;
  padding: 1rem var(--page-gutter) 0;
}

.mobile-toolbar {
  display: none;
}

.identity-panel,
.center-column,
.right-column {
  min-width: 0;
}

.identity-panel {
  display: flex;
  flex-direction: column;
  align-self: start;
}

.center-column {
  display: flex;
  width: var(--game-size);
  flex-direction: column;
  gap: 1rem;
}

.right-column {
  display: flex;
  width: 100%;
  flex-direction: column;
}

.logo-link {
  display: block;
  align-self: center;
  width: min(100%, 360px);
  margin: clamp(.25rem, 2vh, 1.4rem) auto clamp(.75rem, 2vh, 1.5rem);
}

.saltacol-logo {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 .6rem 1rem rgba(0, 0, 0, .48));
}

.logo-link,
.credit-logo {
  transform-origin: center;
  transition: transform .22s ease-out;
}

.logo-link:hover,
.logo-link:focus-visible,
.credit-logo:hover,
.credit-logo:focus-visible {
  transform: scale(1.1);
}

.logo-link:hover img,
.logo-link:focus-visible img,
.credit-logo:hover img,
.credit-logo:focus-visible img {
  animation: clickable-graphic-wiggle .42s ease-out;
}

@keyframes clickable-graphic-wiggle {
  0% { transform: rotate(0); }
  28% { transform: rotate(-1.8deg); }
  56% { transform: rotate(1.5deg); }
  78% { transform: rotate(-.7deg); }
  100% { transform: rotate(0); }
}

.utility-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.language-switch {
  display: flex;
  gap: .35rem;
}

.language-switch button,
.share-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid #a77b16;
  border-radius: 50%;
  padding: 0;
  color: #d8d4cd;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .24) 0, rgba(255, 255, 255, .06) 20%, transparent 48%),
    linear-gradient(180deg, #393630 0, #171512 55%, #080706 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -2px 2px rgba(0, 0, 0, .8),
    0 2px 0 #050403,
    0 4px 9px rgba(0, 0, 0, .48);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, filter .16s ease;
}

.language-switch button {
  font: inherit;
  letter-spacing: .1em;
}

.language-switch button[aria-pressed="true"] {
  color: var(--accent);
  border-color: #f0bd2c;
  background:
    linear-gradient(180deg, rgba(255, 239, 159, .34) 0, rgba(255, 255, 255, .06) 24%, transparent 50%),
    linear-gradient(180deg, #4d411f 0, #241d0d 58%, #0d0a05 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 189, .46),
    inset 0 -2px 2px rgba(0, 0, 0, .82),
    0 2px 0 #050403,
    0 0 10px rgba(255, 205, 49, .2);
}

.language-switch button:hover,
.share-button:hover {
  color: #fff;
  border-color: #ffd75a;
  filter: brightness(1.18);
}

.language-switch button:focus-visible,
.share-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.language-switch button:active,
.share-button:active {
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, .8),
    0 2px 0 #050403;
  filter: brightness(.92);
}

.share-button {
  padding: 0;
}

.share-button img {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #000);
}

.share-button.share-complete {
  border-color: #f0bd2c;
  filter: drop-shadow(0 0 5px rgba(255, 214, 63, .5));
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.copy-block {
  max-width: 40rem;
  text-wrap: pretty;
}

.story,
.instructions {
  width: 100%;
  max-width: none;
}

.copy-block h1,
.copy-block h2 {
  position: relative;
  margin: 0 0 1.15rem;
  color: #fff;
  font-size: clamp(1.05rem, 1.15vw, 1.45rem);
  font-weight: 800;
  letter-spacing: .09em;
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(255, 214, 63, .16);
  text-transform: uppercase;
}

.copy-block h1::after,
.copy-block h2::after {
  display: block;
  width: 100%;
  height: 2px;
  margin-top: .42rem;
  background: var(--accent);
  content: "";
}

.copy-block p {
  margin: 0 0 1.05rem;
  font-size: clamp(1rem, 1.08vw, 1.2rem);
}

.copy-block strong {
  color: #fff;
  font-weight: 800;
}


.copy-block .callout {
  color: #fff;
  font-weight: 700;
}

.game-column {
  width: 100%;
}

.game-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #000;
  isolation: isolate;
  filter: drop-shadow(0 1rem 1.3rem rgba(0, 0, 0, .42));
}

.game-frame::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: url("assets/wood-frame.png") center / 100% 100% no-repeat;
  content: "";
  pointer-events: none;
}

.game-window {
  position: absolute;
  z-index: 1;
  inset: 5%;
  overflow: hidden;
  background: #000;
  touch-action: none;
  overscroll-behavior: contain;
}

.game-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: #57534d;
  font-size: clamp(.8rem, 1.2vw, 1rem);
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
}

.game-window .saltacol-flash,
.game-window object,
.game-window embed,
.game-window ruffle-player {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.saltacol-history {
  width: 100%;
  max-width: none;
}

.review-quote {
  margin: 0 0 1.3rem;
  padding: 0 0 0 .85rem;
  border-left: 2px solid #9f7d24;
  color: #cbc7bf;
}

.saltacol-history .review-quote p {
  margin-bottom: .55rem;
  font-size: clamp(.84rem, .9vw, 1rem);
  font-style: italic;
  line-height: 1.45;
}

.review-quote footer {
  font-size: clamp(.76rem, .78vw, .9rem);
  line-height: 1.35;
}

.saltacol-history a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.saltacol-history a:hover,
.saltacol-history a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.illustrated-footer {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(460px, 60vw, 900px);
  padding-top: clamp(280px, 42vw, 650px);
  overflow: hidden;
  background: #000;
}

.left-scenery,
.right-scenery,
.jumping-saltacol {
  position: absolute;
  display: block;
}

.left-scenery {
  z-index: 1;
  bottom: -6%;
  left: 0;
  width: min(35vw, 525px);
  height: auto;
}

.credit-block p,
.legal-notes {
  text-shadow:
    -2px -2px 0 #000,
    0 -2px 0 #000,
    2px -2px 0 #000,
    -2px 0 0 #000,
    2px 0 0 #000,
    -2px 2px 0 #000,
    0 2px 0 #000,
    2px 2px 0 #000,
    0 3px 6px #000;
}

.footer-content {
  position: relative;
  z-index: 5;
  width: 100%;
  padding: 0 var(--page-gutter) .65rem;
}

.credits-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 5rem);
  align-items: end;
}

.credit-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.mistercoo-block {
  align-items: flex-end;
  text-align: right;
}

.credit-logo {
  display: block;
  width: min(29vw, 330px);
  max-width: 100%;
  line-height: 0;
}

.credit-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.credit-block p {
  margin: .35rem 0 0;
  color: #fff;
  font-size: clamp(.84rem, 1.04vw, 1.08rem);
  line-height: 1.3;
  white-space: pre-line;
}

.jumping-saltacol {
  z-index: 3;
  top: 50%;
  left: 50%;
  width: clamp(156px, 18vw, 276px);
  transform: translate(-50%, -50%);
}

.jumping-saltacol img {
  display: block;
  width: 100%;
  height: auto;
}

.right-scenery {
  z-index: 2;
  right: -5%;
  bottom: -2%;
  width: min(64.82vw, 972px);
  height: auto;
}

.legal-notes {
  margin-top: .65rem;
  font-size: clamp(.7rem, .78vw, .85rem);
  line-height: 1.35;
  letter-spacing: .02em;
  text-align: center;
}

.legal-notes p {
  margin: 0;
}

.privacy-note {
  color: #aaa7a2;
}

.copyright-use {
  color: #8c8984;
}

.copyright-use a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.copyright-use a:hover,
.copyright-use a:focus-visible {
  color: #fff;
  text-decoration: none;
}

@media (min-width: 900px) and (max-width: 1199px) and (min-aspect-ratio: 4 / 3) {
  :root {
    --game-size: min(50vw, calc(100dvh - 2rem), 1000px);
  }

  .play-layout {
    grid-template-columns: minmax(0, 1fr) var(--game-size) minmax(0, 1fr);
    column-gap: 1rem;
  }

  .copy-block p {
    font-size: .95rem;
  }
}

@media (max-aspect-ratio: 4 / 3), (max-width: 899px) {
  :root {
    --game-size: min(96vw, 1000px);
  }

  .play-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
    width: 100%;
    padding: .5rem 2vw 0;
  }

  .mobile-toolbar {
    display: grid;
    grid-row: 1;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    height: 40px;
    margin: 0 0 8px;
  }

  .mobile-toolbar .language-switch {
    justify-self: start;
    flex-direction: row;
  }

  .mobile-logo {
    display: block;
    justify-self: center;
    width: auto;
    height: 40px;
    filter: drop-shadow(0 .25rem .5rem rgba(0, 0, 0, .48));
  }

  .mobile-toolbar .share-button {
    justify-self: end;
  }

  .identity-panel,
  .center-column,
  .right-column {
    display: contents;
  }

  .identity-panel > .logo-link,
  .identity-panel > .utility-controls {
    display: none;
  }

  .game-column {
    grid-row: 2;
    justify-self: center;
    width: var(--game-size);
    margin-bottom: 1.8rem;
  }

  .story {
    grid-row: 3;
    width: 100%;
    margin-bottom: 1.8rem;
    padding: 0 clamp(.4rem, 2vw, 1.2rem);
  }

  .instructions {
    grid-row: 4;
    width: 100%;
    margin-bottom: 1.8rem;
    padding: 0 clamp(.4rem, 2vw, 1.2rem);
  }

  .saltacol-history {
    grid-row: 5;
    width: 100%;
    padding: 0 clamp(.4rem, 2vw, 1.2rem);
  }

  .copy-block h1,
  .copy-block h2 {
    font-size: clamp(1rem, 3.2vw, 1.25rem);
  }

  .copy-block p {
    font-size: clamp(.95rem, 2.8vw, 1.08rem);
  }

  .illustrated-footer {
    min-height: 0;
    padding-top: clamp(230px, 60vw, 450px);
  }

  .left-scenery {
    bottom: -2%;
    width: min(42vw, 360px);
  }

  .credit-logo {
    width: min(38vw, 260px);
  }

  .credit-block p {
    font-size: clamp(.78rem, 2.35vw, .98rem);
  }

  .jumping-saltacol {
    width: clamp(140px, 26vw, 210px);
  }

  .right-scenery {
    width: min(77.95vw, 667px);
  }
}

@media (max-width: 520px) {
  .game-column,
  .story,
  .instructions {
    margin-bottom: 1.4rem;
  }


  .copy-block p {
    hyphens: auto;
  }

  .credit-block p {
    font-size: clamp(.7rem, 3vw, .82rem);
    line-height: 1.25;
  }

  .legal-notes {
    font-size: clamp(.66rem, 2.7vw, .76rem);
  }
}

@media (max-width: 380px) {
  .story p,
  .instructions p {
    font-size: .84rem;
    line-height: 1.42;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .logo-link:hover,
  .logo-link:focus-visible,
  .credit-logo:hover,
  .credit-logo:focus-visible {
    transform: scale(1.03);
  }

  .logo-link:hover img,
  .logo-link:focus-visible img,
  .credit-logo:hover img,
  .credit-logo:focus-visible img {
    animation: none;
  }
}
