﻿/* 中式街机弹珠机视觉样式：红金霓虹、金属边框、移动端禁滚动 */
:root {
  --bg: #070009;
  --panel: rgba(24, 3, 34, 0.94);
  --gold: #ffd66b;
  --gold-2: #ff9f1c;
  --red: #ff244b;
  --blue: #16d9ff;
  --purple: #9c4dff;
  --green: #63ff8c;
  --text: #fff6d8;
  --muted: #d8bce8;
  --shadow: 0 0 18px rgba(255, 45, 101, 0.45), 0 0 38px rgba(74, 51, 255, 0.28);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #070009;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
}

body {
  position: fixed;
  inset: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(180deg, #3a074b, #16011d);
  border: 1px solid rgba(255, 214, 107, 0.55);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.12), 0 0 18px rgba(255, 36, 75, 0.25);
  border-radius: 999px;
  padding: 10px 14px;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

button:active,
button.pressed {
  transform: translateY(2px) scale(0.98);
  filter: brightness(1.25);
}

button.primary {
  background: linear-gradient(180deg, #ffe27e, #ff7b1b 55%, #c60e2e);
  color: #2a0500;
  font-weight: 900;
  border-color: #fff0a8;
}

.arcade-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 31, 80, 0.28), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(31, 205, 255, 0.24), transparent 26%),
    radial-gradient(circle at 52% 86%, rgba(255, 204, 42, 0.16), transparent 30%),
    linear-gradient(135deg, #050009, #170019 45%, #050009);
  overflow: hidden;
}

.arcade-bg::before,
.arcade-bg::after {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(90deg, transparent 0 92%, rgba(255,255,255,0.08) 94%, transparent 96%),
    linear-gradient(0deg, transparent 0 92%, rgba(255, 214, 107, 0.06) 94%, transparent 96%);
  background-size: 90px 90px;
  transform: rotate(12deg);
  animation: bgMove 12s linear infinite;
}

.arcade-bg::after {
  background-size: 140px 140px;
  animation-duration: 20s;
  opacity: 0.45;
  filter: blur(1px);
}

@keyframes bgMove {
  from { transform: translate3d(0, 0, 0) rotate(12deg); }
  to { transform: translate3d(-90px, 90px, 0) rotate(12deg); }
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100dvh;
  width: 100vw;
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(320px, 760px) minmax(190px, 260px);
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding: 10px max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left));
}

.side-panel {
  max-height: calc(100dvh - 34px);
  overflow: hidden;
  border: 1px solid rgba(255, 214, 107, 0.35);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(39, 4, 48, 0.82), rgba(8, 0, 15, 0.82));
  padding: 18px;
  box-shadow: var(--shadow), inset 0 0 30px rgba(255, 255, 255, 0.04);
}

.side-panel h2,
.side-panel h3 {
  margin: 0 0 12px;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 214, 107, 0.6);
}

.side-panel p,
.side-panel li,
.side-panel dt,
.side-panel dd {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.side-panel ul {
  padding-left: 18px;
}

.side-panel kbd {
  padding: 2px 7px;
  border-radius: 6px;
  background: #16051f;
  color: var(--gold);
  border: 1px solid rgba(255, 214, 107, 0.45);
}

.side-panel dl {
  margin: 0 0 14px;
}

.side-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed rgba(255, 214, 107, 0.2);
  padding: 8px 0;
}

.side-panel dd {
  margin: 0;
  color: #fff;
  font-weight: 800;
}

.tip,
.small-note {
  color: #f8c8ff !important;
  font-size: 12px !important;
}

.achievement-list {
  display: grid;
  gap: 7px;
  font-size: 12px;
}

.achievement-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.24);
  color: #9c89a8;
}

.achievement-item.unlocked {
  color: #fff7ce;
  border-color: rgba(255, 214, 107, 0.55);
  background: linear-gradient(90deg, rgba(255, 169, 28, 0.24), rgba(255, 36, 75, 0.14));
  box-shadow: 0 0 14px rgba(255, 214, 107, 0.18);
}

.machine {
  position: relative;
  width: min(100%, 760px);
  max-height: calc(100dvh - 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 34px 34px 26px 26px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.22), transparent 20% 80%, rgba(255,255,255,0.12)),
    linear-gradient(180deg, #780415 0%, #24002e 50%, #09000d 100%);
  border: 4px solid #e5b64a;
  box-shadow:
    0 0 0 5px rgba(117, 55, 0, 0.7),
    0 0 34px rgba(255, 33, 74, 0.55),
    0 0 80px rgba(55, 174, 255, 0.24),
    inset 0 0 36px rgba(255, 255, 255, 0.12);
}

