﻿/* Premium gameplay lobby */

.game-brand,
.game-status,
.bet-title,
.amount-title,
.game-controls,
.game-social,
.game-disclaimer {
  display: none;
}

.device.is-playing {
  --game-gap: clamp(12px, 1.4vw, 26px);
  --plate-w: min(78%, 570px);
  --cover-w: min(56%, 420px);
  grid-template-columns: clamp(218px, 19vw, 292px) minmax(390px, 1fr) clamp(330px, 29vw, 430px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "top top top"
    "hist play dock"
    "fun fun fun";
  column-gap: var(--game-gap);
  padding: 0 max(16px, var(--safe-r)) 0 max(16px, var(--safe-l));
  overflow: hidden;
}

.device.is-playing .scene {
  margin-left: calc(max(16px, var(--safe-l)) * -1);
  margin-right: calc(max(16px, var(--safe-r)) * -1);
}

.device.is-playing .vignette {
  background:
    radial-gradient(ellipse at 50% 43%, transparent 33%, rgba(8, 3, 2, 0.48) 100%),
    linear-gradient(90deg, rgba(4, 2, 2, 0.45), transparent 24%, transparent 68%, rgba(4, 2, 2, 0.55)),
    linear-gradient(180deg, rgba(4, 2, 2, 0.24), transparent 45%, rgba(4, 2, 2, 0.54));
}

.device.is-playing .hud-top {
  min-width: 0;
  padding: max(10px, var(--safe-t)) 0 7px;
  gap: clamp(7px, 1vw, 14px);
  background: linear-gradient(180deg, rgba(5, 3, 2, 0.72), rgba(5, 3, 2, 0.08));
}

.device.is-playing .btn-exit,
.device.is-playing .hud-icon {
  border: 1px solid rgba(241, 191, 55, 0.7);
  border-radius: 50%;
  background: rgba(12, 9, 6, 0.86);
  box-shadow: inset 0 0 12px rgba(255, 203, 67, 0.08), 0 5px 14px rgba(0, 0, 0, 0.32);
  transition: transform 150ms ease, filter 150ms ease;
}

.device.is-playing .btn-exit {
  width: clamp(42px, 5.5vh, 56px);
  height: clamp(42px, 5.5vh, 56px);
  padding: 5px;
}

.device.is-playing .hud-tools {
  gap: 8px;
}

.device.is-playing .hud-icon {
  min-width: clamp(42px, 5.5vh, 56px);
  min-height: clamp(42px, 5.5vh, 56px);
  justify-content: center;
  padding: 5px;
}

.device.is-playing .hud-icon.js-lang {
  width: auto;
  min-width: clamp(94px, 11vh, 126px);
  padding: 5px 13px 5px 8px;
  gap: 7px;
  border-radius: 999px;
}

.device.is-playing .hud-icon.js-lang .hud-lang-label {
  font-family: var(--font-display);
  font-size: clamp(0.78rem, 1.8vh, 1rem);
  color: #ffe39a;
}

.device.is-playing .hud-icon:hover,
.device.is-playing .btn-exit:hover {
  transform: translateY(-2px);
  filter: brightness(1.18);
}

.device.is-playing .bank-chip {
  border-color: rgba(245, 192, 54, 0.8);
  background: linear-gradient(180deg, rgba(34, 23, 13, 0.96), rgba(8, 7, 6, 0.96));
  color: #ffe8a0;
  padding: 8px 17px;
  font-size: clamp(0.78rem, 1.8vh, 1rem);
}

.device.is-playing .result-scroll {
  width: clamp(52px, 7vh, 68px);
  height: clamp(52px, 7vh, 68px);
}

.device.is-playing .history,
.device.is-playing .bet-dock {
  align-self: center;
  justify-self: center;
  margin: 0;
  min-width: 0;
  max-height: calc(100% - 6px);
  z-index: 5;
}

.device.is-playing .history {
  width: min(100%, 274px);
  aspect-ratio: 260 / 700;
}

.device.is-playing .bet-dock {
  width: min(100%, 420px);
  aspect-ratio: 4 / 7;
}

.device.is-playing .panel-frame-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 11px 18px rgba(0, 0, 0, 0.5));
}

