/* Bank It Food Quiz: a cut-and-paste zine page. Flat torn paper, tape, cut-out letters. */

:root {
  --paper: var(--ak-surface);
  --tape: color-mix(in srgb, var(--ak-accent-2) 22%, var(--ak-bg));
  --tape-red: color-mix(in srgb, var(--ak-accent) 82%, var(--ak-bg));
  --paper-shadow: drop-shadow(2px 3px 0 color-mix(in srgb, var(--ak-ink) 32%, transparent));
  --gap: clamp(6px, 1.3dvh, 12px);
  --coin-ratio: 2.313;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--ak-font-body);
  color: var(--ak-ink);
  background-color: var(--ak-bg);
  background-image: var(--ak-bg-art);
  background-size: var(--ak-bg-size);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid var(--ak-focus);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

/* ---------- page ---------- */

.play {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: manipulation;
  background-color: var(--ak-bg);
  background-image: var(--ak-backdrop-layer,
    linear-gradient(color-mix(in srgb, var(--ak-bg) 87%, transparent), color-mix(in srgb, var(--ak-bg) 87%, transparent)),
    url("./art/zine-page.jpg"));
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding:
    max(8px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}

.layout {
  width: 100%;
  height: 100%;
  flex: none;
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "top"
    "trail"
    "q"
    "stage"
    "note"
    "desk";
  gap: var(--gap);
}

.board,
.side { display: contents; }

.top { grid-area: top; }
.trail { grid-area: trail; }
.qpanel { grid-area: q; }
.stage { grid-area: stage; }
.note { grid-area: note; }
.desk { grid-area: desk; }

/* ---------- torn paper ---------- */

.scrap {
  position: relative;
  isolation: isolate;
  filter: var(--paper-shadow);
}

.scrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  clip-path: var(--torn, none);
}

.tape {
  position: absolute;
  height: 20px;
  width: 74px;
  background: var(--tape);
  clip-path: polygon(0 12%, 6% 0, 12% 14%, 20% 2%, 100% 0, 94% 50%, 100% 100%, 8% 96%, 0 88%, 5% 50%);
  transform-origin: center;
  pointer-events: none;
}

/* ---------- top bar ---------- */

.top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding-right: 60px;
}

.corner-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--ak-ink);
  border-radius: 0;
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-2deg);
}

.corner-btn svg { width: 26px; height: 26px; }
.corner-btn .cross { display: none; }
.corner-btn[aria-pressed="true"] .wave { display: none; }
.corner-btn[aria-pressed="true"] .cross { display: inline; }

.hint-btn {
  font-family: var(--ak-font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  transform: rotate(1.5deg);
  background: var(--ak-btn-fill);
  color: var(--ak-btn-ink);
}

.play-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  height: clamp(32px, 5.4dvh, 46px);
  width: auto;
  transform: translate(-50%, -50%) rotate(-2deg);
  pointer-events: none;
}

/* ---------- trail of six ---------- */

.trail {
  list-style: none;
  margin: 0;
  padding: 0 4px;
  display: flex;
  gap: clamp(4px, 1.6vw, 10px);
  justify-content: center;
}

.slot {
  flex: 0 1 52px;
  min-width: 0;
  height: clamp(40px, 6dvh, 52px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--ak-font-display);
  font-size: 18px;
  line-height: 1;
}

.slot:nth-child(odd) { transform: rotate(-2deg); }
.slot:nth-child(even) { transform: rotate(1.5deg) translateY(2px); }
.slot svg { width: 24px; height: 24px; }
.slot .amt { font-family: var(--ak-font-body); font-weight: 700; font-size: 12px; }
.slot.is-now { --paper: var(--ak-choice-selected-bg); color: var(--ak-choice-selected-ink); }

/* ---------- question panel: cut-out letters ---------- */

.qpanel {
  padding: clamp(14px, 2.4dvh, 22px) clamp(10px, 3vw, 18px) clamp(10px, 1.8dvh, 16px);
  margin: 0 4px;
  transform: rotate(-1deg);
}

.tape-q { top: -9px; left: 50%; margin-left: -37px; transform: rotate(-4deg); }

.ransom {
  margin: 0;
  font-family: var(--ak-font-display);
  font-weight: var(--ak-title-weight);
  font-size: clamp(20px, min(5.8vw, 3.6dvh), 32px);
  line-height: 1.32;
  letter-spacing: 0.03em;
  text-align: center;
  word-spacing: 0.08em;
}

.cut {
  display: inline-block;
  padding: 0 0.16em;
  margin: 0.04em 0.02em;
  background: var(--ak-surface);
  color: var(--ak-ink);
}

