/* Part 2 of 4 of the game's styles (they load in this order: styles.css, styles-placement.css, styles-polish.css, styles-final.css). */

/* ============================== M. Animations ============================== */
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes sheet-in {
  from {
    transform: scale(0.82);
    opacity: 0;
  }
}
@keyframes tip-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
@keyframes floaty {
  to {
    transform: translateY(-0.5em);
  }
}
@keyframes aurora {
  from {
    opacity: 0.55;
    transform: translateX(-2%) scaleY(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(2%) scaleY(1.08);
  }
}
@keyframes play-breathe {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.045);
  }
}
@keyframes ring-breathe {
  from {
    opacity: 0.7;
  }
  to {
    opacity: 1;
  }
}
@keyframes hint {
  from {
    filter: drop-shadow(0 0.22em 0.3em rgba(14, 12, 6, 0.55)) drop-shadow(0 0 0.1em rgba(253, 237, 192, 0.5));
  }
  to {
    filter: drop-shadow(0 0.22em 0.3em rgba(14, 12, 6, 0.55)) drop-shadow(0 0 0.75em rgba(253, 237, 192, 1));
  }
}
@keyframes card-hop {
  0% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-9%) scale(1.05);
  }
  100% {
    transform: translateY(0);
  }
}
/* the overshoot is small on purpose: a title may not leave the screen, even for a frame */
@keyframes slam {
  0% {
    transform: scale(0.2);
    opacity: 0;
  }
  60% {
    transform: scale(1.07);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes step-punch {
  0% {
    transform: scale(1.07);
    filter: brightness(2.1) drop-shadow(0 0.4em 0.6em rgba(0, 0, 0, 0.8));
  }
  100% {
    transform: scale(1);
  }
}
@keyframes bump {
  40% {
    scale: 1.18;
  }
} /* scale, not transform: a placed plate keeps its translate */
@keyframes spring {
  25% {
    transform: scale(1.04, 1.2);
  }
  50% {
    transform: scale(1.01, 0.92);
  }
  75% {
    transform: scale(1, 1.05);
  }
}
@keyframes shake {
  15% {
    transform: translate(0.22em, -0.12em);
  }
  35% {
    transform: translate(-0.2em, 0.14em);
  }
  55% {
    transform: translate(0.14em, 0.1em);
  }
  75% {
    transform: translate(-0.08em, -0.06em);
  }
}
@keyframes pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
.spring {
  animation: spring 0.45s ease-out;
}
.bump {
  animation: bump 0.3s ease-out;
}
.pop {
  animation: pop 0.35s ease-out both;
}
.world.shake {
  animation: shake 0.3s linear;
}

/* ============================== N. Landscape ============================== */
.app[data-mode='landscape'] .controls {
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: max(0.35em, env(safe-area-inset-bottom));
  gap: 0.6em;
}
.app[data-mode='landscape'] .notice {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(0.2em, env(safe-area-inset-bottom));
  pointer-events: none;
}
.app[data-mode='landscape'] .rack {
  margin-bottom: 1.5em;
}
.app[data-mode='landscape'] .row-bet {
  width: auto;
  margin-bottom: 1.5em;
}
.app[data-mode='landscape'] .row-next {
  width: auto;
  margin-bottom: 1.5em;
  min-width: 20em;
}
/* the four moves stack on the right edge */
.app[data-mode='landscape'] .row-act {
  position: absolute;
  right: max(0.7em, env(safe-area-inset-right));
  bottom: 21%;
  width: 9.8em;
  flex-direction: column;
  gap: 0.45em;
}
.app[data-mode='landscape'] .row-act .btn-act {
  --ph: 3em;
  flex: none;
  width: 100%;
  flex-direction: row;
  gap: 0.5em;
  justify-content: flex-start;
  font-size: 1.12em;
}
.app[data-mode='landscape'] .row-act .btn-act .ico {
  height: calc(var(--ph) * 0.52);
}
.app[data-mode='landscape'] .lobby {
  top: var(--lobby-top, 44%);
}
.app[data-mode='landscape'] .tables {
  max-width: 44em;
}
.app[data-mode='landscape'] .table-card {
  flex-direction: column;
}
.app[data-mode='landscape'] .entry-logo {
  height: min(30vh, 30vw);
  margin-top: 0;
}
.app[data-mode='landscape'] .wheel-stage {
  flex-direction: row;
  flex-wrap: wrap;
  align-content: center;
  gap: 0.6em 2em;
}
.app[data-mode='landscape'] .wheel-wrap {
  width: min(24em, 74vh);
  order: -1;
}
.app[data-mode='landscape'] .wheel-title {
  width: min(19em, 40vw);
}
.app[data-mode='landscape'] .sheet-card {
  width: min(30em, 100%);
}

/* ============================== O. Less motion ============================== */
.is-calm *,
.is-calm *::before,
.is-calm *::after {
  animation: none !important;
  transition-duration: 0.01s !important;
}
@media (prefers-reduced-motion: reduce) {
  .bg-glow,
  .entry-logo {
    animation: none;
  }
}

/* painted plates without 1-px seams (src/ui/nine.js swaps the 9 pieces for one drawing) */
.nine {
  border-image: none !important;
  background-size: 100% 100% !important;
  background-origin: border-box !important;
  background-clip: border-box !important;
  background-repeat: no-repeat !important;
}

/* ============================== P. Placement ==============================
   Every position below is a share of the screen measured on the design: portrait 04-bet / 05-play, landscape 20-desk-bet / 23-land-play.
   --wr is the reference width set by layout (the screen width, capped so tablets keep the proportions). */
.controls {
  inset: 0;
  display: block;
  padding: 0;
  pointer-events: none;
}
.controls > * {
  pointer-events: auto;
}
.rack {
  position: absolute;
  left: var(--rack-x, 50%);
  top: 74.7%;
  translate: -50% -50%;
  --ph: 2.35em;
  gap: 0.2em;
  padding: 0 calc(var(--ph) * 0.55);
  transition:
    left 0.3s,
    opacity 0.25s,
    filter 0.25s;
}
.chip-btn {
  width: calc(var(--wr) * 0.132);
  max-width: 4em;
  margin: -1em 0;
}
.row {
  position: absolute;
  left: 50%;
  top: 84.5%;
  translate: -50% -50%;
  width: calc(var(--wr) * 0.957);
  max-width: none;
  min-height: 0;
  gap: calc(var(--wr) * 0.008);
}
.row-act .btn-act {
  --ph: 4.35em;
  gap: 0.2em;
}
.row-act .btn-act .ico {
  height: calc(var(--ph) * 0.36);
}
.row-act .btn-act > span {
  font-size: max(0.9em, 10px);
}
.row-bet {
  top: 86.5%;
  align-items: center;
}
.row-bet .btn-act {
  --ph: 3.15em;
  flex: 1 1 0;
  min-width: 0;
}
.row-bet #x2 {
  flex: 0.78 1 0;
  min-width: 0;
}
.btn-deal {
  --ph: 3.45em;
  flex: 1.35 1 0;
  min-width: 0;
  font-size: 1.22em;
}
.row-next {
  top: 85.5%;
}
.btn-again {
  --ph: 3.5em;
}
.btn-newbet {
  --ph: 3.2em;
}
.row-more {
  left: calc(50% - var(--wr) * 0.33);
  top: 67.5%;
  width: auto;
  height: auto;
}
.notice {
  position: absolute;
  left: 0;
  right: 0;
  top: 93.3%;
  translate: 0 -50%;
}
.prompt {
  --ph: 2.1em;
  font-size: 1.1em;
  min-width: calc(var(--wr) * 0.6);
}
/* top bar: small and tight, as painted (the touch area of the round buttons is bigger than the art) */
.top {
  padding: max(0.4em, env(safe-area-inset-top)) max(0.45em, env(safe-area-inset-right)) 0
    max(0.45em, env(safe-area-inset-left));
  gap: 0.3em;
}
.plaque {
  --ph: 1.7em;
}
.balance {
  min-width: 7.1em;
}
.level {
  max-width: calc(var(--wr) * 0.44);
}
#balance {
  font-size: 1em;
}
.coin-ico {
  width: 1.25em;
  height: 1.25em;
}
.level-badge {
  width: 2.5em;
  height: 2.3em;
}
.btn-round {
  width: 2.15em;
  height: 2.15em;
}
.btn-round::after {
  content: '';
  position: absolute;
  inset: -0.35em;
}
.xp {
  height: 1.55em;
  border-radius: 0.5em;
}
.xp i {
  inset: auto 0.3em 0.22em 0.3em;
  height: 0.3em;
}
.xp em {
  inset: 0.12em 0 auto 0;
  display: block;
  text-align: center;
}
/* bet spots are ellipses printed on the felt */
.spot,
.spot .ring {
  border-radius: 50%;
}
.spot-main .ring {
  inset: 0;
}
.bet-label {
  --ph: 1.5em;
  font-size: 0.9em;
  min-width: calc(var(--wr) * 0.24);
}
.total {
  --ph: 1.75em;
  font-size: 1.05em;
}
.crystal {
  width: calc(var(--wr) * 0.17);
  bottom: -0.3em;
}
.crystal-l {
  left: -0.4em;
}
.crystal-r {
  right: -0.4em;
}
/* entry: logo, the bear, TAP TO PLAY at 73-82% */
.entry {
  padding: 0;
}
.entry-logo {
  position: absolute;
  left: 50%;
  top: 7.2%;
  translate: -50% 0;
  height: 16.6%;
  width: auto;
  max-width: 92vw;
  margin: 0;
  object-fit: contain;
}
.entry-cta {
  position: absolute;
  left: 0;
  right: 0;
  top: 77.6%;
  translate: 0 -50%;
  margin: 0;
}
.btn-play {
  --ph: 3.9em;
  min-width: calc(var(--wr) * 0.7);
  font-size: 1.5em;
}
.disclaimer {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 88.5%;
  margin: 0 auto;
}
.maker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.9%;
  text-align: center;
  margin: 0;
}
.loading {
  width: calc(var(--wr) * 0.74);
}