.device.is-playing .hist-inner,
.device.is-playing .bet-inner {
  height: calc(100% - 24px);
  margin: 12px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(23, 17, 10, 0.94), rgba(7, 7, 6, 0.95));
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(7px);
}

.device.is-playing .hist-inner {
  gap: clamp(5px, 0.8vh, 9px);
  padding: clamp(20px, 2.6vh, 30px) clamp(13px, 1.4vw, 20px);
}

.device.is-playing .hist-title,
.device.is-playing .bet-title,
.device.is-playing .amount-title {
  color: #ffe298;
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 5px #000;
}

.device.is-playing .hist-title,
.device.is-playing .bet-title {
  font-size: clamp(0.78rem, 1.8vh, 1.05rem);
}

.device.is-playing .amount-title {
  display: block;
  font-size: clamp(0.72rem, 1.6vh, 0.95rem);
}

.device.is-playing .hist-list {
  gap: 0;
  overflow: hidden;
}

.device.is-playing .history-slot {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  padding: 3px 5px;
  border-bottom: 1px solid rgba(232, 186, 68, 0.23);
  background: none;
}

.device.is-playing .history-slot .hist-row {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  gap: clamp(7px, 0.8vw, 12px);
}

.device.is-playing .history-slot .hist-die {
  width: clamp(38px, 5.3vh, 56px);
  height: clamp(38px, 5.3vh, 56px);
}

.device.is-playing .history-slot .hist-num {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vh, 1.42rem);
  color: #ffe08a;
}

.device.is-playing .history-slot .hist-time {
  grid-column: 2;
  align-self: start;
  font-size: clamp(0.54rem, 1.1vh, 0.68rem);
  color: #d9b75d;
}

.device.is-playing .history-slot.is-empty::after {
  content: "-";
  width: auto;
  border: 0;
  background: none;
  color: rgba(244, 211, 119, 0.35);
  font-size: 21px;
}

.device.is-playing .hist-foot {
  min-height: 42px;
  display: flex;
  border: 1px solid rgba(235, 184, 52, 0.55);
  background: rgba(41, 27, 13, 0.72);
  color: #f6d77e;
  transition: transform 150ms ease, filter 150ms ease;
}

.device.is-playing .hist-foot b {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: rgba(236, 183, 47, 0.16);
}

.device.is-playing .hist-foot:hover {
  transform: translateY(-1px);
  filter: brightness(1.16);
}

.device.is-playing .playfield {
  grid-template-rows: auto auto auto auto;
  align-content: center;
  padding: 0;
  overflow: visible;
}

.game-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(90%, 600px);
  min-height: 0;
  margin: 0 auto;
  color: #f2c04a;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}

.game-brand img {
  width: min(62%, 330px);
  max-height: clamp(34px, 6.8vh, 76px);
  margin-bottom: -4px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.65));
}

.game-brand div {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
}

.game-brand strong {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vh, 4.8rem);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 #5a2d08, 0 5px 0 #9a5b13, 0 10px 18px rgba(0, 0, 0, 0.7);
}

.game-brand span {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(0.78rem, 2.1vh, 1.18rem);
  color: #ffe4a0;
  letter-spacing: 0.12em;
}

.device.is-playing .playfield .stage {
  width: min(100%, 760px);
  height: min(49vh, 500px);
  align-self: stretch;
  overflow: visible;
}

.device.is-playing .table {
  transform: rotateX(4deg);
}

.device.is-playing .stone-plat {
  width: min(96%, 720px);
  bottom: -22%;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.56));
}

.device.is-playing .plate {
  top: 29%;
  filter: drop-shadow(0 17px 13px rgba(20, 7, 0, 0.5));
}

.device.is-playing .cover {
  top: 5%;
}

.device.is-playing[data-phase="locking"] .cover {
  animation: game-cover-shake 420ms ease-in-out infinite;
}

@keyframes game-cover-shake {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  25% { transform: translateX(calc(-50% - 4px)) rotate(-1.5deg); }
  75% { transform: translateX(calc(-50% + 4px)) rotate(1.5deg); }
}

.game-status {
  display: block;
  position: relative;
  z-index: 7;
  min-height: 24px;
  margin-top: 2px;
  color: #f2d17a;
  font-size: clamp(0.72rem, 1.8vh, 0.95rem);
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 6px #000;
}

.device.is-playing .lock-block {
  position: absolute;
  top: 43%;
  left: 50%;
  transform: translate(-50%, 10px);
  margin: 0;
}

