Back to Browser Side Quest
SOURCE / PINNED RELEASE

Made of little things.

Browser Side Quest

Release
b9d42f5768e4…
Author-recorded commit
c267690145fa…
License
LICENSE
Author’s source reference
nostr://npub1ye5ptcxfyyxl5vjvdjar2ua3f0hynkjzpx552mu5snj3qmx5pzjscpknpr/wss%3A%2F%2Fgit.shakespeare.diy%2F/browser-side-quest

Archive hash verified: 6d4b90b8a5f328f7…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

src/styles.css
/*
 * Browser Side Quest — visual direction: keep the 2012 original's art (parchment,
 * dark wood HUD, GraphicPixel type, gold accents) and scale it in whole or
 * fractional "art pixels" (--u) so it fits any frame. App-owned colors only.
 * All UI art comes from the 1x sheets; positions below are 1x coordinates.
 */

@font-face {
  font-family: 'GraphicPixel';
  src: url('./assets/fonts/graphicpixel-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'AdvoCut';
  src: url('./assets/fonts/advocut-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #111;
  --wood: url('./assets/img/wood.png');
  --sheet: url('./assets/img/spritesheet.png');
  --barsheet: url('./assets/img/barsheet.png');
  --achsheet: url('./assets/img/achievements.png');
  --gold: #fcda5c;
  --gold-2: #fce045;
  --ink: #373737;
  --text: #eee;
  --red: #d83939;
  --u: 2; /* UI art scale (dialogs) */
  --h: 2; /* HUD art scale */
  --napplet-text-selection: none;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'GraphicPixel', ui-monospace, monospace;
  -webkit-text-size-adjust: 100%;
  user-select: var(--napplet-text-selection);
  -webkit-user-select: var(--napplet-text-selection);
}

input {
  user-select: text;
  -webkit-user-select: text;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

canvas:focus {
  outline: none;
}

.sheet {
  image-rendering: pixelated;
}

.app {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.9) 125%),
    var(--wood) repeat;
  background-size: auto, calc(128px * var(--u));
  image-rendering: pixelated;
}

/* ---------- Stage & canvases ---------- */

#stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* The map and the HUD bar share one border, like the original #canvasborder. */
#frame {
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 2px #1e1a14, 0 0 0 calc(2px + 2px * var(--h)) #6b5a3c, 0 6px 24px rgba(0, 0, 0, 0.6);
}

#viewport {
  position: relative;
  line-height: 0;
  background: #000 url('./assets/img/loading.png') no-repeat center;
}

#viewport canvas {
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: pixelated;
}

#background {
  position: relative !important;
}

.game.started #foreground {
  cursor: none;
}

.touch #foreground {
  cursor: default;
}

#foreground {
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  line-height: 1;
}

.bubble {
  position: absolute;
  display: inline-block;
  max-width: 60%;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(45, 45, 45, 0.8);
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  font-size: max(11px, calc(7px * var(--h)));
}

/* Original proportions: a 14px line in a 35px-tall bubble. */
.bubble p {
  margin: 0;
  line-height: 2.5;
}

/* The speech tail hangs just below the bubble; Game.assignBubbleTo puts its tip
   over the speaker's head. */
.thingy {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 11px;
  height: 10px;
  transform: translateX(-50%);
}

/* ---------- Achievement toast ---------- */

#achievement-notification {
  position: absolute;
  left: 50%;
  bottom: calc(10px * var(--h));
  width: calc(216px * var(--h));
  max-width: 96%;
  height: 0;
  transform: translateX(-50%);
  background: var(--achsheet) 0 calc(-248px * var(--h)) / calc(416px * var(--h)) auto;
  image-rendering: pixelated;
  text-align: center;
  pointer-events: none;
  transition: height 0.3s ease;
  overflow: visible;
  z-index: 8;
  line-height: 1;
}

#achievement-notification.active {
  height: calc(34px * var(--h));
}

#achievement-notification .coin {
  position: absolute;
  top: calc(-20px * var(--h));
  left: 50%;
  margin-left: calc(-12px * var(--h));
  opacity: 0;
  transition: opacity 0.2s linear;
}

