@font-face {
  font-family: "Architects Daughter";
  src: url("../assets/ArchitectsDaughter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7efd9;
  --paper-deep: #ead8ad;
  --ink: #1d1b18;
  --soft-ink: #5d554b;
  --red: #d7432f;
  --blue: #2f66b3;
  --green: #287d54;
  --yellow: #f2c24b;
  --intergame-mark-width: 256.25px;
  --intergame-mark-height: 218.667px;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: grid;
  place-items: start center;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background-color: var(--paper);
  background-position: center;
  background-size: cover;
  color: var(--ink);
  font-family: "Architects Daughter", "Comic Sans MS", "Marker Felt", "Trebuchet MS", system-ui, sans-serif;
  -webkit-touch-callout: none;
  user-select: none;
}

body.paper-background-ready {
  background-image: url("../assets/crumpled_paper_background.webp");
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.1)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(47, 102, 179, 0.13) 32px 33px);
  content: "";
}

button {
  font: inherit;
}

canvas {
  image-rendering: pixelated;
}

.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  cursor: pointer;
}

.text-link:hover:not(:disabled),
.text-link:focus-visible {
  color: var(--red);
}

.text-link:disabled {
  color: rgba(29, 27, 24, 0.34);
  cursor: not-allowed;
}

.game-shell {
  position: fixed;
  top: 0;
  left: 50%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  width: 960px;
  height: 540px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transform: translateX(-50%) scale(var(--ui-scale, 1));
  transform-origin: top center;
}

.wipe-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: block;
  width: 960px;
  height: 540px;
  pointer-events: all;
}

.pause-menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  width: 960px;
  height: 540px;
  pointer-events: all;
}

.pause-menu {
  display: grid;
  gap: 18px;
  width: 260px;
}