.device.is-playing .lock-block.is-on {
  transform: translate(-50%, 0);
}

.device.is-playing .lock-icon {
  width: clamp(44px, 6vh, 64px);
}

.device.is-playing .spin-zone {
  width: min(74%, 430px);
  gap: 4px;
  padding: 0 0 2px;
}

.device.is-playing .btn-spin {
  min-height: 0;
  aspect-ratio: 420 / 110;
  border-radius: 42px;
  background: linear-gradient(180deg, #b32c1e, #65130e);
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.48), 0 0 16px rgba(244, 178, 39, 0.22);
}

.device.is-playing .btn-spin-frame {
  object-fit: fill;
}

.device.is-playing .btn-spin-text b {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4.2vh, 2.5rem);
  color: #ffe8a0;
  text-shadow: 0 2px 0 #6a2e09, 0 5px 9px rgba(0, 0, 0, 0.55);
}

.device.is-playing .spin-hint {
  color: #e8c76f;
}

.device.is-playing .bet-inner {
  display: flex;
  gap: clamp(5px, 0.75vh, 9px);
  padding: clamp(20px, 2.6vh, 30px) clamp(15px, 1.45vw, 23px);
  overflow: hidden;
}

.device.is-playing .bet-title {
  display: block;
}

.device.is-playing .timer-bar {
  flex: 0 0 3px;
}

.device.is-playing .faces-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 0.8vw, 10px);
  flex: 1 1 auto;
  min-height: 0;
}

.device.is-playing .face-bet {
  min-height: 0;
  justify-content: center;
  padding: clamp(5px, 0.7vh, 9px) 4px;
  border-radius: 6px;
  box-shadow: 0 5px 9px rgba(0, 0, 0, 0.32);
}

.device.is-playing .face-bet .tile-bg,
.device.is-playing .btn-spin-frame,
.device.is-playing .action-frame {
  object-fit: contain;
  object-position: center;
}

.device.is-playing .face-bet .face-die {
  width: clamp(36px, 5.2vh, 54px);
  height: clamp(36px, 5.2vh, 54px);
}

.device.is-playing .face-meta {
  flex-direction: column;
  gap: 0;
  font-size: clamp(0.66rem, 1.5vh, 0.82rem);
  line-height: 1.05;
  text-align: center;
}

.device.is-playing .face-meta b {
  font-size: 1.35em;
}

.device.is-playing .amounts {
  gap: clamp(5px, 0.7vh, 8px);
}

.device.is-playing .amounts button {
  min-height: clamp(36px, 5.2vh, 48px);
}

.device.is-playing .bet-total {
  font-size: clamp(0.7rem, 1.55vh, 0.9rem);
}

.device.is-playing .actions {
  gap: clamp(6px, 0.8vh, 9px);
}

.device.is-playing .btn-place,
.device.is-playing .btn-clear {
  min-height: clamp(44px, 6.2vh, 58px);
  border-radius: 5px;
}

.device.is-playing .game-fun {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 7px 0 max(9px, var(--safe-b));
  pointer-events: auto;
}

.game-disclaimer {
  display: flex;
  justify-self: start;
  align-items: center;
  gap: 9px;
  max-width: 260px;
  padding: 7px 11px;
  border: 1px solid rgba(236, 184, 50, 0.48);
  background: rgba(8, 7, 5, 0.8);
}

.game-disclaimer img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  object-position: center;
}

.game-disclaimer span {
  display: flex;
  flex-direction: column;
}

.game-disclaimer b {
  font-size: 10px;
  line-height: 1.25;
}

.game-disclaimer small {
  color: #f0ca68;
  font-size: 8px;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: clamp(7px, 0.8vw, 12px);
}

.game-control {
  width: clamp(50px, 6.2vh, 66px);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(240, 189, 53, 0.68);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(35, 23, 12, 0.95), rgba(8, 7, 6, 0.96));
  color: #f5d57b;
  transition: transform 150ms ease, filter 150ms ease;
}

.game-control.is-on {
  box-shadow: inset 0 0 12px rgba(240, 188, 49, 0.12), 0 0 10px rgba(240, 188, 49, 0.14);
}

.game-control img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  object-position: center;
}

