@font-face {
  font-family: RedPixel;
  src: url("/assets/fonts/Tiny5-Regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: RedUI;
  src: url("/assets/fonts/ChakraPetch-Latin.woff2") format("woff2");
  font-display: swap;
}
:root {
  color-scheme: dark;
  --red: #ed315a;
  --pink: #ff8ca4;
  --paper: #f9ecdc;
  --ink: #11121b;
  --muted: #b1a7bb;
  --edge: #60404f;
  --gold: #f3c274;
  --pixel-font: RedPixel, monospace;
  --ui-font: RedUI, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0, #35152b, transparent 60%),
    linear-gradient(#ffffff03 1px, transparent 1px),
    linear-gradient(90deg, #ffffff03 1px, transparent 1px), #0c0d14;
  background-size:
    auto,
    40px 40px,
    40px 40px,
    auto;
  color: var(--paper);
  font: 15px / 1.5 var(--ui-font);
}
button,
input,
select,
summary {
  font: inherit;
}
button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
select {
  border: 1px solid #704956;
  border-radius: 4px;
  background: #201a27;
  color: var(--paper);
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
}
button {
  box-shadow: 0 3px 0 #090b12;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled),
button[aria-pressed="true"] {
  background: #74304b;
  border-color: #ed688b;
}
button:active:not(:disabled) {
  translate: 0 1px;
}
button:disabled {
  cursor: default;
  opacity: 0.43;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--pink);
}
:focus-visible {
  outline: 2px solid #f7d888;
  outline-offset: 4px;
}
canvas:focus,
canvas:focus-visible {
  outline: none;
}
[hidden] {
  display: none !important;
}
img,
canvas {
  image-rendering: pixelated;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 400;
}
svg {
  width: 22px;
  height: 22px;
  display: block;
}
button svg {
  margin: auto;
}
.site-head {
  max-width: 1400px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 22px;
  min-height: 80px;
}
.rr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 24px / 1 var(--pixel-font);
  letter-spacing: 2px;
}
.rr-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.rr-brand small {
  display: block;
  font: 9px / 1.6 var(--ui-font);
  letter-spacing: 3px;
  color: #d9a0b2;
  margin-top: 5px;
}
.back-link {
  margin-left: auto;
  color: #cfb5c5;
  font-size: 13px;
}
#play-mode {
  font-size: 10px;
  letter-spacing: 1px;
  color: #b1a7bb;
  border-left: 1px solid #553344;
  padding-left: 20px;
}
.play-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}
.game-frame {
  border: 2px solid #774154;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 0 0 4px #0b0d15,
    0 18px 80px #0008;
  background: #12131c;
  isolation: isolate;
}
.game-hud {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 180px minmax(180px, 1fr) 44px;
  gap: 24px;
  align-items: center;
  min-height: 82px;
  padding: 10px 22px;
  background: linear-gradient(105deg, #3d192b, #1b1725 65%);
  border-bottom: 3px solid #b94a65;
}
.game-wordmark {
  font: 36px / 0.9 var(--pixel-font);
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-shadow: 2px 3px #070b14;
}
.game-wordmark em {
  font-style: normal;
  color: #ff6d8d;
}
.game-wordmark small {
  display: block;
  font: 10px / 1.5 var(--ui-font);
  color: #bba9bb;
  letter-spacing: 2px;
  margin-top: 7px;
}
.currency > span,
.score-hud > span,
.chapter-hud > span {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: #d2bdc8;
}
.currency strong,
.score-hud strong {
  display: block;
  font: 36px / 1 var(--pixel-font);
  color: var(--gold);
}
.pixel-track {
  height: 9px;
  background: #080c17;
  border: 2px solid #755567;
  margin-top: 8px;
}
.pixel-track i {
  display: block;
  height: 100%;
  background: repeating-linear-gradient(90deg, #ed5578 0 9px, #ff9bb0 9px 11px);
  transition: width 0.25s;
}
.pause-icon {
  font-size: 22px;
  line-height: 1;
  padding: 6px;
  background: #180f1e;
}
.game-body {
  position: relative;
  height: clamp(530px, calc(100dvh - 220px), 760px);
  overflow: hidden;
  background: #111a27;
}
.game-body > #world,
.game-body > #juice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.game-body > #world {
  object-fit: cover;
  z-index: 0;
  opacity: 0.75;
}
.game-body > #juice {
  z-index: 6;
}
.game-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#070a1520, #070a1500 50%, #070a1540);
  pointer-events: none;
  z-index: 1;
}
#game-view {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}
.world-menu {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  padding: 30px;
  text-align: center;
  background: linear-gradient(#080b16c9, #1b1029d9);
  backdrop-filter: blur(2px);
}
.menu-kicker {
  font-size: 10px;
  letter-spacing: 7px;
  color: #f4a4b9;
}
.world-menu h1 {
  font: clamp(42px, 7vw, 88px) / 0.92 var(--pixel-font);
  color: #fff2dc;
  text-shadow:
    4px 5px #a8294c,
    6px 8px #000;
}
.world-menu p {
  max-width: 460px;
  font-size: 15px;
  line-height: 1.7;
  color: #d4becd;
}
.menu-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}
.menu-actions button:first-child {
  background: #c02b52;
  border-color: #fc8ba7;
  min-width: 220px;
  box-shadow: 0 4px #5c1633;
  font-size: 16px;
}
.menu-actions button:first-child:hover {
  background: #e23c65;
}
.hub-gamebar {
  max-width: 1360px;
  margin: 18px auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 12px;
}
.hub-gamebar > button {
  min-width: 46px;
  background: #15121e;
}
.hub-gamebar button[aria-expanded="true"] {
  background: #9d274e;
}
.settings {
  margin-right: auto;
}
.settings summary {
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid #583b50;
  border-radius: 4px;
  font-size: 12px;
}
.settings > div {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px;
  background: #17131f;
  border: 1px solid #583b50;
  margin-top: 8px;
}
.settings label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  font-size: 12px;
}
.settings label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
}
.settings input[type="range"] {
  grid-column: 1 / -1;
  accent-color: var(--red);
  width: 150px;
}
.build-select {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.build-select select {
  font-size: 12px;
  max-width: 330px;
  background: #15121e;
}
.game-notes {
  max-width: 1360px;
  margin: 24px auto;
  padding: 24px 12px;
  border-top: 1px solid #593347;
}
.game-notes h2 {
  font: 25px var(--pixel-font);
  margin-bottom: 8px;
}
.game-notes p {
  max-width: 780px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.game-notes details {
  margin-top: 18px;
  padding: 12px 0;
  border-top: 1px solid #392a3f;
}
.game-notes summary {
  cursor: pointer;
  color: #ddbdcd;
  font-size: 13px;
}
.game-notes details > p {
  margin-top: 12px;
}
#dev-tools > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0;
}
#dev-tools select {
  max-width: 250px;
}
.arcade-page .feedback-game-panel {
  position: static !important;
  inset: auto !important;
  width: calc(100% - 40px) !important;
  max-width: 1360px;
  max-height: none;
  margin: 20px auto;
  padding: 24px;
  border: 1px solid #603449;
  border-radius: 8px;
  background: #15121d;
}
.arcade-page .feedback-game-panel :is(button, input) {
  min-height: 44px;
}
.arcade-page .feedback-game-panel textarea {
  min-height: 110px;
}
.arcade-page .feedback-game-panel h2 {
  font: 28px var(--pixel-font);
}
.arcade-page .feedback-game-panel header {
  border: 0;
}
.feedback-notifications-toggle {
  position: static !important;
}
/* The clicker is a single work floor: every machine hits these same cheeses. */
.crusher-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  height: 100%;
  gap: 0;
}
.cheese-bed {
  position: relative;
  min-width: 0;
  --light-x: 50%;
  --light-y: 50%;
  isolation: isolate;
}
.cheese-bed.dark-event::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: radial-gradient(
    circle var(--light-radius) at var(--light-x) var(--light-y),
    transparent,
    #050511ed
  );
  pointer-events: none;
}
.workbench {
  background: linear-gradient(90deg, #231620ed, #13141df5);
  border-left: 2px solid #75434e;
  padding: 22px 18px;
  overflow: auto;
  scrollbar-width: thin;
  z-index: 5;
}
.bench-title span {
  font-size: 10px;
  letter-spacing: 2px;
  color: #e3a5b8;
}
.bench-title h2 {
  font: 37px / 1 var(--pixel-font);
  margin: 3px 0 8px;
}
.bench-title small {
  color: #ae9cb0;
  font-size: 11px;
}
.bench-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 12px;
}
.bench-tabs button {
  flex: 1;
  padding: 7px;
  min-height: 36px;
  font-size: 12px;
}
.upgrade {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 9px;
  align-items: center;
  text-align: left;
  width: 100%;
  padding: 15px 10px;
  margin: 10px 0;
  background: linear-gradient(110deg, #3b2332, #221e2b);
  border: 1px solid #98606c;
  border-left: 3px solid #ed5c7c;
}
.upgrade img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.upgrade strong {
  font-size: 13px;
  display: block;
  color: #f4e1ce;
}
.upgrade small {
  font-size: 10px;
  display: block;
  color: #c3aebb;
  margin-top: 6px;
  line-height: 1.5;
}
.upgrade b {
  font: 21px var(--pixel-font);
  color: #f2bf78;
}
.upgrade:disabled {
  opacity: 0.6;
  filter: saturate(0.5);
}
.ascend {
  width: 100%;
  padding: 16px 10px;
  text-align: center;
  border-color: #a27a48;
  background: linear-gradient(#3e2d32, #211a25);
  margin-top: 14px;
}
.ascend span {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: #e4bf82;
}
.ascend strong {
  display: block;
  font-size: 13px;
  margin: 6px 0;
}
.ascend small {
  font-size: 10px;
  color: #b5a8b6;
}
.bench-tip {
  font-size: 11px;
  color: #a58f9f;
  line-height: 1.7;
  margin-top: 18px;
}
.breakable-cheese {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 142px;
  height: 158px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition:
    left 0.08s linear,
    top 0.08s linear;
  touch-action: manipulation;
}
.breakable-cheese:hover:not(:disabled) {
  background: transparent;
  filter: brightness(1.13);
  border: 0;
}
.breakable-cheese:disabled {
  opacity: 1;
}
.breakable-cheese img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 0 #080a1438);
  pointer-events: none;
}
.breakable-cheese small {
  font: 11px var(--ui-font);
  text-shadow: 1px 2px #000;
  color: #fff1da;
  white-space: nowrap;
}
.casca {
  height: 6px;
  width: 75px;
  background: #211a26;
  border: 1px solid #090b13;
  display: block;
  box-shadow: 0 1px #ffffff25;
}
.casca i {
  display: block;
  width: calc(var(--hp) * 100%);
  height: 100%;
  background: #f7c878;
  transition: width 0.12s;
}
.golden img {
  filter: drop-shadow(0 0 16px #f4bc4d66);
}
.moldy small {
  color: #c4e4a4;
}
.marked::before {
  content: "!";
  font: 36px var(--pixel-font);
  color: #ff7e90;
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  text-shadow: 2px 2px #000;
}
.blocked {
  filter: brightness(0.4) saturate(0.3);
}
.blocked::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 2px solid #e8567e;
  background: repeating-linear-gradient(
    45deg,
    #e54e7b33 0 6px,
    transparent 6px 12px
  );
  pointer-events: none;
}
.bed-footer {
  position: absolute;
  inset: auto 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}
.bed-footer button {
  pointer-events: auto;
  font-size: 11px;
}
.redrat-helper {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 340px;
}
.redrat-helper img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 2px #090b13);
}
.redrat-helper span {
  font-size: 12px;
  line-height: 1.5;
  color: #ddcbd5;
  text-shadow: 1px 2px #000;
}
.hazard {
  position: absolute;
  top: 12px;
  left: 15px;
  right: 15px;
  z-index: 7;
  text-align: center;
  padding: 10px 16px;
  background: #171321eb;
  border: 1px solid #b98659;
  border-left: 4px solid #f3bc77;
  pointer-events: none;
}
.hazard strong {
  display: block;
  color: #ffdca1;
  font: 22px / 1 var(--pixel-font);
}
.hazard span {
  font-size: 11px;
  display: block;
  margin-top: 5px;
  color: #d1bdcf;
}
.hazard[data-phase="active"] {
  border-color: #cb567d;
  border-left-color: #ed5578;
}
.enemy-target {
  position: absolute;
  left: 84%;
  top: 19%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 125px;
  border: 0;
  background: transparent !important;
  box-shadow: none;
  z-index: 8;
  padding: 0;
}
.enemy-target img {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 0 10px #c35de9);
}
.enemy-target span {
  display: block;
  font-size: 10px;
  color: #e0afea;
  text-shadow: 1px 2px #000;
  white-space: nowrap;
}
.reward-float {
  position: absolute;
  z-index: 9;
  pointer-events: none;
  color: #ffe2a0;
  font: 32px var(--pixel-font);
  text-shadow: 2px 3px #090b13;
  animation: reward-rise 0.7s ease-out forwards;
}
.seal-console {
  position: absolute;
  z-index: 8;
  top: 87px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px;
  background: #23182feb;
  border: 2px solid #a969d2;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 245px;
}
.seal-console > span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #dfb0f6;
}
.seal-console > strong {
  font-size: 24px;
  color: #e7cffb;
}
.seal-console > div {
  display: flex;
  gap: 6px;
}
.seal-console button {
  width: 44px;
  height: 44px;
  padding: 4px;
  font-size: 25px;
  color: #c999e8;
}
/* Cheetris: board geometry stays honest; depth lives inside each cell. */
.duel-layout {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(160px, 220px) max-content minmax(160px, 220px);
  gap: 38px;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  --board-width: min(270px, calc((100dvh - 295px) / 2));
}
.duel-ally,
.duel-rival {
  position: relative;
  align-self: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
}
.duel-ally h2,
.duel-rival h2 {
  font: 30px / 0.9 var(--pixel-font);
  text-shadow: 2px 3px #000;
}
.duel-ally h2 {
  color: #ff9cba;
}
.duel-rival h2 {
  color: #d7a0f0;
}
.portrait-stage {
  position: relative;
  height: 110px;
  width: 150px;
  isolation: isolate;
}
.portrait-stage img {
  position: relative;
  width: 110px;
  height: 110px;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 8px #090b1440);
}
.ally-aura,
.villain-aura {
  position: absolute;
  inset: 30% 0 0;
  border-radius: 50%;
  z-index: 0;
  background: radial-gradient(ellipse, #ed527944, transparent 70%);
  animation: aura-breathe 2.6s ease-in-out infinite;
}
.villain-aura {
  background: radial-gradient(ellipse, #aa54df77, transparent 70%);
}
.small-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #b6a3b8;
}
.duel-ally canvas {
  height: 64px;
  width: 110px;
  object-fit: contain;
  background: #151422bb;
  border: 1px solid #634555;
  border-radius: 4px;
}
.reserve-slot {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.reserve-slot span {
  font-size: 9px;
  color: #bcaabb;
}
.duel-ally > button {
  width: 160px;
  font-size: 11px;
  min-height: 38px;
}
.pulse-button {
  position: relative;
  overflow: hidden;
  border-color: #b63f64;
  background: #3e1930;
  isolation: isolate;
  padding: 12px 7px;
}
.pulse-button i {
  position: absolute;
  inset: 0 auto 0 0;
  background: #d7427144;
  z-index: -1;
  transition: width 0.2s;
}
.pulse-button span {
  display: block;
  font-size: 10px;
  font-weight: bold;
  color: #ffd2dc;
}
.pulse-button small {
  display: block;
  font-size: 9px;
  margin-top: 5px;
  color: #e5a7c1;
}
.pulse-button:not(:disabled) {
  box-shadow: 0 0 16px #e8437055;
}
.board-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.duel-alert {
  font-size: 11px;
  text-align: center;
  color: #e4c5d3;
  min-height: 26px;
  max-width: 300px;
}
.duel-alert.danger {
  color: #eda2e3;
}
.board-rim {
  position: relative;
  width: var(--board-width);
  padding: 6px;
  background: linear-gradient(
    120deg,
    #ea899a,
    #69354d 40%,
    #b3637f 70%,
    #563c59
  );
  box-shadow:
    0 0 0 3px #090c16,
    8px 8px 0 #080a1466,
    0 0 40px #c2406714;
  border: 1px solid #e7a7b0;
}
.board-rim > #matrix {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 2;
  background: #0b111b;
  border: 1px solid #050711;
  image-rendering: pixelated;
  outline-offset: 8px;
}
.board-rim::before,
.board-rim::after {
  content: "";
  position: absolute;
  left: -10px;
  top: 10%;
  width: 5px;
  height: 25%;
  background: #f06c8a;
  box-shadow: 0 0 12px #ec537e66;
}
.board-rim::after {
  left: auto;
  right: -10px;
  top: auto;
  bottom: 10%;
}
.touch-pad {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  width: calc(var(--board-width) + 90px);
  max-width: 450px;
}
.touch-pad button {
  padding: 8px 10px;
  min-width: 44px;
  min-height: 44px;
  font-size: 11px;
  background: #2e1a2b;
}
.boss-hearts {
  display: grid;
  grid-template-columns: repeat(4, 22px);
  gap: 6px;
  margin: 8px 0;
}
.boss-hearts i {
  width: 22px;
  height: 18px;
  background: #252335;
  clip-path: polygon(
    0 20%,
    20% 0,
    45% 0,
    50% 15%,
    55% 0,
    80% 0,
    100% 20%,
    100% 55%,
    50% 100%,
    0 55%
  );
}
.boss-hearts i.alive {
  background: linear-gradient(#e6a3f6 0 20%, #ae57d3 20% 65%, #6b2d8b 65%);
  filter: drop-shadow(0 0 3px #974ed1);
}
.duel-rival > p {
  font-size: 11px;
  line-height: 1.7;
  max-width: 190px;
  color: #d3b6d3;
}
.curse-clock {
  border-top: 1px solid #62425f;
  padding-top: 12px;
  width: 170px;
}
.curse-clock span {
  font-size: 8px;
  letter-spacing: 1.7px;
  color: #c4a9cb;
}
.curse-clock strong {
  font: 27px / 1.2 var(--pixel-font);
  display: block;
  color: #daa0ea;
}
.seal-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.seal-row i {
  font-style: normal;
  font-size: 22px;
  color: #735e7a;
}
.seal-row i.current {
  color: #e4aff4;
  filter: drop-shadow(0 0 6px #b761dd);
}
.seal-row i.broken {
  color: #f3c57f;
}
.duel-rival .duel-whisper {
  font-size: 10px;
  color: #a491b1;
  max-width: 170px;
}
#clear-label {
  position: absolute;
  top: 46%;
  left: 50%;
  width: 220px;
  text-align: center;
  transform: translate(-50%, -50%);
  font: 32px var(--pixel-font);
  color: #fff1b5;
  text-shadow: 2px 3px #080b13;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}
#clear-label.show {
  opacity: 1;
}
#stage-sweep {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: linear-gradient(#151223dd, #572340ed);
  padding: 15px;
  z-index: 5;
  gap: 14px;
}
#stage-sweep span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #edb6ce;
}
#stage-sweep strong {
  font: 30px var(--pixel-font);
}
.cursed {
  box-shadow: inset 0 0 25px #ae4bcc44;
}
/* Native dialogs and account/mode surfaces share the same family. */
dialog {
  max-width: 650px;
  width: calc(100% - 32px);
  max-height: 85dvh;
  background: #191421;
  border: 2px solid #8e455f;
  color: var(--paper);
  padding: 28px;
  border-radius: 8px;
  box-shadow: 0 15px 80px #0009;
  font-family: var(--ui-font);
}
dialog::backdrop {
  background: #080811c9;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font: 34px var(--pixel-font);
  margin-bottom: 15px;
}
dialog button,
dialog a {
  display: inline-block;
  margin: 7px 8px 7px 0;
}
dialog p {
  font-size: 13px;
  color: #c5b5c9;
  line-height: 1.8;
}
dialog input,
dialog textarea {
  background: #0d101a;
  color: var(--paper);
  border: 1px solid #69415b;
  padding: 10px;
  width: 100%;
  font: inherit;
}
dialog label {
  display: block;
  margin-top: 12px;
}
.credits-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.credits-step,
.credits-role {
  font-size: 10px;
  letter-spacing: 1px;
  color: #d48ca7;
}
.credits-content {
  max-height: 50dvh;
  overflow: auto;
  line-height: 1.8;
}
.credits-content article {
  margin: 16px 0;
}
.credits-content h3 {
  font-size: 22px;
}
.credits-navigation {
  display: flex;
  justify-content: space-between;
}
.credits-track {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.credits-content a {
  text-decoration: underline;
  color: #e7b8d1;
}
@keyframes reward-rise {
  to {
    translate: 0 -75px;
    opacity: 0;
  }
}
@keyframes aura-breathe {
  50% {
    opacity: 0.55;
    transform: scale(0.9);
  }
}
@media (max-width: 1000px) {
  .game-hud {
    gap: 12px;
    grid-template-columns: 1fr 140px 1fr 44px;
    padding: 12px 15px;
  }
  .game-wordmark {
    font-size: 29px;
  }
  .crusher-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .workbench {
    padding: 16px 12px;
  }
  .duel-layout {
    grid-template-columns: 150px max-content 150px;
    gap: 18px;
    padding: 16px 12px;
  }
  .duel-ally > button {
    width: 140px;
  }
  .portrait-stage {
    width: 130px;
  }
  .game-body {
    min-height: 540px;
  }
  .duel-layout {
    --board-width: min(250px, calc((100dvh - 295px) / 2));
  }
}
@media (max-width: 700px) {
  .site-head {
    padding: 12px;
    min-height: 60px;
    gap: 10px;
  }
  .rr-brand {
    font-size: 20px;
  }
  .rr-brand img {
    width: 32px;
    height: 32px;
  }
  .rr-brand small {
    font-size: 7px;
  }
  .back-link {
    font-size: 11px;
  }
  #play-mode {
    display: none;
  }
  .play-page {
    padding: 0 8px;
  }
  .game-frame {
    border-radius: 4px;
  }
  .game-hud {
    grid-template-columns: minmax(0, 1fr) 90px 36px;
    gap: 6px 12px;
    padding: 10px 12px;
    min-height: 90px;
  }
  .game-wordmark {
    font-size: 27px;
  }
  .game-wordmark small {
    font-size: 8px;
    margin-top: 3px;
  }
  .currency > span,
  .score-hud > span {
    font-size: 7px;
    letter-spacing: 0.3px;
  }
  .currency strong,
  .score-hud strong {
    font-size: 27px;
  }
  .chapter-hud {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .chapter-hud > span {
    font-size: 9px;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }
  .chapter-hud .pixel-track {
    margin: 0;
    flex: 1;
    height: 7px;
  }
  .pause-icon {
    grid-column: 3;
    grid-row: 1;
    min-height: 36px;
    font-size: 19px;
    padding: 3px;
  }
  .game-body {
    height: 600px;
    min-height: 0;
  }
  .arcade-page[data-game="click"] .game-body {
    height: 900px;
  }
  .crusher-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 480px 420px;
  }
  .workbench {
    border-left: 0;
    border-top: 2px solid #75434e;
    padding: 16px;
  }
  .bench-title {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .bench-title h2 {
    font-size: 27px;
  }
  .bench-title span {
    grid-column: 1;
    font-size: 8px;
  }
  .bench-title small {
    grid-column: 2;
    grid-row: 1 / 3;
    font-size: 10px;
  }
  .bench-tabs {
    margin: 10px 0;
  }
  .upgrade {
    padding: 10px;
    margin: 7px 0;
  }
  .upgrade img {
    width: 30px;
    height: 30px;
  }
  .ascend {
    padding: 10px;
    margin-top: 8px;
  }
  .bench-tip {
    display: none;
  }
  .breakable-cheese {
    width: 100px;
    height: 125px;
  }
  .breakable-cheese img {
    width: 88px;
    height: 88px;
  }
  .breakable-cheese small {
    font-size: 9px;
  }
  .casca {
    width: 60px;
  }
  .hazard {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 8px;
  }
  .hazard strong {
    font-size: 19px;
  }
  .hazard span {
    font-size: 9px;
  }
  .bed-footer {
    inset: auto 10px 5px;
  }
  .redrat-helper img {
    width: 48px;
    height: 48px;
  }
  .redrat-helper span {
    font-size: 10px;
    max-width: 170px;
  }
  .bed-footer button {
    font-size: 9px;
    padding: 8px;
  }
  .enemy-target {
    width: 75px;
    height: 80px;
    top: 23%;
    left: 83%;
  }
  .enemy-target img {
    width: 64px;
    height: 64px;
  }
  .enemy-target span {
    font-size: 8px;
  }
  .seal-console {
    top: 80px;
    min-width: 220px;
    padding: 8px;
  }
  .duel-layout {
    grid-template-columns: 66px minmax(0, 1fr) 66px;
    gap: 5px;
    padding: 14px 6px;
    align-items: start;
    --board-width: min(230px, calc(100vw - 180px));
  }
  .duel-ally,
  .duel-rival {
    gap: 7px;
    padding: 30px 0 0;
  }
  .portrait-stage {
    width: 66px;
    height: 65px;
  }
  .portrait-stage img {
    width: 65px;
    height: 65px;
  }
  .duel-ally h2,
  .duel-rival h2 {
    font-size: 17px;
  }
  .small-label {
    font-size: 7px;
    letter-spacing: 0;
  }
  .duel-ally canvas {
    width: 64px;
    height: 46px;
  }
  .duel-ally > button {
    width: 66px;
    min-height: 44px;
    font-size: 9px;
    padding: 7px 3px;
  }
  .pulse-button span {
    font-size: 8px;
  }
  .pulse-button small {
    font-size: 8px;
  }
  .reserve-slot span {
    font-size: 7px;
  }
  .board-rim {
    padding: 4px;
    max-width: 100%;
  }
  .duel-alert {
    font-size: 9px;
    line-height: 1.4;
    min-height: 27px;
    max-width: 220px;
  }
  .touch-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    padding-top: 3px;
  }
  .touch-pad button {
    font-size: 9px;
    padding: 5px 2px;
  }
  .touch-pad button:last-child {
    grid-column: 2 / 4;
  }
  .boss-hearts {
    grid-template-columns: repeat(4, 11px);
    gap: 4px;
  }
  .boss-hearts i {
    width: 11px;
    height: 10px;
  }
  .duel-rival > p {
    font-size: 9px;
    line-height: 1.55;
    max-width: 66px;
  }
  .curse-clock {
    width: 66px;
    padding-top: 8px;
  }
  .curse-clock span {
    font-size: 6px;
    letter-spacing: 0;
  }
  .curse-clock strong {
    font-size: 24px;
  }
  .duel-rival .duel-whisper {
    display: none;
  }
  .seal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .seal-row i {
    font-size: 18px;
  }
  .hub-gamebar {
    padding: 0 10px;
    gap: 8px;
  }
  .settings {
    margin-right: 0;
  }
  .build-select {
    flex-wrap: wrap;
    font-size: 10px;
  }
  .build-select select {
    max-width: 280px;
    font-size: 10px;
  }
  #version-picker {
    width: 100%;
  }
  .game-notes {
    margin: 18px 10px;
    padding: 18px 0;
  }
  .arcade-page .feedback-game-panel {
    width: calc(100% - 20px) !important;
    padding: 18px;
  }
  .world-menu {
    padding: 24px 15px;
  }
  .world-menu h1 {
    font-size: 48px;
  }
  .world-menu p {
    font-size: 12px;
  }
  .menu-actions {
    flex-direction: column;
    width: min(280px, 100%);
  }
  .menu-actions button:first-child {
    min-width: 0;
  }
  .settings > div {
    gap: 12px;
  }
  .board-rim::before {
    left: -7px;
    width: 3px;
  }
  .board-rim::after {
    right: -7px;
    width: 3px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .site-head {
    min-height: 46px;
    padding: 6px 16px;
  }
  .rr-brand img {
    width: 30px;
    height: 30px;
  }
  .rr-brand {
    font-size: 20px;
  }
  .rr-brand small {
    font-size: 7px;
  }
  .game-hud {
    min-height: 54px;
    padding: 6px 16px;
    grid-template-columns: 1fr 100px 1fr 36px;
  }
  .game-wordmark {
    font-size: 26px;
  }
  .game-wordmark small {
    display: none;
  }
  .currency strong,
  .score-hud strong {
    font-size: 27px;
  }
  .chapter-hud > span {
    font-size: 8px;
  }
  .game-body {
    height: 330px;
    min-height: 0;
  }
  .duel-layout {
    --board-width: 120px;
    grid-template-columns: 140px max-content 140px;
    gap: 30px;
    padding: 8px;
  }
  .duel-ally,
  .duel-rival {
    gap: 4px;
    padding: 0;
  }
  .portrait-stage {
    height: 58px;
    width: 100px;
  }
  .portrait-stage img {
    width: 58px;
    height: 58px;
  }
  .duel-ally h2,
  .duel-rival h2 {
    font-size: 20px;
  }
  .duel-ally canvas {
    height: 35px;
    width: 80px;
  }
  .duel-ally > button {
    min-height: 32px;
    font-size: 8px;
  }
  .duel-alert {
    font-size: 8px;
    min-height: 20px;
  }
  .touch-pad {
    width: 240px;
    gap: 4px;
  }
  .touch-pad button {
    padding: 4px;
    font-size: 9px;
  }
  .duel-rival > p {
    font-size: 9px;
  }
  .duel-whisper {
    display: none;
  }
  .boss-hearts {
    grid-template-columns: repeat(4, 15px);
    gap: 4px;
    margin: 4px;
  }
  .boss-hearts i {
    width: 15px;
    height: 13px;
  }
  .curse-clock {
    padding-top: 4px;
  }
  .curse-clock strong {
    font-size: 20px;
  }
  .seal-row {
    margin: 0;
  }
  .seal-row i {
    font-size: 17px;
  }
  .pulse-button {
    padding: 6px;
  }
  .small-label {
    font-size: 7px;
  }
}
.game-frame:fullscreen {
  width: 100vw;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.game-frame:fullscreen .game-body {
  flex: 1;
  height: auto;
}
.game-frame:fullscreen .duel-layout {
  --board-width: min(300px, calc((100dvh - 200px) / 2));
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .reward-float {
    opacity: 1;
  }
}
.world-menu {
  animation: menu-arrival 0.2s ease-out;
}
.breakable-cheese .hammer-hit {
  position: absolute;
  top: 6px;
  left: 55%;
  opacity: 0;
  pointer-events: none;
  transform-origin: 10% 90%;
}
.breakable-cheese .hammer-hit img {
  width: 42px;
  height: 42px;
  filter: drop-shadow(2px 2px #080b14);
}
.breakable-cheese.striking .hammer-hit {
  animation: hammer-swing 0.18s ease-out forwards;
}
@keyframes hammer-swing {
  0% {
    opacity: 1;
    transform: rotate(35deg) translateY(-10px);
  }
  60% {
    opacity: 1;
    transform: rotate(-35deg) translateY(7px);
  }
  100% {
    opacity: 0;
    transform: rotate(-45deg) translateY(10px);
  }
}
@keyframes menu-arrival {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 700px) {
  .arcade-page[data-game="click"] .game-wordmark {
    font-size: 22px;
  }
  .duel-rival h2 {
    font-size: 14px;
  }
  .duel-rival > p {
    font-size: 10px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .game-body {
    height: calc(100dvh - 110px);
  }
  .duel-layout {
    --board-width: min(120px, calc((100dvh - 220px) / 2));
  }
  .breakable-cheese {
    width: 92px;
    height: 92px;
  }
  .breakable-cheese img {
    width: 64px;
    height: 64px;
  }
  .breakable-cheese small {
    font-size: 8px;
  }
  .crusher-layout {
    grid-template-columns: minmax(0, 1fr) 235px;
  }
  .workbench {
    padding: 10px;
  }
  .bench-title h2 {
    font-size: 24px;
  }
  .bench-title span,
  .bench-title small {
    font-size: 8px;
  }
  .bench-tabs {
    margin: 8px 0;
  }
  .upgrade {
    padding: 8px;
    margin: 6px 0;
    grid-template-columns: 28px 1fr auto;
  }
  .upgrade img {
    width: 26px;
    height: 26px;
  }
  .upgrade strong {
    font-size: 10px;
  }
  .upgrade small {
    font-size: 8px;
  }
  .redrat-helper {
    display: none;
  }
  .bed-footer {
    bottom: 4px;
    right: 8px;
    justify-content: end;
  }
  .bed-footer button {
    font-size: 8px;
    min-height: 28px;
    padding: 5px 8px;
  }
  .hazard {
    padding: 5px 9px;
    top: 5px;
    left: 7px;
    right: 7px;
  }
  .hazard strong {
    font-size: 17px;
  }
  .hazard span {
    font-size: 8px;
  }
  .enemy-target {
    top: 39%;
    width: 72px;
    height: 80px;
  }
  .enemy-target img {
    width: 64px;
    height: 64px;
  }
}
/* Interactions are game controls; documentation and comment text remain selectable. */
#game-frame,
.arcade-page button,
.arcade-page img,
.village-page button,
.village-page canvas,
.village-page img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
html:not([data-village-skin="classic"])[data-village-skin] .game-hud {
  border-color: var(--skin-accent);
  background: linear-gradient(100deg, var(--skin-shadow), #111522 65%);
}
html:not([data-village-skin="classic"])[data-village-skin] .pixel-track i {
  background: var(--skin-accent);
  box-shadow: 0 0 10px var(--skin-shadow);
}
html:not([data-village-skin="classic"])[data-village-skin] .board-rim {
  border-color: var(--skin-accent);
  box-shadow: 0 0 24px var(--skin-shadow);
}
.village-coin-status {
  font: 12px var(--ui-font, system-ui);
  color: #f6d885;
  padding: 8px 12px;
  white-space: nowrap;
  user-select: none;
}
html[data-village-skin$="-3"] .game-hud,
html[data-village-skin$="-4"] .game-hud,
html[data-village-skin$="-5"] .game-hud {
  border-bottom-width: 4px;
}
html[data-village-skin$="-5"] .game-hud {
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, #ffffff06 10px 12px),
    linear-gradient(100deg, var(--skin-shadow), #111522 65%);
}

/* the Cheetris wordmark in the page header */
.game-logo {
  height: 34px;
  width: auto;
  image-rendering: pixelated;
  margin-left: auto;
  margin-right: 12px;
}
.game-logo[hidden] {
  display: none;
}