.cut-1 { color: var(--ak-accent); transform: rotate(1.5deg); }
.cut-2 { outline: 2px solid var(--ak-ink); outline-offset: -2px; transform: rotate(-1.5deg); }
.cut-3 { background: var(--ak-choice-selected-bg); color: var(--ak-choice-selected-ink); transform: rotate(2deg); }
.cut-4 { transform: rotate(-2.5deg) translateY(1px); }

.last-tag {
  margin: 0 auto 6px;
  width: fit-content;
  max-width: 100%;
  padding: 2px 10px;
  background: var(--ak-choice-selected-bg);
  color: var(--ak-choice-selected-ink);
  font-size: clamp(14px, 2.1dvh, 17px);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  transform: rotate(-1.5deg);
}

.reason {
  margin: 6px 0 0;
  text-align: center;
  font-size: clamp(16px, 2.4dvh, 19px);
  font-weight: 700;
}

/* ---------- stage: answers, choice, result ---------- */

.stage {
  position: relative;
  min-height: 0;
  display: flex;
  container-type: size;
}

.stage > * { flex: 1; min-height: 0; }

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(6px, 1.6dvh, 14px) clamp(8px, 2.6vw, 16px);
  padding: 8px 4px 4px;
}

.answer {
  position: relative;
  min-height: 48px;
  border: 0;
  background: url("./art/answer-card.png") center / 100% 100% no-repeat;
  padding: 15% 9% 16%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: clamp(14px, min(4.2vw, 2.4dvh), 20px);
  line-height: 1.2;
  color: var(--ak-ink);
}

.answer:nth-child(1) { transform: rotate(-1.5deg); }
.answer:nth-child(2) { transform: rotate(1deg) translateY(4px); }
.answer:nth-child(3) { transform: rotate(1.8deg) translateX(2px); }
.answer:nth-child(4) { transform: rotate(-1deg) translateY(-2px); }

.answer:disabled { cursor: default; }

.mark {
  position: absolute;
  top: 2px;
  right: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px 2px 3px;
  background: var(--ak-surface);
  border: 2px solid var(--ak-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  transform: rotate(3deg);
}

.mark svg { width: 22px; height: 22px; flex: none; }

.answer.is-wrong { outline: 4px solid var(--ak-ink); outline-offset: -6px; }
.answer.is-right { outline: 4px dashed var(--ak-accent); outline-offset: -6px; }

/* the choice: two rubber stamps */

.decide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 3vw, 20px);
  align-items: center;
  padding: 4px;
}

.decide-note {
  grid-column: 1 / -1;
  justify-self: center;
  margin: 0;
  padding: 2px 12px;
  background: var(--ak-choice-selected-bg);
  color: var(--ak-choice-selected-ink);
  font-family: var(--ak-font-display);
  font-size: clamp(18px, 3dvh, 24px);
  letter-spacing: 0.03em;
  text-align: center;
  transform: rotate(-1.5deg);
}

.decide.has-note .stamp-face { width: clamp(44px, min(36cqw, calc(100cqh - 172px)), 150px); }

.stamp {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  min-height: 48px;
}

.stamp-face {
  width: clamp(44px, min(36cqw, calc(100cqh - 124px)), 150px);
  aspect-ratio: 192 / 193;
  background: url("./art/choice-stamps.png") 0 0 / 200% 100% no-repeat;
}

.stamp-keep .stamp-face { background-position: 100% 0; }
.stamp-bank { transform: rotate(-2deg); }
.stamp-keep { transform: rotate(1.5deg) translateY(6px); }

.stamp-word {
  font-family: var(--ak-font-display);
  font-size: clamp(22px, 3.6dvh, 32px);
  letter-spacing: 0.04em;
  padding: 0 10px;
  background: var(--ak-surface);
  border: 2px solid var(--ak-ink);
}

.stamp-bank .stamp-word { background: var(--ak-btn-fill); color: var(--ak-btn-ink); }

.stamp-sub {
  max-width: 22ch;
  font-size: clamp(14px, 2dvh, 16px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  background: var(--ak-surface);
  padding: 2px 6px;
}

/* ---------- note: what happened, the road not taken, the fact ---------- */

.note {
  margin: 0 6px;
  padding: 10px 14px;
  transform: rotate(0.8deg);
  min-height: clamp(60px, 10dvh, 96px);
}

.note p { margin: 0; }
.note-main { font-size: clamp(16px, 2.3dvh, 19px); font-weight: 700; }
.note-road { font-size: clamp(15px, 2.1dvh, 17px); font-weight: 700; color: var(--ak-accent); margin-top: 3px !important; }
.note-fact { font-size: clamp(14px, 2dvh, 16px); color: var(--ak-ink-muted); margin-top: 3px !important; }
.note-main:empty,
.note-road:empty,
.note-fact:empty { display: none; }

.guide {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--ak-surface);
  border: 3px solid var(--ak-ink);
}