/* ---------- landscape ---------- */
.app[data-mode='landscape'] .controls {
  display: block;
  padding: 0;
}
.app[data-mode='landscape'] .rack {
  top: 86.5%;
  --ph: 4.6em;
  margin: 0;
}
.app[data-phase='bet'][data-mode='landscape'] .rack {
  left: 31%;
}
.app[data-mode='landscape'] .chip-btn {
  width: calc(var(--wr) * 0.058);
  max-width: none;
  margin: 0;
}
.app[data-mode='landscape'] .row {
  margin: 0;
}
.app[data-mode='landscape'] .row-bet,
.app[data-mode='landscape'] .row-next {
  left: 72.5%;
  top: 85%;
  width: calc(var(--wr) * 0.39);
  min-width: 0;
}
.app[data-mode='landscape'] .row-bet .btn-act {
  --ph: 3.4em;
}
.app[data-mode='landscape'] .btn-deal {
  --ph: 4.3em;
}
.app[data-mode='landscape'] .row-act {
  left: auto;
  right: max(2.6%, env(safe-area-inset-right));
  top: 62.5%;
  bottom: auto;
  translate: 0 -50%;
  width: calc(var(--wr) * 0.168);
  min-width: 9.6em;
  gap: 0.5em;
}
.app[data-mode='landscape'] .row-act .btn-act {
  --ph: 3.7em;
  font-size: 1.15em;
}
.app[data-mode='landscape'] .row-more {
  left: auto;
  right: max(2.6%, env(safe-area-inset-right));
  top: 38%;
  translate: 0 -50%;
}
.app[data-mode='landscape'] .notice {
  top: 96.3%;
  bottom: auto;
}
.app[data-mode='landscape'] .plaque {
  --ph: 2.9em;
}
.app[data-mode='landscape'] #balance {
  font-size: 1.35em;
}
.app[data-mode='landscape'] .coin-ico {
  width: 1.9em;
  height: 1.9em;
}
.app[data-mode='landscape'] .level-badge {
  width: 3.6em;
  height: 3.3em;
  font-size: 1.1em;
}
.app[data-mode='landscape'] .xp {
  height: 2.2em;
  max-width: 12em;
}
.app[data-mode='landscape'] .btn-round {
  width: 3em;
  height: 3em;
}
.app[data-mode='landscape'] .top {
  padding-top: max(0.9em, env(safe-area-inset-top));
  padding-inline: max(2%, env(safe-area-inset-left));
}
.app[data-mode='landscape'] .prompt {
  --ph: 2.6em;
}
.app[data-mode='landscape'] .entry-logo {
  top: 3%;
  height: 30%;
}
.app[data-mode='landscape'] .entry-cta {
  top: 84%;
}
.app[data-mode='landscape'] .btn-play {
  min-width: 18em;
  font-size: 1.5em;
}
.app[data-mode='landscape'] .disclaimer {
  top: 94%;
}
.app[data-mode='landscape'] .maker {
  display: none;
}

