:root {
  --cream: #f1ebe0;
  --paper: #f7f3eb;
  --forest: #173a2a;
  --moss: #4d5e2e;
  --ochre: #9a7426;
  --clay: #b8532a;
  --ink: #1c2a22;
  --line: color-mix(in oklab, var(--forest) 18%, transparent);
  --soft: color-mix(in oklab, var(--forest) 72%, transparent);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 28px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--forest);
  font-family: "Google Sans Flex", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--forest); color: var(--cream); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
[hidden] { display: none !important; }

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.ink {
  display: inline-block;
  flex: none;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.display {
  font-family: "Homemade Apple", "Bradley Hand", cursive;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.6rem 1rem 1.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 500ms var(--ease), background-color 300ms, color 300ms, border-color 300ms;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn .arrow { transition: transform 500ms var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--forest); color: var(--cream); }
.btn-primary:hover { background: var(--clay); }
.btn-ghost { background: transparent; color: var(--forest); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--forest); }
.btn-small { padding: 0.7rem 1.1rem; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--forest);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: background-color 250ms, color 250ms, transform 400ms var(--ease), box-shadow 250ms;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { box-shadow: inset 0 0 0 1.5px var(--forest); }
.icon-btn[aria-pressed="true"] { background: var(--forest); color: var(--cream); box-shadow: none; }
.icon-btn[disabled] { opacity: 0.35; pointer-events: none; }

/* ---------- layout ---------- */

.top {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 0;
}
.brand { display: inline-flex; transition: opacity 300ms; }
.brand:hover { opacity: 0.7; }
.pill {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: var(--forest);
  color: var(--cream);
}

main { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.hero-wrap { position: relative; }
.floaters {
  position: absolute;
  inset: -80px -16px 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  color: var(--forest);
}
.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 36px;
  text-align: center;
}
.hero-cat { width: clamp(120px, 20vw, 200px); color: var(--ink); animation: enter 1.2s var(--ease) both, breathe 7s ease-in-out 1.2s infinite; }
.hero .eyebrow { margin: 20px 0 0; color: var(--ink); }
.hero h1 { margin: 14px 0 6px; font-size: clamp(2rem, 6.6vw, 4.6rem); text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--clay); }
.lede { max-width: 34rem; margin: 0 auto; font-size: 1.04rem; line-height: 1.6; color: var(--soft); text-wrap: pretty; }
.counter {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-top: 22px;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.92rem;
}
.counter b { color: var(--clay); font-weight: 800; font-variant-numeric: tabular-nums; }

.shared {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 18px auto 0;
  padding: 14px 16px 14px 20px;
  border-radius: 22px;
  background: var(--clay);
  color: var(--paper);
  animation: enter 900ms var(--ease) both;
}
.shared p { margin: 0; font-weight: 600; }
.shared .btn { background: var(--paper); color: var(--forest); }

/* ---------- modes ---------- */

.modes {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}
.mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 11px;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--forest);
  text-align: center;
  transition: background-color 300ms var(--ease), color 300ms, transform 500ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.mode:hover { transform: translateY(-2px); }
.mode .ink { height: 30px; width: auto; transition: transform 700ms var(--ease); }
.mode:hover .ink { animation: sway 2.6s ease-in-out infinite; }
.mode b { font-size: 0.78rem; font-weight: 700; line-height: 1.15; }
.mode small { display: none; font-size: 0.78rem; color: var(--soft); line-height: 1.35; }
.mode[aria-selected="true"] { background: var(--forest); color: var(--cream); box-shadow: none; }
.mode[aria-selected="true"] small { color: color-mix(in oklab, var(--cream) 75%, transparent); }
.mode .long { display: none; }

.workspace { display: grid; gap: 16px; align-items: start; }