.guide-arrow { width: 40px; height: 40px; flex: none; transition: transform 0.2s; }
.guide-text { font-size: 19px; font-weight: 700; line-height: 1.25; color: var(--ak-ink); }

.is-pointed {
  outline: 4px dashed var(--ak-accent) !important;
  outline-offset: 4px !important;
}

/* ---------- desk: the tin and the open pile ---------- */

.desk {
  --desk-h: clamp(84px, 15dvh, 140px);
  position: relative;
  height: var(--desk-h);
  display: flex;
  align-items: flex-end;
  gap: clamp(6px, 2.4vw, 16px);
  padding: 0 4px;
}

.tin {
  position: relative;
  height: 100%;
  aspect-ratio: 384 / 371;
  flex: none;
}

.tin img { width: 100%; height: 100%; display: block; }

.tin-tape {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 50%;
  height: 16%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--ak-font-display);
  color: var(--ak-ink);
  line-height: 1;
}

.tin-tape small { font-size: calc(var(--desk-h) * 0.1); }
.tin-tape b { font-weight: 400; font-size: calc(var(--desk-h) * 0.16); }

.pile {
  height: 100%;
  width: calc((var(--desk-h) - 22px) / var(--coin-ratio));
  min-width: 44px;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}

.coins {
  width: 100%;
  height: 0;
  background: url("./art/coin-pile.png") top center / 100% auto no-repeat;
  transform-origin: 50% 100%;
}

.pile-tag {
  font-family: var(--ak-font-display);
  font-size: 15px;
  white-space: nowrap;
  padding: 0 6px;
  background: var(--ak-surface);
  border: 2px solid var(--ak-ink);
  transform: rotate(-3deg);
}

.pile-tag b { font-weight: 400; color: var(--ak-accent); }

.desk-end {
  flex: 1;
  min-width: 0;
  align-self: center;
  display: flex;
  justify-content: center;
}

.stakes {
  margin: 0;
  padding: 8px 10px;
  font-size: clamp(14px, 2.1dvh, 17px);
  font-weight: 700;
  line-height: 1.3;
  transform: rotate(-1.2deg);
}

.stakes span { display: block; }
.stakes .risk { color: var(--ak-accent); }
.stakes:empty { display: none; }

.paper-btn {
  min-height: 52px;
  padding: 6px 18px;
  border: 2px solid var(--ak-ink);
  border-radius: 0;
  background: var(--ak-btn-fill);
  color: var(--ak-btn-ink);
  font-family: var(--ak-font-display);
  font-size: clamp(20px, 3dvh, 26px);
  letter-spacing: 0.04em;
  transform: rotate(-1.5deg);
  clip-path: polygon(0 4%, 9% 0, 30% 5%, 55% 0, 80% 4%, 100% 0, 98% 50%, 100% 100%, 70% 96%, 40% 100%, 12% 95%, 0 100%, 2% 50%);
}

.paper-btn:active { background: var(--ak-btn-active); }
.paper-btn.is-plain { background: var(--ak-surface); color: var(--ak-ink); transform: rotate(1.5deg); }

/* ---------- the ending: a result card taped onto the page ---------- */

.ending { display: flex; align-items: center; justify-content: center; padding: 10px 4px 4px; }

.result {
  width: 100%;
  max-width: 460px;
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(16px, 2.6dvh, 26px) clamp(14px, 4vw, 24px) clamp(12px, 2dvh, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1.2dvh, 10px);
  transform: rotate(-1.5deg);
}

.result .tape { background: var(--tape-red); width: 84px; height: 22px; }
.result .tape-l { top: -8px; left: -14px; transform: rotate(-32deg); }
.result .tape-r { top: -8px; right: -14px; transform: rotate(30deg); }

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-head { font-size: clamp(22px, min(6.4vw, 4dvh), 34px); text-align: left; }
.result-says { margin: 0; font-size: clamp(14px, 2.1dvh, 17px); font-weight: 700; line-height: 1.3; }

.result-tin {
  margin: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border: 2px solid var(--ak-ink);
  background: var(--ak-surface);
  transform: rotate(3deg);
  line-height: 1;
  font-family: var(--ak-font-display);
  font-size: clamp(14px, 2.2dvh, 18px);
}

.result-tin b {
  font-weight: 400;
  font-size: clamp(28px, 5dvh, 42px);
  color: var(--ak-accent);
  line-height: 1;
}

