/* --- fonts (bundled in fonts/) --- */
@font-face {
  font-family: 'IM Fell English';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IMFellEnglish-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'IM Fell English';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IMFellEnglish-Italic.ttf') format('truetype');
}
@font-face {
  font-family: 'Macondo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Macondo-Regular.ttf') format('truetype');
}

/* ==========================================================================
   Skullcat's Omen
   Layout is built as a 1440x800 "canvas" (matching the Figma "Desktop - 1"
   frame) using container-query units (cqw) so every measurement scales
   together and stays proportional to the original design.

   1px in the Figma frame  ==  (100 / 1440)cqw  ==  0.069444cqw

   Image assets live in /images:
     - skullcat.png       the cat illustration (.cat)
     - blob-vector.png    the decorative background blob (.blob)
     - divining-frame.png the photo in the "currently divining" panel
                          (.divining-photo)
   ========================================================================== */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'IM Fell English', 'Comic Sans MS', cursive, serif;
  background: #1b1818;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  height: 100vh;
}

.stage {
  position: relative;
  width: calc(min(100vw, 100vh * 1.8) * 1.06);
  aspect-ratio: 1440 / 800;
}

.canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
  isolation: isolate;
  color: #6f5454;
  background-image: url('../images/background.PNG');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.blob {
  /* v3: old tail blob hidden — new cat is a full-canvas PNG */
  display: none;
}