.machine::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 28px 28px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.machine-top {
  width: 100%;
  padding: 6px 8px 10px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.brand-row h1 {
  margin: 0;
  font-size: clamp(24px, 4.2vw, 42px);
  letter-spacing: 0.08em;
  color: #ffe792;
  text-shadow: 0 0 10px #ff244b, 0 0 24px rgba(255, 214, 107, 0.8), 0 2px 0 #6e000a;
}

.brand-row p {
  margin: 1px 0 0;
  font-size: clamp(8px, 1.5vw, 12px);
  color: #ffd0e4;
  letter-spacing: 0.18em;
}

.brand-row .deploy-version {
  margin-top: 3px;
  font-size: clamp(9px, 1.7vw, 12px);
  letter-spacing: 0.08em;
  color: #7dfffd;
  text-shadow: 0 0 8px rgba(22, 217, 255, 0.9);
}

.dragon-light {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff3aa;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe777, #ff244b 64%, #400018);
  box-shadow: 0 0 16px #ff244b, 0 0 28px #ffd66b;
  animation: pulse 1.4s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { filter: brightness(0.85); transform: scale(0.96); }
  to { filter: brightness(1.28); transform: scale(1.03); }
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.display-cell {
  min-width: 0;
  border: 1px solid rgba(255, 214, 107, 0.45);
  border-radius: 12px;
  padding: 7px 6px 6px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.12)),
    #09050f;
  box-shadow: inset 0 0 14px rgba(0, 255, 255, 0.06), 0 0 10px rgba(255, 214, 107, 0.12);
}

.display-cell span {
  display: block;
  color: #ffb7cb;
  font-size: clamp(10px, 1.8vw, 12px);
}

.display-cell strong {
  display: block;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(15px, 3vw, 22px);
  color: #7dfffd;
  text-shadow: 0 0 9px rgba(22, 217, 255, 0.9);
  white-space: nowrap;
}

.jackpot-cell strong {
  color: #ffe06e;
  text-shadow: 0 0 10px #ff244b, 0 0 18px #ffd66b;
}

.status-strip {
  margin-top: 7px;
  min-height: 25px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 107, 0.38);
  background: linear-gradient(90deg, rgba(17, 0, 24, 0.9), rgba(80, 0, 60, 0.76), rgba(17, 0, 24, 0.9));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: #fff0b6;
  font-size: 13px;
  overflow: hidden;
}

.status-strip::before {
  content: "";
  width: 80px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: marqueeLight 2s linear infinite;
}

@keyframes marqueeLight {
  from { transform: translateX(-190px); }
  to { transform: translateX(190px); }
}

.fever-text {
  color: #fffb7a;
  text-shadow: 0 0 10px #ff244b;
  font-weight: 900;
}

.playfield-shell {
  position: relative;
  width: min(100%, calc((100dvh - 280px) * 720 / 980));
  max-width: 720px;
  max-height: calc(100dvh - 280px);
  aspect-ratio: 720 / 980;
  flex: 0 1 auto;
  border-radius: 22px;
  overflow: hidden;
  background: #09000e;
  border: 4px solid rgba(255, 214, 107, 0.8);
  box-shadow:
    inset 0 0 28px rgba(255, 255, 255, 0.08),
    inset 0 0 80px rgba(22, 217, 255, 0.08),
    0 0 30px rgba(0, 0, 0, 0.45);
}

.playfield-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.20) 0 9%, transparent 10% 38%, rgba(255,255,255,0.08) 39%, transparent 52%),
    radial-gradient(circle at 50% 6%, rgba(255,255,255,0.14), transparent 18%);
  mix-blend-mode: screen;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #0b0011;
}

.canvas-error {
  position: absolute;
  inset: 20px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff4c7;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 214, 107, 0.55);
  border-radius: 18px;
  padding: 20px;
}

.control-deck {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1.6fr;
  align-items: center;
  gap: 12px;
  padding: 12px 8px 0;
}

.power-meter {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 214, 107, 0.35);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
}

#powerFill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #13d7ff, #6dff84 45%, #ffe66d 70%, #ff244b);
  box-shadow: 0 0 14px rgba(255, 214, 107, 0.75);
  transition: width 0.05s linear;
}

.launch-button {
  position: relative;
  width: clamp(82px, 13vw, 112px);
  height: clamp(82px, 13vw, 112px);
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 24%, rgba(255,255,255,0.9), transparent 12%),
    radial-gradient(circle, #ffef85, #ff7b1b 46%, #c40025 70%, #4d0011 100%);
  border: 4px solid #fff0a8;
  box-shadow: 0 0 22px #ff244b, 0 0 34px rgba(255, 214, 107, 0.65), inset 0 -10px 18px rgba(67, 0, 0, 0.45);
}

.launch-button .ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.35);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.2);
}

.launch-button .label {
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
  color: #fff7c3;
  text-shadow: 0 2px 0 #8e0018, 0 0 10px #ff244b;
}

.power-label {
  position: absolute;
  bottom: 15px;
  font-size: 12px;
  color: #350001;
  font-weight: 900;
}

.secondary-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
}

.secondary-controls button {
  padding: 9px 8px;
  font-size: 13px;
  white-space: nowrap;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(5px);
}

.overlay.active {
  display: flex;
}

.modal {
  position: relative;
  width: min(92vw, 520px);
  max-height: min(88dvh, 720px);
  overflow: hidden;
  border-radius: 28px;
  border: 2px solid rgba(255, 214, 107, 0.8);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 35%),
    linear-gradient(180deg, rgba(105, 5, 41, 0.96), rgba(20, 0, 30, 0.96));
  box-shadow: 0 0 44px rgba(255, 36, 75, 0.55), inset 0 0 28px rgba(255, 255, 255, 0.08);
  padding: 30px;
  text-align: center;
}