.result-stamps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(4px, 2vw, 10px);
}

.result-stamps li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.result-stamps li:nth-child(odd) { transform: rotate(-4deg); }
.result-stamps li:nth-child(even) { transform: rotate(3deg); }
.result-stamps svg { width: clamp(26px, 4.6dvh, 36px); height: clamp(26px, 4.6dvh, 36px); }

.result-trades {
  margin: 0;
  padding-left: 1.1em;
  font-size: clamp(13px, 1.9dvh, 15px);
  line-height: 1.3;
  color: var(--ak-ink-muted);
}

.result-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2px; }
.result-btns .paper-btn {
  flex: 1 1 0;
  white-space: nowrap;
  padding: 6px 10px;
  font-size: clamp(18px, 2.8dvh, 24px);
}

/* ---------- sideways: board on one side, controls and status on the other ---------- */

@media (orientation: landscape) {
  .layout {
    max-width: 1100px;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "top top"
      "board side";
    column-gap: clamp(12px, 2.4vw, 28px);
  }

  .board,
  .side {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-height: 0;
  }

  .board { grid-area: board; }
  .side { grid-area: side; }

  .top { min-height: 44px; }
  .play-logo { height: clamp(28px, 9dvh, 44px); }

  .stage { flex: 1; }
  .note { flex: 0 1 auto; min-height: 0; overflow: hidden; }
  .desk { margin-top: auto; }

  .ransom { font-size: clamp(18px, min(2.6vw, 6dvh), 30px); }
  .answer { font-size: clamp(14px, min(1.8vw, 4dvh), 20px); }
  .stamp-word { font-size: clamp(20px, 6dvh, 30px); }
  .stamp-sub, .stakes { font-size: clamp(13px, 3.6dvh, 16px); }
  .slot { height: clamp(36px, 10dvh, 50px); }
  .desk { --desk-h: clamp(84px, 30dvh, 150px); }
  .note-main { font-size: clamp(15px, 4.4dvh, 19px); }
  .note-road { font-size: clamp(14px, 4dvh, 17px); }
  .note-fact { font-size: clamp(13px, 3.8dvh, 16px); }
  .guide-text { font-size: 18px; }
  .guide-arrow { width: 34px; height: 34px; }

  .result-head { font-size: clamp(20px, 6.4dvh, 32px); }
  .result { gap: clamp(4px, 1.6dvh, 10px); }
  .result-says { font-size: clamp(13px, 3.8dvh, 17px); }
  .result-tin b { font-size: clamp(24px, 8dvh, 40px); }
  .result-stamps svg { width: clamp(24px, 7dvh, 34px); height: clamp(24px, 7dvh, 34px); }
  .result-trades { font-size: clamp(12px, 3.4dvh, 15px); }
  .result .paper-btn { min-height: 48px; font-size: clamp(18px, 5dvh, 24px); }

  .is-over .qpanel { display: none; }
}

/* desktop: the same page, centered at a comfortable size */
@media (min-width: 1000px) and (min-height: 700px) {
  .layout { max-width: 980px; height: min(100%, 720px); }
}

/* upright: the note gives its row to the result card */
/* short phones: the guide needs the room more than the fun fact does */
@media (max-height: 720px) {
  .note:has(.guide:not([hidden])) .note-fact { display: none; }
}

@media (orientation: portrait) {
  .is-over .note,
  .is-over .trail { display: none; }
}

/* ---------- motion: the choice settles, then the consequence ---------- */

