:root {
  --app-width: 100vw;
  --app-height: 100vh;
  --layout-gap: clamp(8px, 1.2vh, 16px);
  --felt-bright: #0f7a35;
  --felt-mid: #0d632d;
  --felt-dark: #07391a;
  --cabinet-shadow: rgba(0, 0, 0, 0.66);
  --cream: #f4f1e6;
  --button-border: #1f1f1f;
  --card-red: #ba2020;
  --card-black: #101010;
  --hold-highlight: #ffd86f;
  --hold-lift: 0px;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

* {
  box-sizing: border-box;
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--app-height);
  width: var(--app-width);
  height: var(--app-height);
  display: block;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 12%, #1c1c1c 0%, #070707 72%);
  color: #fff;
  font-family:
    "Noto Sans",
    "Segoe UI",
    system-ui,
    -apple-system,
    "Trebuchet MS",
    "Arial Black",
    Arial,
    sans-serif;
}

.machine {
  position: fixed;
  inset: 0;
  width: var(--app-width);
  min-height: var(--app-height);
  height: var(--app-height);
  padding:
    calc(clamp(10px, 1.8vh, 22px) + env(safe-area-inset-top))
    calc(clamp(10px, 1.6vw, 22px) + env(safe-area-inset-right))
    calc(clamp(12px, 2.1vh, 24px) + env(safe-area-inset-bottom))
    calc(clamp(10px, 1.6vw, 22px) + env(safe-area-inset-left));
  border-radius: 0;
  border: 4px solid #1a1a1a;
  box-shadow:
    0 24px 56px var(--cabinet-shadow),
    0 3px 0 #2b2b2b inset,
    0 -3px 0 #040404 inset;
  overflow: hidden;
  contain: layout paint;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: var(--layout-gap);
  background: linear-gradient(180deg, #131313 0%, #090909 100%);
  transition: box-shadow 220ms ease;
}

.machine::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 22%),
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.1), transparent 24%);
  pointer-events: none;
  z-index: 0;
}