.stage {
  position: relative;
  z-index: 2;
  padding: 22px 16px 24px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.panel { animation: enter 600ms var(--ease) both; }
.panel-head { margin: 0 0 4px; font-size: clamp(1.4rem, 4.4vw, 1.9rem); }
.hint { margin: 0 0 18px; color: var(--soft); line-height: 1.5; font-size: 0.95rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }

/* Spin the Pot */
.reels { display: grid; gap: 10px; }
.reel {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label btns" "win win";
  align-items: center;
  gap: 6px 10px;
}
.reel-label { grid-area: label; color: var(--soft); }
.reel-btns { grid-area: btns; display: flex; gap: 6px; }
.reel-btns .icon-btn { width: 36px; height: 36px; }
.reel-btns .icon-btn svg { width: 15px; height: 15px; }
.reel-window {
  grid-area: win;
  position: relative;
  height: 3.4rem;
  overflow: hidden;
  border-radius: 16px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 10px 14px -12px rgba(23, 58, 42, 0.35), inset 0 -10px 14px -12px rgba(23, 58, 42, 0.35);
  transition: opacity 300ms, box-shadow 300ms;
}
.reel-strip { will-change: transform; }
.reel-strip span {
  display: block;
  height: 3.4rem;
  padding: 0 16px;
  line-height: 3.4rem;
  font-size: clamp(1.05rem, 4.6vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reel.locked .reel-window { box-shadow: inset 0 0 0 2px var(--clay); }
.reel.off .reel-window { opacity: 0.35; }
.reel.off .reel-strip span { font-weight: 500; font-style: italic; }
.reel.landed .reel-strip span { animation: land 500ms var(--ease); }

.pot-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; }
.spin-btn { flex: 1 1 auto; font-size: 1.05rem; }
.spin-btn .ink { width: 34px; color: currentColor; }
.spin-btn.spinning .ink { animation: tip 900ms var(--ease) infinite; }

/* Pick a Path */
.step { display: flex; align-items: center; gap: 10px; margin: 24px 0 12px; font-size: 1rem; font-weight: 700; }
.step:first-of-type { margin-top: 4px; }
.step span {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none;
  border-radius: 50%; background: var(--clay); color: var(--paper); font-size: 0.78rem;
}
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 0;
  border-radius: 20px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition: background-color 300ms, color 300ms, transform 500ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { transform: translateY(-2px); }
.tile .ink { height: 36px; width: auto; margin-bottom: auto; color: var(--forest); transition: color 300ms; }
.tile > span:last-child { display: grid; gap: 4px; }
.tile b { font-size: 0.98rem; line-height: 1.15; }
.tile small { font-size: 0.8rem; line-height: 1.3; color: var(--soft); }
.tile.wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 14px; min-height: 0; }
.tile.wide .ink { margin: 0; }
.tile[aria-pressed="true"] { background: var(--forest); color: var(--cream); box-shadow: none; }
.tile[aria-pressed="true"] .ink { color: var(--cream); }
.tile[aria-pressed="true"] small { color: color-mix(in oklab, var(--cream) 75%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 0.62rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background-color 300ms, color 300ms, transform 400ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--clay); color: var(--paper); box-shadow: none; }

/* Steep / Sign forms */
.field { display: grid; gap: 8px; }
.field label, .field .label { font-weight: 700; font-size: 0.95rem; }
.input, .select {
  width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 1.2rem;
  font-weight: 600;
  transition: box-shadow 250ms;
}
.input:focus, .select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--forest); }
.input::placeholder { color: color-mix(in oklab, var(--forest) 40%, transparent); font-weight: 500; }
.select { appearance: none; -webkit-appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23173a2a' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 20px center; }
.sign-grid { display: grid; grid-template-columns: 88px 1fr 1.4fr; gap: 10px; align-items: end; }
.sign-grid .input { text-align: center; text-transform: uppercase; padding: 12px; font-size: 1.5rem; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.examples .chip { font-size: 0.84rem; padding: 0.45rem 0.85rem; }

/* Read the Leaves */
.deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; perspective: 1200px; }
.leaf {
  position: relative;
  aspect-ratio: 5 / 7;
  padding: 0;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
  animation: deal 700ms var(--ease) both;
}
.leaf-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 900ms var(--ease);
}
.leaf:not(.flipped):not([disabled]):hover .leaf-inner { transform: translateY(-4px) rotate(-1.5deg); }
.leaf.flipped .leaf-inner { transform: rotateY(180deg); }
.leaf-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 16px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}
.leaf-back {
  background: var(--forest);
  color: var(--cream);
  box-shadow: inset 0 0 0 5px var(--forest), inset 0 0 0 6px color-mix(in oklab, var(--cream) 45%, transparent);
}
.leaf-back .ink { width: 56%; max-height: 52%; opacity: 0.92; }
.leaf-back .eyebrow { font-size: 0.56rem; opacity: 0.7; }
.leaf-front {
  transform: rotateY(180deg);
  background: var(--cream);
  color: var(--forest);
  box-shadow: inset 0 0 0 1.5px var(--clay);
  text-align: center;
}
.leaf-front .eyebrow { font-size: 0.56rem; color: var(--clay); }
.leaf-front b { font-size: clamp(0.78rem, 3.3vw, 1.05rem); line-height: 1.15; overflow-wrap: anywhere; }
.leaf-front .ink { width: 34%; color: var(--moss); }
.leaf[disabled]:not(.flipped) { opacity: 0.4; }
.leaf[disabled] { cursor: default; }