#achievement-notification.active .coin {
  opacity: 1;
}

#achievement-notification .achievement-info {
  overflow: hidden;
  height: 100%;
}

#achievement-notification .title,
#achievement-notification .name {
  opacity: 0;
  transition: opacity 0.3s linear;
}

#achievement-notification.active .title,
#achievement-notification.active .name {
  opacity: 1;
}

#achievement-notification .title {
  color: var(--gold-2);
  font-size: calc(7px * var(--h));
  margin: calc(9px * var(--h)) 0 calc(3px * var(--h));
}

#achievement-notification .name {
  color: var(--text);
  font-size: calc(10px * var(--h));
}

.coin {
  width: calc(24px * var(--cu, var(--h)));
  height: calc(26px * var(--cu, var(--h)));
  background: var(--achsheet) no-repeat;
  background-size: calc(416px * var(--cu, var(--h))) auto;
  background-position: calc(var(--cx) * -1px * var(--cu, var(--h))) calc(var(--cy) * -1px * var(--cu, var(--h)));
  image-rendering: pixelated;
}

/* ---------- HUD bar (barsheet) ---------- */

#bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: calc(2px * var(--h));
  height: calc(17px * var(--h));
  padding: 0 calc(3px * var(--h));
  background: linear-gradient(#4a4a4a, #383838 30%, #2f2f2f);
  border-top: 1px solid #6a6a6a;
  box-shadow: inset 0 -1px 0 #1c1c1c;
  line-height: 1;
  white-space: nowrap;
}

.intro #bar {
  visibility: hidden;
}

#healthbar {
  position: relative;
  flex: none;
  width: calc(102px * var(--h));
  height: calc(13px * var(--h));
  background: var(--barsheet) 0 calc(-17px * var(--h)) / calc(480px * var(--h)) auto;
  image-rendering: pixelated;
}

#hitpoints {
  position: absolute;
  left: calc(11px * var(--h));
  top: calc(1px * var(--h));
  height: calc(11px * var(--h));
  width: 0;
  max-width: calc(90px * var(--h));
  background: #d83939;
  transition: width 0.5s ease;
  z-index: -1;
}

#hitpoints.white {
  animation: flash 0.5s linear 1;
}

#hitpoints.invincible {
  animation: invincible 0.3s steps(3, end) alternate infinite;
}

.equip {
  flex: none;
  width: calc(16px * var(--h));
  height: calc(16px * var(--h));
  background-repeat: no-repeat;
  background-size: calc(96px * var(--h)) auto;
  background-position: calc(-32px * var(--h)) 0;
  image-rendering: pixelated;
}

#notifications {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: calc(15px * var(--h));
  overflow: hidden;
  text-align: center;
  font-size: max(11px, calc(8px * var(--h)));
  color: var(--text);
}

#notifications div {
  position: absolute;
  top: 0;
  width: 100%;
}

#notifications div.top {
  top: calc(-15px * var(--h));
  transition: top 0.5s ease;
}

#notifications div.top #message1 {
  opacity: 0;
  transition: opacity 0.2s linear;
}

#notifications span {
  display: block;
  height: calc(15px * var(--h));
  line-height: calc(15px * var(--h));
  overflow: hidden;
  text-overflow: ellipsis;
}

#playercount {
  flex: none;
  color: #e3e3e3;
  font-size: max(11px, calc(8px * var(--h)));
  padding: 0 calc(3px * var(--h));
  height: 100%;
}

#playercount:hover {
  color: var(--gold-2);
}

#barbuttons {
  display: flex;
  flex: none;
  gap: calc(1px * var(--h));
}

.barbutton {
  position: relative;
  width: calc(14px * var(--h));
  height: calc(15px * var(--h));
}

.barbutton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--barsheet) no-repeat;
  background-size: calc(480px * var(--h)) auto;
  background-position: calc(var(--bx) * -1px * var(--h)) calc(-17px * var(--h));
  image-rendering: pixelated;
}

