:root {
  --bg: #0b1020;
  --bg2: #121933;
  --card: #1a2244;
  --line: #2a3566;
  --gold: #ffcc48;
  --gold2: #ff9f1a;
  --text: #e8ecff;
  --dim: #8f9bc9;
  --win: #37e08a;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #1d2a5e 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

/* ---- 文档页 ---- */
.doc-body { padding: 40px 16px; }
.doc { max-width: 860px; margin: 0 auto; }
.doc h1 { font-size: 26px; margin: 0 0 6px; }
.doc .tag { font-size: 12px; background: var(--gold); color: #2a1a00; border-radius: 10px; padding: 2px 8px; vertical-align: middle; }
.doc .sub { color: var(--dim); margin: 0 0 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 10px; font-size: 16px; color: var(--gold); }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.card ul { margin: 0; padding-left: 18px; line-height: 1.9; }
.card code { background: #0d1330; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }

/* ---- 游戏端 ---- */
.gp-wrap { max-width: 920px; margin: 0 auto; padding: 10px 10px 40px; }
.gp-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin: 8px 0 12px;
  background: linear-gradient(180deg, #1d2750, #141c3c);
  border: 1px solid var(--line); border-radius: 14px;
}
.gp-title { font-weight: 700; letter-spacing: .5px; }
.gp-title small { color: var(--dim); font-weight: 400; margin-left: 8px; }
.gp-bal { text-align: right; }
.gp-bal b { color: var(--gold); font-size: 20px; }
.gp-bal span { display: block; color: var(--dim); font-size: 12px; }

/* lobby */
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lobby-item {
  background: linear-gradient(180deg, #232e63, #18204a);
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 12px; text-align: center;
  cursor: pointer; transition: transform .12s ease, border-color .12s ease;
}
.lobby-item:hover { transform: translateY(-3px); border-color: var(--gold); }
.lobby-item .ico { font-size: 34px; line-height: 1; }
.lobby-item .nm { margin-top: 10px; font-size: 14px; }
.lobby-item .hot { color: var(--gold2); font-size: 11px; margin-top: 4px; }

/* game */
.slot-machine {
  background: linear-gradient(180deg, #1b2550, #121a3a);
  border: 2px solid var(--line); border-radius: 18px; padding: 14px; position: relative;
  box-shadow: 0 18px 60px rgba(0,0,0,.45), inset 0 0 60px rgba(80,120,255,.06);
}
.slot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.slot-head .name { font-weight: 700; color: var(--gold); }
.free-badge {
  display: none; background: linear-gradient(90deg, #ff9f1a, #ffcc48); color: #3a2400;
  font-weight: 800; border-radius: 999px; padding: 4px 12px; font-size: 13px;
  animation: pulse 1s infinite alternate;
}
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.06); } }

.reels {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  background: #0a0f26; border: 1px solid var(--line); border-radius: 12px; padding: 8px;
}
.reel { display: grid; grid-template-rows: repeat(3, 1fr); gap: 6px; }
.cell {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #212c5e, #161e42);
  border: 1px solid #2c3870; border-radius: 10px;
  font-size: 40px; height: 76px; user-select: none;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.cell.spinning { filter: blur(1px) brightness(.8); }
.cell.win { background: linear-gradient(180deg, #3c4b13, #2b360b); border-color: var(--gold); transform: scale(1.04); }
.cell.scatter-win { box-shadow: 0 0 0 2px var(--win) inset; }

.lines-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }

.ctrl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; }
.bet-box { display: flex; align-items: center; gap: 8px; }
.btn {
  border: 1px solid var(--line); background: #1b2450; color: var(--text);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; cursor: pointer;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-round { width: 34px; height: 34px; padding: 0; text-align: center; font-size: 18px; line-height: 1; }
.bet-val { min-width: 56px; text-align: center; font-weight: 700; }
.chip { border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.spin-btn {
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  border: none; color: #2a1a00; font-weight: 800; font-size: 17px;
  padding: 12px 34px; border-radius: 999px; cursor: pointer; letter-spacing: 2px;
  box-shadow: 0 8px 24px rgba(255,170,40,.35);
}
.spin-btn:disabled { filter: grayscale(.6); cursor: not-allowed; box-shadow: none; }
.auto-btn.on { border-color: var(--win); color: var(--win); }

.win-bar {
  margin-top: 12px; min-height: 28px; text-align: center; font-weight: 800; font-size: 20px;
  color: var(--win); text-shadow: 0 0 18px rgba(55,224,138,.35);
}
.win-bar.zero { color: var(--dim); font-weight: 400; font-size: 14px; text-shadow: none; }

.footer-links { display: flex; justify-content: space-between; margin-top: 14px; color: var(--dim); font-size: 12px; }
.footer-links a { color: var(--dim); text-decoration: none; border-bottom: 1px dashed var(--line); cursor: pointer; }
.fairness {
  display: none; margin-top: 10px; background: #0d1330; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px;
  color: var(--dim); word-break: break-all; line-height: 1.7;
}
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(10,15,38,.95); border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .2s ease;
  pointer-events: none; z-index: 20;
}
.toast.show { opacity: 1; }

@media (max-width: 640px) {
  .gp-wrap { padding: 6px 6px 30px; }
  .cell { height: 58px; font-size: 30px; border-radius: 8px; }
  .spin-btn { padding: 11px 24px; font-size: 16px; }
  .gp-top { margin: 6px 0 8px; }
}