/* ---------- result card ---------- */

.result { position: relative; z-index: 2; }
.card {
  --c-bg: var(--forest);
  --c-fg: var(--cream);
  --c-accent: #d0aa5c;
  --c-art: var(--cream);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 380px;
  padding: 26px 22px 24px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--c-bg);
  color: var(--c-fg);
  box-shadow: 0 34px 60px -34px rgba(23, 58, 42, 0.55);
  transition: background-color 600ms var(--ease), color 600ms var(--ease);
}
.card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--c-accent) 55%, transparent);
  pointer-events: none;
}
.card.pop > * { animation: enter 800ms var(--ease) both; }
.card.pop > :nth-child(2) { animation-delay: 60ms; }
.card.pop > :nth-child(3) { animation-delay: 140ms; }
.card.pop > :nth-child(4) { animation-delay: 220ms; }
.card.pop > :nth-child(5) { animation-delay: 300ms; }
.card.pop > :nth-child(6) { animation-delay: 380ms; }
.card.pop .card-art { animation: enter 1s var(--ease) 200ms both, breathe 7s ease-in-out 1.2s infinite; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.card-top .eyebrow { color: var(--c-accent); }
.stamp {
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--c-fg) !important;
  font-size: 0.62rem;
  white-space: nowrap;
}
.card .name {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  font-size: clamp(2.2rem, 9vw, 4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.card .name.long { font-size: clamp(1.8rem, 7vw, 3rem); }
.card .name.xlong { font-size: clamp(1.5rem, 5.6vw, 2.4rem); }
.card .line {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: "Homemade Apple", "Bradley Hand", cursive;
  font-size: clamp(1rem, 3.6vw, 1.25rem);
  line-height: 1.75;
  text-wrap: pretty;
}
.card .verdict { position: relative; z-index: 1; margin: 0; font-weight: 600; color: var(--c-accent); }
.chart { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 0.92rem; }
.chart dt { opacity: 0.7; }
.chart dd { margin: 0; font-weight: 700; }
.pair { position: relative; z-index: 1; display: grid; gap: 2px; max-width: 58%; margin-top: auto; padding-top: 18px; }
.pair .eyebrow { color: var(--c-accent); }
.pair b { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.pair span:last-child { font-size: 0.92rem; opacity: 0.8; line-height: 1.4; }
.card-art { position: absolute; right: 14px; bottom: 18px; width: clamp(120px, 34%, 210px); color: var(--c-art); opacity: 0.95; }
.card-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.card-foot .ink { width: 38px; color: var(--c-fg); }
.card-foot .eyebrow { font-size: 0.6rem; opacity: 0.8; }
.card.empty .name { opacity: 0.9; }
.card.empty .card-art { animation: breathe 7s ease-in-out infinite; }
.card.shared-card .stamp { background: var(--c-accent); color: var(--c-bg) !important; box-shadow: none; }

.actions { display: grid; gap: 10px; margin-top: 14px; }
.actions-main { display: flex; gap: 8px; }
.actions-main .btn { flex: 1; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
#keep[aria-pressed="true"] { background: var(--clay); color: var(--paper); }

/* ---------- teapot ---------- */

.teapot { position: relative; z-index: 2; margin-top: 48px; }
.teapot-head { display: flex; align-items: center; gap: 14px; }
.teapot-head .ink { width: 64px; }
.teapot h2 { margin: 0; font-size: clamp(1.5rem, 4.6vw, 2.2rem); }
.teapot p { margin: 2px 0 0; color: var(--soft); }
.kept { list-style: none; display: grid; gap: 8px; margin: 18px 0 0; padding: 0; }
.kept li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 18px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  animation: enter 600ms var(--ease) both;
}
.kept .dot { width: 12px; height: 12px; flex: none; border-radius: 50%; }
.kept button.view {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: none;
  text-align: left;
}
.kept button.view b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kept button.view small { color: var(--soft); }

/* ---------- footer ---------- */

footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 72px 16px 56px;
  text-align: center;
}
footer .ink { width: 74px; color: var(--forest); }
footer p { margin: 0; }
footer .eyebrow { color: var(--ink); }
footer .small { max-width: 30rem; font-size: 0.9rem; color: var(--soft); line-height: 1.5; }
footer a { text-underline-offset: 3px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 18px 40px -18px rgba(23, 58, 42, 0.6);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 500ms var(--ease), opacity 300ms;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- floaters ---------- */

.floater {
  position: absolute;
  top: var(--y);
  left: var(--x);
  animation: drift var(--t) ease-in-out infinite;
  animation-delay: var(--delay);
  will-change: transform;
}
.parallax {
  transform: translate3d(calc(var(--px, 0) * var(--depth) * 1px), calc(var(--py, 0) * var(--depth) * 1px), 0);
  transition: transform 1.2s var(--ease);
}
.floater .enter { animation: enter 900ms var(--ease) both; }

/* ---------- motion ---------- */

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) rotate(calc(var(--r) * -1)); }
  50% { transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--r)); }
  100% { transform: translate3d(0, 0, 0) rotate(calc(var(--r) * -1)); }
}
@keyframes breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.035) translateY(-6px); }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes sway {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-3deg); }
  75% { transform: translateY(-2px) rotate(3deg); }
}
@keyframes land {
  0% { transform: translateY(-6px); }
  60% { transform: translateY(2px); }
  100% { transform: none; }
}
@keyframes tip {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-18deg) translateY(-2px); }
}
@keyframes deal {
  from { opacity: 0; transform: translateY(30px) rotate(var(--deal-r, 4deg)) scale(0.92); }
  to { opacity: 1; transform: none; }
}