/* Comfortable touch targets without changing the art size. */
.touch .barbutton::after,
.touch #playercount::after {
  content: '';
  position: absolute;
  inset: -10px -4px;
}

.touch #playercount {
  position: relative;
}

#chatbutton { --bx: 102; }
#chatbutton:hover { --bx: 116; }
#chatbutton.active { --bx: 130; }
#achievementsbutton { --bx: 144; }
#achievementsbutton:hover { --bx: 158; }
#achievementsbutton.active { --bx: 172; }
#achievementsbutton.blink { --bx: 288; }
#helpbutton { --bx: 186; }
#helpbutton:hover { --bx: 200; }
#helpbutton.active { --bx: 214; }
#mutebutton { --bx: 228; }
#mutebutton:hover { --bx: 242; }
#mutebutton.active { --bx: 256; }

/* ---------- Chat ---------- */

#chatbox {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 0);
  width: min(calc(394px * var(--h)), calc(100% - 16px));
  height: calc(16px * var(--h));
  background: var(--barsheet) 0 calc(-32px * var(--h)) / calc(480px * var(--h)) auto;
  image-rendering: pixelated;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: bottom 0.2s ease, opacity 0.2s linear;
}

#chatbox.active {
  bottom: calc(17px * var(--h) + 4px);
  opacity: 1;
  pointer-events: auto;
}

#chatinput {
  width: 94%;
  height: 100%;
  margin-left: 3%;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: max(16px, calc(10px * var(--h)));
}

/* ---------- Touch controls ---------- */

#touchpad {
  display: none;
}

.touch.game:not(.overlay) #touchpad {
  display: block;
}

#touchpad .pad {
  position: absolute;
  z-index: 6;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(30, 26, 20, 0.45);
  border: 2px solid rgba(252, 218, 92, 0.35);
  color: var(--gold);
  font-size: 20px;
  touch-action: none;
}

#touchpad .pad::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

#touchpad .up { left: 60px; bottom: calc(17px * var(--h) + 116px); }
#touchpad .down { left: 60px; bottom: calc(17px * var(--h) + 12px); }
#touchpad .left { left: 8px; bottom: calc(17px * var(--h) + 64px); }
#touchpad .right { left: 112px; bottom: calc(17px * var(--h) + 64px); }
#touchpad .action { right: 16px; bottom: calc(17px * var(--h) + 40px); width: 64px; height: 64px; border-radius: 50%; }
#touchpad .up::before { border-bottom-color: var(--gold); border-top-width: 0; }
#touchpad .down::before { border-top-color: var(--gold); border-bottom-width: 0; }
#touchpad .left::before { border-right-color: var(--gold); border-left-width: 0; }
#touchpad .right::before { border-left-color: var(--gold); border-right-width: 0; }
#touchpad .action::before { display: none; }
#touchpad .pad.held { background: rgba(252, 218, 92, 0.3); }

.touchpad-off #touchpad {
  display: none !important;
}

/* ---------- Population / players ---------- */

#population {
  position: absolute;
  right: calc(4px * var(--h));
  bottom: calc(17px * var(--h) + 6px);
  z-index: 12;
  min-width: calc(131px * var(--h));
  max-width: calc(100% - 16px);
  max-height: 60%;
  overflow: auto;
  padding: calc(5px * var(--h)) calc(6px * var(--h));
  background: rgba(40, 40, 40, 0.94);
  border: 1px solid #6a6a6a;
  border-radius: 4px;
  color: #fff;
  text-align: center;
  font-size: max(11px, calc(7px * var(--h)));
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s linear;
}

#population.visible {
  opacity: 1;
  pointer-events: auto;
}

#population .n,
#world-name {
  color: var(--gold-2);
}

#player-list {
  list-style: none;
  margin: 4px 0;
  padding: 0;
  text-align: left;
}

#player-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

#player-list img,
#player-list .avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  background: #555;
  flex: none;
}

#player-list .who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#player-list .npub {
  color: #aaa;
  font-size: 0.85em;
}

#player-list .me .who {
  color: var(--gold);
}