.game-control span {
  max-width: 88%;
  overflow-wrap: anywhere;
  font-size: 7px;
  line-height: 1.05;
  text-align: center;
}

.game-social {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 12px;
  border: 1px solid rgba(236, 184, 50, 0.48);
  background: rgba(8, 7, 5, 0.8);
  color: #e8c66a;
  font-size: 9px;
}

.game-social button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(240, 189, 53, 0.65);
  border-radius: 50%;
  color: #f5d274;
  font-family: var(--font-display);
  font-weight: 700;
}

.game-control:hover,
.game-social button:hover {
  transform: translateY(-2px);
  filter: brightness(1.16);
}

.device.is-playing .outcome-toast {
  top: 46%;
  background: rgba(18, 10, 5, 0.94);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 15px rgba(237, 184, 50, 0.22);
}

/* The full game board follows the 3:2 reference composition on roomy screens. */
@media (min-width: 901px) and (min-height: 721px) {
  .device.is-playing {
    --plate-w: min(80%, 600px);
    --cover-w: min(59%, 450px);
    grid-template-columns: clamp(270px, 22vw, 370px) minmax(390px, 1fr) clamp(370px, 26vw, 430px);
    grid-template-rows: auto minmax(0, 1fr) clamp(108px, 13.5vh, 138px);
  }

  .device.is-playing .history {
    width: min(100%, 360px);
    aspect-ratio: 8 / 15;
    transform: translateX(16px);
  }

  .device.is-playing .bet-dock {
    width: min(100%, 430px);
    aspect-ratio: 8 / 13;
    transform: translateX(-30px);
  }

  .device.is-playing .faces-row {
    flex: 0 0 min(29vh, 270px);
  }

  .game-brand img {
    width: min(58%, 300px);
    max-height: 78px;
    margin-top: -22px;
    margin-bottom: -6px;
  }

  .game-brand strong {
    font-size: clamp(3.2rem, 8.8vh, 5.3rem);
  }

  .game-brand span {
    margin-top: 10px;
    font-size: clamp(0.9rem, 2.2vh, 1.28rem);
  }

  .device.is-playing .playfield .stage {
    height: min(42vh, 430px);
  }

  .device.is-playing .cover {
    top: 2%;
  }

  .device.is-playing .stone-plat {
    width: min(94%, 700px);
    bottom: -25%;
  }

  .device.is-playing .playfield {
    transform: translateX(clamp(28px, 2.2vw, 40px));
  }

  .device.is-playing .spin-zone {
    width: min(78%, 480px);
  }

  .device.is-playing .game-fun {
    padding-top: 4px;
    padding-bottom: max(7px, var(--safe-b));
  }

  .game-control {
    width: clamp(72px, 10.7vh, 112px);
    gap: 4px;
  }

  .game-control img {
    width: clamp(26px, 3.8vh, 38px);
    height: clamp(26px, 3.8vh, 38px);
  }

  .game-control span {
    font-size: clamp(8px, 1.15vh, 12px);
  }

  .game-disclaimer {
    max-width: 285px;
    padding: 10px 14px;
  }

  .game-disclaimer img {
    width: 42px;
    height: 42px;
  }

  .game-disclaimer b {
    font-size: 12px;
  }

  .game-disclaimer small {
    font-size: 9px;
  }

  .game-social {
    gap: 10px;
    padding: 9px 11px 9px 15px;
    font-size: 11px;
  }

  .game-social button {
    width: 40px;
    height: 40px;
  }
}

@media (min-width: 901px) and (min-height: 721px) and (max-height: 850px) {
  .device.is-playing {
    --plate-w: min(66%, 460px);
    --cover-w: min(50%, 360px);
    grid-template-rows: auto minmax(0, 1fr) 76px;
  }

  .device.is-playing .history {
    width: min(100%, 274px);
    aspect-ratio: 260 / 700;
    transform: none;
  }

  .device.is-playing .bet-dock {
    width: min(100%, 380px);
    aspect-ratio: 11 / 20;
    transform: none;
  }

  .device.is-playing .playfield {
    transform: none;
  }

  .game-brand img {
    width: min(66%, 350px);
    max-height: 70px;
    margin-top: 0;
    margin-bottom: -5px;
  }

  .game-brand strong {
    font-size: clamp(2.7rem, 7vh, 3.5rem);
  }

  .game-brand span {
    margin-top: 4px;
    font-size: 0.9rem;
  }

  .device.is-playing .playfield .stage {
    height: min(40vh, 330px);
  }

  .device.is-playing .plate {
    top: 20%;
  }

  .device.is-playing .cover {
    top: 2%;
  }

  .device.is-playing .stone-plat {
    width: min(90%, 620px);
    bottom: -10%;
  }

  .device.is-playing .spin-zone {
    width: min(74%, 430px);
  }

  .device.is-playing .faces-row {
    flex: 1 1 auto;
  }

  .game-control {
    width: 66px;
  }

  .game-control img {
    width: 25px;
    height: 25px;
  }

  .game-control span {
    font-size: 8px;
  }
}

