/* Last Exhibit website
   Buttons and boxes use the game's own UI sprites (assets/img/ui), scaled
   3x with border-image so they stay pixel-sharp at any width.
   Colours are sampled from those sprites. */

@font-face {
  font-family: "Pixuf";
  src: url("../fonts/Pixuf.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #120d0a;
  --bg-2: #1b1410;
  --wood: #4e2e1d;
  --box: #975f36;
  --orange: #c87f49;
  --orange-hi: #eb9758;
  --outline: #190c0c;
  --cream: #f1e3c8;
  --dim: #b39c80;

  --pixel: "Pixuf", "Courier New", monospace;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);

  /* the era section recolours this */
  --era: #c87f49;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--orange-hi); }
a:hover { color: var(--cream); }
:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.75rem;
}
h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); color: var(--orange-hi); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }
.intro { max-width: 60ch; color: var(--dim); margin-bottom: 1.75rem; }
.small { font-size: 0.9rem; color: var(--dim); }
code, kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88em; }

.wrap { width: min(1150px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { width: min(760px, 100%); }
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 6px solid var(--bg-2); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 200; }
.skip-link:focus { top: 1rem; background: var(--cream); color: var(--bg); padding: 0.5rem 0.8rem; }

/* ---- The game's pieces ----------------------------------------------- */

/* Orange button: Buttons_2small/button_02.png */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0 0.1rem;
  border: 15px solid transparent;
  border-image: url("../img/ui/button.png") 5 fill / 15px stretch;
  image-rendering: pixelated;
  background: none;
  color: var(--outline);
  font-family: var(--pixel);
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-image-source: url("../img/ui/button-hover.png"); color: var(--outline); }
.btn:active { transform: translateY(2px); }
.btn--small { min-height: 2.3rem; font-size: 0.85rem; border-width: 12px; border-image-width: 12px; }
.btn[aria-pressed="true"], .btn[aria-selected="true"] { filter: brightness(1.2) saturate(1.1); box-shadow: inset 0 -3px 0 var(--outline); }
.btn[aria-pressed="false"].chip, .tabs .btn[aria-selected="false"] { filter: brightness(0.75); }
.btn svg { width: 0.9em; height: 0.9em; }

/* Brown box: dialogue/dialoguefenster.png */
.box {
  border: 12px solid transparent;
  border-image: url("../img/ui/box.png") 4 fill / 12px stretch;
  image-rendering: pixelated;
}
.box.pad { padding: 0.6rem 0.7rem; }

/* ---- Header ------------------------------------------------------------ */

.hud {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem var(--gutter);
  transition: background 0.2s;
}
.hud.is-scrolled { background: var(--bg); border-bottom: 4px solid var(--outline); }
.wordmark {
  font-family: var(--pixel);
  font-size: 1.15rem;
  color: var(--cream);
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 2px 2px 0 var(--outline);
}
.hud__right { display: flex; align-items: center; gap: 0.35rem; }
.hud__play { display: none; }
.hud.is-past-stage .hud__play { display: inline-flex; }
.hud .btn { min-height: 2.3rem; font-size: 0.85rem; border-width: 12px; border-image-width: 12px; }
.lang { display: flex; gap: 0.2rem; }

.meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.meter i { width: 3px; height: 4px; background: currentColor; }
.toggle[aria-pressed="true"] .meter i,
.now-playing .meter i { animation: meter 0.8s steps(3) infinite alternate; }
.meter i:nth-child(2) { animation-delay: -0.4s !important; }
.meter i:nth-child(3) { animation-delay: -0.2s !important; }
@keyframes meter { from { height: 3px; } to { height: 11px; } }

.now-playing {
  position: fixed;
  left: var(--gutter);
  bottom: 0.75rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 2 * var(--gutter));
  font-size: 0.85rem;
  color: var(--cream);
  visibility: hidden;
}
.now-playing.is-on { visibility: visible; }
.now-playing b { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 480px) {
  .hud .wordmark { font-size: 0.95rem; }
  #sound-toggle span:not(.meter) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---- Download stage ------------------------------------------------------ */

.stage {
  --floor: 30px;
  --ds: 2;
  --ph: clamp(96px, 15svh, 140px);
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto auto;
  padding-top: 4rem;
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 900px) {
  .stage { --ds: 3; --ph: clamp(120px, 19svh, 170px); }
}
.stage__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/art/hero-museum.png") 62% 40% / cover no-repeat;
  image-rendering: pixelated;
  filter: brightness(0.55);
}
.stage__head {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: 1rem var(--gutter);
  text-align: center;
}
.stage__title {
  margin: 0;
  font-size: clamp(2.6rem, min(1rem + 8vw, 14svh), 7.5rem);
  line-height: 0.9;
  color: var(--cream);
  text-shadow: 4px 4px 0 var(--outline), -2px -2px 0 var(--outline), 2px -2px 0 var(--outline), -2px 2px 0 var(--outline);
}
.stage__line { max-width: 34rem; margin: 0; padding: 0.25rem 0.5rem; font-size: 1.05rem; line-height: 1.45; }