.world-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.link {
  color: #c6c0a3;
  text-decoration: underline dotted;
}

.link:hover {
  color: var(--gold);
}

.link.big {
  font-size: 1.3em;
  padding: 8px 16px;
}

/* ---------- Intro, logo & parchment ---------- */

#intro {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(10px * var(--u));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s linear, visibility 0s linear 0.4s;
}

.intro #intro,
.overlay #intro {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.4s linear;
}

.overlay #intro {
  background: rgba(0, 0, 0, 0.45);
}

.game #logo {
  display: none;
}

#logo,
#logosparks {
  width: calc(229px * var(--u));
  height: calc(42px * var(--u));
  background: var(--sheet) no-repeat 0 0 / calc(422px * var(--u)) auto;
  image-rendering: pixelated;
  flex: none;
}

#logo {
  position: relative;
}

#logosparks {
  position: absolute;
  inset: 0;
  animation: logosparks 0.8s steps(6, end) infinite;
}

/* "Browser Side Quest": the original logo art is kept, with "Side" written in
   above the gap between "Browser" and "Quest" like a proofreader's insertion,
   in the logo's own palette. The gap sits at x = 132 of the 229px art. */
#logoside {
  position: absolute;
  left: calc(132px * var(--u));
  top: calc(-18px * var(--u));
  transform: translateX(-50%) rotate(-7deg);
  font-family: 'GraphicPixel', monospace;
  font-size: calc(17px * var(--u));
  line-height: 1;
  color: #f4cf38;
  white-space: nowrap;
  --o: max(1px, calc(1px * var(--u)));
  text-shadow:
    0 var(--o) 0 #b7991d,
    var(--o) 0 0 #070402, calc(var(--o) * -1) 0 0 #070402,
    0 calc(var(--o) * 2) 0 #070402, 0 calc(var(--o) * -1) 0 #070402,
    var(--o) var(--o) 0 #070402, calc(var(--o) * -1) var(--o) 0 #070402,
    var(--o) calc(var(--o) * 2) 0 #070402, calc(var(--o) * -1) calc(var(--o) * 2) 0 #070402;
  pointer-events: none;
}

#logocaret {
  position: absolute;
  left: calc(132px * var(--u));
  top: calc(26px * var(--u));
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: calc(4px * var(--u)) solid transparent;
  border-right: calc(4px * var(--u)) solid transparent;
  border-bottom: calc(8px * var(--u)) solid #f4cf38;
  filter: drop-shadow(0 0 max(1px, calc(0.7px * var(--u))) #070402) drop-shadow(0 0 max(1px, calc(0.7px * var(--u))) #070402);
  pointer-events: none;
}

#parchment {
  position: relative;
  flex: none;
  width: calc(422px * var(--u));
  height: calc(182px * var(--u));
  font-size: calc(10px * var(--u));
  color: var(--ink);
  text-align: center;
}

.parchment-left,
.parchment-right,
.parchment-middle {
  position: absolute;
  top: 0;
  height: 100%;
  background-image: var(--sheet);
  background-repeat: no-repeat;
  background-size: calc(422px * var(--u)) auto;
  image-rendering: pixelated;
}

.parchment-left {
  left: 0;
  width: calc(38px * var(--u));
  background-position: 0 calc(-294px * var(--u));
}

.parchment-right {
  right: 0;
  width: calc(38px * var(--u));
  background-position: calc(-384px * var(--u)) calc(-294px * var(--u));
}

.parchment-middle {
  left: calc(38px * var(--u));
  width: calc(346px * var(--u));
  background-position: calc(-38px * var(--u)) calc(-294px * var(--u));
}

#parchment article {
  position: absolute;
  inset: 0;
  padding: calc(14px * var(--u)) calc(8px * var(--u)) 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s linear;
}

#parchment.createcharacter #createcharacter,
#parchment.loadcharacter #loadcharacter,
#parchment.confirmation #confirmation,
#parchment.about #about,
#parchment.death #death,
#parchment.disconnected #disconnected {
  opacity: 1;
  pointer-events: auto;
}

