:root {
  --page: #000000;
  --paper: #ffffff;
  --ink: #000000;
  --scroll-thumb: #a0a0a0;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; background: var(--page); }

/* Stage plus the torn-paper edges: 940 x (48 + 450 + 65). */
main {
  --site-width: min(100vw, 1200px, calc(100vh * 940 / 563));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.torn {
  display: block;
  width: var(--site-width);
  height: auto;
}

/* A 1px overlap hides hairline seams when the site is scaled to fractional sizes. */
#stage, .torn:last-of-type { margin-top: -1px; }
.torn:last-of-type { position: relative; }

/* Same 940x450 stage as the Flash movie; scales down on small screens. */
#stage {
  display: block;
  width: var(--site-width);
  aspect-ratio: 940 / 450;
  overflow: hidden;
  background: var(--paper);
  /* In Flash only buttons react to the pointer. */
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.stage-bg { fill: var(--paper); }

.hit {
  pointer-events: all;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
}
.hit.passive { cursor: default; }
.hit:focus-visible { outline: 2px solid #ff9900; outline-offset: 1px; }

.field {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-weight: 900;
}

/* Replaces the Flash FScrollBar component of "Jack of Spades". */
.article {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  padding-right: 8px;
  font-family: Arial, Helvetica, sans-serif;
  text-align: justify;
  color: var(--ink);
}
.article::-webkit-scrollbar { width: 10px; }
.article::-webkit-scrollbar-thumb { background: var(--scroll-thumb); }
@supports not selector(::-webkit-scrollbar) {
  .article { scrollbar-color: var(--scroll-thumb) transparent; scrollbar-width: thin; }
}
.article p { margin: 0; min-height: 1em; }

/* Link back to the simple version, shown only on touch screens. */
.simple-link { display: none; margin: 8px 0 16px; color: #ffffff; font: 14px Arial, Helvetica, sans-serif; opacity: .8; }
@media (hover: none) { .simple-link { display: block; } }
.play-alone .simple-link { display: none; }

/* A single poem opened from the simple version. */
.play-back {
  position: fixed; top: 8px; left: 8px; z-index: 1;
  padding: 8px 14px; color: #ffffff; font: 16px Arial, Helvetica, sans-serif; text-decoration: none;
}
.play-start {
  position: fixed; inset: 0; margin: auto; width: max-content; height: max-content;
  padding: 14px 24px; border: 2px solid #ff0000; border-radius: 999px;
  background: #ffffff; color: #000000; font: 700 18px Arial, Helvetica, sans-serif; cursor: pointer;
}

.noscript { color: #fff; font: 16px Arial, sans-serif; text-align: center; }