@media (min-width: 901px) and (max-width: 1500px) and (min-height: 851px) {
  .device.is-playing .actions {
    gap: 5px;
  }

  .device.is-playing .btn-place,
  .device.is-playing .btn-clear {
    min-height: 46px;
  }
}

@media (max-width: 1180px) and (orientation: landscape) {
  .device.is-playing {
    --game-gap: 10px;
    grid-template-columns: 194px minmax(340px, 1fr) 314px;
    padding-left: max(10px, var(--safe-l));
    padding-right: max(10px, var(--safe-r));
  }

  .device.is-playing .scene {
    margin-left: calc(max(10px, var(--safe-l)) * -1);
    margin-right: calc(max(10px, var(--safe-r)) * -1);
  }

  .device.is-playing .game-fun {
    grid-template-columns: 180px auto 150px;
    gap: 7px;
  }

  .game-social > span,
  .game-disclaimer b {
    display: none;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .device.is-playing {
    --plate-w: min(88%, 540px);
    --cover-w: min(64%, 380px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "top"
      "play"
      "dock"
      "hist"
      "fun";
    gap: 13px;
    height: var(--app-h, 100dvh);
    padding: 0 max(12px, var(--safe-r)) max(16px, var(--safe-b)) max(12px, var(--safe-l));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .device.is-playing .scene {
    position: absolute;
    inset: 0;
    width: calc(100% + max(24px, var(--safe-l) + var(--safe-r)));
    height: 100%;
    min-height: 100dvh;
    margin-left: calc(max(12px, var(--safe-l)) * -1);
    margin-right: 0;
  }

  .device.is-playing .hud-top {
    position: relative;
    z-index: 7;
    width: 100%;
    min-height: 52px;
    padding-top: max(8px, var(--safe-t));
  }

  .device.is-playing .btn-exit,
  .device.is-playing .hud-icon {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .device.is-playing .hud-icon img {
    width: 27px;
    height: 27px;
  }

  .device.is-playing .bank-chip {
    padding: 7px 10px;
  }

  .device.is-playing .result-scroll {
    width: 48px;
    height: 48px;
  }

  .device.is-playing .playfield {
    min-height: clamp(520px, 76vh, 720px);
    grid-template-rows: auto auto auto auto;
    gap: 5px;
  }

  .game-brand img {
    width: min(65%, 340px);
    max-height: 60px;
  }

  .game-brand strong {
    font-size: clamp(2.2rem, 7vh, 4rem);
  }

  .device.is-playing .playfield .stage {
    width: min(100%, 620px);
    height: clamp(270px, 40vh, 390px);
    align-self: auto;
  }

  .device.is-playing .plate {
    top: 32%;
  }

  .device.is-playing .cover {
    top: 5%;
  }

  .device.is-playing .spin-zone {
    width: min(88%, 430px);
  }

  .device.is-playing .btn-spin {
    min-height: 0;
  }

  .device.is-playing .bet-dock {
    width: min(100%, 560px);
    max-height: none;
    height: 700px;
    min-height: 700px;
    aspect-ratio: auto;
    align-self: start;
  }

  .device.is-playing .bet-inner {
    height: calc(100% - 24px);
    margin: 12px;
    padding: 25px clamp(17px, 4vw, 28px);
  }

  .device.is-playing .faces-row {
    min-height: 230px;
  }

  .device.is-playing .face-bet .face-die {
    width: clamp(42px, 11vw, 58px);
    height: clamp(42px, 11vw, 58px);
  }

  .device.is-playing .history {
    width: min(100%, 560px);
    max-height: none;
    aspect-ratio: auto;
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    align-self: start;
    border: 1px solid rgba(235, 183, 49, 0.58);
    background: rgba(8, 7, 5, 0.9);
  }

  .device.is-playing .history > .panel-frame-img {
    display: none;
  }

  .device.is-playing .hist-inner {
    height: auto;
    margin: 0;
    padding: 14px;
    background: transparent;
  }

  .device.is-playing .hist-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    min-height: 82px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .device.is-playing .history-slot {
    flex: 0 0 112px;
    min-height: 72px;
    display: grid;
    border: 0;
    background: url("../assets/img/btn-dark-frame.webp") center / 100% 100% no-repeat;
  }

  .device.is-playing .history-slot .hist-time {
    display: block;
    font-size: 8px;
  }

  .device.is-playing .hist-foot {
    min-height: 40px;
  }

  .device.is-playing .game-fun {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 0 max(6px, var(--safe-b));
  }

  .game-controls {
    order: 1;
    width: 100%;
  }

  .game-control {
    width: clamp(54px, 15vw, 70px);
  }

  .game-social {
    order: 2;
    justify-self: auto;
  }

  .game-disclaimer {
    order: 3;
    justify-self: auto;
  }
}

@media (max-width: 430px) and (orientation: portrait) {
  .device.is-playing .hud-tools {
    gap: 5px;
  }

  .device.is-playing .hud-icon,
  .device.is-playing .btn-exit {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .device.is-playing .hud-icon img,
  .device.is-playing .btn-exit img {
    width: 25px;
    height: 25px;
  }

  .device.is-playing .hud-lang-label {
    display: none;
  }

  .device.is-playing .bank-chip > span:first-child {
    display: none;
  }

  .device.is-playing .bank-chip {
    padding: 6px 8px;
    font-size: 12px;
  }

  .device.is-playing .result-scroll {
    width: 43px;
    height: 43px;
  }

  .game-brand img {
    max-height: 48px;
  }

  .game-brand strong {
    font-size: 2.45rem;
  }

  .device.is-playing .playfield .stage {
    height: clamp(250px, 34vh, 300px);
  }

  .device.is-playing .btn-spin {
    min-height: 0;
  }

  .device.is-playing .bet-dock {
    height: 600px;
    min-height: 600px;
    aspect-ratio: auto;
  }

  .device.is-playing .bet-inner {
    height: calc(100% - 20px);
    margin: 10px;
    padding: 23px 16px;
  }

  .device.is-playing .faces-row {
    min-height: 220px;
  }

  .device.is-playing .face-bet {
    min-height: 102px;
  }

  .device.is-playing .face-bet .face-die {
    width: 46px;
    height: 46px;
  }

  .device.is-playing .amounts button {
    min-height: 44px;
  }

  .game-social > span {
    display: none;
  }
}

@media (max-height: 720px) and (orientation: landscape) {
  .device.is-playing {
    grid-template-rows: auto minmax(0, 1fr) auto;
    --plate-w: min(56%, 350px);
    --cover-w: min(41%, 285px);
  }

  .device.is-playing .hud-top {
    padding-top: max(5px, var(--safe-t));
    padding-bottom: 3px;
  }

  .device.is-playing .btn-exit,
  .device.is-playing .hud-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .game-brand img {
    max-height: 28px;
  }

  .game-brand strong {
    font-size: 1.8rem;
  }

  .game-brand span {
    margin-top: 2px;
    font-size: 0.64rem;
  }

  .device.is-playing .playfield .stage {
    height: min(40vh, 235px);
  }

  .device.is-playing .plate {
    top: 3%;
  }

  .device.is-playing .cover {
    top: 4%;
  }

  .device.is-playing .stone-plat {
    width: min(68%, 440px);
    bottom: -2%;
  }

  .device.is-playing .game-status {
    min-height: 18px;
    margin: 0;
    font-size: 0.68rem;
  }

  .device.is-playing .spin-zone {
    width: min(66%, 360px);
  }

  .device.is-playing .btn-spin {
    min-height: 0;
  }

  .device.is-playing .spin-hint {
    display: none;
  }

  .device.is-playing .game-fun {
    padding-top: 4px;
    padding-bottom: max(5px, var(--safe-b));
  }

  .game-control {
    width: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device.is-playing[data-phase="locking"] .cover {
    animation: none !important;
  }
}

/* Gameplay layer contract: scenery, environment, hero, panels, actions, HUD. */
.device.is-playing .scene { z-index: 0; }
.device.is-playing .godrays,
.device.is-playing .dust,
.device.is-playing .tiger { z-index: 10; }
.device.is-playing .apong-stage,
.device.is-playing .apong-stage-layers { z-index: 20; }
.device.is-playing .history,
.device.is-playing .bet-dock { z-index: 30; }
.device.is-playing .game-brand,
.device.is-playing .game-status,
.device.is-playing .spin-zone { z-index: 40; }
.device.is-playing .hud-top,
.device.is-playing .game-fun { z-index: 50; }
.device.is-playing .outcome-toast,
.device.is-playing .lock-block { z-index: 100; }

.orientation-lock {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  overflow: hidden;
  background:
    linear-gradient(rgba(8, 5, 5, 0.58), rgba(8, 5, 5, 0.88)),
    url("../assets/img/bg-angkor-portrait.webp") center / cover no-repeat;
  color: #ffe5a0;
  text-align: center;
}

.orientation-lock::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(235, 183, 49, 0.7);
  pointer-events: none;
}

.orientation-symbol {
  position: relative;
  width: 112px;
  height: 82px;
  margin-bottom: 6px;
}

.orientation-phone {
  position: absolute;
  left: 32px;
  top: 7px;
  width: 42px;
  height: 68px;
  border: 3px solid #f2c04a;
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(242, 192, 74, 0.24);
  transform: rotate(-12deg);
}

.orientation-phone::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f2c04a;
  transform: translateX(-50%);
}

.orientation-arrow {
  position: absolute;
  right: 5px;
  bottom: 4px;
  font-size: 48px;
  color: #f2c04a;
  line-height: 1;
}

.orientation-lock h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  letter-spacing: 0;
}

.orientation-lock p {
  font-family: var(--font-khmer);
  font-size: clamp(1rem, 4.8vw, 1.3rem);
}

.orientation-lock small {
  color: #d9bd70;
  font-size: clamp(0.78rem, 3.8vw, 1rem);
}

@media (max-width: 1023px) and (orientation: portrait) {
  .device.is-playing {
    visibility: hidden;
    pointer-events: none;
  }

  .device.is-playing + .orientation-lock {
    display: flex;
  }
}

@media (max-width: 932px) and (orientation: landscape) {
  .device.is-playing {
    --game-gap: 6px;
    --plate-w: min(58%, 300px);
    --cover-w: min(43%, 230px);
    grid-template-columns: clamp(92px, 15.5vw, 142px) minmax(0, 1fr) clamp(180px, 27vw, 250px);
    grid-template-rows: auto minmax(0, 1fr) 48px;
    column-gap: var(--game-gap);
    width: 100vw;
    height: var(--app-h, 100dvh);
    padding: 0 max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .device.is-playing .scene {
    margin-left: calc(max(6px, env(safe-area-inset-left)) * -1);
    margin-right: calc(max(6px, env(safe-area-inset-right)) * -1);
  }

  .device.is-playing .hud-top {
    min-height: 42px;
    padding: max(3px, env(safe-area-inset-top)) 0 2px;
    gap: 5px;
  }

  .device.is-playing .btn-exit,
  .device.is-playing .hud-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 4px;
  }

  .device.is-playing .hud-icon.js-lang {
    width: auto;
    min-width: 70px;
    padding: 4px 8px 4px 5px;
    gap: 3px;
  }

  .device.is-playing .hud-icon img,
  .device.is-playing .btn-exit img {
    width: 25px;
    height: 25px;
  }

  .device.is-playing .bank-chip {
    padding: 5px 9px;
    font-size: 0.68rem;
  }

  .device.is-playing .result-scroll {
    width: 40px;
    height: 40px;
  }

  .device.is-playing .history,
  .device.is-playing .bet-dock {
    width: 100%;
    height: calc(100% - 4px);
    max-height: none;
    aspect-ratio: auto;
  }

  .device.is-playing .hist-inner,
  .device.is-playing .bet-inner {
    height: calc(100% - 8px);
    margin: 4px;
    border-radius: 2px;
  }

  .device.is-playing .hist-inner {
    gap: 2px;
    padding: 9px 7px;
  }

  .device.is-playing .hist-title,
  .device.is-playing .bet-title,
  .device.is-playing .amount-title {
    font-size: 0.58rem;
  }

  .device.is-playing .history-slot {
    padding: 1px 2px;
  }

  .device.is-playing .history-slot .hist-row {
    gap: 4px;
  }

  .device.is-playing .history-slot .hist-die {
    width: 24px;
    height: 24px;
  }

  .device.is-playing .history-slot .hist-num {
    font-size: 0.8rem;
  }

  .device.is-playing .history-slot .hist-time {
    font-size: 0.42rem;
  }

  .device.is-playing .hist-foot {
    min-height: 32px;
    padding: 3px;
    gap: 4px;
    font-size: 0.56rem;
  }

  .device.is-playing .playfield {
    grid-template-rows: auto auto auto auto;
    align-content: center;
    min-width: 0;
    gap: 0;
    transform: none;
  }

  .game-brand {
    width: 100%;
  }

  .game-brand img {
    width: min(54%, 170px);
    max-height: 24px;
    margin: 0 0 -2px;
  }

  .game-brand strong {
    font-size: clamp(1.35rem, 6.5vh, 1.75rem);
  }

  .game-brand span {
    margin-top: 1px;
    font-size: 0.5rem;
  }

  .device.is-playing .playfield .apong-stage {
    width: 100%;
    height: min(37vh, 150px);
  }

  .device.is-playing .plate {
    top: 3%;
  }

  .device.is-playing .cover {
    top: 7%;
  }

  .device.is-playing .stone-plat {
    width: min(76%, 320px);
    bottom: -3%;
  }

  .device.is-playing .game-status {
    min-height: 14px;
    margin: 0;
    font-size: 0.52rem;
  }

  .device.is-playing .spin-zone {
    width: min(82%, 300px);
    padding: 0;
  }

  .device.is-playing .btn-spin {
    min-height: 54px;
    aspect-ratio: 420 / 100;
  }

  .device.is-playing .btn-spin-text b {
    font-size: clamp(1.1rem, 5.5vh, 1.45rem);
  }

  .device.is-playing .spin-hint {
    display: none;
  }

  .device.is-playing .bet-inner {
    gap: 2px;
    padding: 9px 7px;
  }

  .device.is-playing .timer-bar {
    flex-basis: 2px;
  }

  .device.is-playing .faces-row {
    flex: 0 0 min(25vh, 96px);
    gap: 3px;
  }

  .device.is-playing .face-bet {
    min-height: 44px;
    padding: 1px;
    border-radius: 3px;
  }

  .device.is-playing .face-bet .face-die {
    width: 24px;
    height: 24px;
  }

  .device.is-playing .face-meta {
    font-size: 0.48rem;
  }

  .device.is-playing .amounts {
    gap: 2px 4px;
  }

  .device.is-playing .amounts button {
    min-height: 27px;
    font-size: 0.6rem;
  }

  .device.is-playing .bet-total {
    font-size: 0.55rem;
  }

  .device.is-playing .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .device.is-playing .btn-place,
  .device.is-playing .btn-clear {
    min-height: 42px;
  }

  .device.is-playing .action-text b {
    font-size: 0.65rem;
  }

  .device.is-playing .action-text small {
    display: none;
  }

  .device.is-playing .game-fun {
    grid-template-columns: minmax(112px, 1fr) auto minmax(94px, 1fr);
    gap: 5px;
    padding: 2px 0 max(3px, env(safe-area-inset-bottom));
  }

  .game-disclaimer {
    max-width: 150px;
    padding: 4px 6px;
    gap: 4px;
  }

  .game-disclaimer img {
    width: 26px;
    height: 26px;
  }

  .game-disclaimer b {
    display: block;
    font-size: 7px;
  }

  .game-disclaimer small {
    display: none;
  }

  .game-controls {
    gap: 3px;
  }

  .game-control {
    width: 42px;
    gap: 0;
  }

  .game-control img {
    width: 18px;
    height: 18px;
  }

  .game-control span {
    font-size: 5px;
  }

  .game-social {
    gap: 3px;
    padding: 3px 4px;
  }

  .game-social > span {
    display: none;
  }

  .game-social button {
    width: 30px;
    height: 30px;
    font-size: 0.65rem;
  }
}