#parchment h2 {
  margin: 0;
  font-weight: normal;
  font-size: calc(10px * var(--u));
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.left-ornament,
.right-ornament {
  display: inline-block;
  width: calc(31px * var(--u));
  height: calc(12px * var(--u));
  margin: 0 calc(7px * var(--u));
  background: var(--sheet) no-repeat;
  background-size: calc(422px * var(--u)) auto;
  image-rendering: pixelated;
  flex: none;
}

.left-ornament {
  background-position: calc(-354px * var(--u)) 0;
}

.right-ornament {
  background-position: calc(-385px * var(--u)) 0;
}

#character {
  position: relative;
  width: calc(12px * var(--u));
  height: calc(21px * var(--u));
  margin: calc(12px * var(--u)) auto 0;
  background: var(--sheet) no-repeat calc(-354px * var(--u)) calc(-12px * var(--u)) / calc(422px * var(--u)) auto;
  image-rendering: pixelated;
}

#character div {
  position: absolute;
  inset: 0;
  background: var(--sheet) no-repeat calc(-366px * var(--u)) calc(-12px * var(--u)) / calc(422px * var(--u)) auto;
  image-rendering: pixelated;
  transition: opacity 0.4s linear;
}

#character.disabled div {
  opacity: 0;
}

#nameinput {
  width: 60%;
  margin-top: calc(8px * var(--u));
  padding: 0 calc(5px * var(--u));
  height: calc(20px * var(--u));
  border: 2px dashed #b2af9b;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  color: #fff;
  text-align: center;
  font: inherit;
  font-size: max(16px, calc(10px * var(--u)));
  animation: glow 0.5s linear infinite alternate;
}

#nameinput:focus {
  animation: none;
  color: #fff;
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.3);
}

#nameinput::placeholder {
  color: #fff;
  opacity: 0.85;
}

.stroke {
  text-shadow:
    2px 2px 0 var(--ink), 2px -2px 0 var(--ink), 0 2px 0 var(--ink), 2px 0 0 var(--ink),
    -2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 0 -2px 0 var(--ink), -2px 0 0 var(--ink);
}

.button {
  position: relative;
  display: block;
  width: calc(125px * var(--u));
  height: calc(51px * var(--u));
  margin: calc(6px * var(--u)) auto 0;
  background: var(--sheet) no-repeat calc(-229px * var(--u)) calc(-102px * var(--u)) / calc(422px * var(--u)) auto;
  image-rendering: pixelated;
}

.play div {
  position: absolute;
  inset: 0;
  background: var(--sheet) no-repeat calc(-229px * var(--u)) 0 / calc(422px * var(--u)) auto;
  image-rendering: pixelated;
  transition: opacity 0.4s linear;
}

.play:active div {
  background-position: calc(-229px * var(--u)) calc(-153px * var(--u));
}

.play.disabled div {
  opacity: 0;
}

.play.disabled {
  cursor: default;
}

.button.delete {
  background-position: calc(-229px * var(--u)) calc(-51px * var(--u));
}

.button.delete:active {
  background-position: 0 calc(-726px * var(--u));
}

#respawn {
  background-position: 0 calc(-476px * var(--u));
  margin-top: calc(14px * var(--u));
}

#respawn:active {
  background-position: calc(-125px * var(--u)) calc(-476px * var(--u));
}

.hint {
  margin: calc(4px * var(--u)) 0 0;
  font-size: calc(7px * var(--u));
  color: #6d6a58;
  min-height: 1em;
}

#playerimage {
  width: calc(32px * var(--u));
  height: calc(32px * var(--u));
  margin-top: calc(4px * var(--u));
  image-rendering: pixelated;
}

#playername {
  color: #fff;
  margin-top: calc(2px * var(--u));
}

#create-new,
#cancel {
  margin-top: calc(4px * var(--u));
}

#create-new .link span {
  color: #b2af9b;
}

#create-new .link,
#cancel .link {
  color: var(--ink);
  text-decoration: none;
}

