:root {
  color-scheme: dark;
  --bg: #030711;
  --panel: rgba(5, 10, 31, 0.82);
  --panel-strong: rgba(6, 6, 26, 0.94);
  --cyan: #19dfff;
  --cyan-soft: rgba(25, 223, 255, 0.46);
  --pink: #ff30df;
  --pink-soft: rgba(255, 48, 223, 0.46);
  --violet: #8a55ff;
  --ink: #e8fbff;
  --muted: #84f3ff;
  --shadow-cyan: 0 0 14px rgba(25, 223, 255, 0.72), 0 0 34px rgba(25, 223, 255, 0.28);
  --shadow-pink: 0 0 14px rgba(255, 48, 223, 0.72), 0 0 36px rgba(255, 48, 223, 0.34);
  font-family: "Arial Black", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 48, 223, 0.2), transparent 28%),
    radial-gradient(circle at 48% 72%, rgba(25, 223, 255, 0.15), transparent 32%),
    linear-gradient(180deg, #02040c 0%, #050013 45%, #020105 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  opacity: 0.48;
  background:
    linear-gradient(rgba(25, 223, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 48, 223, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, black 0 78%, transparent);
}

body::after {
  opacity: 0.22;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
}

button,
select {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.slot-app {
  position: relative;
  width: min(100vw, 430px);
  height: max(100vh, calc(min(100vw, 430px) * 2.14));
  min-height: 900px;
  margin: 0 auto;
  padding: 0;
  display: block;
  isolation: isolate;
}

.slot-app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("/image/optimized/neon-ui-bg.webp") top center / 100% 100% no-repeat;
  opacity: 1;
  filter: saturate(1.05) contrast(1.02);
}

.slot-app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(2, 4, 12, 0.03), rgba(2, 1, 5, 0.12) 78%);
}

.status-bar,
.title-panel,
.machine,
.result-card,
.spin-button,
.action-row button,
.action-row p,
.bet-button,
.sheet-panel,
.modal-panel {
  position: relative;
}

.status-bar {
  position: absolute;
  left: 7.2%;
  top: 2.6%;
  width: 85.6%;
  height: 7.1%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 1px;
  padding: 0 6.2%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}

.status-bar div {
  min-width: 0;
  text-align: center;
  display: grid;
  align-content: center;
  height: 100%;
}

.label,
.eyebrow {
  display: block;
  color: var(--cyan);
  font-size: clamp(10px, 2.9vw, 15px);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: var(--shadow-cyan);
}

.status-bar strong {
  display: block;
  margin-top: 4px;
  color: #e9fbff;
  width: 100%;
  min-width: 0;
  font-size: 30px;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
  text-shadow: 0 0 9px #7cecff, 0 0 20px rgba(25, 223, 255, 0.8);
}

.title-panel {
  position: absolute;
  left: 19.8%;
  top: 13.15%;
  width: 52.6%;
  height: 6.1%;
  padding: 0;
  text-align: center;
}

.title-tools {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 34%;
  margin: 0;
  padding: 0 5.5%;
}

.eyebrow {
  display: none;
  margin: 0;
  color: #ff71ee;
  font-size: clamp(11px, 3.3vw, 17px);
  text-align: center;
  justify-self: end;
  white-space: nowrap;
  text-shadow: var(--shadow-pink);
}

.language-switch {
  display: none;
  align-items: center;
  gap: 5px;
  color: #dcbcff;
  font-size: clamp(9px, 2.6vw, 13px);
  font-weight: 950;
  text-shadow: 0 0 10px rgba(220, 188, 255, 0.85);
}

.language-switch select {
  width: clamp(88px, 25vw, 118px);
  min-height: clamp(28px, 7vw, 34px);
  padding: 0 24px 0 9px;
  border: 1px solid rgba(25, 223, 255, 0.95);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 48, 223, 0.18), transparent 32%),
    rgba(5, 12, 36, 0.94);
  color: #9ff7ff;
  font-weight: 950;
  outline: 0;
  box-shadow: var(--shadow-cyan);
}

.title-panel h1 {
  position: absolute;
  left: 0;
  right: 0;
  top: 6%;
  margin: 0;
  color: #ffeaff;
  font-size: clamp(34px, 8.7vw, 45px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow:
    2px 2px 0 #00dfff,
    -2px -2px 0 #ff30df,
    0 0 14px rgba(255, 48, 223, 0.95),
    0 0 42px rgba(25, 223, 255, 0.58);
}

.machine {
  position: absolute;
  left: 11.1%;
  top: 24.35%;
  width: 77.8%;
  height: 38.05%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  justify-items: center;
  clip-path: none;
}

.machine::before {
  display: none;
}

.reels {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3.6%;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.reel {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow:
    0 0 10px rgba(25, 223, 255, 0.18),
    0 0 16px rgba(255, 48, 223, 0.12);
}

.reel::before,
.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.reel::before {
  display: none;
}

.reel::after {
  display: none;
}

.reel-symbol {
  position: relative;
  z-index: 1;
  width: 86%;
  height: 86%;
  display: grid;
  place-items: center;
}

.reel-symbol img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  pointer-events: none;
  filter:
    saturate(1.18)
    contrast(1.12)
    drop-shadow(0 0 8px rgba(25, 223, 255, 0.52));
}

.reel.spinning .reel-symbol {
  animation: symbol-roll 0.32s cubic-bezier(0.52, 0, 0.24, 1) infinite;
}

.reel.spinning::after {
  display: block;
  background:
    linear-gradient(180deg, rgba(25, 223, 255, 0.26), transparent 24%, transparent 72%, rgba(255, 48, 223, 0.2)),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 9px);
}