.pause-menu-button {
  min-height: 72px;
  padding: 12px 18px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 6px 7px 0 rgba(29, 27, 24, 0.42);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.pause-menu-button:hover,
.pause-menu-button:focus-visible {
  outline: 0;
  background: var(--yellow);
}

.pause-menu-button.danger:hover,
.pause-menu-button.danger:focus-visible {
  background: var(--red);
  color: #fff7e7;
}

.loading-screen {
  display: grid;
  place-items: center;
  height: 100%;
}

.loading-start {
  position: relative;
  display: block;
  width: 512px;
  height: 520px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

.loading-start.ready {
  cursor: pointer;
}

.loading-boil,
.loading-progress,
.loading-click-message {
  position: absolute;
  left: 0;
  width: 512px;
  height: 256px;
  filter: drop-shadow(3px 6px 0 rgba(29, 27, 24, 0.1));
}

.loading-boil {
  top: 0;
}

.loading-progress {
  top: 220px;
  transform: rotate(-0.35deg);
}

.loading-click-message {
  top: 0;
  opacity: 0;
  transform: rotate(0.3deg);
}

.loading-start.ready .loading-click-message {
  opacity: 1;
}

.arena {
  position: relative;
  min-height: 0;
}

.layout-arena {
  width: 100%;
  height: 100%;
}

.layout-stage {
  position: relative;
  overflow: hidden;
}

.layout-slot {
  position: absolute;
  display: grid;
  place-items: center;
}

.layout-slot canvas,
.layout-slot img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.layout-slot .doodle-canvas,
.layout-slot .cue-canvas,
.layout-slot .turn-counter,
.layout-slot .bullets-label,
.layout-slot .wins-label,
.layout-slot .win-mark,
.layout-slot .pick-label,
.layout-slot .move-icon,
.layout-slot .bullets-icon,
.layout-slot .empty-resource-icon,
.layout-slot .move-arrow {
  transform: none;
}

.layout-slot .empty-resource-icon {
  width: 75%;
  height: 75%;
}

.layout-slot .player-identity {
  width: 100%;
  height: 100%;
  padding: 0;
}

.layout-slot .player-name {
  max-width: 100%;
  font-size: 30px;
}

.layout-slot .player-rating {
  margin-top: 4px;
  font-size: 18px;
}

.layout-slot .player-debug {
  margin-top: 4px;
  font-size: 14px;
}

.layout-moves {
  display: contents;
}

.layout-stage .move-card,
.layout-stage .sheet-button {
  width: 100%;
  height: 100%;
}

.layout-stage .move-button-art,
.layout-stage .sheet-button-art {
  width: 100%;
  height: 100%;
}

.layout-stage .bullet-slot {
  pointer-events: none;
}

.layout-stage .empty-bullet-slot {
  display: block;
  width: 100%;
  height: 100%;
}

.layout-controls {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 30;
  margin: 0;
}

.title-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  height: 100%;
  padding-top: 8px;
  padding-bottom: 0;
}

.ranked-disconnect-notice {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 32px;
  color: #211d19;
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  background: rgba(242, 233, 207, 0.94);
}

.opponent-select-screen {
  position: relative;
}

.curtain-border {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  width: 960px;
  height: 540px;
  pointer-events: none;
}

.title-logo {
  display: block;
  width: 398px;
  height: 286px;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(3px 6px 0 rgba(29, 27, 24, 0.1));
}

.title-logo {
  transform: rotate(-0.3deg);
}

.pick-variant-header {
  display: block;
  width: 310px;
  height: 186px;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(3px 6px 0 rgba(29, 27, 24, 0.1));
  transform: rotate(-0.3deg);
}

.pick-variant-header.online-stage-header {
  width: 607px;
  height: 205px;
  margin-bottom: -54px;
  transform: translateY(-40px) rotate(-0.3deg);
}

.tiebreaker-ban-stage .pick-variant-header.online-stage-header {
  width: 364px;
  height: 205px;
}

.online-interstitial {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 960px;
  height: 540px;
  overflow: hidden;
}

.online-interstitial-header {
  width: 304px;
  height: 205px;
  margin-bottom: -52px;
  image-rendering: pixelated;
  transform: translateY(-40px);
}

.match-found-name {
  position: relative;
  z-index: 5;
  max-width: 720px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  overflow-wrap: anywhere;
}

.match-found-vs {
  position: relative;
  z-index: 5;
  width: 64px;
  height: 64px;
  margin: 4px 0;
  image-rendering: pixelated;
}

.scoreboard-stage {
  display: block;
}

.match-result-name {
  position: absolute;
  bottom: 12px;
  left: 50%;
  z-index: 2;
  width: 90%;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  overflow-wrap: anywhere;
  transform: translateX(-50%);
}

.scoreboard-name {
  position: absolute;
  top: 108px;
  z-index: 8;
  width: 240px;
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
}

.scoreboard-name-left {
  left: 230px;
  text-align: right;
}

.scoreboard-name-right {
  right: 230px;
  text-align: left;
}

.scoreboard-ready {
  position: absolute;
  top: 50%;
  width: var(--intergame-mark-width);
  height: var(--intergame-mark-height);
  image-rendering: pixelated;
  pointer-events: none;
}

.scoreboard-name-left .scoreboard-ready {
  left: 100%;
  transform: translate(8px, -50%) rotate(-3deg);
}

.scoreboard-name-right .scoreboard-ready {
  left: 100%;
  width: 112.5px;
  height: 96px;
  transform: translate(-20px, -50%) rotate(3deg);
}

.scoreboard-next-variant-wrap {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 9;
  width: 192px;
  height: 96px;
  transform: translateY(-50%);
}

.scoreboard-next-variant {
  width: 192px;
  height: 96px;
  transform: none;
}

.scoreboard-next-variant .sheet-button-art {
  width: 192px;
  height: 96px;
}

.scoreboard-next-variant:hover {
  transform: translateY(-2px);
}

.scoreboard-next-variant:active {
  transform: translateY(2px);
}

.scoreboard-next-ready {
  left: 50%;
  z-index: 2;
  width: var(--intergame-mark-width);
  height: var(--intergame-mark-height);
  transform: translate(-50%, -50%) rotate(-3deg);
}

.scoreboard-waiting-message {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 9;
  width: 100%;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.scoreboard-header {
  position: absolute;
  top: 4px;
  left: 237px;
  z-index: 7;
  width: 486px;
  height: 102px;
  image-rendering: pixelated;
}

.scoreboard-board {
  position: absolute;
  top: 51px;
  left: 48px;
  z-index: 3;
  width: 864px;
  height: 486px;
  image-rendering: pixelated;
}

.scoreboard-games {
  position: absolute;
  top: 181px;
  left: 246px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.scoreboard-game-row {
  display: grid;
  grid-template-columns: 64px 244px 64px;
  gap: 48px;
  align-items: center;
}

.scoreboard-variant-button {
  width: 244px;
  height: 96px;
  image-rendering: pixelated;
}

.scoreboard-win-counter {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}

.scoreboard-tiebreaker {
  width: 260px;
  height: 102px;
  margin-top: -3px;
  image-rendering: pixelated;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.scene-gallery-link {
  margin-top: 12px;
}

.scene-gallery {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  padding: 18px 24px 22px;
}

.scene-gallery-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: baseline;
  padding-bottom: 14px;
}

.scene-gallery-header h1 {
  margin: 0;
  font-size: 32px;
}

.scene-gallery-header > span {
  justify-self: end;
  color: var(--soft-ink);
  font-size: 16px;
}

.scene-gallery-scroll {
  min-height: 0;
  padding-right: 8px;
  overflow-y: auto;
  scrollbar-color: var(--ink) transparent;
}

.scene-gallery-group h2 {
  margin: 18px 0 10px;
  font-size: 24px;
}

.scene-gallery-group:first-child h2 {
  margin-top: 0;
}

.scene-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.scene-gallery-card {
  display: grid;
  min-width: 0;
  padding: 8px;
  border: 2px solid rgba(29, 27, 24, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.scene-gallery-card:hover,
.scene-gallery-card:focus-visible {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
}

.scene-gallery-art {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
}

.scene-gallery-card > span {
  margin-top: 5px;
  font-size: 16px;
}

.scene-gallery-card > small {
  overflow: hidden;
  color: var(--soft-ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-audio-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.title-audio-button {
  display: block;
  width: 170px;
  height: 85px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: rotate(-0.35deg);
}

.title-audio-button:nth-child(2) {
  transform: rotate(0.45deg);
}

.title-audio-button-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(2px 4px 0 rgba(29, 27, 24, 0.12));
}

.title-audio-button:hover,
.title-audio-button:focus-visible {
  outline: 0;
  transform: rotate(-0.35deg) translateY(-2px);
}

.title-audio-button:nth-child(2):hover,
.title-audio-button:nth-child(2):focus-visible {
  transform: rotate(0.45deg) translateY(-2px);
}

.title-volume-slider {
  display: block;
  width: 170px;
  height: 85px;
  cursor: ew-resize;
  image-rendering: pixelated;
  touch-action: none;
  filter: drop-shadow(2px 4px 0 rgba(29, 27, 24, 0.12));
  opacity: 1;
  transform: rotate(0.25deg);
  transition: opacity 120ms ease, transform 120ms ease;
}

.title-volume-slider.is-muted {
  opacity: 0.42;
}

.title-volume-slider:nth-child(3) {
  transform: rotate(-0.28deg);
}

.title-volume-slider:hover,
.title-volume-slider:focus-visible {
  outline: 0;
  transform: rotate(0.25deg) translateY(-2px);
}

.title-volume-slider:nth-child(3):hover,
.title-volume-slider:nth-child(3):focus-visible {
  transform: rotate(-0.28deg) translateY(-2px);
}

.online-name-form {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: 840px;
  margin-top: 22px;
  transform: rotate(-0.35deg);
}

.online-name-label {
  color: var(--ink);
  font-size: 48px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 2px 3px 0 rgba(255, 255, 255, 0.38);
}

.online-name-input {
  width: 100%;
  height: 78px;
  padding: 0 18px;
  border: 4px solid var(--ink);
  border-radius: 6px;
  outline: 0;
  background: rgba(247, 239, 217, 0.72);
  box-shadow: 4px 6px 0 rgba(29, 27, 24, 0.13);
  color: var(--ink);
  font: inherit;
  font-size: 42px;
  font-weight: 950;
  text-align: center;
}

.online-name-input:focus {
  border-color: var(--red);
}

.online-player-count {
  margin: -4px 0 0;
  color: var(--soft-ink);
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
  transform: rotate(0.25deg);
}

.online-name-actions {
  display: flex;
  gap: 34px;
  align-items: center;
  justify-content: center;
}

.online-name-random {
  margin-top: -4px;
  font-size: 28px;
  transform: rotate(0.4deg);
}

.online-name-actions .ghost {
  font-size: 30px;
}

.variant-ban-list {
  display: grid;
  gap: 14px;
  width: min(760px, 82vw);
  margin: 18px auto 8px;
}

.variant-ban-button {
  width: 100%;
  min-height: 58px;
  font-size: 30px;
}

.variant-ban-button.selected {
  opacity: 0.55;
}

.ranked-variant-pick {
  position: relative;
}

.ranked-variant-pick.picked,
.ranked-variant-pick.banned {
  opacity: 0.58;
}

.ranked-variant-pick.banned {
  filter: grayscale(1);
}

.ranked-variant-pick.tiebreaker-ban.picked,
.ranked-variant-pick.tiebreaker-ban.banned {
  opacity: 1;
  filter: none;
}

.ranked-variant-pick.tiebreaker-reveal {
  z-index: 201;
}

.ranked-ban-animation,
.ranked-ban-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: var(--intergame-mark-width);
  height: var(--intergame-mark-height);
  image-rendering: pixelated;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-3deg);
}

.tiebreaker-ban-waiting {
  position: absolute;
  bottom: 16px;
  left: 50%;
  z-index: 8;
  width: 100%;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.ranked-variant-ready {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--intergame-mark-width);
  height: var(--intergame-mark-height);
  transform: translate(-50%, -50%) rotate(-3deg);
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 3;
}

.opponent-actions {
  display: grid;
  grid-template-columns: repeat(2, 256px);
  gap: 18px 24px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
}

.variant-actions {
  display: grid;
  grid-template-columns: repeat(3, 244px);
  gap: 14px 22px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.play-button,
.opponent-button,
.variant-button {
  position: relative;
  display: block;
  width: 256px;
  height: 128px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: rotate(0.45deg);
  transition: transform 120ms ease, filter 120ms ease;
}

.variant-button {
  width: 244px;
  height: 96px;
}

.opponent-button:nth-child(2n) {
  transform: rotate(-0.35deg);
}

.opponent-button.back-button,
.variant-actions .back-button {
  grid-column: 1 / -1;
  justify-self: center;
}

.variant-actions .back-button,
.variant-actions .back-button .opponent-button-art {
  width: 192px;
  height: 96px;
}

.play-button:hover,
.opponent-button:hover,
.variant-button:hover {
  transform: translateY(-3px) rotate(0deg);
}

.play-button:active,
.opponent-button:active,
.variant-button:active {
  transform: translateY(3px) rotate(0.2deg);
}

.variant-button:has(.variant-difficulty-toggle:active) {
  transform: rotate(0.45deg);
}

.play-button-art,
.opponent-button-art,
.variant-button-art,
.finding-match-art {
  display: block;
  width: 256px;
  height: 128px;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(3px 6px 0 rgba(29, 27, 24, 0.1));
}

.variant-button-art {
  width: 244px;
  height: 96px;
}

.variant-difficulty-toggle {
  position: absolute;
  top: 50%;
  right: -66px;
  z-index: -1;
  display: block;
  width: 74px;
  height: 94px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-52px, -50%) rotate(-2deg);
  transition: transform 180ms ease, opacity 120ms ease;
}

.variant-button-above-curtain .variant-difficulty-toggle {
  opacity: 1;
  pointer-events: all;
  transform: translate(0, -50%) rotate(-2deg);
}

.variant-slot-3 .variant-difficulty-toggle,
.variant-slot-6 .variant-difficulty-toggle {
  right: auto;
  left: -66px;
  transform: translate(52px, -50%) rotate(2deg);
}

.variant-slot-3.variant-button-above-curtain .variant-difficulty-toggle,
.variant-slot-6.variant-button-above-curtain .variant-difficulty-toggle {
  transform: translate(0, -50%) rotate(2deg);
}

.variant-difficulty-toggle:hover,
.variant-difficulty-toggle:focus-visible {
  outline: 0;
  transform: translate(0, calc(-50% - 3px)) rotate(0deg);
}

.variant-difficulty-toggle:active {
  transform: translate(0, calc(-50% + 3px)) rotate(-1deg);
}

.variant-slot-3 .variant-difficulty-toggle:active,
.variant-slot-6 .variant-difficulty-toggle:active {
  transform: translate(0, calc(-50% + 3px)) rotate(1deg);
}

.variant-difficulty-toggle-art {
  display: block;
  width: 74px;
  height: 94px;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(3px 6px 0 rgba(29, 27, 24, 0.12));
}

.variant-button-above-curtain {
  z-index: 212;
}

.variant-detail-open .variant-actions .back-button {
  visibility: hidden;
}

.variant-detail-overlay {
  position: absolute;
  inset: 0;
  z-index: 211;
  width: 960px;
  height: 540px;
  pointer-events: all;
}

.variant-detail-overlay::before {
  position: absolute;
  top: 28px;
  right: 54px;
  bottom: 76px;
  left: 54px;
  z-index: 1;
  border: 4px solid rgba(29, 27, 24, 0.78);
  border-radius: 6px;
  background: rgba(247, 239, 217, 0.86);
  box-shadow: 6px 8px 0 rgba(29, 27, 24, 0.2);
  content: "";
}

.variant-detail-copy {
  position: absolute;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  width: 520px;
  min-height: 272px;
  padding: 22px 26px;
  color: var(--ink);
  text-align: center;
  transform: rotate(-0.35deg);
}

.variant-detail-copy p {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}

.variant-detail-copy .lead {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 30px;
  line-height: 0.98;
}

.variant-detail-copy .lead-sentence {
  color: #AC3235;
}

.variant-detail-actions {
  position: absolute;
  left: 174px;
  bottom: 28px;
  z-index: 4;
  display: flex;
  gap: 18px;
  align-items: center;
}

.variant-detail-action {
  position: relative;
  display: block;
  width: 192px;
  height: 96px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: rotate(0.35deg);
  transition: transform 120ms ease, filter 120ms ease;
}

.variant-detail-action:nth-child(2) {
  transform: rotate(-0.45deg);
}

.variant-detail-action:hover,
.variant-detail-action:focus-visible {
  outline: 0;
  transform: translateY(-3px) rotate(0deg);
}

.variant-detail-action:active {
  transform: translateY(3px) rotate(0.2deg);
}

.variant-detail-action-art {
  display: block;
  width: 192px;
  height: 96px;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(3px 6px 0 rgba(29, 27, 24, 0.1));
}

.variant-detail-action.variant-detail-action-hidden {
  visibility: hidden;
  pointer-events: none;
}

.gameplay-rules-button-slot {
  pointer-events: auto;
}

.gameplay-rules-button {
  width: 100%;
  height: 100%;
}

.gameplay-rules-button .sheet-button-art {
  width: 100%;
  height: 100%;
}

.gameplay-rules-overlay {
  z-index: 300;
  background: rgba(29, 27, 24, 0.2);
}

.gameplay-rules-overlay .variant-detail-copy {
  top: 62px;
  left: 50%;
  width: 700px;
  min-height: 300px;
  transform: translateX(-50%) rotate(-0.35deg);
}

.gameplay-rules-overlay .variant-detail-actions {
  left: 50%;
  transform: translateX(-50%);
}

.variant-detail-waiting {
  margin-top: 12px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
}

.variant-detail-fireballWar .variant-detail-waiting {
  margin-top: 108px;
}

.variant-detail-ready {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--intergame-mark-width);
  height: var(--intergame-mark-height);
  image-rendering: pixelated;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.variant-detail-slot-1 .variant-detail-copy,
.variant-detail-slot-4 .variant-detail-copy {
  top: 82px;
  right: 70px;
}

.variant-detail-slot-3 .variant-detail-copy,
.variant-detail-slot-6 .variant-detail-copy {
  top: 82px;
  left: 70px;
}

.variant-detail-slot-2 .variant-detail-copy {
  top: 28px;
  left: 50%;
  width: 620px;
  min-height: 158px;
  padding-top: 18px;
  padding-bottom: 18px;
  transform: translateX(-50%) rotate(-0.25deg);
}

.variant-detail-slot-2 .variant-detail-copy p {
  font-size: 21px;
}

.variant-detail-slot-2 .variant-detail-copy .lead {
  font-size: 28px;
}

.variant-detail-slot-5 .variant-detail-copy {
  top: 26px;
  left: 50%;
  width: 610px;
  min-height: 276px;
  transform: translateX(-50%) rotate(-0.35deg);
}

.variant-detail-slot-5 .variant-detail-copy p {
  font-size: 20px;
}

.variant-detail-slot-5 .variant-detail-copy .lead {
  font-size: 28px;
}

.variant-page-controls {
  position: absolute;
  right: 70px;
  bottom: 32px;
  z-index: 5;
  display: flex;
  gap: 10px;
  align-items: center;
}

.variant-page-button {
  display: block;
  width: 128px;
  height: 64px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: rotate(-0.25deg);
  transition: transform 120ms ease, filter 120ms ease;
}

.variant-page-button:nth-child(2) {
  transform: rotate(0.25deg);
}

.variant-page-button:hover,
.variant-page-button:focus-visible {
  outline: 0;
  transform: translateY(-3px) rotate(0deg);
}

.variant-page-button:active {
  transform: translateY(3px) rotate(0.2deg);
}

.variant-page-button-art {
  display: block;
  width: 128px;
  height: 64px;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(3px 6px 0 rgba(29, 27, 24, 0.1));
}

.crossed-opponent-mark {
  position: absolute;
  inset: 0;
  display: block;
  width: 256px;
  height: 128px;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(2px 4px 0 rgba(29, 27, 24, 0.08));
}

.finding-match-art {
  margin-top: 34px;
}

.finding-match-overlay {
  position: absolute;
  inset: 0;
  z-index: 201;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  pointer-events: none;
}

.finding-match-panel {
  display: grid;
  place-items: center;
  width: 330px;
  height: 164px;
  border: 4px solid rgba(29, 27, 24, 0.78);
  border-radius: 6px;
  background: rgba(247, 239, 217, 0.86);
  box-shadow: 6px 8px 0 rgba(29, 27, 24, 0.2);
  transform: rotate(-0.35deg);
}

.finding-match-overlay .finding-match-art {
  margin: 0;
}

.finding-match-cancel {
  width: 192px;
  height: 96px;
  pointer-events: all;
}

.finding-match-cancel .opponent-button-art {
  width: 192px;
  height: 96px;
}

.doodle-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
  margin: 0;
  padding: 104px 18px 0;
  overflow: hidden;
  transform: rotate(0.35deg);
}

.test-opponent-controls {
  position: absolute;
  top: 210px;
  right: 8px;
  z-index: 6;
  display: grid;
  gap: 14px;
  justify-items: start;
  width: 154px;
  transform: rotate(0.35deg);
}

.test-opponent-link {
  font-size: 28px;
  line-height: 1;
}

.test-opponent-link.selected {
  color: var(--green);
}

.doodle-stage img,
.doodle-canvas,
.cue-canvas {
  grid-area: 1 / 1;
  width: 512px;
  height: 256px;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(2px 4px 0 rgba(29, 27, 24, 0.08));
}

.stage-presentation-stack {
  display: grid;
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  place-items: center;
}

.stage-presentation-stack > canvas {
  grid-area: 1 / 1;
}

.stage-presentation-stack .result-overlay {
  z-index: 1;
}

.stage-presentation {
  position: relative;
  display: grid;
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  place-items: center;
}

.last-pick-versus {
  position: absolute;
  bottom: -64px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.last-pick-versus .last-pick-button {
  width: 128px;
  height: 64px;
  flex: 0 0 auto;
}

.last-pick-versus .last-pick-vs {
  z-index: 1;
  width: 48px;
  height: 48px;
  margin: 0 -20px;
  flex: 0 0 auto;
}

.layout-slot .stage-presentation-stack {
  position: absolute;
  inset: 0;
}

.layout-slot .stage-presentation {
  position: absolute;
  inset: 0;
}

.doodle-canvas {
  align-self: center;
}

.ready-waiting-overlay {
  position: absolute;
  top: var(--ready-y, 88px);
  left: var(--ready-x, 219px);
  z-index: 4;
  display: block;
  width: 300px;
  height: 256px;
  min-height: 0;
  image-rendering: pixelated;
  pointer-events: none;
  transform: rotate(0.35deg);
  transform-origin: center;
}

.ready-waiting-overlay.p1 {
  --ready-x: 219px;
  --ready-y: 88px;
}

.ready-waiting-overlay.p2 {
  --ready-x: 441px;
  --ready-y: 88px;
}

.countdown-overlay {
  position: absolute;
  top: var(--countdown-y, 88px);
  left: var(--countdown-x, 219px);
  z-index: 5;
  display: block;
  width: 300px;
  height: 256px;
  min-height: 0;
  image-rendering: pixelated;
  pointer-events: none;
  transform: rotate(0.35deg);
  transform-origin: center;
}

.countdown-overlay.p1 {
  --countdown-x: 219px;
  --countdown-y: 88px;
}

.countdown-overlay.p2 {
  --countdown-x: 441px;
  --countdown-y: 88px;
}

.waiting-dots-overlay {
  position: absolute;
  top: var(--waiting-y, 96px);
  left: var(--waiting-x, 365px);
  z-index: 5;
  display: block;
  width: 135px;
  height: 55px;
  min-height: 0;
  image-rendering: pixelated;
  pointer-events: none;
  transform: rotate(0.35deg) scale(0.5);
  transform-origin: top left;
}

.waiting-dots-overlay.p1 {
  --waiting-x: 365px;
  --waiting-y: 96px;
}

.waiting-dots-overlay.p2 {
  --waiting-x: 569px;
  --waiting-y: 111px;
}

.tutorial-stage {
  padding-top: 104px;
}

.tutorial-nav {
  position: absolute;
  top: 330px;
  right: -42px;
  left: -42px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.tutorial-nav-practice {
  justify-content: flex-end;
}

.tutorial-nav-button {
  width: 256px;
  height: 128px;
  pointer-events: auto;
}

.tutorial-nav-button,
.tutorial-nav-button:nth-child(2),
.tutorial-nav-button:only-child {
  grid-column: auto;
}

.tutorial-nav-button .sheet-button-art {
  width: 256px;
  height: 128px;
}

.tutorial-slide {
  display: grid;
  place-content: center;
  width: 720px;
  height: 256px;
  min-height: 0;
  color: var(--ink);
  font-family: "Architects Daughter", "Comic Sans MS", "Marker Felt", "Trebuchet MS", system-ui, sans-serif;
  font-size: 44px;
  font-weight: 850;
  line-height: 1.24;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4);
}

.tutorial-slide p {
  margin: 0;
}

.tutorial-slide strong {
  font-size: 1.35em;
  font-weight: 950;
}

.tutorial-slide-1,
.tutorial-slide-4,
.tutorial-slide-6 {
  font-size: 45px;
}

.tutorial-slide-2,
.tutorial-slide-3,
.tutorial-slide-5,
.tutorial-slide-9 {
  font-size: 47px;
}

.tutorial-tips-slide-1,
.tutorial-tips-slide-2 {
  position: relative;
  display: block;
  width: 576px;
  height: 288px;
  font-size: 26px;
}

.tutorial-tips-slide-1 strong,
.tutorial-tips-slide-2 strong {
  font-size: 1.65em;
}

.tutorial-feedback {
  font-size: 42px;
}

.tutorial-feedback strong {
  font-size: 1.45em;
}

.tutorial-small {
  font-size: 0.78em;
}

.tutorial-side-copy {
  position: relative;
  z-index: 1;
  width: 286px;
  padding: 2px 0 0;
  text-align: center;
  transform: translateX(-18px);
}

.tutorial-tip-graphic {
  position: absolute;
  inset: 0;
  display: block;
  width: 576px;
  height: 288px;
  min-height: 0;
  object-fit: contain;
  filter: none;
  image-rendering: pixelated;
}

.pick-history {
  position: absolute;
  top: 126px;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 156px;
  pointer-events: none;
}

.pick-history.p1 {
  left: 0;
  transform: rotate(-0.35deg);
}

.pick-history.p2 {
  right: 0;
  transform: rotate(0.35deg);
}

.pick-label,
.move-icon,
.previous-move-button {
  display: block;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(2px 4px 0 rgba(29, 27, 24, 0.08));
}

.pick-label {
  width: auto;
  height: 64px;
}

.move-icon {
  width: 128px;
  height: 128px;
}

.previous-move-button {
  width: 256px;
  height: 128px;
}

.empty-doodle {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: rgba(29, 27, 24, 0.22);
  font-size: 8rem;
  font-weight: 950;
}

.stage-hud {
  position: absolute;
  top: 8px;
  right: 10px;
  left: 10px;
  z-index: 2;
  display: grid;
  grid-template-columns: 256px 128px 256px 128px 256px;
  gap: 8px;
  align-items: start;
  justify-content: center;
  pointer-events: none;
}

.turn-counter,
.bullets-label,
.wins-label,
.win-mark {
  display: block;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(2px 4px 0 rgba(29, 27, 24, 0.08));
}

.turn-counter {
  width: 256px;
  height: 128px;
  justify-self: center;
  transform: translateY(-15px) rotate(-0.2deg);
}

.player-identity {
  display: grid;
  align-content: start;
  width: 240px;
  min-width: 0;
  padding-top: 4px;
  color: var(--ink);
  font-weight: 950;
  line-height: 0.95;
  text-shadow: 2px 3px 0 rgba(255, 255, 255, 0.34);
}

.player-identity.p1 {
  justify-items: start;
  text-align: left;
  transform: rotate(-0.35deg);
}

.player-identity.p2 {
  justify-items: end;
  text-align: right;
  transform: rotate(0.35deg);
}

.player-name {
  max-width: 240px;
  overflow: hidden;
  font-size: 40px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-rating {
  margin-top: 8px;
  color: var(--soft-ink);
  font-size: 26px;
}

.player-debug {
  margin-top: 6px;
  color: var(--soft-ink);
  font-size: 18px;
  line-height: 1;
}

.bullets-meter {
  display: grid;
  gap: 10px;
  width: 256px;
}

.bullets-meter.p1,
.win-meter.p1 {
  justify-self: start;
}

.bullets-meter.p2,
.win-meter.p2 {
  justify-self: end;
}

.bullets-label {
  width: 256px;
  height: 80px;
  transform: translateY(-10px);
}

.bullets-meter.p1 .bullets-label {
  justify-self: start;
}

.bullets-meter.p2 .bullets-label {
  justify-self: end;
}

.bullets-icons {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  gap: 4px;
}

.bullets-meter.p1 .bullets-icons {
  justify-content: start;
}

.bullets-meter.p2 .bullets-icons {
  justify-content: end;
}

.bullets-slot {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
}

.bullets-icon {
  display: block;
  width: 48px;
  height: 48px;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(1px 2px 0 rgba(29, 27, 24, 0.08));
}

.empty-resource-icon {
  width: 36px;
  height: 36px;
}

.bullets-super-meters {
  position: absolute;
  right: 30px;
  left: 30px;
  top: 343px;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
}

.bullets-super-meters .bullets-meter {
  width: 300px;
}

.bullets-super-meters .bullets-meter.p2 {
  justify-items: end;
}

.bullets-super-meters .bullets-label {
  transform: none;
}

.bullets-super-meters .bullets-icons {
  grid-template-columns: repeat(3, 64px);
  gap: 6px;
  padding: 4px 6px;
}

.bullets-super-meters .bullets-slot {
  width: 64px;
  height: 42px;
}

.bullets-super-meters .bullets-icon {
  width: 42px;
  height: 42px;
}

.bullets-super-meters .empty-resource-icon {
  width: 32px;
  height: 32px;
}

.win-meter {
  display: grid;
  gap: 0;
  width: 128px;
}

.wins-label {
  width: 128px;
  height: 64px;
  transform: translateY(-17px);
}

.win-marks {
  display: grid;
  justify-items: center;
  gap: 0;
  margin-top: -18px;
}

.win-mark {
  width: 48px;
  height: 48px;
}

.moves {
  display: grid;
  grid-template-columns: repeat(6, 128px);
  gap: 25px 24px;
  justify-content: center;
  margin-top: 24px;
}

.tutorial-moves {
  min-height: 281px;
}

.move-card:nth-child(1) {
  grid-column: 1 / span 2;
}

.move-card:nth-child(2) {
  grid-column: 3 / span 2;
}

.move-card:nth-child(3) {
  grid-column: 5 / span 2;
}

.move-card:nth-child(4) {
  grid-column: 2 / span 2;
}

.move-card:nth-child(5) {
  grid-column: 4 / span 2;
}

.move-card {
  position: relative;
  display: block;
  width: 256px;
  height: 128px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  justify-self: center;
  transition: opacity 140ms ease;
}

.move-card:nth-child(odd) .move-button-art {
  transform: rotate(-0.5deg);
}

.move-card:nth-child(even) .move-button-art {
  transform: rotate(0.55deg);
}

.move-card:hover:not(:disabled) .move-button-art {
  transform: translateY(-2px) rotate(0deg);
}

.move-card:active:not(:disabled) .move-button-art {
  transform: translateY(2px) rotate(0deg);
}

.move-card:disabled {
  cursor: not-allowed;
}

.move-card:disabled .move-button-art {
  opacity: 0.42;
}

.move-card.selected {
  filter: drop-shadow(0 0 0 var(--ink)) drop-shadow(0 6px 0 rgba(40, 125, 84, 0.42));
  opacity: 1;
}

.move-card.selected .move-button-art {
  transform: translateY(-4px) rotate(0deg);
}

.move-button-art {
  position: relative;
  z-index: 1;
  display: block;
  width: 256px;
  height: 128px;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(2px 4px 0 rgba(29, 27, 24, 0.1));
  transition: transform 140ms ease;
}

.sheet-button {
  grid-column: 2 / span 2;
  display: block;
  width: 256px;
  height: 128px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: rotate(-0.4deg);
  transition: transform 120ms ease;
}

.sheet-button:nth-child(2) {
  grid-column: 4 / span 2;
  transform: rotate(0.45deg);
}

.sheet-button:only-child {
  grid-column: 3 / span 2;
}

.sheet-button:hover {
  transform: translateY(-2px) rotate(0deg);
}

.sheet-button:active {
  transform: translateY(2px) rotate(0.2deg);
}

.sheet-button-art {
  display: block;
  width: 256px;
  height: 128px;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(2px 4px 0 rgba(29, 27, 24, 0.1));
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 12px 0 0;
}

.ghost {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
  transform: rotate(0.4deg);
}

.ghost:hover {
  color: var(--red);
}