@media (prefers-reduced-motion: no-preference) {
  .slap { animation: slap 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
  .answers .answer { animation: slap 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
  .answers .answer:nth-child(2) { animation-delay: 0.04s; }
  .answers .answer:nth-child(3) { animation-delay: 0.08s; }
  .answers .answer:nth-child(4) { animation-delay: 0.12s; }
  .tape-q { animation: tape-flat 0.4s ease-out 0.15s both; }

  .coins[data-n="1"] { --wob: 0.6deg; }
  .coins[data-n="2"] { --wob: 1.2deg; }
  .coins[data-n="3"] { --wob: 2deg; }
  .coins[data-n="4"] { --wob: 2.8deg; }
  .coins[data-n="5"] { --wob: 3.6deg; }
  .coins[data-n="6"] { --wob: 4.4deg; }
  .coins:not([data-n="0"]):not(.is-spilled) { animation: wobble 1.8s ease-in-out infinite; }
  .coins.is-spilled { animation: spill 0.6s cubic-bezier(0.5, 0, 0.7, 1.3) forwards; }

  .tin.is-fed { animation: tin-gulp 0.45s ease-out; }
  .tin.is-fed .tin-tape { animation: label-bounce 0.45s ease-out 0.1s; }

  .is-pointed { animation: ring-pulse 1.1s ease-in-out infinite; }

  .result { animation: card-slap 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
  .result .tape { animation: tape-flat 0.35s ease-out 0.35s both; }
  .result .tape-r { animation-delay: 0.5s; }
}

@media (prefers-reduced-motion: reduce) {
  .coins.is-spilled { visibility: hidden; }
}

@keyframes slap {
  from { opacity: 0; scale: 1.12; }
  to { opacity: 1; scale: 1; }
}

@keyframes card-slap {
  from { opacity: 0; transform: rotate(-7deg) scale(1.2); }
  70% { opacity: 1; transform: rotate(-1deg) scale(0.98); }
  to { opacity: 1; transform: rotate(-1.5deg) scale(1); }
}

@keyframes tape-flat {
  from { scale: 0 1; }
  to { scale: 1 1; }
}

@keyframes wobble {
  0%, 100% { rotate: calc(var(--wob) * -1); }
  50% { rotate: var(--wob); }
}

@keyframes spill {
  0% { rotate: 0deg; translate: 0 0; }
  40% { rotate: 25deg; translate: 6px 0; }
  100% { rotate: 88deg; translate: 10% 8%; opacity: 0.85; }
}

@keyframes tin-gulp {
  0% { transform: scale(1, 1); }
  35% { transform: scale(1.08, 0.92); }
  70% { transform: scale(0.97, 1.04); }
  100% { transform: scale(1, 1); }
}

@keyframes label-bounce {
  0%, 100% { translate: 0 0; }
  40% { translate: 0 -6px; }
}

@keyframes ring-pulse {
  0%, 100% { outline-offset: 4px; }
  50% { outline-offset: 9px; }
}

/* ---------- start screen: the whole controls card stays clear of Play ---------- */

html #activity-start.is-instructions .ak-badge { display: none; }
html #activity-start.is-instructions .ak-logo { max-height: 78px; }
html #activity-start.is-instructions .ak-tagline { margin-top: 6px; }
html #activity-start.is-instructions .ak-howto { margin-top: 10px; gap: 10px; }
html #activity-start.is-instructions .ak-section { padding: 10px 14px 12px; text-align: left; }
html #activity-start.is-instructions .ak-label { margin: 0 0 2px; }
html #activity-start.is-instructions .ak-body { font-size: 16px; line-height: 1.35; }
html #activity-start.is-instructions .ak-controls li + li { margin-top: 2px; }
html #activity-start.is-instructions .ak-first { margin-top: 10px; padding-top: 8px; padding-bottom: 8px; }
html #activity-start.is-instructions { padding-top: 14px; }
html #activity-start.is-instructions .ak-go { margin-top: 10px; }
/* a paper band behind the sticky Play, so the page scrolls under a footer, not under a floating button */
@media (orientation: portrait) {
  html #activity-start.is-instructions .ak-go {
    box-shadow: var(--ak-shadow), 0 0 0 12px var(--ak-bg), 0 22px 0 12px var(--ak-bg);
  }
}
html #activity-start.is-instructions .ak-section:nth-child(odd) { rotate: -1deg; }
html #activity-start.is-instructions .ak-section:nth-child(even) { rotate: 1deg; }

/* sideways: title, first move and Play on the left, the three cards stacked on the right */
@media (orientation: landscape) and (max-height: 500px) {
  html body #activity-start#activity-start.is-instructions .ak-sheet {
    display: grid;
    width: min(100%, 980px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "head howto" "first howto" "go howto";
    column-gap: 20px;
    align-items: start;
  }
  html body #activity-start#activity-start.is-instructions .ak-head { grid-area: head; }
  html body #activity-start#activity-start.is-instructions .ak-first { grid-area: first; }
  html body #activity-start#activity-start.is-instructions .ak-go { grid-area: go; position: static; align-self: start; justify-self: center; }
  html body #activity-start#activity-start.is-instructions .ak-howto {
    grid-area: howto;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  html body #activity-start#activity-start.is-instructions .ak-section { max-width: none; padding: 6px 12px 8px; }
  html body #activity-start#activity-start.is-instructions .ak-body { font-size: 15px; line-height: 1.3; }
  html body #activity-start#activity-start.is-instructions .ak-tagline { font-size: 13px; }
  html body #activity-start#activity-start.is-instructions .ak-logo { max-height: 56px; }
  html body #activity-start#activity-start.is-instructions .ak-first { margin-top: 8px; }
  html body #activity-start#activity-start.is-instructions .ak-go { margin-top: 10px; }
}