/* ---------- round 1 of the design measurements ---------- */
/* the tray: five chips lying flat (seen a little from above, with a rim), 16.35% of the width apart */
.rack {
  width: calc(var(--wr) * 0.893);
  --ph: 2.5em;
  gap: calc(var(--wr) * 0.0305);
  padding: 0;
  justify-content: center;
}
.chip-btn {
  width: calc(var(--wr) * 0.133);
  max-width: none;
  aspect-ratio: 1.42;
  margin: 0;
  background-size: 100% 100%;
  isolation: isolate;
  font-size: 0.86em;
}
.chip-btn::before {
  content: '';
  position: absolute;
  inset: 13% 0 -13% 0;
  z-index: -1;
  border-radius: 50%;
  background: inherit;
  filter: brightness(0.5) saturate(0.9);
}
.chip-btn.is-on {
  transform: translateY(-22%) scale(1.16);
}
.app[data-mode='landscape'] .rack {
  width: auto;
  --ph: 4.6em;
  gap: calc(var(--wr) * 0.012);
  padding: 0 calc(var(--ph) * 0.5);
}
.app[data-mode='landscape'] .chip-btn {
  width: calc(var(--wr) * 0.06);
  aspect-ratio: 1.1;
}
/* bet row: CLEAR 22.7, REBET 21.9, x2 17.7, DEAL 30.3 (% of the width) */
.row-bet #clear {
  flex: 22.7 1 0;
}
.row-bet #rebet {
  flex: 21.9 1 0;
}
.row-bet #x2 {
  flex: 17.7 1 0;
}
.btn-deal {
  flex: 30.3 1 0;
  --ph: 2.85em;
  font-size: 1.22em;
}
.app[data-mode='landscape'] .btn-deal {
  --ph: 3.4em;
}
/* the notice is measured by its text */
.notice > span {
  display: inline-block;
}
.lobby-notice {
  position: absolute;
  top: auto;
  bottom: 3.6%;
  translate: none;
}
/* HUD details */
.coin-ico {
  width: 1.6em;
  height: 1.6em;
}
.level::after {
  content: '';
  position: absolute;
  inset: -0.4em 0;
}
.level {
  position: relative;
}
.total {
  --ph: 2.15em;
  font-size: 1.22em;
  min-width: calc(var(--ph) * 2);
}
.total-dealer {
  --ph: 1.65em;
  font-size: 1.02em;
}
.tip {
  font-size: max(0.8em, 10px);
}
/* while betting, the bet ellipse is taller */
.spot-main .ring {
  transition:
    inset 0.3s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.spots.is-open .spot-main .ring {
  inset: -38% 0 -4% 0;
}
/* entry: the crest logo, the bear under it, TAP TO PLAY 9% tall */
.entry-logo {
  top: 7%;
  height: 31.5%;
  max-width: 84vw;
}
.btn-play {
  --ph: 2.65em;
}
.table-card .btn-act {
  --ph: 2.6em;
}
.lobby-title {
  --ph: 2.2em;
}
/* ---------- round 2: touch targets of 40 px and up, small sizes ---------- */
.btn-round {
  width: 2.5em;
  height: 2.5em;
}
.level {
  min-height: 2.5em;
}
.chip-btn {
  aspect-ratio: 1.3;
}
.total {
  --ph: 1.85em;
  font-size: 1.15em;
}
.total-dealer {
  --ph: 1.6em;
  font-size: 1em;
}
.coin-ico {
  width: 1.35em;
  height: 1.35em;
}
.tip {
  padding: 1em 0.85em;
}
.btn-deal {
  flex: 0 0 31.7%;
  min-width: 0;
}
.felt-t2 {
  letter-spacing: 0.16em;
}
.app[data-mode='landscape'] .btn-deal {
  flex: 1.5 1 0;
}

/* ---------- round 3: the tray chips are their own art (lying flat, seen from above at an angle) ---------- */
.chip-btn {
  aspect-ratio: 256 / 187;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.chip-btn::before {
  content: none;
}
.chip-btn span {
  position: relative;
  top: -5%;
} /* the value sits on the chip's face, above its rim */
.app[data-mode='landscape'] .chip-btn {
  aspect-ratio: 256 / 187;
}

/* ---------- round 3: bear poses with the panels, entry buttons, split marks, low insurance panel ---------- */
.bear-spot {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  height: auto;
  filter: drop-shadow(0 0.5em 0.8em rgba(14, 12, 6, 0.5));
  animation: spot-in 0.4s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.sheet > .sheet-card {
  z-index: 1;
}
.app.has-spot .bear {
  opacity: 0;
  transition: opacity 0.15s;
}
.bear {
  transition: opacity 0.25s;
}
/* positions measured on the design (16-levelup, 19-stats, 17-menu): % of the screen */
.sheet[data-spot='thumbs'] .bear-spot {
  left: 52.6%;
  top: 4.8%;
  height: 27.5%;
  translate: -50% 0;
}
.sheet[data-spot='clipboard'] .bear-spot {
  left: 50.7%;
  top: 5.7%;
  height: 21.8%;
  translate: -50% 0;
}
.sheet[data-spot='peek'] .bear-spot {
  left: 0.5%;
  top: 16.9%;
  height: 40.6%;
}
.sheet[data-spot='thumbs'],
.sheet[data-spot='clipboard'] {
  place-items: end center;
  padding-top: 0;
  padding-bottom: 4%;
}
.sheet[data-spot='peek'] .sheet-card {
  margin-left: 13%;
  width: min(26em, 84%);
}
.sheet-bear {
  width: min(15em, 74%);
  margin-top: -0.4em;
}
.app[data-mode='landscape'] .sheet[data-spot] .bear-spot {
  display: none;
}
@keyframes spot-in {
  from {
    opacity: 0;
    transform: translateY(8%) scale(0.92);
  }
}
@keyframes bear-cheer {
  to {
    transform: translateY(-1.5%) rotate(-1deg);
  }
}
.is-calm .bear-spot {
  animation: none;
}
/* the insurance question sits low: the dealer's Ace and the bear stay in view (06-insurance: 42.8-76.3%) */
.sheet.is-low {
  place-items: start center;
  padding-top: 42.8vh;
  padding-top: 42.8dvh;
  background: rgba(16, 13, 8, 0.42);
}
.sheet.is-low .sheet-card {
  width: min(89vw, 26em);
}
/* entry: SOUND, LANGUAGE, SETTINGS under TAP TO PLAY (02-title: y 86.4%, 6% tall) */
.entry-row {
  position: absolute;
  left: 50%;
  top: 89.4%;
  translate: -50% -50%;
  width: calc(var(--wr) * 0.926);
  display: flex;
  gap: calc(var(--wr) * 0.02);
}
.entry-row .btn-act {
  --ph: 2.45em;
  flex: 1 1 0;
  flex-direction: row;
  gap: 0.35em;
  font-size: 0.82em;
}
.entry-row .btn-act .ico {
  height: calc(var(--ph) * 0.5);
}
.entry-row .ico.off,
.is-muted .entry-row .ico.on {
  display: none;
}
.is-muted .entry-row .ico.off {
  display: block;
}
.app[data-screen='entry'] .loading ~ .btn-play[hidden] {
  display: none;
}
.disclaimer {
  top: 96%;
  translate: 0 -50%;
  font: 400 italic max(0.68em, 9px) var(--serif);
}
.app[data-mode='landscape'] .entry-row {
  top: 93%;
  width: min(34em, 60vw);
}
.app[data-mode='landscape'] .disclaimer {
  top: 98%;
}
.app[data-mode='landscape'] .entry-cta {
  top: 80%;
}
/* split hands: HAND n above the cards, BET beside each stack (07-split) */
.hand-label {
  position: absolute;
  left: 0;
  top: 0;
  --ph: 1.35em;
  font-size: 0.78em;
  letter-spacing: 0.08em;
}
.hand-bet {
  position: absolute;
  left: 0;
  top: 0;
  --ph: 1.45em;
  font-size: 0.78em;
}

/* ============================== Q. Desktop / landscape pass ==============================
   Nothing overlaps: the printed rules sit under the paws, the three seats stay left of the column of moves,
   the tray and the bet buttons share the bottom row, and every label reads at 11 px or more. */
/* XP: one readable bar with its text inside */
.xp {
  height: 1.5em;
  border-radius: 1em;
}
.xp i {
  inset: 0.16em;
  height: auto;
  width: calc((100% - 0.32em) * var(--p, 0));
  min-width: 0.5em;
}
.xp em {
  inset: 0;
  display: grid;
  place-items: center;
  font-size: max(0.56em, 9.5px);
}
.level-badge small {
  font-size: max(0.46em, 8px);
}
.level-badge b {
  font-size: 1em;
}
/* the lobby notice is a line of its own under the tab bar */
.lobby {
  gap: 0.55em;
}
.lobby-notice {
  position: static;
  translate: none;
  flex: none;
  margin-top: -0.1em;
}
.btn-tab > span {
  font-size: max(0.6em, 10px);
}
.table-card h3 {
  font-size: max(0.86em, 11px);
}
.table-card .state {
  font-size: max(0.66em, 10px);
}
.table-card .range {
  font-size: max(0.7em, 10px);
}
/* panels with a bear pose only take their special places in portrait */
.app[data-mode='landscape'] .sheet[data-spot] {
  place-items: center;
  padding: 3.4em 0.5em 0.8em;
}
.app[data-mode='landscape'] .sheet[data-spot] .sheet-card {
  margin-left: 0;
  width: min(30em, 100%);
}
.app[data-mode='landscape'] .has-spot .bear,
.app[data-mode='landscape'].has-spot .bear {
  opacity: 1;
}
.app[data-mode='landscape'] .sheet-body {
  max-height: calc(100dvh - 9em);
}
.app[data-mode='landscape'] .sheet.is-low {
  place-items: center;
  padding-top: 3.4em;
}
.stat small {
  font-size: max(0.56em, 9.5px);
}
.ach-bar em,
.xp em {
  font-size: max(0.56em, 9.5px);
}
.ach-bar {
  height: 1.1em;
}

/* ---------- the table in landscape ---------- */
.app[data-mode='landscape'] .prompt {
  display: none;
} /* the design has no banner here: the open spots say it */
.app[data-mode='landscape'] .spots.is-open .spot-main .ring {
  inset: 0;
}
.app[data-mode='landscape'] .spot-label {
  font-size: max(0.6em, 10px);
}
.app[data-mode='landscape'] .spot-side .spot-label {
  font-size: max(0.5em, 9px);
}
.app[data-mode='landscape'] .bet-label {
  min-width: 0;
  --ph: 1.6em;
  font-size: 0.95em;
}
.app[data-mode='landscape'] .total {
  --ph: 1.9em;
  font-size: 1.15em;
}
.app[data-mode='landscape'] .tip {
  font-size: max(0.85em, 11px);
  padding: 0.7em 0.8em;
}
/* bottom row: the tray on the left, the bet buttons on the right, both centred on 87% */
.app[data-mode='landscape'] .rack {
  top: 87%;
  left: 50%;
  --ph: 4.2em;
}
.app[data-phase='bet'][data-mode='landscape'] .rack {
  left: calc(50% - var(--wr) * 0.19);
}
.app[data-mode='landscape'] .row-bet,
.app[data-mode='landscape'] .row-next {
  left: calc(50% + var(--wr) * 0.225);
  top: 87%;
  width: calc(var(--wr) * 0.38);
  gap: 0.45em;
}
.app[data-mode='landscape'] .row-bet #clear,
.app[data-mode='landscape'] .row-bet #rebet {
  flex: 1 1 0;
}
.app[data-mode='landscape'] .row-bet #x2 {
  flex: 0.62 1 0;
}
.app[data-mode='landscape'] .btn-deal {
  flex: 1.35 1 0;
  --ph: 2.9em;
  font-size: 1.3em;
}
.app[data-mode='landscape'] .row-bet .btn-act {
  --ph: 3.3em;
  font-size: 1.02em;
}
.app[data-mode='landscape'] .row-next .btn-again {
  --ph: 3em;
}
/* the four moves: a column on the right, centred on the seats */
.app[data-mode='landscape'] .row-act {
  right: max(2.2%, env(safe-area-inset-right));
  top: 64%;
  width: calc(var(--wr) * 0.16);
  min-width: 9.8em;
  gap: 0.55em;
}
.app[data-mode='landscape'] .row-act .btn-act {
  --ph: 3.5em;
  font-size: 1.15em;
  padding-left: calc(var(--ph) * 0.5);
}
.app[data-mode='landscape'] .row-more {
  top: 41.5%;
  right: max(2.2%, env(safe-area-inset-right));
}
.app[data-mode='landscape'] .notice {
  top: 96.6%;
}
.app[data-mode='landscape'] .notice,
.notice {
  font-size: max(0.66em, 10px);
}
.app[data-mode='landscape'] .crystal {
  width: calc(var(--wr) * 0.085);
}
/* lobby in landscape: three cards in a row, the tab bar under them */
.app[data-mode='landscape'] .lobby {
  padding-bottom: 0.5em;
}
.app[data-mode='landscape'] .tables {
  max-width: min(46em, 62vw);
}
.app[data-mode='landscape'] .tabbar {
  max-width: 32em;
}
.app[data-mode='landscape'] .btn-tab {
  height: 3.2em;
}

/* ---------- daily wheel: one composition per orientation ---------- */
.wheel-stage {
  display: block;
  padding: 0;
}
.wheel-stage > * {
  position: absolute;
}
.wheel-title {
  left: 50%;
  top: 13.8%;
  translate: -50% -50%;
  width: min(19em, 74vw);
}
.wheel-wrap {
  left: 58%;
  top: 47%;
  translate: -50% -50%;
  width: min(72vw, 43vh);
}
.btn-spin {
  left: 50%;
  top: 84%;
  translate: -50% -50%;
}
.wheel-win {
  left: 50%;
  top: 84%;
  translate: -50% -50%;
}
.wheel-note {
  left: 0;
  right: 0;
  top: 93%;
  translate: 0 -50%;
  text-align: center;
  font-size: max(0.78em, 11px);
}
.wheel-close {
  top: max(0.6em, env(safe-area-inset-top));
  right: 0.6em;
}
.app[data-mode='landscape'] .wheel-stage {
  display: block;
}
.app[data-mode='landscape'] .wheel-wrap {
  left: 31%;
  top: 44%;
  width: min(68vh, 38vw);
  order: 0;
}
.app[data-mode='landscape'] .wheel-title {
  left: 70%;
  top: 17%;
  width: min(26vw, 52vh, 22em);
}
.app[data-mode='landscape'] .btn-spin,
.app[data-mode='landscape'] .wheel-win {
  left: 31%;
  top: 88.5%;
}
.app[data-mode='landscape'] .wheel-note {
  left: 50%;
  right: 4%;
  top: 88.5%;
}
@keyframes bear-cheer {
  to {
    transform: translateY(-1.5%) rotate(-1deg);
  }
}
/* desktop: the tray sits lower so the BET plates above it stay clear; the lobby notice is in the flow */
.app[data-mode='landscape'] .rack {
  top: 89.3%;
  --ph: 3.7em;
}
.app[data-mode='landscape'] .row-bet,
.app[data-mode='landscape'] .row-next {
  top: 89.3%;
}
.app[data-mode='landscape'] .lobby-notice {
  position: static;
  translate: none;
}
/* settings rows: the name keeps its room, the control takes what is left (never on top of the name) */
.opt {
  gap: 0.6em;
}
.opt > .opt-name {
  flex: 0 0 auto;
  font-size: max(0.92em, 11px);
}
.opt .slider {
  flex: 1 1 3em;
  min-width: 3em;
  max-width: 9em;
}
.opt select {
  flex: 0 1 auto;
  width: auto;
  max-width: 8.5em;
  min-width: 4.5em;
}
.seg button {
  padding: 0.35em 0.6em;
}
.sheet[data-spot='peek'] .sheet-card {
  margin-left: 9%;
  width: min(27em, 90%);
}
/* a panel with the bear above it leaves him his room: its own content scrolls */
.sheet[data-spot='thumbs'] .sheet-body,
.sheet[data-spot='clipboard'] .sheet-body {
  max-height: 56vh;
  max-height: 56dvh;
}
.sheet[data-spot='thumbs'] .bear-spot,
.sheet[data-spot='clipboard'] .bear-spot {
  z-index: 0;
}
.app[data-mode='landscape'] .sheet[data-spot] .sheet-body {
  max-height: calc(100dvh - 9em);
}
/* a split hand: its total sits under the cards, HAND n above them */
.total[data-side='bottom'] {
  translate: -50% -50%;
}

/* ============================== R. Feel and juice, pass 2 ============================== */
/* buttons: a quick squeeze, then they spring back */
.btn-act,
.btn-pill,
.btn-round,
.btn-tab,
.table-card {
  transition:
    transform 0.24s cubic-bezier(0.3, 1.7, 0.5, 1),
    filter 0.2s,
    opacity 0.2s;
}
.btn-act:active,
.btn-pill:active,
.btn-round:active,
.btn-tab:active,
.chip-btn:active {
  transform: scale(0.92);
  transition-duration: 0.05s;
}
@media (hover: hover) {
  .btn-act:not(:disabled):hover,
  .btn-pill:not(:disabled):hover {
    filter: brightness(1.12) drop-shadow(0 0.22em 0.3em rgba(14, 12, 6, 0.55));
  }
  .table-card:not(.is-locked):hover {
    transform: translateY(-0.25em);
  }
  .chip-btn:not(.is-on):hover {
    transform: translateY(-8%);
  }
}
/* a celebration dims the room and the felt behind the bear: he stays lit, he is the one reacting */
.stage-dim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(19, 16, 9, 0.3), rgba(15, 12, 7, 0.74));
  animation: fade-in 0.25s;
  pointer-events: none;
}
.app.celebrating .felt {
  opacity: 0.12;
}
.app.celebrating .controls,
.app.celebrating .top {
  filter: brightness(0.62) saturate(0.8);
  transition: filter 0.25s;
}
.controls,
.top {
  transition: filter 0.3s;
}
.app.celebrating .card:not(.is-won) .card-in {
  filter: brightness(0.55);
}
/* the warm light of the room flickers */
.bg-fire {
  position: absolute;
  left: -6%;
  top: 12%;
  width: 34%;
  height: 20%;
  background: radial-gradient(closest-side, rgba(255, 170, 70, 0.3), rgba(255, 120, 40, 0.12) 55%, transparent);
  mix-blend-mode: screen;
  animation: fire 2.3s steps(1) infinite;
  pointer-events: none;
}
.app[data-mode='landscape'] .bg-fire {
  left: -3%;
  top: 14%;
  width: 20%;
  height: 30%;
}
@keyframes fire {
  0% {
    opacity: 0.75;
  }
  13% {
    opacity: 1;
  }
  24% {
    opacity: 0.6;
  }
  37% {
    opacity: 0.9;
  }
  52% {
    opacity: 0.7;
  }
  66% {
    opacity: 1;
  }
  81% {
    opacity: 0.65;
  }
  100% {
    opacity: 0.85;
  }
}
/* "+10 XP" rising from the bar */
.float-xp {
  position: absolute;
  left: 55%;
  top: 60%;
  font: 800 max(0.7em, 12px) var(--sans);
  font-style: normal;
  color: #ffd36e;
  text-shadow:
    -1px 0 #1a1206,
    1px 0 #1a1206,
    0 -1px #1a1206,
    0 1px #1a1206,
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 0.5em rgba(255, 200, 90, 0.6);
  white-space: nowrap;
  pointer-events: none;
  animation: float-up 1.2s ease-out both;
}
@keyframes float-up {
  0% {
    opacity: 0;
    transform: translateY(0.3em);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(1.6em);
  }
}
/* wins in a row */
.streak {
  position: absolute;
  left: max(0.5em, env(safe-area-inset-left));
  top: calc(100% + 0.25em);
  --ph: 1.5em;
  font-size: max(0.66em, 10px);
  letter-spacing: 0.05em;
  color: var(--gold);
  border-image-source: url(../../art/badge-gold.webp);
}
.top {
  position: absolute;
}
/* the balance glows when credits arrive */
.balance.spring {
  animation:
    spring 0.45s ease-out,
    gain 0.7s ease-out;
}
@keyframes gain {
  0% {
    filter: drop-shadow(0 0 0 rgba(255, 224, 138, 0));
  }
  30% {
    filter: drop-shadow(0 0 0.7em rgba(255, 224, 138, 0.95));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 224, 138, 0));
  }
}
/* the lobby cards arrive one after the other */
.table-card {
  animation: pop 0.42s cubic-bezier(0.3, 1.4, 0.5, 1) calc(0.25s + var(--i, 0) * 0.08s) both;
}
.bet-label.bump {
  animation: bump 0.28s ease-out;
}