.scroll-modal {
  overflow-y: auto;
  text-align: left;
  user-select: text;
  -webkit-user-select: text;
  touch-action: pan-y;
}

.modal h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 8vw, 56px);
  color: #ffe889;
  text-shadow: 0 0 14px #ff244b, 0 0 28px rgba(255, 214, 107, 0.8);
}

.modal p,
.modal li {
  color: #ffe6ff;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.modal-neon {
  position: absolute;
  inset: -40%;
  opacity: 0.28;
  pointer-events: none;
  background: conic-gradient(from 0deg, transparent, #ff244b, #ffd66b, #16d9ff, transparent);
  animation: rotateNeon 8s linear infinite;
}

@keyframes rotateNeon {
  to { transform: rotate(360deg); }
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 18px 0 24px;
  text-align: left;
}

.result-grid strong {
  color: var(--gold);
  text-align: right;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255, 214, 107, 0.22);
  color: #ffe6ff;
}

.setting-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #ff9f1c;
}

.range-row input {
  width: 180px;
  accent-color: #ff9f1c;
}

.toast-layer {
  position: fixed;
  z-index: 14;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff7cf;
  background: rgba(31, 0, 35, 0.86);
  border: 1px solid rgba(255, 214, 107, 0.55);
  box-shadow: 0 0 18px rgba(255, 36, 75, 0.35);
  animation: toastIn 2.6s ease forwards;
  white-space: nowrap;
}

@keyframes toastIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  84% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.98); }
}

.jackpot-banner,
.bonus-roller,
.achievement-popup {
  position: fixed;
  z-index: 13;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 560px);
  border-radius: 30px;
  border: 3px solid #ffe889;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.35), transparent 28%),
    linear-gradient(180deg, #b0002c, #3a0050);
  box-shadow: 0 0 40px #ff244b, 0 0 90px rgba(255, 214, 107, 0.6);
  padding: 26px 18px;
  pointer-events: none;
}

.jackpot-banner span,
.bonus-roller span {
  display: block;
  font-size: clamp(34px, 11vw, 78px);
  font-weight: 1000;
  color: #fff8b8;
  text-shadow: 0 0 14px #ff244b, 0 0 28px #ffd66b;
}

.jackpot-banner strong,
.bonus-roller strong {
  display: block;
  color: #fff;
  font-size: clamp(22px, 6vw, 42px);
  text-shadow: 0 0 12px #16d9ff;
}

.achievement-popup {
  top: 18%;
  width: min(86vw, 380px);
  padding: 18px 20px;
  font-weight: 800;
  color: #fff7ce;
}

.low-fx .playfield-shell::after,
.low-fx .arcade-bg::before,
.low-fx .arcade-bg::after {
  animation: none !important;
  opacity: 0.18;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: minmax(320px, 760px);
  }
  .side-panel {
    display: none;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    align-items: stretch;
  }

  .machine {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-width: 2px;
    border-radius: 0;
    padding: 7px 6px max(7px, env(safe-area-inset-bottom));
  }

  .machine-top {
    padding: 2px 4px 6px;
  }

  .brand-row {
    gap: 8px;
  }

  .dragon-light {
    width: 27px;
    height: 27px;
  }

  .scoreboard {
    gap: 4px;
  }

  .display-cell {
    border-radius: 9px;
    padding: 5px 2px 4px;
  }

  .display-cell span {
    font-size: 9px;
  }

  .display-cell strong {
    font-size: clamp(12px, 4vw, 17px);
  }

  .status-strip {
    margin-top: 5px;
    min-height: 22px;
    font-size: 12px;
  }

  .playfield-shell {
    width: min(100%, calc((100dvh - 224px) * 720 / 980));
    max-height: calc(100dvh - 224px);
    border-width: 2px;
    border-radius: 16px;
  }

  .control-deck {
    grid-template-columns: 1fr auto;
    grid-template-areas: "meter launch" "secondary secondary";
    gap: 8px;
    padding: 8px 4px 0;
  }

  .power-meter { grid-area: meter; }
  .launch-button { grid-area: launch; }
  .secondary-controls { grid-area: secondary; }

  .launch-button {
    width: 76px;
    height: 76px;
  }

  .launch-button .label {
    font-size: 20px;
  }

  .power-label {
    bottom: 10px;
    font-size: 10px;
  }

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

  .secondary-controls button {
    padding: 8px 3px;
    font-size: 11px;
  }

  .modal {
    padding: 22px;
    border-radius: 22px;
  }

  .toast-layer {
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

@media (max-height: 730px) and (max-width: 680px) {
  .brand-row p { display: none; }
  .dragon-light { display: none; }
  .playfield-shell {
    width: min(100%, calc((100dvh - 198px) * 720 / 980));
    max-height: calc(100dvh - 198px);
  }
  .launch-button {
    width: 66px;
    height: 66px;
  }
  .secondary-controls button {
    padding: 6px 2px;
  }
}