.page {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page.page-critical-omens { transform-origin: 14.395% 26.7795%; }
.page.page-dormant-curses { transform-origin: 40.992% 26.7795%; }
.page.page-flash-hexes    { transform-origin: 15.783% 74.6305%; }
.page.page-stray-leaves   { transform-origin: 42.367% 74.7285%; }

.shadow {
  position: absolute;
  border-radius: 1.389cqw;
  background-image: url('../images/card-blank.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  /* lets hovering over the shadow's exposed edge (the part peeking out
     from behind the note) count as hovering its .page-* wrapper, so the
     rustle/wobble's detection box covers the whole card shadow, not just
     the note on top of it */
  pointer-events: auto;
}

.shadow-tl {
  left: 1.736%;
  top: 3.125%;
  width: 25.486%;
  height: 62%;
}

.shadow-tr {
  left: 27.2913%;
  top: 3.125%;
  width: 25.486%;
  height: 62%;
}

.shadow-bl {
  left: 3.54167%;
  top: 48.851%;
  width: 25.486%;
  height: 62%;
}

.shadow-br {
  left: 29.08397%;
  top: 48.949%;
  width: 25.486%;
  height: 62%;
}

.note {
  position: absolute;
  width: 22.678%;
  height: 35.059%;
  pointer-events: auto;
  border-radius: 0.833cqw;
  padding: 1.5% 4%;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 0 transparent;
  transition: box-shadow 0.15s ease;
}

.note-critical-omens { left: 3.056%; top: 11.625%; }
.note-dormant-curses { left: 28.6113%; top: 11.625%; }
.note-flash-hexes    { left: 4.86067%; top: 57.351%; }
.note-stray-leaves   { left: 30.40297%; top: 57.449%; }

.note.is-drop-target {
  box-shadow: inset 0 0 0 0.3cqw rgba(111, 84, 84, 0.6);
}

.note-title {
  position: absolute;
  width: 25.486%;
  text-align: center;
  margin: 0;
  font-family: 'Macondo', cursive;
  font-size: 1.6cqw;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.3;
  white-space: nowrap;
}

.title-critical-omens { left: 1.736%;  top: 8.0%;   color: #6f5454; }
.title-dormant-curses { left: 27.2913%; top: 8.0%;  color: #6f5454; }
.title-flash-hexes    { left: 3.54167%;  top: 53.725%; color: #6f5454; }
.title-stray-leaves   { left: 29.08397%; top: 53.825%; color: #6e5555; }

/* duplicate titles: same text, centered, font-size reduced ~7pt total
   (1.6cqw -> 0.952cqw), positioned 25px (3.125%) above the original */
.note-title-sub {
  position: absolute;
  width: 25.486%;
  text-align: center;
  margin: 0;
  font-family: 'Macondo', cursive;
  font-size: 0.859cqw;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.3;
  white-space: nowrap;
}

.title-sub-critical-omens { left: 1.736%;  top: 4.75%; color: #6f5454; }
.title-sub-dormant-curses { left: 27.2913%; top: 4.75%; color: #6f5454; }
.title-sub-flash-hexes    { left: 3.54167%;  top: 50.475%; color: #6f5454; }
.title-sub-stray-leaves   { left: 29.08397%; top: 50.575%; color: #6e5555; }

.task-list {
  list-style: none;
  counter-reset: task-counter;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.task {
  counter-increment: task-counter;
  height: 3.73cqh;
  width: calc(100% + 1.389cqw + 2.083cqw);
  margin-left: -2.083cqw;
  display: flex;
  align-items: center;
  gap: 0.4cqw;
  font-size: 1.024cqw;
  color: #6f5454;
  transform: translateY(-2.75cqh);
}

.task.is-dragging {
  opacity: 0.4;
}

.task::before {
  content: counter(task-counter) ". ";
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.task span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* double-click a task to swap its <span> for one of these, in place */
.task-edit-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.024cqw;
  color: #6f5454;
}

.task-edit-input:focus {
  outline: none;
}

.task .delete {
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(94, 71, 71, 0.6);
  font-size: 0.9cqw;
  line-height: 1;
  padding: 0.2cqw;
  transform: translateX(1.389cqw);
}

.task .delete:hover {
  color: #6f5454;
}

.task.is-divining span,
.task:hover span,
.task.is-hover-underline span {
  text-decoration: underline solid #6f5454;
  text-decoration-thickness: 0.12cqw;
  text-underline-offset: 0.2cqw;
}

.note:has(.task:hover) .task.is-divining:not(:hover) span {
  text-decoration: none;
}

.task.is-complete span {
  text-decoration: line-through solid rgba(111, 84, 84, 0.7);
  text-decoration-thickness: 0.12cqw;
  color: rgba(111, 84, 84, 0.55);
}

.task-list:empty {
  height: 0;
}

.add-task-form {
  margin: 0;
  height: 3.73cqh;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4cqw;
  font-size: 1.024cqw;
  transform: translateY(-2.75cqh);
  width: calc(100% + 1.389cqw + 2.083cqw);
  margin-left: -2.083cqw;
}

/* hide the add-task row when the column is at capacity */
.note.is-full .add-task-form {
  display: none;
}

.add-task-form::before {
  content: "+";
  flex-shrink: 0;
  color: rgba(111, 84, 84, 0.45);
  font-variant-numeric: tabular-nums;
}

.add-task-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.024cqw;
  color: rgba(111, 84, 84, 0.45);
}

.add-task-input::placeholder {
  color: rgba(111, 84, 84, 0.45);
}

.add-task-input:focus {
  outline: none;
  color: #6f5454;
}

.fairies {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.fairies.is-paused {
  opacity: 0;
}

.fairies.is-paused .fairy {
  animation-play-state: paused;
}

.fairy {
  position: absolute;
  bottom: -8%;
  border-radius: 50%;
  mix-blend-mode: screen;
  -webkit-mask-image:
    radial-gradient(circle, #fff 0%, #fff 55%, transparent 100%),
    url('../images/grain.png');
  mask-image:
    radial-gradient(circle, #fff 0%, #fff 55%, transparent 100%),
    url('../images/grain.png');
  -webkit-mask-size: 100% 100%, 22% 22%;
  mask-size: 100% 100%, 22% 22%;
  -webkit-mask-repeat: no-repeat, repeat;
  mask-repeat: no-repeat, repeat;
  -webkit-mask-composite: source-over, source-in;
  mask-composite: add, intersect;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

@keyframes fairy-path-a {
  0%   { transform: translate(0, 0); opacity: 0; }
  8%   { transform: translate(1.4cqw, -10cqh); opacity: 0.7; }
  15%  { transform: translate(2.8cqw, -20cqh); opacity: 0.3; }
  23%  { transform: translate(3.4cqw, -30cqh); opacity: 0.9; }
  31%  { transform: translate(2.3cqw, -40cqh); opacity: 0.45; }
  38%  { transform: translate(0.2cqw, -50cqh); opacity: 0.85; }
  46%  { transform: translate(-2cqw, -60cqh); opacity: 0.15; }
  54%  { transform: translate(-3.3cqw, -70cqh); opacity: 0.8; }
  62%  { transform: translate(-3cqw, -80cqh); opacity: 0.25; }
  69%  { transform: translate(-1.2cqw, -90cqh); opacity: 0.9; }
  77%  { transform: translate(1cqw, -100cqh); opacity: 0.35; }
  85%  { transform: translate(2.5cqw, -110cqh); opacity: 0.7; }
  100% { transform: translate(0, -120cqh); opacity: 0; }
}

@keyframes fairy-path-b {
  0%   { transform: translate(0, 0); opacity: 0; }
  7%   { transform: translate(-1.8cqw, -10cqh); opacity: 0.6; }
  14%  { transform: translate(-3.2cqw, -20cqh); opacity: 0.9; }
  22%  { transform: translate(-2cqw, -30cqh); opacity: 0.25; }
  30%  { transform: translate(0.5cqw, -40cqh); opacity: 0.8; }
  39%  { transform: translate(2.6cqw, -50cqh); opacity: 0.4; }
  47%  { transform: translate(3.4cqw, -60cqh); opacity: 0.95; }
  55%  { transform: translate(2cqw, -70cqh); opacity: 0.2; }
  63%  { transform: translate(-0.6cqw, -80cqh); opacity: 0.75; }
  71%  { transform: translate(-2.8cqw, -90cqh); opacity: 0.3; }
  79%  { transform: translate(-3.3cqw, -100cqh); opacity: 0.85; }
  90%  { transform: translate(-1cqw, -110cqh); opacity: 0.5; }
  100% { transform: translate(0.5cqw, -120cqh); opacity: 0; }
}

@keyframes fairy-path-c {
  0%   { transform: translate(0, 0); opacity: 0; }
  9%   { transform: translate(0.9cqw, -10cqh); opacity: 0.5; }
  17%  { transform: translate(2.4cqw, -20cqh); opacity: 0.85; }
  25%  { transform: translate(3cqw, -30cqh); opacity: 0.3; }
  33%  { transform: translate(1.8cqw, -40cqh); opacity: 0.7; }
  42%  { transform: translate(-0.4cqw, -50cqh); opacity: 0.95; }
  50%  { transform: translate(-2.2cqw, -60cqh); opacity: 0.2; }
  58%  { transform: translate(-2.8cqw, -70cqh); opacity: 0.6; }
  67%  { transform: translate(-1.5cqw, -80cqh); opacity: 0.9; }
  75%  { transform: translate(0.8cqw, -90cqh); opacity: 0.35; }
  83%  { transform: translate(2.5cqw, -100cqh); opacity: 0.75; }
  92%  { transform: translate(1.2cqw, -110cqh); opacity: 0.45; }
  100% { transform: translate(-0.5cqw, -120cqh); opacity: 0; }
}

@keyframes fairy-path-d {
  0%   { transform: translate(0, 0); opacity: 0; }
  6%   { transform: translate(-1cqw, -10cqh); opacity: 0.45; }
  13%  { transform: translate(-2.6cqw, -20cqh); opacity: 0.9; }
  21%  { transform: translate(-3.4cqw, -30cqh); opacity: 0.25; }
  29%  { transform: translate(-2cqw, -40cqh); opacity: 0.6; }
  37%  { transform: translate(0.6cqw, -50cqh); opacity: 0.95; }
  46%  { transform: translate(2.4cqw, -60cqh); opacity: 0.3; }
  55%  { transform: translate(2.8cqw, -70cqh); opacity: 0.8; }
  63%  { transform: translate(1.2cqw, -80cqh); opacity: 0.4; }
  71%  { transform: translate(-1cqw, -90cqh); opacity: 0.85; }
  80%  { transform: translate(-2.5cqw, -100cqh); opacity: 0.2; }
  90%  { transform: translate(-1.5cqw, -110cqh); opacity: 0.65; }
  100% { transform: translate(0.5cqw, -120cqh); opacity: 0; }
}

.fairy-1  { left: 4%;  width: 2.2cqw; height: 2.2cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-a 22s ease-in-out infinite; animation-delay: -3s; }
.fairy-2  { left: 14%; width: 1.4cqw; height: 1.4cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-c 17s ease-in-out infinite; animation-delay: -9s; }
.fairy-3  { left: 24%; width: 2.8cqw; height: 2.8cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-b 26s ease-in-out infinite; animation-delay: -14s; }
.fairy-4  { left: 33%; width: 1.8cqw; height: 1.8cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-d 19s ease-in-out infinite; animation-delay: -1s; }
.fairy-5  { left: 42%; width: 1.2cqw; height: 1.2cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-a 15s ease-in-out infinite; animation-delay: -11s; }
.fairy-6  { left: 50%; width: 2.4cqw; height: 2.4cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-c 24s ease-in-out infinite; animation-delay: -6s; }
.fairy-7  { left: 58%; width: 1.6cqw; height: 1.6cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-d 20s ease-in-out infinite; animation-delay: -16s; }
.fairy-8  { left: 67%; width: 2cqw;   height: 2cqw;   background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-b 18s ease-in-out infinite; animation-delay: -4s; }
.fairy-9  { left: 75%; width: 1.3cqw; height: 1.3cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-a 23s ease-in-out infinite; animation-delay: -19s; }
.fairy-10 { left: 83%; width: 2.6cqw; height: 2.6cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-c 27s ease-in-out infinite; animation-delay: -8s; }
.fairy-11 { left: 90%; width: 1.7cqw; height: 1.7cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-d 16s ease-in-out infinite; animation-delay: -2s; }
.fairy-12 { left: 96%; width: 1.1cqw; height: 1.1cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-b 21s ease-in-out infinite; animation-delay: -13s; }

.fairy-13 { left: 56%; width: 1.5cqw; height: 1.5cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-a 19s ease-in-out infinite; animation-delay: -7s; }
.fairy-14 { left: 62%; width: 2.3cqw; height: 2.3cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-c 25s ease-in-out infinite; animation-delay: -17s; }
.fairy-15 { left: 70%; width: 1.1cqw; height: 1.1cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-d 14s ease-in-out infinite; animation-delay: -5s; }
.fairy-16 { left: 79%; width: 2.7cqw; height: 2.7cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-b 29s ease-in-out infinite; animation-delay: -21s; }
.fairy-17 { left: 88%; width: 1.6cqw; height: 1.6cqw; background-image: radial-gradient(circle, rgba(214, 207, 191, 0.85) 0%, rgba(214, 207, 191, 0.32) 35%, transparent 75%); animation: fairy-path-a 18s ease-in-out infinite; animation-delay: -10s; }

.cat {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/cat.PNG');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}

@keyframes cat-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.012); }
}

.cat,
.cat-face-shade,
.cat-eyes,
.cat-eyes-flash {
  transform-origin: 50% 100%;
  animation: cat-breathe 7s ease-in-out infinite;
}

.cat-face-shade {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 38%);
  -webkit-mask-image: url('../images/cat.PNG');
  mask-image: url('../images/cat.PNG');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
}

.cat-eyes {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/cat.PNG');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  /* v3: rough eye positions — tune after viewing in browser */
  -webkit-mask-image:
    radial-gradient(circle 2.6cqw at 63.5% 30.0%, #fff 0%, #fff 55%, transparent 100%),
    radial-gradient(circle 2.6cqw at 72.0% 30.0%, #fff 0%, #fff 55%, transparent 100%);
  mask-image:
    radial-gradient(circle 2.6cqw at 63.5% 30.0%, #fff 0%, #fff 55%, transparent 100%),
    radial-gradient(circle 2.6cqw at 72.0% 30.0%, #fff 0%, #fff 55%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.cat-eyes-flash {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
    135deg,
    transparent 0%,
    transparent 42%,
    #fff 50%,
    transparent 58%,
    transparent 100%
  );
  background-size: 260% 260%;
  background-repeat: no-repeat;
  background-position: 130% 130%;
  opacity: 0;
  pointer-events: none;
  /* matches .cat-eyes */
  -webkit-mask-image:
    radial-gradient(circle 2.6cqw at 63.5% 30.0%, #fff 0%, #fff 55%, transparent 100%),
    radial-gradient(circle 2.6cqw at 72.0% 30.0%, #fff 0%, #fff 55%, transparent 100%);
  mask-image:
    radial-gradient(circle 2.6cqw at 63.5% 30.0%, #fff 0%, #fff 55%, transparent 100%),
    radial-gradient(circle 2.6cqw at 72.0% 30.0%, #fff 0%, #fff 55%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

@keyframes eye-shine-sweep {
  0%   { background-position: 150% 150%; opacity: 0; }
  18%  { opacity: 1; }
  50%  { background-position: 40% 40%; opacity: 1; }
  82%  { opacity: 1; }
  100% { background-position: -50% -50%; opacity: 0; }
}

.cat-eyes-flash,
.cat-eyes-flash.is-shining {
  display: none !important;
  opacity: 0 !important;
  animation: none !important;
}

.omen-dim {
  position: fixed;
  inset: 0;
  background: #000;
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.omen-dim.is-dimmed {
  opacity: 0.55;
  transition: opacity 0.35s ease;
}


.omen-blackout {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

@keyframes omen-blackout {
  0%      { opacity: 0; }
  1%      { opacity: 1; }
  33.33%  { opacity: 1; }
  100%    { opacity: 0; }
}

.omen-blackout.is-active {
  animation: omen-blackout 1.5s ease-out;
}

.omen-blackout.is-active-short {
  animation: omen-blackout 0.6s ease-out;
}

.omen-flash {
  position: fixed;
  inset: 0;
  background: #e50c0c;
  mix-blend-mode: color;
  opacity: 0;
  pointer-events: none;
}

@keyframes omen-flash {
  0%      { opacity: 0; }
  1%      { opacity: 1; }
  33.33%  { opacity: 1; }
  100%    { opacity: 0; }
}

.omen-flash.is-flashing {
  animation: omen-flash 1.5s ease-out;
}

.omen-flash.is-flashing-short {
  animation: omen-flash 0.6s ease-out;
}

@keyframes omen-rock {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(6.4deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(-6.4deg); }
  100% { transform: rotate(0deg); }
}

.is-shaking {
  transform-origin: 50% 50%;
  animation-name: omen-rock;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes page-breeze {
  0%   { transform: rotate(0deg) translate(0, 0); }
  30%  { transform: rotate(0.55deg) translate(0.22cqw, -0.12cqh); }
  62%  { transform: rotate(-0.3deg) translate(-0.12cqw, 0.08cqh); }
  100% { transform: rotate(0deg) translate(0, 0); }
}

.is-breezing {
  animation: page-breeze 2.6s ease-in-out;
}

@keyframes page-rustle-in {
  0%   { transform: rotate(0deg) translate(0, 0); }
  18%  { transform: rotate(-1.7deg) translate(-0.55cqw, 0.24cqh); }
  38%  { transform: rotate(1.2deg) translate(0.4cqw, -0.2cqh); }
  58%  { transform: rotate(-0.85deg) translate(-0.28cqw, 0.14cqh); }
  78%  { transform: rotate(0.4deg) translate(0.14cqw, -0.07cqh); }
  100% { transform: rotate(-0.5deg) translate(-0.18cqw, 0.09cqh); }
}

.is-rustling-in {
  animation: page-rustle-in 0.5s ease-out forwards;
}

@keyframes page-rustle-out {
  0%   { transform: rotate(-0.5deg) translate(-0.18cqw, 0.09cqh); }
  40%  { transform: rotate(0.35deg) translate(0.12cqw, -0.06cqh); }
  75%  { transform: rotate(-0.12deg) translate(-0.04cqw, 0.02cqh); }
  100% { transform: rotate(0deg) translate(0, 0); }
}

.is-rustling-out {
  animation: page-rustle-out 0.45s ease-out;
}

.page-divining {
  position: absolute;
  inset: 0;
}

.page.page-divining { transform-origin: 78.0905% 67.625%; }

.divining-photo {
  position: absolute;
  left: 56.9448%;
  top: 66.875%;
  width: 40.347%;
  /* height kept in the same ratio as new text box 2.png so the
     frame art isn't stretched */
  height: 15.373%;
  border-radius: 0;
  background-image: url('../images/text-box.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  overflow: hidden;
  transform-origin: 50% 50%;
}

@keyframes reveal-shake {
  0%   { transform: translate(0, 0) scale(1); }
  8%   { transform: translate(-0.45cqw, 0.35cqh) scale(1.06); }
  16%  { transform: translate(0.5cqw, -0.325cqh) scale(1.07); }
  24%  { transform: translate(-0.4cqw, -0.4cqh) scale(1.05); }
  32%  { transform: translate(0.375cqw, 0.325cqh) scale(1.04); }
  42%  { transform: translate(-0.25cqw, 0.2cqh) scale(1.025); }
  52%  { transform: translate(0.2cqw, -0.16cqh) scale(1.015); }
  64%  { transform: translate(-0.125cqw, 0.1cqh) scale(1.0075); }
  78%  { transform: translate(0.06cqw, -0.06cqh) scale(1.0025); }
  100% { transform: translate(0, 0) scale(1); }
}

.divining-photo.is-revealing,
.divining-task.is-revealing {
  animation: reveal-shake 0.9s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.divining-task {
  position: absolute;
  left: 59.722%;
  top: 69.875%;
  width: 31.736%;
  margin: 0;
  font-size: 1.297cqw;
  color: #ffffff;
  transform-origin: 50% 50%;
}

.divining-task.is-shuffling {
  overflow: hidden;
  height: 13.875cqh;
  line-height: 1.25;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  color: #8b0000;
  letter-spacing: 0.05em;
}

.divining-stakes {
  position: absolute;
  left: 70.681%;
  top: 76.450%;
  width: 23.834%;
  margin: 0;
  font-size: 1.297cqw;
  color: #ffffff;
  text-align: right;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.divining-stakes.is-visible {
  opacity: 1;
}

.pill {
  position: absolute;
  top: 84.375%;
  width: 19.618%;
  /* height kept in the same ratio as button-frame.png (860:185) so the
     frame art isn't stretched */
  height: 7.596%;
  border: none;
  border-radius: 0;
  background: url('../images/button-frame.png') no-repeat center / 100% 100%;
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  /* shifts the centered label down ~2px within the frame art */
  box-sizing: border-box;
  padding-top: 0.5cqh;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.pill:hover {
  filter: brightness(1.3);
}

.pill:active {
  transform: scale(0.97);
}

.pill-divine {
  left: 56.9448%;
  font-size: 2.13cqw;
}

.pill-banish {
  left: 77.6738%;
  font-size: 2.13cqw;
}

/* ================================================================
   v2 ATMOSPHERE EXPANSION
   Vignette + grain, dread meter, peripheral shadow, marginalia,
   completion ritual (also used on BANISH), witching-hour palette,
   subtle breathing overlay, and a divination blur.
   ================================================================ */

.canvas {
  --dread: 0;
  --canvas-blur: 0px;
  /* pre-promote to a GPU compositing layer so toggling blur during
     divination never triggers layer creation or teardown — it just
     updates the existing layer's filter value on the GPU */
  will-change: filter;
  /* blur and grayscale are combined so neither overrides the other.
     --grayscale is set by JS updateDread(); --canvas-blur by is-divining. */
  filter: blur(var(--canvas-blur)) grayscale(var(--grayscale, 0));
  transition: filter 1.2s ease-in-out;
}

.canvas.is-divining {
  --canvas-blur: 1.2px;
}

.canvas.is-divining .cat-eyes {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cat-omen {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/cat-dark.PNG');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  transform-origin: 50% 100%;
  animation: cat-breathe 7s ease-in-out infinite;
}

.canvas.is-divining .cat-omen {
  opacity: 1;
}

.cat-selection {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/cat-selection.PNG');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transform-origin: 50% 100%;
  animation: cat-breathe 7s ease-in-out infinite;
}

.cat-selection.is-flashing {
  animation: cat-breathe 7s ease-in-out infinite, omen-flash 1.5s ease-out;
}

.cat-selection.is-flashing-short {
  animation: cat-breathe 7s ease-in-out infinite, omen-flash 0.6s ease-out;
}

.vignette {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle, transparent 55%, rgba(0, 0, 0, 0.54) 100%);
  opacity: calc(0.35 + var(--dread) * 0.65);
  transition: opacity 2s ease;
}

/* dread grain — grain.png tiled over the whole canvas, fades in with dread.
   mix-blend-mode: overlay presses the grain texture into both light and dark
   areas without washing them out. Invisible at dread 0. */
.dread-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('../images/grain.png');
  background-size: 128px 128px;
  background-repeat: repeat;
  mix-blend-mode: overlay;
  opacity: calc(var(--dread) * 0.45);
  transition: opacity 2s ease;
  z-index: 99;
}


.peripheral-shadow {
  position: absolute;
  width: 18cqw;
  height: 30cqh;
  top: 30%;
  left: -20%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  filter: blur(18px);
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
}

.peripheral-shadow.is-passing {
  animation: peripheral-pass 1s ease-in-out;
}

@keyframes peripheral-pass {
  0%   { opacity: 0; transform: translateX(0) scaleY(1); }
  35%  { opacity: 0.35; }
  65%  { opacity: 0.28; }
  100% { opacity: 0; transform: translateX(45cqw) scaleY(1.1); }
}

.completion-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse, transparent 65%, rgba(255, 190, 110, 0.46) 100%),
    radial-gradient(ellipse, transparent 48%, rgba(255, 80, 10, 0.46) 100%);
  opacity: 0;
}

.completion-glow.is-glowing {
  animation: completion-glow-pulse 1.1s ease-out;
}

@keyframes completion-glow-pulse {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

.eye-star-anchor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.eye-star-anchor-left {
  animation: eye-star-breathe-left 7s ease-in-out infinite;
}

.eye-star-anchor-right {
  animation: eye-star-breathe-right 7s ease-in-out infinite;
}

@keyframes eye-star-breathe-left {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(0.268%, -0.781%); }
}

@keyframes eye-star-breathe-right {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(0.408%, -0.781%); }
}

.eye-star {
  position: absolute;
  top: 35.250%;
  transform: translate(-50%, -50%);
  font-size: 2.56cqw;
  line-height: 1;
  color: #fff;
  mix-blend-mode: normal;
  pointer-events: none;
  opacity: 0;
}

.eye-star.is-chosen {
  opacity: 1;
}

.eye-star.is-banishing {
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* v3: rough estimate — tune after viewing in browser */
.eye-star-left  { left: 72.111%; }
.eye-star-right { left: 83.596%; }

.eye-star.eye-star-glow {
  filter: blur(9px);
  color: #e50c0c;
}

@keyframes eye-star-blink {
  0%   { opacity: 1; }
  38%  { opacity: 0; }
  62%  { opacity: 0; }
  100% { opacity: 1; }
}

.eye-star.is-blinking {
  animation: eye-star-blink 0.9s ease-in-out;
}

.eye-star.is-flaring {
  animation: eye-star-flare 1.5s ease-out;
}

.eye-star.is-flaring-short {
  animation: eye-star-flare 0.6s ease-out;
}

/* while the DIVINE wheel spins, the eyes stay lit and rapidly cycle
   through all four suits (text swapped via JS every 60ms) */
.eye-star.is-spinning {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.15);
}

@keyframes eye-star-flare {
  0%   { opacity: 0;  transform: translate(-50%, -50%) scale(0.6); }
  5%   { opacity: 1;  transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 1;  transform: translate(-50%, -50%) scale(1); }
}

.stage {
  transition: filter 3s ease;
}

body.is-witching-hour .stage {
  filter: saturate(0.78) brightness(0.9) hue-rotate(-8deg);
}

.breathing-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #000;
  opacity: 0;
}

.canvas.scene-breathing .breathing