/* rules sheet: each move drawn as its own button, with small cards as the example */
.rule-move {
  gap: 0.5em;
  padding: 0.4em 0.5em;
}
.rule-plate {
  --ph: 2.3em;
  flex: 0 0 auto;
  min-width: 6.2em;
  flex-direction: row;
  gap: 0.3em;
  font-size: max(0.78em, 10px);
  pointer-events: none;
  filter: none;
}
.rule-plate .ico {
  height: calc(var(--ph) * 0.5);
  width: auto;
}
.rule-text {
  flex: 1 1 0;
  min-width: 0;
  font-style: italic;
}
.rule-cards {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.12em;
}
.rule-cards .ico {
  width: 1.2em;
  height: 1.2em;
}
.mini-card {
  display: inline-block;
  width: 1.55em;
  aspect-ratio: 200 / 280;
  background: url(../../art/cards.webp) 0 0 / 1300% 500% no-repeat;
  filter: drop-shadow(0 1px 1px rgba(14, 12, 6, 0.5));
}
.mini-card + .mini-card {
  margin-left: -0.5em;
  transform: rotate(6deg);
}
.rule-plus {
  font: 800 0.9em var(--sans);
  color: var(--cyan);
  margin: 0 0.15em;
}
/* an unused seat is not shown once the cards are out */
.spots:not(.is-open) .spot-main:not(.has-bet) {
  opacity: 0;
}
.spot-main {
  transition: opacity 0.25s;
}

/* End of assets/ui/styles-placement.css */
