#content:is([data-game=mines],[data-game=beef],[data-game=hilo]) > .page-head {
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
#content:is([data-game=mines],[data-game=beef],[data-game=hilo]) > .page-head p {
  margin-top: 5px;
}
[data-step-layout] {
  align-items: start;
  grid-template-columns: minmax(0,1fr) minmax(256px,31%);
  gap: 14px;
}
[data-step-layout] .stage.panel, [data-step-layout] #game-sidebar.panel {
  min-width: 0;
  border: 1px solid #7965883f;
  border-radius: 23px;
}
[data-step-layout] .stage.panel { padding: 0; overflow: hidden; }
[data-step-layout] #game-sidebar.panel {
  background: linear-gradient(145deg,#272131,#191720 65%);
  box-shadow: inset 0 1px #e9c9ff14, 0 12px 28px #08060b38;
}
[data-step-layout] .result-strip { border-radius: 15px; }

.step-stage {
  --step-accent:#c6a4f3;
  display: grid;
  align-content: space-between;
  gap: clamp(16px,2vw,26px);
  min-width: 0;
  min-height: 418px;
  padding: clamp(17px,2.5vw,32px);
  background:
    radial-gradient(ellipse at 51% 47%,#302344c4,transparent 67%),
    linear-gradient(135deg,#1e1928,#14111b 64%,#1c1527);
}
.step-stage[data-step-stage="beef"] {
  --step-accent:#efc08a;
  container-type: inline-size;
  background:
    radial-gradient(ellipse at 50% 20%,#47302787,transparent 78%),
    linear-gradient(147deg,#282126,#161419 75%);
}
.step-stage[data-step-stage="hilo"] {
  --step-accent:#c3b8ff;
  background:
    radial-gradient(ellipse at 53% 51%,#36304ed1,transparent 68%),
    linear-gradient(135deg,#231d30,#191621 65%,#232034);
}
.step-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .65rem .9rem;
  min-width: 0;
}
.step-stage-head h2 { margin: 0 0 .2rem; color: #f2e9f8; font-size: 1.18rem; }
.step-stage-head p { margin: 0; color: #c6b7d0; font-size: .81rem; }
.step-stage-head p strong { color: var(--step-accent); font-weight: 650; }
.step-phase {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: .38rem .62rem;
  border: 1px solid #d8bafd26;
  border-radius: 999px;
  color: #e3d1f2;
  background: #312440b8;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.step-phase[data-step-phase-label=active] {
  color: #d3f7e7;
  background: #214359;
  border-color: #77dacc55;
}
.step-phase[data-step-phase-label=active]::before {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.step-stage-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .3rem .75rem;
  min-width: 0;
  color: #c8b9d0;
  font-size: .82rem;
  line-height: 1.4;
}
.step-stage-note p { margin: 0; }
.step-stage-note strong { color: var(--step-accent); font-variant-numeric: tabular-nums; }

.step-cols-2 { --step-cols:2; }
.step-cols-3 { --step-cols:3; }
.step-cols-4 { --step-cols:4; }
.step-cols-5 { --step-cols:5; }
.step-cols-6 { --step-cols:6; }
.step-grid {
  display: grid;
  justify-self: center;
  width: min(100%,435px);
  min-width: 0;
  grid-template-columns: repeat(var(--step-cols),minmax(0,1fr));
  gap: clamp(5px,1vw,10px);
  padding: clamp(5px,1vw,13px);
  border: 1px solid #bd9be833;
  border-radius: 16px;
  background: #120e1a8c;
  box-shadow: inset 0 5px 16px #08060cbd, 0 12px 40px #0a07173b;
}
.step-cell {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #7b629169;
  border-radius: clamp(7px,1vw,13px);
  color: #ad94c9;
  background: linear-gradient(151deg,#40344e,#30253d 68%,#372841);
  box-shadow: inset 0 1px #eed9ff26, inset 0 -3px #0d0a1780, 0 3px 5px #08050e5e;
  transition: transform .15s ease, border-color .15s ease, filter .15s ease;
}
.step-cell:disabled { opacity: 1; }
.step-cell svg { width: clamp(17px,2.5vw,32px); height: clamp(17px,2.5vw,32px); }
.step-cell:not(:disabled):hover {
  color: #f0dcff;
  border-color: #d6afff;
  filter: brightness(1.16);
  transform: translateY(-2px);
}
.step-cell:not(:disabled):active { transform: translateY(1px); }
.step-cell:focus-visible, .step-console button:focus-visible {
  z-index: 2;
  outline: 2px solid #e9cfff;
  outline-offset: 2px;
}
.step-cell[data-cell-state=safe] {
  color: #9ef8db;
  background: linear-gradient(148deg,#244943,#173a3b);
  border-color: #6adcb478;
  box-shadow: inset 0 1px #b4f8e254, inset 0 -3px #0b22218f, 0 3px 5px #03081062;
}
.step-cell[data-cell-state=danger], .step-cell[data-cell-state=struck] {
  color: #ffd1d8;
  background: linear-gradient(145deg,#5a3046,#3f2136);
  border-color: #dc879783;
}
.step-cell[data-cell-state=struck] {
  border-color: #ffc0cb;
  background: linear-gradient(145deg,#963750,#6a263e);
  box-shadow: inset 0 1px #ffe1e55e, 0 0 18px #ff638c5c;
}
.step-cell[data-cell-state=next] {
  color: #ffe2b8;
  border-color: #efb66bda;
  box-shadow: inset 0 1px #f7d09772, inset 0 -3px #432b2496, 0 0 15px #d593534c;
}
[data-mines-auto-plan] .step-cell[data-cell-state=planned] {
  color: #f9e8ff;
  border-color: #c699ed;
  background: linear-gradient(151deg,#784d9f,#503365 76%);
  box-shadow: inset 0 1px #f9ddff57, inset 0 -3px #22142c90, 0 3px 10px #160c2594;
}
[data-mines-plan-order] {
  display: none;
  font-size: clamp(.95rem,2.2vw,1.55rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.step-cell[data-cell-state=planned] [data-mines-plan-order] { display: block; }
.step-cell[data-mines-waiting] { border-style: dashed; opacity: .75; }
[data-mines-queue-status][hidden] { display: none; }
.step-cell[data-cell-state=planned] > svg { display: none; }
.mines-playback-order {
  position: absolute;
  inset: 3px 3px auto auto;
  min-width: 1.4em;
  padding: .1em .23em;
  border-radius: 4px;
  color: #faedff;
  background: #140f1dda;
  font-size: clamp(.59rem,1.1vw,.74rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.mines-plan-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem 1rem;
}
.mines-plan-footer > div { flex: 1 1 14rem; }
.mines-plan-footer output {
  color: #e8d0fa;
  font-size: .89rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.mines-plan-footer p {
  margin: .18rem 0 0;
  color: #c8b9d0;
  font-size: .8rem;
  line-height: 1.45;
}
.mines-plan-clear {
  min-height: 36px;
  padding: .42rem .7rem;
  border: 1px solid #a48abc75;
  border-radius: 8px;
  color: #ecdbf8;
  background: #372a45;
  font-size: .8rem;
}
.mines-plan-clear:hover:not(:disabled) { border-color: #e0b6f6; background: #4d395d; }
.mines-plan-clear:focus-visible { outline: 2px solid #e9cfff; outline-offset: 2px; }
.mines-plan-clear:disabled { opacity: .6; }
.step-stage[data-step-animate] .step-cell[data-step-latest] svg { animation: step-cell-open .34s cubic-bezier(.18,.76,.26,1) both; }
@keyframes step-cell-open {
  0% { opacity: .38; transform: translateY(5px) scale(.72); }
  52% { opacity: 1; transform: translateY(-2px) scale(1.14); }
  100% { opacity: 1; transform: none; }
}

.beef-ladder {
  --beef-gap:clamp(6px,1.05cqi,11px);
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: var(--beef-gap);
  min-width: 0;
  margin: 0;
  padding: clamp(7px,1.65cqi,16px);
  border: 1px solid #b798713b;
  border-radius: 16px;
  list-style: none;
  background:
    repeating-linear-gradient(90deg,#c79c670a 0 1px,transparent 1px 8px),
    linear-gradient(153deg,#28211f,#151417 68%,#231b1c);
  box-shadow: inset 0 5px 18px #0c090bc2,0 10px 24px #0c070b30;
}
.beef-ladder-step {
  --beef-edge:#80684e;
  --beef-body:#392e27;
  --beef-base:#211b1e;
  --beef-ink:#f7ede2;
  --beef-detail:#dfbb93;
  position: relative;
  min-width: 0;
}
.beef-ladder-step::before {
  content: "";
  position: absolute;
  top: calc(50% - 1.5px);
  left: calc(100% - 1px);
  display: none;
  width: calc(var(--beef-gap) + 2px);
  height: 3px;
  background: linear-gradient(#927451,#63503e 50%,#40342b 50%);
  pointer-events: none;
}
.beef-checkpoint {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-content: center;
  align-items: center;
  gap: 3px 4px;
  width: 100%;
  min-width: 0;
  min-height: 74px;
  height: 100%;
  padding: clamp(6px,1.3cqi,12px);
  border: 1px solid var(--beef-edge);
  border-radius: 12px 6px 12px 6px;
  color: var(--beef-ink);
  background:
    linear-gradient(127deg,#f5c58e16,transparent 58%),
    linear-gradient(165deg,var(--beef-body),var(--beef-base));
  box-shadow: inset 0 1px #fff1de26,inset 0 -3px #0f0d125e,0 2px 5px #0b080a77;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-align: start;
}
.beef-step-index, .beef-step-odds, .beef-step-terminal {
  color: var(--beef-detail);
  font-size: clamp(.66rem,1.85cqi,.82rem);
  line-height: 1.15;
}
.beef-step-index { font-weight: 700; }
.beef-step-mark { display: grid; place-items: center; color: var(--beef-detail); }
.beef-step-mark svg { width: clamp(13px,3.5cqi,22px); height: clamp(13px,3.5cqi,22px); }
.beef-step-factor {
  grid-column: 1 / -1;
  display: block;
  font-size: clamp(.85rem,2.6cqi,1.24rem);
  font-weight: 780;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.beef-step-odds, .beef-step-terminal { grid-column: 1 / -1; }
.beef-step-terminal { font-size: .62rem; font-weight: 680; }
.beef-ladder-step[data-beef-state=closed] {
  --beef-edge:#65564d;
  --beef-body:#2d2828;
  --beef-ink:#e0d4cc;
  --beef-detail:#c9b6a5;
}
.beef-ladder-step[data-beef-state=next] {
  --beef-edge:#ecb06e;
  --beef-body:#68492c;
  --beef-base:#372620;
  --beef-ink:#fff4df;
  --beef-detail:#ffe0b1;
}
.beef-ladder-step[data-beef-state=safe] {
  --beef-edge:#709a79;
  --beef-body:#344c3d;
  --beef-base:#1d2a25;
  --beef-ink:#e4f5e4;
  --beef-detail:#b0e0b7;
}
.beef-ladder-step:is([data-beef-state=danger],[data-beef-state=struck]) {
  --beef-edge:#c17c84;
  --beef-body:#65373f;
  --beef-base:#361f29;
  --beef-ink:#fff0f0;
  --beef-detail:#f1bdc1;
}
.beef-ladder-step[data-beef-terminal] .beef-checkpoint {
  box-shadow: inset 0 -3px var(--beef-edge),inset 0 1px #fff1de26,0 2px 5px #0b080a77;
}
button.beef-checkpoint { transition: border-color .16s ease,filter .16s ease; }
button.beef-checkpoint:not(:disabled):hover { border-color: #ffe2a9; filter: brightness(1.18); }
button.beef-checkpoint:focus-visible { z-index: 1; outline: 2px solid #ffdb9c; outline-offset: 2px; }
button.beef-checkpoint:disabled { opacity: .77; }
.beef-ladder-legend {
  display: block;
  margin-top: .3rem;
  color: #d8c3ad;
  font-size: .76rem;
  line-height: 1.35;
}
.step-stage[data-step-animate] .beef-ladder-step[data-step-latest] .beef-step-mark,
.step-stage[data-step-animate] .beef-checkpoint[data-step-latest] .beef-step-mark {
  animation: step-cell-open .34s cubic-bezier(.18,.76,.26,1) both;
}
@container (width > 490px) {
  .beef-ladder-step:not(:nth-child(5n),:last-child)::before { display: block; }
}
@container (390px < width <= 490px) {
  .beef-ladder { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .beef-ladder-step:not(:nth-child(4n),:last-child)::before { display: block; }
}
@container (260px < width <= 390px) {
  .beef-ladder { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .beef-ladder-step:not(:nth-child(3n),:last-child)::before { display: block; }
}
@container (width <= 390px) {
  .beef-step-factor[data-beef-factor-wide] {
    font-family: var(--font-interface-narrow);
    font-size: clamp(.7rem,3.38cqi,.85rem);
    white-space: nowrap;
  }
}
@container (width <= 260px) {
  .beef-ladder { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .beef-ladder-step:not(:nth-child(2n),:last-child)::before { display: block; }
}

.step-card-table {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(19px,5vw,58px);
  padding: 9px 0;
}
.step-card-slot { display: grid; justify-items: center; gap: 14px; min-width: 0; }
.step-card-slot > span { color: #cdbfd9; font-size: .84rem; line-height: 1.25; text-align: center; }
.step-card {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: clamp(100px,16vw,154px);
  aspect-ratio: 5/7;
  border: 1px solid #b9abd1;
  border-radius: 15px;
  box-shadow: 0 1px #fff5, 0 5px 0 #262035, 0 18px 31px #090611ae;
}
.step-card-face {
  color: #282034;
  background: radial-gradient(at 42% 36%,#fff9f0,#e7dbc8 87%);
}
.step-card-face[data-suit=red] { color: #a03753; }
.step-card-face::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid #84708c65;
  border-radius: 10px;
  pointer-events: none;
}
.step-card-corner {
  position: absolute;
  inset: 13px auto auto 13px;
  display: grid;
  justify-items: center;
  gap: 1px;
  font-size: 1.02rem;
  line-height: 1;
}
.step-card-corner i { font-style: normal; font-size: .85em; }
.step-card-inverse { inset: auto 13px 13px auto; transform: rotate(180deg); }
.step-card-suit { font: 400 clamp(3.1rem,7vw,5.45rem)/1 Georgia,serif; }
.step-card-back {
  border-color: #987aca;
  color: #d7b2f4;
  background:
    linear-gradient(145deg,#80649c25,#1c143b72),
    repeating-linear-gradient(45deg,#bb8ff217 0 1px,transparent 1px 7px),
    repeating-linear-gradient(-45deg,#b791e615 0 1px,transparent 1px 7px),
    #39275a;
}
.step-card-back::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid #d6b5f68a;
  border-radius: 10px;
}
.step-card-back span {
  padding: .21em .25em;
  border: 1px solid #bf9feb94;
  border-radius: 10px;
  background: #33224fcc;
  font-size: clamp(26px,4vw,51px);
  line-height: 1;
  transform: rotate(45deg);
}
.step-next-card .step-card { transform: scale(.88) rotate(5deg); transform-origin: bottom center; }
.step-stage[data-step-animate] .step-card-face { animation: step-card-deal .35s cubic-bezier(.16,.82,.29,1) both; }
@keyframes step-card-deal {
  from { opacity: .34; transform: perspective(470px) rotateY(-48deg) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.step-card-history {
  display: grid;
  gap: .5rem;
  min-width: 0;
  padding: 0;
  margin: 0 auto;
}
.step-card-history h3 { margin: 0; color: #cdbfd9; font-size: .8rem; font-weight: 550; text-align: center; }
.step-card-history ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 0; margin: 0; list-style: none; }
.step-card-history li {
  padding: .22rem .48rem;
  color: #e8dcf7;
  background: #452f5d;
  border: 1px solid #9675b94b;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
}
.step-card-history li[data-suit=red] { color: #ffd0dc; background: #573349; border-color: #a9688870; }

.step-console { display: grid; gap: 14px; }
.step-console-head { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.step-console-head p { margin: 0; color: #cbbbd6; font-size: .8rem; }
.step-console-head p strong { color: #ead8f8; font-weight: 650; }
.step-console-card { display: none; }
.step-multipliers { display: grid; gap: 7px; margin: 0; }
.step-multipliers > div {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 6px 10px;
  padding: .66rem .75rem;
  border: 1px solid #aa85cd41;
  border-radius: 10px;
  background: #36283e99;
}
.step-multipliers dt { color: #d0c0da; font-size: .82rem; }
.step-multipliers dd { margin: 0; color: #f3dbff; font-size: 1.13rem; font-weight: 740; font-variant-numeric: tabular-nums; }
.step-moves, .step-cashout-row { display: grid; gap: 7px; }
.step-move.button {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  justify-items: start;
  gap: 8px;
  min-height: 55px;
  padding: .55rem .62rem;
  text-align: start;
  border: 1px solid #a990c138;
  border-radius: 11px;
  color: #f0e7f5;
  background: #352a40;
}
.step-move.button:not(:disabled):hover { background: #4a3659; border-color: #b98cdb94; }
.step-move.button svg { width: 19px; height: 19px; color: #d9b2fa; }
.step-move span { display: grid; gap: 3px; }
.step-move .step-choice-factor { text-align: end; gap: 2px; }
.step-move strong { font-size: .87rem; font-variant-numeric: tabular-nums; }
.step-move small { color: #cfbfd9; font-size: .76rem; font-weight: 500; }
.hilo-opening-console { display: grid; gap: 7px; }
.hilo-opening-status { margin: 0; color: #d8c9e1; font-size: .82rem; }
.hilo-opening-quote.button:disabled {
  cursor: default;
  opacity: 1;
  border-color: #9c87bd36;
  color: #eee4f8;
  background: #251e31;
  box-shadow: none;
}
.hilo-opening-skip.button { color: #f5e9fc; border-color: #ac84d477; }
.hilo-opening-console button:focus-visible { outline: 2px solid #e9cfff; outline-offset: 2px; }
.step-cashout.button {
  min-height: 47px;
  color: #21132d;
  background: linear-gradient(145deg,#e0bdfe,#b880ed);
  border-radius: 12px;
}
.step-cashout.button:hover:not(:disabled) { background: #e6c7ff; color: #21132d; }
.step-cashout.button:disabled { color: #d8c2e6; background: #41324b; opacity: .78; }
.step-cashout-row p { margin: 0; color: #c9bbd2; font-size: .78rem; }

@media (max-width: 850px) {
  [data-step-layout] { grid-template-columns: 1fr; }
  [data-step-layout] .stage-column { display: contents; }
  [data-step-layout] .stage { grid-row: 1; }
  [data-step-layout] #game-sidebar { grid-row: 2; }
  [data-step-layout] .result-strip { grid-row: 3; }
  #content[data-game=beef] [data-step-layout] #game-sidebar { grid-row: 1; }
  #content[data-game=beef] [data-step-layout] .stage { grid-row: 2; }
  .step-stage { min-height: 355px; }
  .step-console-card { display: flex; align-items: center; gap: 6px; }
  .step-console-card span { color: #cbbbd6; font-size: .75rem; text-align: end; }
  .step-console-card strong {
    flex: none;
    padding: .23rem .4rem;
    border-radius: 5px;
    color: #252033;
    background: #f1e6d5;
    font: 750 .87rem/1.2 var(--font-interface);
  }
  .step-console-card strong[data-suit=red] { color: #9f2d4a; }
}
@media (max-width: 490px) {
  #content:is([data-game=mines],[data-game=beef],[data-game=hilo]) > .page-head { align-items: flex-start; margin-bottom: 13px; }
  [data-step-layout] .stage.panel, [data-step-layout] #game-sidebar.panel { border-radius: 17px; }
  .step-stage { min-height: 0; padding: 12px; gap: 15px; }
  .step-stage-head { flex-wrap: wrap; align-items: center; gap: .3rem .55rem; }
  .step-stage-head h2 { font-size: 1.03rem; }
  .step-stage-head p { font-size: .75rem; }
  .step-phase { padding: .29rem .45rem; font-size: .69rem; }
  .step-stage-note { font-size: .76rem; }
  .step-grid { gap: 5px; border-radius: 12px; }
  .step-cell svg { width: clamp(18px,5.7vw,26px); height: clamp(18px,5.7vw,26px); }
  .step-card-table { padding-block: 6px; gap: 21px; }
  .step-card { width: clamp(85px,27vw,125px); border-radius: 11px; }
  .step-card-face::before, .step-card-back::before { inset: 6px; border-radius: 7px; }
  .step-card-corner { inset: 9px auto auto 9px; }
  .step-card-inverse { inset: auto 9px 9px auto; }
  .step-card-slot { gap: 11px; }
  .step-card-slot > span { font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .step-stage[data-step-animate] .step-cell[data-step-latest] svg,
  .step-stage[data-step-animate] .beef-ladder-step[data-step-latest] .beef-step-mark,
  .step-stage[data-step-animate] .beef-checkpoint[data-step-latest] .beef-step-mark,
  .step-stage[data-step-animate] .step-card-face { animation: none; }
  .step-cell:not(:disabled):hover, .step-cell:not(:disabled):active { transform: none; }
}