.machine::after {
  content: "";
  position: absolute;
  inset: clamp(7px, 0.9vh, 12px);
  border-radius: clamp(10px, 1.7vw, 22px);
  border: 3px solid #0b3f1e;
  background:
    radial-gradient(circle at 50% 48%, var(--felt-bright) 0%, var(--felt-mid) 48%, var(--felt-dark) 100%),
    linear-gradient(180deg, #0e5d2b, #073317);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 16px 18px rgba(255, 255, 255, 0.07),
    inset 0 -20px 28px rgba(0, 0, 0, 0.42);
  z-index: 0;
}

.machine.machine-red {
  background: linear-gradient(180deg, #131313 0%, #090909 100%);
}

.machine > * {
  position: relative;
  z-index: 1;
}

.top-bar {
  background: linear-gradient(180deg, #1b6d36 0%, #0f4f26 100%);
  border: 2px solid #0d4722;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 16px;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.14),
    inset 0 -4px 6px rgba(0, 0, 0, 0.36);
}

.top-item {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  font-size: clamp(18px, 2.1vw, 30px);
  font-weight: 900;
  color: #f3f8ef;
  text-transform: uppercase;
}

.top-item span {
  letter-spacing: 0.05em;
}

.top-item strong {
  color: #fff;
  letter-spacing: 0.02em;
}

.brand-strip {
  background: linear-gradient(180deg, #fcfcf8 0%, #eeeee8 100%);
  border-radius: 14px;
  border: 2px solid #cecec7;
  min-height: 108px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 12px;
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.deck-mark {
  position: relative;
  width: 78px;
  height: 78px;
  justify-self: center;
}

.mark-card {
  width: 52px;
  height: 70px;
  border: 2px solid #d6d6d0;
  border-radius: 8px;
  position: absolute;
  background:
    radial-gradient(circle, #b6c4cf 20%, transparent 22%) 0 0/14px 14px,
    radial-gradient(circle, #b6c4cf 20%, transparent 22%) 7px 7px/14px 14px,
    #eef2f5;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.mark-card:first-child {
  transform: rotate(-18deg);
  left: 2px;
  top: 11px;
}

.mark-card:last-child {
  transform: rotate(9deg);
  right: 2px;
  bottom: 7px;
}

.mark-card:last-child::after {
  content: "♣";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #1a1a1a;
  font-size: 24px;
  font-weight: 900;
}

.logo-text {
  color: #c53a2d;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  line-height: 1;
  flex-wrap: nowrap;
}

.logo-main {
  font-size: clamp(34px, 4.6vw, 72px);
  font-weight: 900;
  letter-spacing: 0.015em;
}

.logo-main-stacked {
  line-height: 0.8;
}

.logo-script {
  color: #2a7b43;
  font-family: "Brush Script MT", "Comic Sans MS", cursive;
  font-size: clamp(42px, 5.4vw, 76px);
  transform: translateY(7px);
}

.status-line {
  margin: 0;
  text-align: center;
  font-size: clamp(26px, 5.9vh, 78px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
  min-height: 1.2em;
}

.status-line.win-flash {
  animation: winFlash 460ms ease 2;
}

.cards-section {
  min-height: 0;
  display: flex;
  align-items: center;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, 1.5vw, 18px);
  align-items: stretch;
  width: 100%;
  height: 100%;
}

.card-slot {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: start;
  align-content: start;
  gap: clamp(6px, 0.9vh, 10px);
  width: 100%;
  min-height: 0;
  height: 100%;
}

.hold-tag {
  min-height: 24px;
  width: min(100%, 194px);
  border-radius: 9px;
  border: 2px solid #553f00;
  background: #f0c944;
  color: #392600;
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 900;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hold-tag.hidden {
  visibility: hidden;
}

.card {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
  justify-self: center;
  align-self: start;
  border-radius: 14px;
  border: 2px solid #d3d3d3;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 11px 12px;
  cursor: pointer;
  box-shadow:
    0 10px 14px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
  transition: transform 200ms ease-out, border-color 200ms ease, box-shadow 200ms ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
}

.card[disabled] {
  cursor: default;
}

.card[disabled]:hover {
  transform: none;
}

.card.is-held {
  border-color: var(--hold-highlight);
  box-shadow:
    0 0 0 2px rgba(78, 56, 5, 0.9),
    0 0 16px rgba(255, 216, 111, 0.75),
    0 15px 22px rgba(0, 0, 0, 0.4);
  transform: translateY(calc(-1 * var(--hold-lift)));
}

.card.is-winning {
  border-color: #ffd247;
  box-shadow:
    0 0 0 2px rgba(96, 62, 0, 0.92),
    0 0 20px rgba(255, 221, 118, 0.82),
    0 16px 24px rgba(0, 0, 0, 0.42);
  transform: translateY(calc(-1 * var(--hold-lift)));
  animation: winningCardPulse 1.1s ease-in-out infinite;
}

/* SPMK card back — PAF-style: patterned ends, white center band, mark + wordmark */
.card.is-back {
  --spmk-back-base: #e6eaee;
  --spmk-back-dot: rgba(118, 132, 145, 0.42);
  --spmk-red: #d62828;
  --spmk-green: #0f6a34;
  border: 4px solid #fff;
  border-color: #fff;
  box-shadow:
    0 10px 14px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  background-color: var(--spmk-back-base);
  background-image:
    linear-gradient(
      to bottom,
      transparent 0 calc(29% - 0px),
      #fff calc(29% - 0px) calc(71% + 0px),
      transparent calc(71% + 0px) 100%
    ),
    radial-gradient(circle at 38% 42%, var(--spmk-back-dot) 0, var(--spmk-back-dot) 2.4px, transparent 2.7px),
    radial-gradient(circle at 38% 42%, var(--spmk-back-dot) 0, var(--spmk-back-dot) 2.4px, transparent 2.7px);
  background-size:
    100% 100%,
    12px 12px,
    12px 12px;
  background-position:
    0 0,
    0 0,
    6px 6px;
}

.card.is-back::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: clamp(28px, 7vw, 36px);
  height: clamp(28px, 7vw, 36px);
  transform: translate(calc(-50% - clamp(38px, 10vw, 48px)), -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--spmk-green) 0 44%, transparent 45%),
    conic-gradient(from 210deg at 50% 50%, var(--spmk-red) 0deg, var(--spmk-red) 130deg, transparent 130deg);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.card.is-back::after {
  content: "SPMK";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(calc(-50% + clamp(14px, 3.5vw, 20px)), -50%);
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: none;
  color: #0a4a22;
  font-family: "Noto Sans", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(13px, 2.6vw, 20px);
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: none;
  pointer-events: none;
}

.card.deal-slide {
  animation: dealSlide 260ms ease;
}

.card.flip-reveal {
  animation: flipReveal 280ms ease;
}

.card.double-dealer {
  border-color: #ffd560;
  box-shadow: 0 0 0 2px rgba(94, 60, 0, 0.9), 0 10px 16px rgba(0, 0, 0, 0.38);
}

.card.double-choice {
  border-color: #9fc7e8;
  animation: doubleChoicePulse 1s ease-in-out infinite;
}

.card-corner {
  display: flex;
  flex-direction: column;
  line-height: 0.9;
  font-weight: 900;
  font-size: clamp(24px, 2.8vw, 36px);
}

.card-corner.bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.card-center {
  align-self: center;
  font-size: clamp(70px, 7.1vw, 104px);
  line-height: 1;
}

.card.red {
  color: var(--card-red);
}

.card.black {
  color: var(--card-black);
}

.card.joker {
  color: #5e2b8f;
}

.joker-middle {
  align-self: center;
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.controls {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(6px, 1.2vh, 16px);
}

.btn {
  min-height: clamp(52px, 9vh, 88px);
  border-radius: 12px;
  border: 3px solid var(--button-border);
  font-family: inherit;
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 900;
  cursor: pointer;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: 0.015em;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -9px 0 rgba(0, 0, 0, 0.22);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 140ms ease;
}

.btn:hover {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.14),
    0 0 14px rgba(255, 255, 255, 0.22),
    0 6px 9px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -9px 0 rgba(0, 0, 0, 0.22);
}

.btn:focus-visible,
.card:focus-visible,
.house-btn:focus-visible,
.close-btn:focus-visible {
  outline: 3px solid rgba(255, 230, 143, 0.9);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(2px);
  filter: brightness(0.88);
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.btn-red {
  background: linear-gradient(180deg, #de4f40 0%, #b12418 100%);
}

.btn-white {
  background: linear-gradient(180deg, #f7f7f7 0%, #e4e4e4 100%);
  color: #131313;
}

.btn-ivory {
  background: linear-gradient(180deg, #f5f2e8 0%, #ddd8ca 100%);
  color: #161616;
}

.btn-blue {
  background: linear-gradient(180deg, #2d73ff 0%, #174bbf 100%);
}

.btn-green {
  background: linear-gradient(180deg, #4cb064 0%, #207c37 100%);
}

.btn-audio {
  background: linear-gradient(180deg, #f5a845 0%, #d6800f 100%);
  color: #171717;
}

.btn-audio.is-muted {
  background: linear-gradient(180deg, #de4f40 0%, #b12418 100%);
  color: #fff;
}

.paytable-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 20;
}

.paytable-overlay.hidden {
  display: none;
}

.paytable-shell {
  width: 100%;
  height: 100%;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  background:
    repeating-linear-gradient(0deg, #f6f3e8 0, #f6f3e8 26px, #f2eedf 26px, #f2eedf 28px),
    #f5f2e7;
  color: #1a1a1a;
  border: 4px solid #0e5731;
  border-radius: 0;
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
}

.paytable-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  gap: 10px;
}

.paytable-head h2 {
  margin: 0;
  color: #b43328;
  font-size: clamp(22px, 3vw, 36px);
}

.close-btn {
  border: 2px solid #222;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  font-size: 18px;
  width: 40px;
  height: 40px;
}

.paytable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: clamp(12px, 1.9vh, 24px);
  font-weight: 800;
}

.paytable th,
.paytable td {
  border: 2px solid #205f3a;
  padding: clamp(4px, 0.8vh, 8px) clamp(6px, 0.9vw, 10px);
}

.paytable thead th {
  text-align: center;
  background: #0f6a34;
  color: #fff;
}

.paytable thead th:first-child {
  background: #2b6e3f;
}

.paytable .bet-col-header-low {
  background: #ab241c;
}

.paytable .bet-col-header-mid,
.paytable .bet-col-header-high {
  background: #1e6f3b;
}

.paytable .hand-label {
  text-align: left;
  background: #f9f8f3;
  color: #9a2319;
  width: 42%;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.9vw, 12px);
}

.paytable .hand-label::after {
  content: "";
  flex: 1;
  min-width: 12px;
  border-top: 2px solid #c3392b;
}

.paytable .row-full-house .hand-label::after {
  content: none;
}

.paytable td {
  text-align: center;
  background: #f8f8f1;
}

.paytable tbody .bet-col-active {
  background: #eadf9c;
}

.paytable thead .bet-col-active {
  box-shadow: inset 0 0 0 3px #f4e078;
}

.paytable .row-win td,
.paytable .row-win .hand-label {
  background: #ffe16b;
}

.paytable .full-house-label {
  padding: 0;
  display: block;
}

.paytable .full-house-arrow {
  display: block;
  width: 100%;
  padding: clamp(6px, 1.2vh, 10px) clamp(10px, 1.2vw, 16px);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #c4362a 0%, #a12016 100%);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
}

.paytable .full-house-bonus {
  padding: 0;
  background: #f8f3d1;
}

.paytable .full-house-bonus-wrap {
  min-height: clamp(36px, 5.2vh, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vw, 14px);
  padding: 4px 8px;
  background: linear-gradient(180deg, #f9efb1 0%, #ebdd93 100%);
}

.paytable .row-full-house.row-win .full-house-bonus-wrap {
  background: linear-gradient(180deg, #ffe98f 0%, #f2d964 100%);
}

.paytable .row-full-house.row-win .full-house-arrow {
  background: linear-gradient(180deg, #da4639 0%, #b8261b 100%);
}

.paytable .full-house-bonus-burst {
  display: inline-grid;
  place-items: center;
  width: clamp(18px, 2.2vw, 30px);
  height: clamp(18px, 2.2vw, 30px);
  border-radius: 999px;
  background: #fff4ad;
  color: #765817;
  font-size: clamp(11px, 1.4vw, 16px);
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(151, 118, 32, 0.26);
}

.paytable .full-house-bonus-text {
  color: #1f1f1f;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.paytable-note {
  margin: 12px 0 0;
  font-size: clamp(13px, 1.6vw, 18px);
  color: #1d4d32;
  font-weight: 900;
}

.bonus-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  color: #f4f6ff;
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
}

.bonus-overlay.hidden {
  display: none;
}

.bonus-scene {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #2f79d8 0%, #1d54a4 42%, #19478f 100%);
}

.bonus-scene::before {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 30%;
  height: 24%;
  background:
    radial-gradient(80% 140% at 12% 98%, #293aa6 0 50%, transparent 51%),
    radial-gradient(70% 130% at 48% 104%, #2b40b0 0 50%, transparent 51%),
    radial-gradient(80% 120% at 86% 105%, #263a9c 0 50%, transparent 51%);
  opacity: 0.72;
}

.bonus-scene::after {
  content: "";
  position: absolute;
  inset: 54% 0 0;
  background:
    linear-gradient(180deg, #3f8e46 0%, #225f2f 58%, #123f22 100%),
    repeating-linear-gradient(
      -8deg,
      rgba(44, 103, 58, 0.62) 0 3px,
      rgba(29, 84, 44, 0) 3px 42px
    );
}

.bonus-moon {
  display: none;
}

.bonus-hills {
  position: absolute;
  inset: auto 0 24% 0;
  height: 20%;
  background:
    radial-gradient(120% 100% at 18% 100%, #2942ac 0 50%, transparent 51%),
    radial-gradient(130% 100% at 58% 108%, #233f9f 0 50%, transparent 51%),
    radial-gradient(110% 100% at 88% 104%, #1e3187 0 50%, transparent 51%);
  opacity: 0.62;
}

.bonus-shell {
  position: relative;
  z-index: 1;
  padding: 14px 16px 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  gap: 8px;
  height: 100%;
}

.bonus-title {
  margin: 0;
  text-align: center;
  font-size: clamp(24px, 3.4vw, 42px);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.bonus-message {
  margin: 0;
  text-align: center;
  min-height: 1.2em;
  font-size: clamp(17px, 2.3vw, 28px);
  font-weight: 900;
  color: #fff0ab;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.48);
}

.bonus-overlay[data-stage="selection"] .bonus-title,
.bonus-overlay[data-stage="selection"] .bonus-message,
.bonus-overlay[data-stage="results"] .bonus-title,
.bonus-overlay[data-stage="results"] .bonus-message {
  display: none;
}

.bonus-overlay[data-stage="selection"] .bonus-selection-scene {
  filter: saturate(1.04) contrast(0.96);
}

.bonus-selection-scene {
  position: relative;
  min-height: clamp(220px, 44vh, 430px);
  overflow: hidden;
}

.bonus-selection-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 16%, transparent 66%, rgba(0, 0, 0, 0.34));
  pointer-events: none;
  z-index: 1;
}

.bonus-selection-scene.hidden {
  display: none;
}

.houses-row {
  margin-top: 8px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  gap: clamp(6px, 1vw, 14px);
  align-items: end;
  height: 66%;
}

.houses-row.is-hidden {
  display: none;
}

.house-btn {
  border: 0;
  background: transparent;
  padding: 0 2px;
  cursor: pointer;
  position: relative;
  min-height: clamp(188px, 31vh, 280px);
  display: block;
}

.house-btn:nth-child(1) {
  animation-delay: 30ms;
}

.house-btn:nth-child(2) {
  animation-delay: 95ms;
}

.house-btn:nth-child(3) {
  animation-delay: 160ms;
}

.house-btn:nth-child(4) {
  animation-delay: 225ms;
}

.house-btn:nth-child(5) {
  animation-delay: 290ms;
}

.bonus-selection-scene.is-opening .house-btn {
  animation: houseRise 420ms ease both;
}

.house-arrow {
  --arrow-tilt: -24deg;
  position: absolute;
  left: 50%;
  top: -2px;
  width: 52px;
  height: 60px;
  transform: translateX(-50%) rotate(var(--arrow-tilt));
  z-index: 4;
  animation: houseArrow 560ms ease-in-out infinite;
}

.house-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 24px;
  height: 30px;
  transform: translateX(-50%);
  background: #f65845;
  border-radius: 3px;
}

.house-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 30px solid #f65845;
}

.house-btn:nth-child(1) .house-arrow {
  --arrow-tilt: -28deg;
}

.house-btn:nth-child(2) .house-arrow {
  --arrow-tilt: -35deg;
}

.house-btn:nth-child(3) .house-arrow {
  --arrow-tilt: -18deg;
}

.house-btn:nth-child(4) .house-arrow {
  --arrow-tilt: -26deg;
}

.house-btn:nth-child(5) .house-arrow {
  --arrow-tilt: -30deg;
}

.house-shadow {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: min(18vw, 150px);
  height: 63%;
  transform: translateX(-50%);
  transform-origin: top center;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(10, 26, 16, 0.68), rgba(6, 14, 9, 0.96));
  opacity: 0.96;
  transition: transform 140ms ease, opacity 140ms ease;
}

.house {
  --house-transform: translateX(-50%);
  position: absolute;
  left: 50%;
  top: 46px;
  width: min(14vw, 118px);
  height: clamp(130px, 21vh, 196px);
  transform: var(--house-transform);
  border-radius: 2px;
  border: 3px solid #1a1511;
  background: linear-gradient(180deg, #241d17 0%, #120f0c 100%);
  box-shadow: 0 9px 12px rgba(0, 0, 0, 0.56);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.house-btn:hover .house,
.house-btn:focus-visible .house {
  transform: var(--house-transform) translateY(-4px);
  box-shadow: 0 0 0 2px rgba(255, 237, 161, 0.75), 0 13px 16px rgba(0, 0, 0, 0.58);
}

.house-btn:hover .house-shadow,
.house-btn:focus-visible .house-shadow {
  opacity: 0.98;
  transform: translateX(-50%) scaleX(1.04);
}

.house-window {
  position: absolute;
  border: 2px solid #5f4f2f;
  background: linear-gradient(180deg, #fff7b8, #e7a95d);
  box-shadow: 0 0 12px rgba(255, 219, 116, 0.6);
  animation: windowFlicker 1.5s steps(2, end) infinite;
}

.house-roof {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-92%);
  top: 0;
  width: 112%;
  height: 52px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #24211f, #121010);
}

.house-window-top {
  left: 50%;
  top: 12px;
  width: 56%;
  height: 22%;
  transform: translateX(-50%);
}

.house-window-main {
  right: 10px;
  top: 44%;
  width: 34%;
  height: 24%;
}

.house-window-side {
  left: 10px;
  top: 44%;
  width: 26%;
  height: 14%;
}

.house-door {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28%;
  height: 34%;
  transform: translateX(-50%);
  border: 2px solid #4c3722;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #be8a52, #8f6037);
}

.house-door::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 56%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2f1f13;
}

.house-number {
  position: absolute;
  left: 50%;
  bottom: 34%;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid #2b2e17;
  background: #f9f08f;
  color: #121212;
  font-size: 20px;
  font-weight: 900;
  display: grid;
  place-items: center;
  z-index: 3;
}

.house-prize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -32px;
  text-align: center;
  font-size: clamp(16px, 2vw, 25px);
  font-weight: 900;
  color: #fff4b8;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.house-variant-1 {
  height: clamp(142px, 24vh, 206px);
}

.house-variant-1 .house-window-side {
  display: none;
}

.house-variant-2 {
  --house-transform: translateX(-50%) skewY(-1deg);
  top: 70px;
  height: clamp(114px, 19vh, 162px);
}

.house-variant-2 .house-window-top {
  display: none;
}

.house-variant-2 .house-door {
  width: 34%;
  background: linear-gradient(180deg, #bb9158, #7f5b3a);
}

.house-variant-3 {
  height: clamp(156px, 25vh, 226px);
}

.house-variant-3 .house-window-main {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 32%;
}

.house-variant-3 .house-window-side {
  display: none;
}

.house-variant-4 {
  --house-transform: translateX(-50%) skewY(1deg);
  top: 62px;
  height: clamp(124px, 20vh, 182px);
}

.house-variant-4 .house-window-top {
  top: 16px;
  width: 60%;
}

.house-variant-5 {
  height: clamp(138px, 22vh, 204px);
}

.house-variant-5 .house-roof::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #2a2e15;
  background: #e3d552;
}

.house-variant-2 .house-window {
  animation-delay: 140ms;
}

.house-variant-3 .house-window {
  animation-delay: 260ms;
}

.house-variant-4 .house-window {
  animation-delay: 90ms;
}

.house-variant-5 .house-window {
  animation-delay: 320ms;
}

.bonus-selection-scene.is-opening .street-figure {
  animation:
    figureReveal 420ms ease-out both,
    figureIdle 1800ms ease-in-out 420ms infinite;
}

.street-figure {
  position: absolute;
  left: 50%;
  bottom: -48px;
  width: min(42vw, 274px);
  height: min(38vh, 270px);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  animation: figureIdle 1800ms ease-in-out infinite;
}

.bonus-final-win {
  position: absolute;
  left: 50%;
  bottom: 10%;
  margin: 0;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
  font-size: clamp(38px, 8vw, 90px);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em;
}

.bonus-final-win.hidden {
  display: none;
}

.street-figure-neck {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 16px;
  height: 50px;
  transform: translateX(-50%);
  background: #e7efef;
}

.street-figure-head {
  position: absolute;
  left: 50%;
  top: 0;
  width: 64px;
  height: 62px;
  transform: translateX(-50%);
  clip-path: polygon(0 50%, 35% 0, 100% 0, 88% 56%, 100% 100%, 28% 100%);
  background: #f3f8f9;
}

.street-figure-head::before {
  content: "";
  position: absolute;
  left: 46px;
  top: 24px;
  width: 12px;
  height: 10px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: #edf4f5;
}

.street-figure-head::after {
  content: "";
  position: absolute;
  left: 34px;
  top: 24px;
  width: 18px;
  height: 3px;
  background: #131313;
}

.street-figure-body {
  position: absolute;
  left: 50%;
  top: 26%;
  width: 92px;
  height: 162px;
  transform: translateX(-50%);
  background: #ef553f;
  clip-path: polygon(12% 0, 88% 0, 100% 24%, 92% 100%, 8% 100%, 0 24%);
}

.street-figure-body::before {
  content: "";
  position: absolute;
  left: 46%;
  bottom: 0;
  width: 10px;
  height: 40px;
  transform: translateX(-50%) skewX(-8deg);
  background: #ca2f22;
}

.street-figure-body::after {
  content: "";
  position: absolute;
  left: 56%;
  bottom: 0;
  width: 10px;
  height: 40px;
  transform: translateX(-50%) skewX(8deg);
  background: #ca2f22;
}

.street-figure-arm {
  position: absolute;
  top: 34%;
  width: 78px;
  height: 86px;
  border: 7px solid #ef553f;
  border-top: 0;
  border-radius: 0 0 72px 72px;
}

.street-figure-arm.left {
  left: 50%;
  transform: translateX(-82px);
}

.street-figure-arm.right {
  left: 50%;
  transform: translateX(4px);
}

.street-figure-hand {
  position: absolute;
  top: 64%;
  width: 24px;
  height: 14px;
  border-radius: 12px;
  background: #f2f4f6;
}

.street-figure-hand.left {
  left: 50%;
  transform: translateX(-116px) rotate(-18deg);
}

.street-figure-hand.right {
  left: 50%;
  transform: translateX(92px) rotate(18deg);
}

.street-figure-hand::before,
.street-figure-hand::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 4px;
  border-radius: 4px;
  background: #f2f4f6;
}

.street-figure-hand::before {
  right: -6px;
  top: 2px;
  transform: rotate(28deg);
}

.street-figure-hand::after {
  right: -6px;
  bottom: 2px;
  transform: rotate(-24deg);
}

.house-btn.is-picked {
  cursor: default;
}

.house-btn.is-picked .house {
  border-color: #f6ec98;
  box-shadow: 0 0 0 2px rgba(255, 243, 171, 0.65), 0 11px 14px rgba(0, 0, 0, 0.56);
}

.house-btn.is-picked .house-arrow {
  opacity: 0;
}

.house-btn.is-disabled {
  cursor: not-allowed;
}

.house-btn.is-disabled .house {
  opacity: 0.75;
}

.house-btn.is-disabled .house-arrow {
  opacity: 0.46;
}

.house-btn.revealed .house {
  background: linear-gradient(180deg, #3d2e23 0%, #211913 100%);
}

.house-btn.revealed .house-arrow {
  opacity: 0;
}

.house-btn.revealed .house-window {
  background: linear-gradient(180deg, #fff4bf, #f3bf7a);
}

.house-btn.revealed .house-prize {
  color: #ffef9f;
  opacity: 1;
  transform: translateY(0);
}

.house-btn.is-picked .house-prize {
  opacity: 1;
  transform: translateY(0);
}

.bonus-overlay[data-stage="results"] .house-btn.is-disabled .house {
  opacity: 1;
}

.bonus-overlay[data-stage="results"] .house-btn.is-picked .house-arrow,
.bonus-overlay[data-stage="results"] .house-btn.revealed .house-arrow {
  opacity: 1;
}

.bonus-overlay[data-stage="results"] .house-btn.revealed .house-prize {
  left: 50%;
  right: auto;
  top: 42%;
  bottom: auto;
  min-width: clamp(68px, 11vw, 124px);
  padding: 6px 10px;
  border: 2px solid #85919c;
  border-radius: 4px;
  background: #2e3b48;
  color: #f2f5fa;
  text-shadow: none;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.34);
  opacity: 1;
  transform: translate(-50%, -50%);
}

.bonus-overlay[data-stage="results"] .house-btn.is-picked .house-prize {
  border-color: #85ddbe;
  background: #6ccba6;
  color: #effff7;
}

.bonus-overlay[data-stage="results"] .street-figure,
.bonus-overlay[data-stage="doubleGuess"] .street-figure,
.bonus-overlay[data-stage="doubleResult"] .street-figure {
  opacity: 0;
  transform: translateX(-50%) translateY(30px);
  animation: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.bonus-overlay[data-stage="results"] .bonus-results {
  display: none;
}

.bonus-enter {
  margin-top: 6px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  min-height: clamp(190px, 40vh, 320px);
}

.bonus-enter.hidden {
  display: none;
}

.bonus-enter-prompt {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #ffe895;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.bonus-cartoon-scene {
  width: min(100%, 640px);
  aspect-ratio: 16 / 9;
  position: relative;
  border-radius: 8px;
  border: 3px solid #6d451b;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, #c07a35 0 24px, #b06f30 24px 48px),
    repeating-linear-gradient(90deg, rgba(239, 174, 102, 0.26) 0 4px, transparent 4px 104px);
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.38);
  animation: bonusPromptIn 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.bonus-cartoon-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 203, 120, 0.12), rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(180deg, transparent 0 46px, rgba(146, 84, 31, 0.55) 46px 50px);
  pointer-events: none;
}

.scene-eye {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 124px;
  height: 60px;
  border-radius: 62px / 30px;
  border: 2px solid rgba(134, 124, 24, 0.95);
  background: radial-gradient(circle at 50% 42%, #f4ec8b 12%, #dbcc3f 66%, #b8a525 100%);
  box-shadow: 0 0 16px rgba(255, 247, 147, 0.55);
}

.scene-eye::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  background: #f3fff7;
}

.scene-eye span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: eyeBlink 2.1s ease-in-out infinite;
}

.scene-eye span::before,
.scene-eye span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 15px;
  background: #af652a;
}

.scene-eye span::before {
  top: 0;
}

.scene-eye span::after {
  bottom: 0;
}

.scene-table {
  position: absolute;
  left: 50%;
  bottom: -34px;
  z-index: 2;
  width: 84%;
  height: 146px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 3px solid #1e5f2b;
  background: radial-gradient(circle at 50% 30%, #2e9a44, #1b6e32 64%, #145127 100%);
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.45);
}

.scene-pot {
  position: absolute;
  left: 50%;
  top: 36%;
  z-index: 3;
  transform: translate(-50%, -50%);
  padding: 6px 14px;
  border: 2px solid #7fc193;
  border-radius: 6px;
  background: rgba(7, 77, 43, 0.6);
  color: #def4e4;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 900;
}

.bonus-player {
  position: absolute;
  bottom: 44px;
  z-index: 1;
  width: 138px;
  height: 212px;
  --player-base-transform: none;
  animation: playerBob 2300ms ease-in-out infinite;
}

.bonus-player .player-body {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 96px;
  height: 128px;
  transform: translateX(-50%);
  border: 3px solid #2d2018;
  border-radius: 42px 42px 12px 12px;
  z-index: 1;
}

.bonus-player .player-neck {
  position: absolute;
  left: 50%;
  top: 92px;
  width: 22px;
  height: 26px;
  transform: translateX(-50%);
  border: 2px solid #2d2018;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #f2ddc3;
  z-index: 2;
}

.bonus-player .player-head {
  position: absolute;
  top: 32px;
  left: 50%;
  width: 86px;
  height: 82px;
  transform: translateX(-50%);
  border: 3px solid #2d2018;
  border-radius: 42px 42px 36px 36px;
  background: #f2ddc3;
  z-index: 3;
}

.bonus-player .player-head::before,
.bonus-player .player-head::after {
  content: "";
  position: absolute;
  top: 32px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30261f;
}

.bonus-player .player-head::before {
  left: 25px;
}

.bonus-player .player-head::after {
  right: 25px;
}

.bonus-player .player-hair {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 86px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 16px;
}

.bonus-player .player-arm {
  position: absolute;
  top: 130px;
  left: 50%;
  width: 122px;
  height: 24px;
  transform: translateX(-50%) rotate(-4deg);
  border: 3px solid #2d2018;
  border-radius: 14px;
  background: #f2ddc3;
  transform-origin: left center;
}

.bonus-player .player-face {
  position: absolute;
  left: 50%;
  top: 56px;
  width: 84px;
  height: 62px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 4;
}

.bonus-player .player-face::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 8px;
  height: 14px;
  transform: translateX(-50%);
  border-left: 2px solid #bc916b;
  border-radius: 2px;
}

.bonus-player .player-cards {
  position: absolute;
  top: 116px;
  left: 54%;
  width: 58px;
  height: 40px;
  transform: rotate(-18deg);
  border: 2px solid #f3f7fb;
  border-radius: 4px;
  background: #d84c70;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

.bonus-player .player-cards::before,
.bonus-player .player-cards::after {
  content: "";
  position: absolute;
  width: 58px;
  height: 40px;
  border: 2px solid #f3f7fb;
  border-radius: 4px;
  background: #d84c70;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

.bonus-player .player-cards::before {
  transform: rotate(-14deg) translate(-11px, 3px);
}

.bonus-player .player-cards::after {
  transform: rotate(14deg) translate(12px, 5px);
}

.player-left {
  left: 2%;
  --player-base-transform: skewX(-3deg);
}

.player-left .player-body {
  background: linear-gradient(90deg, #efece4 0 62%, #d84e30 62% 100%);
}

.player-left .player-head {
  border-radius: 6px;
  transform: translateX(-50%) skewX(-3deg);
}

.player-left .player-head::before,
.player-left .player-head::after {
  width: 22px;
  height: 13px;
  top: 28px;
  border-radius: 3px;
  background: #181818;
}

.player-left .player-head::before {
  left: 14px;
}

.player-left .player-head::after {
  right: 14px;
}

.player-left .player-hair {
  background: #1f1a17;
  transform: translateX(-50%) rotate(-8deg);
}

.player-left .player-face::before {
  content: "";
  position: absolute;
  left: 48px;
  top: 26px;
  width: 22px;
  height: 12px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: #f2ddc3;
}

.player-left .player-cards {
  animation: cardsFan 620ms ease-in-out infinite alternate;
}

.player-middle {
  left: 50%;
  --player-base-transform: translateX(-50%);
  animation-delay: -220ms;
}

.player-middle .player-body {
  background: linear-gradient(180deg, #7438aa, #592a84);
}

.player-middle .player-head {
  width: 90px;
  height: 88px;
}

.player-middle .player-hair {
  width: 62px;
  border-radius: 14px 14px 10px 10px;
  background: #a06d43;
}

.player-middle .player-face::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 30px;
  height: 14px;
  transform: translateX(-50%);
  border-bottom: 3px solid #b65656;
  border-radius: 0 0 18px 18px;
}

.player-middle .player-cards {
  left: 44%;
  transform: rotate(14deg);
}

.player-right {
  right: 3%;
  --player-base-transform: skewX(3deg);
  animation-delay: -420ms;
}

.player-right .player-body {
  background: linear-gradient(180deg, #e75e3f, #c43d28);
}

.player-right .player-body::before,
.player-right .player-body::after {
  content: "";
  position: absolute;
  bottom: 18px;
  width: 42px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(31, 83, 49, 0.8);
  background:
    linear-gradient(90deg, #5cb975 0 30%, #7ad18f 30% 34%, #5cb975 34% 64%, #7ad18f 64% 68%, #5cb975 68% 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.player-right .player-body::before {
  left: -12px;
  transform: rotate(-8deg) translateY(8px);
}

.player-right .player-body::after {
  right: -12px;
  transform: rotate(8deg) translateY(8px);
}

.bonus-enter.is-revealed .player-right .player-body::before,
.bonus-enter.is-revealed .player-right .player-body::after {
  opacity: 1;
  transform: translateY(0);
}

.bonus-enter.is-revealed .player-right .player-body::before {
  transform: rotate(-4deg) translateY(0);
}

.bonus-enter.is-revealed .player-right .player-body::after {
  transform: rotate(4deg) translateY(0);
}

.player-right .player-head {
  width: 82px;
  height: 80px;
  clip-path: polygon(4% 8%, 82% 0, 100% 24%, 96% 74%, 76% 100%, 10% 98%, 0 56%);
  border-radius: 6px;
}

.player-right .player-head::before {
  left: 22px;
}

.player-right .player-head::after {
  right: 22px;
}

.player-right .player-hair {
  width: 84px;
  background: #281f1a;
}

.player-right .player-face::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 28px;
  width: 34px;
  height: 16px;
  border-bottom: 4px solid #dd8a95;
  border-radius: 0 0 18px 18px;
  transform: rotate(16deg);
}

.player-right .player-arm {
  top: 142px;
  left: 24%;
  width: 138px;
  transform: rotate(-18deg);
  animation: armSweep 980ms ease-in-out infinite;
}

.player-right .player-cards {
  display: none;
}

.scene-chips {
  position: absolute;
  right: 20%;
  bottom: 68px;
  z-index: 3;
  width: 74px;
  height: 52px;
  border-radius: 18px;
  background: radial-gradient(circle at 36% 45%, #f0e15d 0 34%, #d2b72e 35% 100%);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.32));
  animation: chipPulse 620ms ease-in-out infinite;
}

.scene-chips::before,
.scene-chips::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 20px;
  border-radius: 8px;
  background: #4cab54;
}

.scene-chips::before {
  right: -8px;
  top: 8px;
}

.scene-chips::after {
  left: -8px;
  bottom: 8px;
}

.bonus-enter.is-revealed .bonus-cartoon-scene {
  animation: insidePush 420ms ease-out both;
}

.bonus-voitto {
  margin: 0;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 900;
  color: #fff1a9;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 220ms ease, transform 220ms ease;
}

.bonus-prize-value {
  margin: 0;
  font-size: clamp(34px, 5.5vw, 72px);
  font-weight: 900;
  color: #ffe47a;
  text-shadow: 0 0 14px rgba(255, 224, 114, 0.5);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 220ms ease, transform 220ms ease;
}

.bonus-prize-value.burst {
  animation: prizeBurst 560ms ease;
}

.bonus-enter.is-revealed .bonus-voitto {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.bonus-results {
  display: grid;
  gap: 8px;
  background: rgba(9, 17, 36, 0.86);
  border: 2px solid #4d628f;
  border-radius: 12px;
  padding: 12px;
  font-size: clamp(16px, 2vw, 24px);
}

.bonus-results.hidden {
  display: none;
}

.bonus-result-total {
  color: #ffe486;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 900;
}

.bonus-double {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bonus-double.hidden {
  display: none;
}

.bonus-double-card {
  width: min(210px, 42vw);
  cursor: default;
}

.bonus-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.bonus-actions.hidden {
  display: none;
}

.bonus-actions .btn.hidden {
  display: none;
}

.operator-overlay {
  position: absolute;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  padding: 0;
}

.operator-overlay.hidden {
  display: none;
}

.operator-panel {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, rgba(11, 23, 36, 0.96), rgba(7, 13, 26, 0.98));
  border: 2px solid #3f597f;
  border-radius: 0;
  padding: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.52);
}

.operator-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.operator-head h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  color: #dce8ff;
}

.operator-subhead {
  margin: 0;
  font-size: clamp(15px, 2vw, 22px);
  color: #c1d4ff;
  font-weight: 900;
}

.operator-rows {
  display: grid;
  gap: 8px;
}

.operator-audio-rows {
  display: grid;
  gap: 8px;
}

.operator-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) 2fr auto;
  align-items: center;
  gap: 10px;
  background: rgba(20, 35, 61, 0.76);
  border: 1px solid #40557b;
  border-radius: 8px;
  padding: 7px 10px;
}

.operator-row label {
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 900;
  color: #f3f7ff;
}

.operator-row input[type="range"],
.operator-rtp-row input[type="range"] {
  width: 100%;
  accent-color: #45a4ff;
}

.operator-value {
  min-width: 64px;
  text-align: right;
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 900;
  color: #ffe58d;
}

.operator-rtp-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) 2fr auto;
  gap: 10px;
  align-items: center;
  background: rgba(24, 42, 71, 0.8);
  border: 1px solid #4e6793;
  border-radius: 8px;
  padding: 8px 10px;
}

.operator-rtp-row label {
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 900;
  color: #f3f7ff;
}

.operator-credits-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  background: rgba(24, 42, 71, 0.8);
  border: 1px solid #4e6793;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
}

.operator-credits-row label {
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 900;
  color: #f3f7ff;
}

.operator-credits-row input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 2px solid #4e6793;
  background: rgba(10, 18, 32, 0.92);
  color: #fff;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 800;
  font-family: inherit;
  appearance: textfield;
  -moz-appearance: textfield;
}

.operator-credits-row input[type="number"]::-webkit-outer-spin-button,
.operator-credits-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.operator-credits-apply {
  min-height: 40px;
  padding: 6px 12px;
  white-space: nowrap;
  font-size: clamp(11px, 1.5vw, 14px);
  font-weight: 900;
}

.operator-preset-row {
  background: rgba(20, 35, 61, 0.76);
  border: 1px solid #40557b;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.operator-full-house-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 800;
  color: #f3f7ff;
  line-height: 1.35;
}

.operator-full-house-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: #45a4ff;
  cursor: pointer;
}

.operator-actions {
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@keyframes dealSlide {
  0% {
    transform: translate(120px, -130px) scale(0.9);
    opacity: 0;
  }
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
}

@keyframes flipReveal {
  0% {
    transform: rotateY(85deg);
  }
  100% {
    transform: rotateY(0);
  }
}

@keyframes winFlash {
  0%,
  100% {
    color: #fff;
  }
  40% {
    color: #ffe06f;
  }
}

@keyframes winningCardPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@keyframes doubleChoicePulse {
  0%,
  100% {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.34);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(189, 226, 255, 0.86), 0 12px 20px rgba(0, 0, 0, 0.45);
  }
}

@keyframes houseRise {
  0% {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes houseArrow {
  0%,
  100% {
    transform: translateX(-50%) rotate(var(--arrow-tilt)) translateY(0);
  }
  50% {
    transform: translateX(-50%) rotate(var(--arrow-tilt)) translateY(8px);
  }
}

@keyframes windowFlicker {
  0%,
  100% {
    filter: brightness(1);
    opacity: 1;
  }
  35% {
    filter: brightness(0.82);
    opacity: 0.84;
  }
  70% {
    filter: brightness(1.08);
    opacity: 1;
  }
}

@keyframes figureReveal {
  0% {
    transform: translateX(-50%) translateY(24px) scale(0.92);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes figureIdle {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-3px);
  }
}

@keyframes bonusPromptIn {
  0% {
    transform: scale(0.92) translateY(16px);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes insidePush {
  0% {
    transform: scale(1.04) translateY(8px);
    filter: saturate(0.9);
  }
  100% {
    transform: scale(1) translateY(0);
    filter: saturate(1);
  }
}

@keyframes eyeBlink {
  0% {
    transform: scaleY(1);
    opacity: 1;
  }
  48% {
    transform: scaleY(1);
    opacity: 1;
  }
  52% {
    transform: scaleY(0.1);
    opacity: 0.5;
  }
  56%,
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes playerBob {
  0%,
  100% {
    transform: var(--player-base-transform) translateY(0);
  }
  50% {
    transform: var(--player-base-transform) translateY(-4px);
  }
}

@keyframes cardsFan {
  0% {
    transform: rotate(-22deg) translateX(0);
  }
  100% {
    transform: rotate(-12deg) translateX(4px);
  }
}

@keyframes armSweep {
  0%,
  100% {
    transform: rotate(-18deg);
  }
  50% {
    transform: rotate(-8deg);
  }
}

@keyframes chipPulse {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.06) translateY(-2px);
  }
}

@keyframes prizeBurst {
  0% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.16);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-height: 920px) {
  .brand-strip {
    min-height: 90px;
  }

  .status-line {
    font-size: clamp(24px, 5.2vh, 58px);
  }

  .btn {
    min-height: clamp(48px, 7.8vh, 74px);
  }
}

@media (max-height: 760px) {
  .machine {
    padding:
      calc(8px + env(safe-area-inset-top))
      calc(10px + env(safe-area-inset-right))
      calc(10px + env(safe-area-inset-bottom))
      calc(10px + env(safe-area-inset-left));
    gap: 8px;
  }

  .top-bar {
    padding: 6px 10px;
  }

  .top-item {
    font-size: clamp(12px, 2.4vh, 20px);
  }

  .brand-strip {
    min-height: 72px;
    padding: 6px 10px;
  }

  .status-line {
    font-size: clamp(20px, 4.3vh, 40px);
  }

  .card-corner {
    font-size: clamp(16px, 2vw, 24px);
  }

  .card-center {
    font-size: clamp(42px, 5vw, 72px);
  }

  .btn {
    min-height: clamp(42px, 7vh, 58px);
    font-size: clamp(11px, 1.5vw, 16px);
  }

  .paytable th,
  .paytable td {
    padding: 4px 6px;
  }

  .operator-panel {
    gap: 6px;
    padding: 10px;
  }
}

@media (max-width: 940px) {
  .brand-strip {
    grid-template-columns: 84px 1fr;
    min-height: 90px;
    padding: 8px 12px;
  }

  .deck-mark {
    width: 66px;
    height: 66px;
  }

  .mark-card {
    width: 44px;
    height: 60px;
  }

  .logo-text {
    justify-content: flex-start;
    gap: 6px;
  }

  .controls {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  .btn {
    min-height: clamp(44px, 7.6vh, 72px);
    font-size: clamp(14px, 2vw, 18px);
  }

  .card-slot {
    gap: 6px;
  }

  .status-line {
    font-size: clamp(32px, 5.2vw, 56px);
  }

  .houses-row {
    grid-template-columns: repeat(5, minmax(56px, 1fr));
    gap: 6px;
  }

  .house-btn {
    min-height: clamp(162px, 30vh, 220px);
  }

  .house {
    width: min(13vw, 96px);
  }

  .house-shadow {
    width: min(16vw, 112px);
  }

  .street-figure {
    width: min(42vw, 260px);
    height: min(32vh, 220px);
  }

  .operator-row,
  .operator-rtp-row,
  .operator-credits-row {
    grid-template-columns: 1fr;
  }

  .operator-value {
    text-align: left;
  }
}

@media (max-width: 660px) {
  .machine {
    width: var(--app-width);
    min-height: var(--app-height);
    height: var(--app-height);
    border-radius: 0;
    border-width: 3px;
    padding:
      calc(8px + env(safe-area-inset-top))
      calc(8px + env(safe-area-inset-right))
      calc(10px + env(safe-area-inset-bottom))
      calc(8px + env(safe-area-inset-left));
    gap: 8px;
  }

  .machine::after {
    inset: 5px;
    border-radius: 10px;
  }

  .top-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 6px;
  }

  .top-item {
    font-size: clamp(11px, 3.1vw, 16px);
    gap: 4px;
  }

  .cards-row {
    gap: 6px;
  }

  .card-slot {
    gap: 6px;
  }

  .hold-tag {
    min-height: 18px;
    font-size: 11px;
  }

  .btn {
    min-height: clamp(40px, 6.8vh, 52px);
    font-size: clamp(10px, 2.6vw, 13px);
  }

  .controls {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }

  .brand-strip {
    grid-template-columns: 62px 1fr;
    min-height: 72px;
    gap: 6px;
  }

  .deck-mark {
    width: 52px;
    height: 52px;
  }

  .mark-card {
    width: 34px;
    height: 48px;
  }

  .mark-card:last-child::after {
    font-size: 15px;
  }

  .logo-main {
    font-size: clamp(22px, 6.5vw, 30px);
  }

  .logo-script {
    font-size: clamp(24px, 7.2vw, 32px);
    transform: translateY(4px);
  }

  .status-line {
    margin: 0;
    font-size: clamp(26px, 7.3vw, 38px);
  }

  .houses-row {
    grid-template-columns: repeat(3, minmax(60px, 1fr));
    gap: 4px;
  }

  .bonus-selection-scene {
    min-height: 270px;
  }

  .house-btn {
    min-height: 146px;
  }

  .house {
    top: 30px;
    width: min(24vw, 88px);
    border-width: 2px;
  }

  .house-roof {
    height: 42px;
  }

  .house-number {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .house-prize {
    bottom: -28px;
    font-size: 14px;
  }

  .bonus-final-win {
    bottom: 8%;
    font-size: clamp(26px, 9vw, 48px);
  }

  .house-shadow {
    width: min(30vw, 106px);
  }

  .house-arrow {
    width: 30px;
    height: 36px;
  }

  .house-arrow::before {
    width: 16px;
    height: 18px;
  }

  .house-arrow::after {
    border-left-width: 11px;
    border-right-width: 11px;
    border-top-width: 18px;
  }

  .street-figure {
    display: none;
  }

  .bonus-enter {
    min-height: 262px;
    gap: 8px;
  }

  .bonus-enter-prompt {
    font-size: clamp(15px, 4vw, 22px);
  }

  .bonus-cartoon-scene {
    border-width: 2px;
  }

  .scene-eye {
    top: 10px;
    width: 86px;
    height: 42px;
  }

  .scene-table {
    bottom: -30px;
    height: 98px;
  }

  .bonus-player {
    bottom: 30px;
    width: 98px;
    height: 156px;
  }

  .bonus-player .player-head {
    top: 24px;
    width: 62px;
    height: 60px;
  }

  .bonus-player .player-neck {
    top: 68px;
    width: 16px;
    height: 18px;
    border-width: 1px;
  }

  .bonus-player .player-face {
    top: 44px;
    width: 58px;
    height: 42px;
  }

  .bonus-player .player-head::before,
  .bonus-player .player-head::after {
    top: 24px;
  }

  .bonus-player .player-head::before {
    left: 16px;
  }

  .bonus-player .player-head::after {
    right: 16px;
  }

  .bonus-player .player-hair {
    top: 18px;
    width: 58px;
    height: 16px;
  }

  .bonus-player .player-body {
    width: 68px;
    height: 88px;
  }

  .bonus-player .player-arm {
    top: 96px;
    width: 86px;
    height: 18px;
    border-width: 2px;
  }

  .bonus-player .player-cards,
  .bonus-player .player-cards::before,
  .bonus-player .player-cards::after {
    width: 34px;
    height: 24px;
  }

  .bonus-player .player-cards {
    top: 86px;
  }

  .player-middle .player-hair {
    width: 42px;
  }

  .player-right .player-hair {
    width: 56px;
  }

  .player-right .player-arm {
    top: 102px;
    width: 94px;
  }

  .player-right .player-body::before,
  .player-right .player-body::after {
    bottom: 12px;
    width: 26px;
    height: 14px;
  }

  .player-right .player-face::before {
    left: 18px;
    width: 24px;
    height: 12px;
    border-bottom-width: 3px;
  }

  .scene-chips {
    right: 16%;
    bottom: 46px;
    width: 52px;
    height: 36px;
  }

  .scene-chips::before,
  .scene-chips::after {
    width: 20px;
    height: 14px;
  }

  .bonus-actions {
    grid-template-columns: 1fr 1fr;
  }

  .operator-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .machine {
    padding:
      calc(6px + env(safe-area-inset-top))
      calc(6px + env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      calc(6px + env(safe-area-inset-left));
    gap: 6px;
  }

  .top-bar {
    padding: 6px 4px;
  }

  .top-item {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1px;
    font-size: clamp(10px, 2.8vw, 13px);
    line-height: 1.05;
  }

  .brand-strip {
    grid-template-columns: 1fr;
    min-height: 56px;
    padding: 4px 8px;
  }

  .deck-mark {
    display: none;
  }

  .logo-text {
    justify-content: center;
    gap: 4px;
  }

  .logo-main {
    font-size: clamp(18px, 5.8vw, 24px);
  }

  .logo-script {
    font-size: clamp(20px, 6.2vw, 26px);
    transform: translateY(2px);
  }

  .status-line {
    font-size: clamp(18px, 6.1vw, 28px);
    letter-spacing: 0.02em;
  }

  .cards-row {
    gap: 4px;
  }

  .card-slot {
    gap: 4px;
  }

  .hold-tag {
    min-height: 16px;
    font-size: 10px;
    border-width: 1px;
  }

  .card {
    border-radius: 9px;
    border-width: 1px;
    padding: 6px 6px;
  }

  .card-corner {
    font-size: clamp(12px, 4.2vw, 16px);
  }

  .card-center {
    font-size: clamp(30px, 9.4vw, 44px);
  }

  .controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .btn {
    min-height: clamp(44px, 7.2vh, 54px);
    border-width: 2px;
    border-radius: 10px;
    font-size: clamp(11px, 3.2vw, 14px);
  }

  .bonus-shell {
    padding: 10px 10px 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .bonus-selection-scene {
    min-height: 240px;
  }

  .paytable-shell {
    padding: 10px 8px;
    gap: 8px;
  }

  .paytable-head h2 {
    font-size: clamp(17px, 5vw, 24px);
  }

  .close-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
}

@media (max-width: 480px) and (max-height: 700px) {
  .controls {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .btn {
    min-height: 38px;
    font-size: clamp(9px, 2.6vw, 11px);
  }

  .status-line {
    font-size: clamp(16px, 5.2vw, 22px);
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .machine {
    padding:
      calc(4px + env(safe-area-inset-top))
      calc(6px + env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom))
      calc(6px + env(safe-area-inset-left));
    gap: 4px;
  }

  .machine::after {
    inset: 4px;
  }

  .top-bar {
    padding: 4px 6px;
    gap: 4px;
  }

  .top-item {
    font-size: clamp(10px, 2.5vw, 13px);
    gap: 3px;
  }

  .brand-strip {
    min-height: 52px;
    padding: 4px 10px;
    grid-template-columns: 1fr;
  }

  .deck-mark {
    display: none;
  }

  .logo-text {
    justify-content: center;
    gap: 6px;
  }

  .logo-main {
    font-size: clamp(18px, 4vw, 22px);
  }

  .logo-script {
    font-size: clamp(20px, 4.4vw, 24px);
    transform: translateY(1px);
  }

  .status-line {
    font-size: clamp(14px, 3.6vw, 20px);
    min-height: 1.1em;
  }

  .hold-tag {
    min-height: 14px;
    font-size: 9px;
  }

  .card {
    border-radius: 8px;
    padding: 5px 5px;
  }

  .card-corner {
    font-size: clamp(11px, 2.2vw, 14px);
  }

  .card-center {
    font-size: clamp(26px, 5.3vw, 36px);
  }

  .controls {
    gap: 4px;
  }

  .btn {
    min-height: 34px;
    font-size: clamp(9px, 1.8vw, 11px);
    border-width: 2px;
  }

  .bonus-shell {
    padding: 8px;
    gap: 6px;
  }

  .bonus-selection-scene {
    min-height: 180px;
  }

  .operator-panel {
    padding: 8px;
    gap: 6px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
  }

  .btn:hover {
    box-shadow:
      0 4px 8px rgba(0, 0, 0, 0.35),
      inset 0 2px 0 rgba(255, 255, 255, 0.25),
      inset 0 -9px 0 rgba(0, 0, 0, 0.22);
  }
}

/* Cashier: last-chance coin + rebuy */
.cashier-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.82);
  display: grid;
  place-items: center;
  padding: clamp(8px, 2vh, 20px);
}

.cashier-overlay.hidden {
  display: none;
}

.cashier-shell {
  width: min(520px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  border: 4px solid #1a4d2e;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.12) 0%, transparent 42%),
    linear-gradient(180deg, #1e3d28 0%, #0f2418 100%);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #f0f4ec;
  padding: clamp(14px, 2.4vw, 22px);
}

.cashier-panel.hidden {
  display: none;
}

.cashier-heading {
  margin: 0 0 8px;
  font-size: clamp(17px, 2.4vw, 24px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.cashier-sub {
  margin: 0 0 16px;
  font-size: clamp(12px, 1.8vw, 15px);
  font-weight: 700;
  text-align: center;
  color: rgba(230, 240, 228, 0.88);
  line-height: 1.35;
}

.coin-flip-viewport {
  display: grid;
  place-items: center;
  min-height: clamp(140px, 28vw, 200px);
  perspective: 900px;
  margin: 8px 0 12px;
}

.coin-flip-disc {
  width: clamp(120px, 36vw, 168px);
  height: clamp(120px, 36vw, 168px);
  position: relative;
  transform-style: preserve-3d;
}

.coin-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s linear;
}

.coin-flip-disc.is-spinning .coin-flip-inner {
  animation: coin-flip-spin 2.4s cubic-bezier(0.45, 0.02, 0.2, 1) forwards;
}

.coin-flip-disc.is-result-win .coin-flip-inner {
  transform: rotateY(0deg);
}

.coin-flip-disc.is-result-lose .coin-flip-inner {
  transform: rotateY(180deg);
}

@keyframes coin-flip-spin {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(calc(720deg + var(--coin-end-y, 0deg)));
  }
}

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 4px solid rgba(40, 40, 40, 0.65);
  box-shadow:
    inset 0 4px 12px rgba(255, 255, 255, 0.35),
    inset 0 -6px 14px rgba(0, 0, 0, 0.45),
    0 8px 20px rgba(0, 0, 0, 0.5);
}

.coin-face-win {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.55) 0%, transparent 42%),
    radial-gradient(circle at 70% 75%, rgba(0, 0, 0, 0.2) 0%, transparent 45%),
    linear-gradient(145deg, #e8c547 0%, #b8891a 48%, #7a5a12 100%);
  transform: rotateY(0deg);
}

.coin-face-lose {
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 40%),
    linear-gradient(145deg, #9aa3a8 0%, #5c6469 50%, #3a4044 100%);
  transform: rotateY(180deg);
}

.coin-face-value {
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 900;
  color: #1a1a1a;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.coin-face-lose .coin-face-value {
  color: #2a2a2a;
}

.coin-face-unit {
  font-size: clamp(12px, 2.4vw, 16px);
  font-weight: 800;
  color: rgba(20, 20, 20, 0.75);
}

.coin-flip-result {
  min-height: 2.6em;
  margin: 0;
  text-align: center;
  font-size: clamp(14px, 2.2vw, 18px);
  font-weight: 900;
  color: #fff4c2;
}

.cashier-rebuy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.cashier-rebuy-head .cashier-heading {
  text-align: left;
  flex: 1;
}

.rebuy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 10px);
  margin-bottom: 14px;
}

@media (max-width: 420px) {
  .rebuy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cash-chip {
  position: relative;
  border: none;
  cursor: pointer;
  padding: 0;
  min-height: clamp(52px, 14vw, 72px);
  border-radius: 10px;
  font-family: inherit;
  font-weight: 900;
  color: #1a1a1a;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}

.cash-chip:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.cash-chip-bill {
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: clamp(10px, 2vw, 13px);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cash-chip-coin {
  border-radius: 50%;
  aspect-ratio: 1;
  width: 100%;
  max-width: 72px;
  margin: 0 auto;
  border: 3px solid rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: clamp(9px, 1.8vw, 11px);
}

.cash-chip-coin .cash-chip-main {
  font-size: clamp(12px, 2.6vw, 15px);
}

.cash-chip-20c {
  background: linear-gradient(145deg, #d4a574 0%, #9a6b3a 100%);
}

.cash-chip-50c {
  background: linear-gradient(145deg, #e8ddd0 0%, #a89888 100%);
}

.cash-chip-1e {
  background: linear-gradient(145deg, #f0d060 0%, #c9a227 55%, #8a6b18 100%);
}

.cash-chip-2e {
  background: linear-gradient(145deg, #dfe5ea 0%, #8fa0b0 55%, #4f5d68 100%);
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cash-chip-2e .cash-chip-sub {
  color: rgba(255, 255, 255, 0.85);
}

.cash-chip-5b {
  background: linear-gradient(180deg, #d8e8c8 0%, #7cb069 100%);
}

.cash-chip-10b {
  background: linear-gradient(180deg, #fde8a0 0%, #e8b84a 100%);
}

.cash-chip-20b {
  background: linear-gradient(180deg, #cfe0f5 0%, #6a9fd4 100%);
}

.cash-chip-50b {
  background: linear-gradient(180deg, #f5d4a8 0%, #d4924a 100%);
}

.cash-chip-100b {
  background: linear-gradient(180deg, #e8d8f0 0%, #b082c4 100%);
}

.cash-chip-200b {
  background: linear-gradient(180deg, #f0dcb8 0%, #d4a060 100%);
}

.cash-chip-500b {
  background: linear-gradient(180deg, #e8d0e8 0%, #c070b0 100%);
}

.cash-chip-eur {
  font-size: clamp(8px, 1.5vw, 10px);
  opacity: 0.85;
  font-weight: 800;
}

.rebuy-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.12);
  font-weight: 800;
  font-size: clamp(14px, 2.2vw, 18px);
}

.rebuy-total-row strong {
  font-size: clamp(18px, 3vw, 26px);
  color: #fff4a8;
}

.rebuy-start-btn {
  width: 100%;
  min-height: 48px;
  font-size: clamp(12px, 2vw, 16px);
  font-weight: 900;
}

.rebuy-start-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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