/* ---------- larger screens ---------- */

@media (max-width: 639px) {
  .floater { top: var(--my, var(--y)); left: var(--mx, var(--x)); }
  .floater[data-sm="hide"] { display: none; }
}

@media (min-width: 640px) {
  .top { padding: 28px 32px 0; }
  main { padding: 0 32px; }
  .hero { padding: 40px 0 52px; }
  .lede { font-size: 1.12rem; }
  .modes { gap: 10px; }
  .mode { padding: 18px 12px 16px; border-radius: 24px; }
  .mode .ink { height: 40px; }
  .mode b { font-size: 0.95rem; }
  .mode small { display: block; }
  .mode .short { display: none; }
  .mode .long { display: inline; }
  .stage { padding: 30px 30px 32px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile.wide { grid-column: span 3; }
  .reel { grid-template-columns: 96px 1fr auto; grid-template-areas: "label win btns"; gap: 12px; }
  .card { padding: 34px 34px 30px; min-height: 540px; }
  .card::after { inset: 14px; }
  .actions-row { justify-content: center; }
}

@media (min-width: 980px) {
  .workspace { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 24px; }
  .result { position: sticky; top: 20px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile.wide { grid-column: span 4; }
  .deck { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ---------- art (sizes from the Até Chá set) ---------- */
.a-atecha-word { -webkit-mask-image: url(art/atecha-word.png); mask-image: url(art/atecha-word.png); aspect-ratio: 573 / 471; }
.a-bird { -webkit-mask-image: url(art/bird.png); mask-image: url(art/bird.png); aspect-ratio: 367 / 299; }
.a-cat-curl { -webkit-mask-image: url(art/cat-curl.png); mask-image: url(art/cat-curl.png); aspect-ratio: 315 / 275; }
.a-cat-sly { -webkit-mask-image: url(art/cat-sly.png); mask-image: url(art/cat-sly.png); aspect-ratio: 285 / 250; }
.a-cat-smile { -webkit-mask-image: url(art/cat-smile.png); mask-image: url(art/cat-smile.png); aspect-ratio: 290 / 250; }
.a-cat { -webkit-mask-image: url(art/cat.png); mask-image: url(art/cat.png); aspect-ratio: 900 / 878; }
.a-cup-bowl { -webkit-mask-image: url(art/cup-bowl.png); mask-image: url(art/cup-bowl.png); aspect-ratio: 462 / 426; }
.a-cup-round { -webkit-mask-image: url(art/cup-round.png); mask-image: url(art/cup-round.png); aspect-ratio: 537 / 525; }
.a-cup-tall { -webkit-mask-image: url(art/cup-tall.png); mask-image: url(art/cup-tall.png); aspect-ratio: 369 / 531; }
.a-cup-v { -webkit-mask-image: url(art/cup-v.png); mask-image: url(art/cup-v.png); aspect-ratio: 486 / 564; }
.a-fish-pot { -webkit-mask-image: url(art/fish-pot.png); mask-image: url(art/fish-pot.png); aspect-ratio: 280 / 250; }
.a-octopus { -webkit-mask-image: url(art/octopus.png); mask-image: url(art/octopus.png); aspect-ratio: 718 / 700; }
.a-panda1 { -webkit-mask-image: url(art/panda1.png); mask-image: url(art/panda1.png); aspect-ratio: 570 / 431; }
.a-panda2 { -webkit-mask-image: url(art/panda2.png); mask-image: url(art/panda2.png); aspect-ratio: 462 / 565; }
.a-ship { -webkit-mask-image: url(art/ship.png); mask-image: url(art/ship.png); aspect-ratio: 347 / 409; }
.a-steam-a { -webkit-mask-image: url(art/steam-a.png); mask-image: url(art/steam-a.png); aspect-ratio: 495 / 600; }
.a-steam-b { -webkit-mask-image: url(art/steam-b.png); mask-image: url(art/steam-b.png); aspect-ratio: 474 / 612; }
.a-steam-cup-1 { -webkit-mask-image: url(art/steam-cup-1.png); mask-image: url(art/steam-cup-1.png); aspect-ratio: 462 / 804; }
.a-steam-cup-3 { -webkit-mask-image: url(art/steam-cup-3.png); mask-image: url(art/steam-cup-3.png); aspect-ratio: 537 / 900; }
.a-tea-everywhere { -webkit-mask-image: url(art/tea-everywhere.png); mask-image: url(art/tea-everywhere.png); aspect-ratio: 602 / 528; }
.a-teacup { -webkit-mask-image: url(art/teacup.png); mask-image: url(art/teacup.png); aspect-ratio: 515 / 900; }
.a-teapot { -webkit-mask-image: url(art/teapot.png); mask-image: url(art/teapot.png); aspect-ratio: 571 / 333; }
.a-wave { -webkit-mask-image: url(art/wave.png); mask-image: url(art/wave.png); aspect-ratio: 435 / 536; }

/* late fixes */
.nb { white-space: nowrap; }
.actions-main .btn-ghost { flex: 0 1 auto; background: var(--paper); }
.reel-btns { justify-content: flex-end; }
@media (min-width: 640px) { .reel { grid-template-columns: 96px 1fr 78px; } }
.floaters { -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
.actions-row { gap: 6px; }
.actions-row .icon-btn { width: 42px; height: 42px; }
.actions-row .btn-small { padding: 0.7rem 1rem; }
.card-foot { padding-right: 34%; }