.reel.stopping .reel-symbol {
  animation: reel-stop 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.1);
}

.reel.win {
  animation: win-pulse 0.72s ease-out 2;
}

.result-card {
  position: absolute;
  left: 7%;
  top: 66.45%;
  width: 86%;
  height: 4.95%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e7fbff;
  font-size: clamp(19px, 5.2vw, 27px);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow: var(--shadow-cyan);
  box-shadow: none;
  clip-path: none;
}

.result-card.win {
  color: #ffeaff;
  border-color: rgba(255, 48, 223, 0.96);
  text-shadow: var(--shadow-pink);
  box-shadow: var(--shadow-pink);
}

.bet-panel {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.bet-button,
.action-row button,
.action-row p {
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent center / 100% 100% no-repeat;
  color: #c9f9ff;
  font-weight: 950;
  box-shadow: none;
  clip-path: none;
  display: grid;
  place-items: center;
}

.bet-button {
  position: absolute;
  min-height: 0;
  padding: 0;
  font-size: clamp(18px, 5vw, 24px);
  text-shadow: var(--shadow-cyan);
  pointer-events: auto;
}

.bet-button[data-bet="1"] {
  left: 3.98%;
  top: 72.58%;
  width: 21.74%;
  height: 5.38%;
  background-image: url("/image/optimized/ui-bet-1-alpha.webp");
}

.bet-button[data-bet="5"] {
  left: 27.43%;
  top: 72.58%;
  width: 21.62%;
  height: 5.38%;
  background-image: url("/image/optimized/ui-bet-5-alpha.webp");
}

.bet-button[data-bet="10"] {
  left: 50.64%;
  top: 72.58%;
  width: 21.62%;
  height: 5.38%;
  background-image: url("/image/optimized/ui-bet-10-alpha.webp");
}

.bet-button[data-bet="50"] {
  left: 73.97%;
  top: 72.58%;
  width: 21.86%;
  height: 5.38%;
  background-image: url("/image/optimized/ui-bet-50-alpha.webp");
}

.bet-button.active {
  border-color: transparent;
  background: transparent url("/image/optimized/ui-bet-active-alpha.webp") center / 100% 100% no-repeat;
  color: white;
  text-shadow: var(--shadow-pink);
  box-shadow: none;
}

.bet-button.active[data-bet="1"] {
  left: 3.79%;
  top: 72.51%;
  width: 22.20%;
  height: 5.51%;
}

.bet-button.active[data-bet="5"] {
  left: 27.24%;
  top: 72.51%;
  width: 22.07%;
  height: 5.51%;
}

.bet-button.active[data-bet="10"] {
  left: 50.45%;
  top: 72.51%;
  width: 22.07%;
  height: 5.51%;
}

.bet-button.active[data-bet="50"] {
  left: 73.78%;
  top: 72.51%;
  width: 22.32%;
  height: 5.51%;
}

.spin-button {
  position: absolute;
  left: 1.76%;
  top: 78.35%;
  width: 96.53%;
  height: 11.5%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent url("/image/optimized/ui-spin-normal-alpha.webp") center / 100% 100% no-repeat;
  color: #fff1ff;
  font-size: clamp(38px, 10.4vw, 58px);
  font-weight: 950;
  line-height: 1;
  text-shadow:
    0 0 8px #fff,
    0 0 22px rgba(255, 48, 223, 1);
  box-shadow: none;
  clip-path: none;
}

.spin-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.995);
}

.spin-button:disabled {
  background-image: url("/image/optimized/ui-spin-loading-alpha.webp");
}

.action-row {
  position: absolute;
  left: 5.39%;
  top: 91.32%;
  width: 90.04%;
  height: 4.99%;
  display: grid;
  grid-template-columns: 22.14% minmax(0, 1fr) 21.48%;
  align-items: center;
  gap: 1.56%;
}

.action-row button {
  background-image: url("/image/optimized/ui-action-normal-alpha.webp");
  padding: 0 8px 2px;
  color: #9ff7ff;
  font-size: clamp(18px, 4.5vw, 21px);
  line-height: 1;
  text-shadow: var(--shadow-cyan);
  white-space: nowrap;
  overflow: hidden;
}