#create-new .link:hover,
#cancel .link:hover {
  color: var(--red);
}

#confirmation p,
#about p,
#death p,
#disconnected p {
  margin: calc(14px * var(--u)) auto 0;
  max-width: 82%;
  line-height: 1.5;
}

#about .desc {
  font-size: calc(9px * var(--u));
}

#about .credits {
  font-size: calc(7px * var(--u));
  color: #5d5a48;
  margin-top: calc(8px * var(--u));
}

.close-hint {
  font-size: calc(7px * var(--u));
}

#death p {
  margin-top: calc(40px * var(--u));
}

/* ---------- Instructions & achievements windows ---------- */

#instructions,
#achievements {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 150;
  transform: translate(-50%, -48%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s linear, transform 0.3s ease;
}

#instructions.active,
#achievements.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

#instructions {
  width: calc(417px * var(--u));
  height: calc(172px * var(--u));
  padding: calc(16px * var(--u)) calc(20px * var(--u)) 0;
  background: var(--sheet) no-repeat 0 calc(-527px * var(--u)) / calc(422px * var(--u)) auto;
  image-rendering: pixelated;
  color: var(--ink);
  font-size: calc(9px * var(--u));
}

#instructions h2 {
  font-weight: normal;
  font-size: calc(13px * var(--u));
  margin: 0 0 calc(10px * var(--u));
  display: flex;
  justify-content: center;
  align-items: center;
}

#instructions ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#instructions li {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--u));
  margin: calc(6px * var(--u)) 0;
  line-height: 1.3;
}

#instructions p {
  text-align: center;
  font-size: calc(8px * var(--u));
  margin-top: calc(8px * var(--u));
}

.icon {
  flex: none;
  background: var(--sheet) no-repeat;
  background-size: calc(422px * var(--u)) auto;
  image-rendering: pixelated;
}

.icon.i1 { width: calc(15px * var(--u)); height: calc(29px * var(--u)); background-position: calc(-378px * var(--u)) calc(-12px * var(--u)); }
.icon.i2 { width: calc(13px * var(--u)); height: calc(16px * var(--u)); background-position: calc(-393px * var(--u)) calc(-12px * var(--u)); }
.icon.i3 { width: calc(16px * var(--u)); height: calc(21px * var(--u)); background-position: calc(-406px * var(--u)) calc(-12px * var(--u)); }

.close {
  position: absolute;
  top: calc(-4px * var(--u));
  right: calc(-5px * var(--u));
  width: calc(16px * var(--u));
  height: calc(16px * var(--u));
  background: var(--sheet) no-repeat calc(-354px * var(--u)) calc(-126px * var(--u)) / calc(422px * var(--u)) auto;
  image-rendering: pixelated;
  z-index: 2;
}

.close:hover {
  background-position: calc(-370px * var(--u)) calc(-126px * var(--u));
}

.close:active {
  background-position: calc(-386px * var(--u)) calc(-126px * var(--u));
}

.touch .close::after {
  content: '';
  position: absolute;
  inset: -12px;
}

#achievements {
  width: calc(416px * var(--u));
  height: calc(196px * var(--u));
  padding: calc(12px * var(--u)) calc(22px * var(--u)) 0;
  background: var(--achsheet) no-repeat 0 0 / calc(416px * var(--u)) auto;
  image-rendering: pixelated;
  font-size: calc(9px * var(--u));
  display: flex;
  flex-direction: column;
}

#achievements h2 {
  font-weight: normal;
  font-size: calc(9px * var(--u));
  margin: 0 0 calc(2px * var(--u));
  color: var(--gold-2);
  text-align: center;
}

#achievements-wrapper {
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
}

#lists {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}

#lists ul {
  flex: none;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

#lists li {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(10px * var(--u));
  height: calc(26px * var(--u));
  margin: calc(4px * var(--u)) 0;
  background: var(--achsheet) no-repeat 0 calc(-196px * var(--u)) / calc(416px * var(--u)) auto;
  image-rendering: pixelated;
  --cu: var(--u);
}

#lists li .coin {
  opacity: 0;
}