.stage__floor { position: relative; padding: 0 var(--gutter); }
.stage__floor::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--floor);
  background: repeating-linear-gradient(90deg, var(--wood) 0 94px, var(--outline) 94px 98px);
  border-top: 4px solid var(--outline);
}

.plinths {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.4rem, 3.5vw, 3rem);
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: var(--floor);
}
.plinth {
  position: relative;
  flex: 0 1 180px;
  min-width: 0;
  height: var(--ph);
  display: grid;
  grid-template-rows: 16px 1fr;
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plinth:hover { color: var(--cream); }
.plinth:focus-visible { outline-offset: 4px; }
.plinth__top {
  background: var(--orange);
  border: 4px solid var(--outline);
  box-shadow: inset 0 3px 0 var(--orange-hi);
}
.plinth:hover .plinth__top,
.plinth.is-detected .plinth__top { background: var(--orange-hi); }
.plinth__body {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.3rem;
  margin: 0 8%;
  padding: 0.4rem 0.2rem;
  background: var(--box);
  border: 4px solid var(--outline);
  border-top: 0;
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.18), inset -6px 0 0 rgba(0, 0, 0, 0.18);
  text-align: center;
}
.plinth svg { width: clamp(20px, 3vw, 30px); height: clamp(20px, 3vw, 30px); color: var(--cream); }
.plinth__name { font-family: var(--pixel); font-size: clamp(0.8rem, 0.6rem + 0.8vw, 1.15rem); line-height: 1; }
.plinth__meta { font-size: clamp(0.62rem, 0.55rem + 0.2vw, 0.75rem); color: #f6dcb8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.plinth.is-pressed { transform: translateY(5px); }
.plinth[aria-disabled="true"] .plinth__body { background: #6d4428; }
.plinth[aria-disabled="true"] .plinth__top { background: #8a5a36; box-shadow: none; }
.plinth[aria-disabled="true"] svg,
.plinth[aria-disabled="true"] .plinth__name { opacity: 0.6; }

.puff {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 8px;
  background: var(--cream);
  pointer-events: none;
  animation: puff 0.45s steps(4) forwards;
}
@keyframes puff { to { transform: translate(var(--px), -14px); opacity: 0; } }

.david {
  position: absolute;
  z-index: 3;
  left: 0;
  bottom: var(--floor);
  width: calc(32px * var(--ds));
  height: calc(64px * var(--ds));
  margin-left: calc(-16px * var(--ds));
  background: url("../img/sprites/david.png") no-repeat;
  background-size: calc(960px * var(--ds)) calc(384px * var(--ds));
  image-rendering: pixelated;
  pointer-events: none;
}
.david__shadow {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: calc(var(--floor) - 4px);
  width: calc(20px * var(--ds));
  height: 8px;
  margin-left: calc(-10px * var(--ds));
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Speech bubble in the style of the game's dialogue box */
.say {
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: 0;
  padding: 0.1rem 0.3rem;
  border: 9px solid transparent;
  border-image: url("../img/ui/box.png") 4 fill / 9px stretch;
  image-rendering: pixelated;
  color: var(--cream);
  font-family: var(--pixel);
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.9rem);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  visibility: hidden;
}
.say.is-on { visibility: visible; }

.stage__info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1.25rem;
  margin: 0;
  padding: 0.9rem var(--gutter) 1.2rem;
  background: var(--outline);
  font-size: 0.85rem;
  color: var(--dim);
}
.stage__info code { color: var(--cream); }
.linkish {
  border: 0;
  padding: 0;
  background: none;
  color: var(--orange-hi);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

/* ---- Phone ------------------------------------------------------------- */

.phone-row { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .phone-row { grid-template-columns: 1.3fr 1fr; } }

.phone {
  justify-self: center;
  width: min(290px, 82vw);
  aspect-ratio: 9 / 17;
  padding: 12px;
  background: #2b2d33;
  border: 4px solid var(--outline);
  border-radius: 28px;
}
.phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: #1a2350;
  display: grid;
  grid-template-rows: auto 1fr;
}
.phone__status { display: flex; justify-content: space-between; padding: 0.5rem 0.9rem 0; font-size: 0.72rem; color: #c9cfe6; }
.phone__apps { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 1rem 0.3rem; padding: 1rem 0.7rem; }
.app { display: grid; justify-items: center; gap: 0.25rem; border: 0; background: none; padding: 0; cursor: pointer; font-size: 0.66rem; color: #dfe3f2; }
.app img { width: 52px; height: 52px; image-rendering: pixelated; }
.app:hover img { transform: translateY(-2px); }

.phone__view { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; background: #0f1430; visibility: hidden; }
.phone__view.is-open { visibility: visible; }
.phone__bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem; border-bottom: 2px solid #26305c; font-size: 0.8rem; }
.phone__back { border: 0; background: #26305c; color: #dfe3f2; font-size: 0.75rem; padding: 0.2rem 0.5rem; cursor: pointer; }
.phone__content { padding: 0.7rem; overflow: auto; font-size: 0.8rem; line-height: 1.45; color: #dfe3f2; }
.phone__content p { margin: 0 0 0.5rem; }
.bubble { max-width: 88%; padding: 0.4rem 0.6rem; margin: 0 0 0.4rem; background: #26305c; border-radius: 8px; }
.flappy { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: pointer; touch-action: manipulation; }

.ledger__goods { list-style: none; margin: 0; padding: 0; }
.good { display: grid; grid-template-columns: 44px 1fr auto; gap: 0.8rem; align-items: center; padding: 0.5rem 0; border-bottom: 2px solid var(--bg-2); }
.good img { width: 44px; height: 44px; padding: 5px; object-fit: contain; image-rendering: pixelated; background: var(--wood); border: 2px solid var(--outline); }
.good__name { display: block; font-weight: 600; }
.good__desc { display: block; font-size: 0.9rem; color: var(--dim); }
.good__price { font-family: var(--pixel); color: var(--orange-hi); white-space: nowrap; }

/* ---- Help -------------------------------------------------------------- */

.help__grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 760px) { .help__grid { grid-template-columns: 1.5fr 1fr; } }
.help__grid > :last-child { grid-column: 1 / -1; }
.faq dt { margin-top: 1rem; }
@media (min-width: 760px) { .faq { columns: 2; column-gap: 2rem; } .faq div { break-inside: avoid; } }
.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.9rem; }
.steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.7rem; }
.steps code { background: var(--wood); padding: 0 0.25rem; }
.cmd { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.4rem; padding: 0.4rem 0.6rem; background: var(--outline); overflow-x: auto; }
.cmd code { white-space: nowrap; }

.keys { margin: 0 0 0.8rem; }
.keys div { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.3rem 0; border-bottom: 2px solid rgba(0, 0, 0, 0.2); }
.keys dd { margin: 0; }
kbd {
  display: inline-block;
  min-width: 1.7rem;
  padding: 0.05rem 0.35rem;
  background: var(--cream);
  color: var(--outline);
  border: 2px solid var(--outline);
  border-bottom-width: 4px;
  text-align: center;
  font-size: 0.78rem;
}

.faq { margin: 0; }
.faq dt { font-weight: 600; margin-top: 0.7rem; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 0; color: #f6dcb8; }
.faq a { color: var(--cream); }
.box .small { color: #f6dcb8; }

/* ---- Credits ----------------------------------------------------------- */

.credits { padding: clamp(3.5rem, 8vw, 5rem) 0 3rem; border-top: 6px solid var(--bg-2); background: #0c0907; }
.team { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.5rem; }
.team b { font-family: var(--pixel); font-weight: 400; font-size: 1.15rem; margin-right: 0.5rem; }
.team span { color: var(--dim); }
.credits__links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.5rem; }

/* ---- Impressum und Datenschutz ----------------------------------------- */

.legal-links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 2rem; font-size: 0.9rem; }
.legal-links a { color: var(--dim); }
.legal-links a:hover { color: var(--cream); }

.legal { padding: 5.5rem 0 4rem; }
.legal h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); color: var(--orange-hi); margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.25rem; color: var(--cream); margin: 2rem 0 0.5rem; }
.legal p, .legal li { max-width: 68ch; }
.legal ul { padding-left: 1.2rem; }
.legal address { font-style: normal; margin-bottom: 1rem; }
.legal .updated { color: var(--dim); font-size: 0.9rem; }

/* ---- play.html --------------------------------------------------------- */

.play-shell { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; }
.play-shell .hud { position: static; }
.play-stage { display: grid; place-items: center; gap: 1rem; padding: 1rem var(--gutter) 3rem; }
.play-frame { position: relative; width: min(100%, calc((100svh - 11rem) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; border: 4px solid var(--outline); }
.play-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play-frame:fullscreen { width: 100vw; height: 100vh; border: 0; }
.play-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.play-note { font-size: 0.9rem; color: var(--dim); text-align: center; margin: 0; }
.play-empty { max-width: 32rem; text-align: center; display: grid; gap: 1rem; justify-items: center; }
.play-empty h1 { font-size: clamp(1.8rem, 1.3rem + 2.5vw, 2.8rem); margin: 0; }
.portal { position: relative; width: 140px; aspect-ratio: 1; }
.portal__sprite { position: absolute; inset: 0; background: url("../img/machine/portal.png") 100% 0 / 600% 100% no-repeat; image-rendering: pixelated; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