#recordsButton {
  width: 109%;
  height: 128%;
  transform: translate(-7.2%, -4.8%);
  font-size: clamp(17px, 4.1vw, 19px);
}

#rulesButton {
  width: 118%;
  height: 128%;
  transform: translate(-13%, -4.8%);
  font-size: clamp(18px, 4.4vw, 20px);
}

.action-row p {
  min-width: 0;
  margin: 0;
  padding: 0 8px 3px;
  display: grid;
  place-items: center;
  color: #a9fff9;
  font-size: clamp(7px, 1.85vw, 8px);
  line-height: 1.04;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  overflow: hidden;
  max-height: 100%;
  max-width: 100%;
  border-color: rgba(255, 48, 223, 0.58);
  text-shadow: 0 0 10px rgba(25, 223, 255, 0.75);
}

.sheet,
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
}

.sheet[hidden],
.modal[hidden] {
  display: none;
}

.sheet-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 2, 10, 0.72);
  backdrop-filter: blur(3px);
}

.sheet-panel,
.modal-panel {
  position: absolute;
  left: 50%;
  width: min(100vw, 430px);
  border: 1px solid rgba(255, 48, 223, 0.9);
  background:
    repeating-linear-gradient(180deg, rgba(25, 223, 255, 0.06) 0 1px, transparent 1px 6px),
    rgba(4, 7, 25, 0.96);
  box-shadow:
    0 0 24px rgba(255, 48, 223, 0.56),
    inset 0 0 30px rgba(25, 223, 255, 0.12);
}

.sheet-panel {
  bottom: 0;
  max-height: 70vh;
  padding: 16px;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
}

.modal-panel {
  top: 50%;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 120px);
  padding: 18px;
  border-radius: 8px;
  transform: translate(-50%, -50%);
  overflow: auto;
}

.sheet-panel header,
.modal-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sheet-panel h2,
.modal-panel h2 {
  margin: 0;
  color: #ff8cf2;
  font-size: 22px;
  text-shadow: var(--shadow-pink);
}

.icon-button {
  width: 40px;
  min-height: 40px;
  border: 1px solid rgba(25, 223, 255, 0.86);
  border-radius: 5px;
  background: rgba(4, 9, 30, 0.92);
  color: #bffaff;
  font-size: 27px;
  line-height: 1;
  box-shadow: var(--shadow-cyan);
}

.records-list {
  display: grid;
  gap: 9px;
  max-height: 50vh;
  overflow: auto;
}

.record-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(25, 223, 255, 0.46);
  border-radius: 7px;
  background: rgba(9, 14, 40, 0.82);
  font-size: 14px;
}

.record-item strong {
  color: #ff8cf2;
  text-shadow: var(--shadow-pink);
}

.record-item small,
.empty {
  color: #a9fff9;
}

.modal-panel ul {
  margin: 0;
  padding-left: 20px;
  color: #dffcff;
  line-height: 1.65;
}

@keyframes symbol-roll {
  0% {
    transform: translateY(-18%) scaleY(0.96);
    filter: blur(1px);
  }
  50% {
    transform: translateY(0) scaleY(1.03);
    filter: blur(0.35px);
  }
  100% {
    transform: translateY(18%) scaleY(0.96);
    filter: blur(1px);
  }
}

@keyframes reel-stop {
  0% {
    transform: translateY(-18%) scaleY(0.96);
    filter: blur(0.6px);
  }
  66% {
    transform: translateY(5%) scaleY(1.03);
    filter: blur(0);
  }
  100% {
    transform: translateY(0) scaleY(1);
    filter: blur(0);
  }
}

@keyframes win-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 48, 223, 0.18),
      inset 0 0 24px rgba(25, 223, 255, 0.22),
      0 0 14px rgba(25, 223, 255, 0.46),
      0 0 18px rgba(255, 48, 223, 0.28);
  }
  50% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.58),
      inset 0 0 30px rgba(255, 48, 223, 0.36),
      0 0 18px rgba(255, 255, 255, 0.78),
      0 0 34px rgba(255, 48, 223, 0.92),
      0 0 48px rgba(25, 223, 255, 0.54);
  }
}

@media (max-width: 380px) {
  .slot-app {
    min-height: 820px;
  }

  .status-bar strong {
    font-size: 26px;
  }

  .title-panel {
    padding: 0;
  }

  .title-panel h1 {
    font-size: 43px;
  }

  .eyebrow,
  .language-switch {
    font-size: 12px;
  }

  .language-switch select {
    max-width: 112px;
    min-height: 34px;
  }

  .machine {
    padding: 0;
  }

  .reels {
    gap: 3.6%;
    padding: 0;
  }

  .bet-panel {
    gap: 2.53%;
  }

  .spin-button {
    min-height: 0;
    font-size: 37px;
  }

  .action-row {
    grid-template-columns: 22.14% minmax(0, 1fr) 21.48%;
    gap: 1.56%;
  }

  .action-row button {
    font-size: 18px;
  }
}