#lists li.unlocked .coin {
  opacity: 1;
}

.achievement-name {
  color: #fff;
  flex: none;
  width: 34%;
  text-shadow: 1px 1px 0 var(--ink);
}

#lists li.unlocked .achievement-name {
  color: var(--gold-2);
}

.achievement-description {
  flex: 1 1 auto;
  color: #ddd;
  font-size: calc(7px * var(--u));
  line-height: 1.2;
}

#achievements nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(24px * var(--u));
  color: #fff;
}

#previous,
#next {
  width: calc(34px * var(--u));
  height: calc(22px * var(--u));
  color: transparent;
  overflow: hidden;
  background: var(--achsheet) no-repeat / calc(416px * var(--u)) auto;
  image-rendering: pixelated;
}

#previous { background-position: calc(-67px * var(--u)) calc(-282px * var(--u)); }
#previous:active { background-position: calc(-134px * var(--u)) calc(-282px * var(--u)); }
#next { background-position: calc(-100px * var(--u)) calc(-282px * var(--u)); }
#next:active { background-position: calc(-167px * var(--u)) calc(-282px * var(--u)); }
#achievements.first #previous { background-position: 0 calc(-282px * var(--u)); cursor: default; }
#achievements.last #next { background-position: calc(-33px * var(--u)) calc(-282px * var(--u)); cursor: default; }

/* ---------- Compact mode: frames too small for the parchment art ---------- */

.compact #logo {
  display: none;
}

.compact #parchment,
.compact #instructions,
.compact #achievements {
  width: calc(100% - 16px);
  height: auto;
  max-height: calc(100% - 16px);
  overflow: auto;
  font-size: 12px;
  background: #e3dcc0;
  border: 3px solid #b9ad84;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  --u: 1;
}

.compact #achievements {
  background: #2c2a26;
  color: #eee;
}

.compact .parchment-left,
.compact .parchment-right,
.compact .parchment-middle,
.compact .left-ornament,
.compact .right-ornament,
.compact #character {
  display: none;
}

.compact #parchment article {
  position: static;
  display: none;
  padding: 10px;
}

.compact #parchment.createcharacter #createcharacter,
.compact #parchment.loadcharacter #loadcharacter,
.compact #parchment.confirmation #confirmation,
.compact #parchment.about #about,
.compact #parchment.death #death,
.compact #parchment.disconnected #disconnected {
  display: block;
}

.compact #parchment h2 {
  white-space: normal;
  font-size: 13px;
}

.compact #parchment p,
.compact .hint,
.compact #about .desc,
.compact #about .credits,
.compact .close-hint {
  font-size: 12px;
  margin-top: 6px;
}

.compact .button {
  width: 125px;
  height: 51px;
  --u: 1;
}

.compact #nameinput {
  width: 90%;
  height: 32px;
}

.compact #lists li {
  background: rgba(255, 255, 255, 0.06);
  height: auto;
  min-height: 30px;
  padding: 2px 4px;
  font-size: 12px;
  --cu: 1;
}

.compact .achievement-description {
  font-size: 11px;
}

.compact #instructions {
  padding: 12px;
}

/* ---------- Too-small notice ---------- */

#too-small {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 300;
  place-items: center;
  padding: 8px;
  background: #1a1612;
  color: var(--gold);
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
}

.too-small #too-small {
  display: grid;
}

/* ---------- Animations ---------- */

@keyframes flash {
  0% { background: #ffa2a2; }
  100% { background: #e22525; }
}

@keyframes glow {
  from { color: var(--gold); }
  to { color: #fff; }
}

@keyframes invincible {
  from { background: #fa6a00; }
  to { background: #fabc00; }
}

@keyframes logosparks {
  from { background-position: 0 calc(-42px * var(--u)); }
  to { background-position: 0 calc(-294px * var(--u)); }
}

@media (prefers-reduced-motion: reduce) {
  #logosparks,
  #nameinput,
  #hitpoints.invincible {
    animation: none;
  }

  * {
    transition-duration: 0s !important;
  }
}