* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b1f31, #0d0f16);
  color: #e8eaf0;
  min-height: 100vh;
}
a { color: inherit; }
.muted { color: #8a90a3; }
#app { min-height: 100vh; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: #141826; border-bottom: 1px solid #242a3c;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 20px; font-weight: 800; color: #f5c542; cursor: pointer; }
.topbar nav { display: flex; gap: 6px; flex: 1; }
.nav {
  background: transparent; border: none; color: #aab0c4; font-size: 15px;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.nav.on, .nav:hover { background: #262b3a; color: #f5c542; }
.top-right { display: flex; align-items: center; gap: 12px; }
.balance { color: #f5c542; font-weight: 800; font-size: 17px; }
.username { color: #c3c9da; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.page h2 { margin-top: 4px; }

/* buttons */
.btn {
  border: none; border-radius: 8px; padding: 10px 18px; font-size: 15px;
  cursor: pointer; font-weight: 600; background: #262b3a; color: #e8eaf0;
}
.btn.gold { background: #f5c542; color: #14100a; }
.btn.gold:disabled { opacity: .4; cursor: not-allowed; }
.btn.big { font-size: 17px; padding: 13px 24px; width: 100%; }
.btn.ghost { background: #262b3a; }
.btn.danger { background: #5a2130; color: #ff8d9f; }

/* auth */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card { width: 380px; background: #171a24; border: 1px solid #262b3a; border-radius: 16px; padding: 32px; }
.auth-card h1 { margin: 0 0 4px; color: #f5c542; }
.auth-card .muted { margin-bottom: 20px; }
.tabs { display: flex; margin-bottom: 18px; background: #0d0f16; border-radius: 8px; padding: 4px; }
.tab { flex: 1; background: transparent; border: none; color: #aab0c4; padding: 9px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.tab.active { background: #f5c542; color: #14100a; font-weight: 700; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #aab0c4; margin-bottom: 6px; }
input {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid #2c3242;
  background: #0d0f16; color: #e8eaf0; font-size: 15px;
}
.hint { margin-top: 16px; font-size: 12px; color: #6b7280; text-align: center; }

/* lobby */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.game-card {
  background: #171a24; border: 1px solid #262b3a; border-radius: 14px; padding: 22px;
  text-align: center; cursor: pointer; transition: transform .12s, border-color .12s;
}
.game-card:hover { transform: translateY(-3px); border-color: #f5c542; }
.game-icon { font-size: 46px; margin-bottom: 8px; }
.game-card h3 { margin: 0 0 6px; }
.game-card .btn { margin-top: 12px; width: 100%; }

/* venues */
.cat-title { margin: 26px 0 10px; font-size: 18px; color: #f5c542; border-left: 4px solid #f5c542; padding-left: 10px; }
.venue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.venue-card { background: #171a24; border: 1px solid #262b3a; border-radius: 14px; padding: 16px; }
.venue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.venue-icon { font-size: 30px; }
.venue-name { font-weight: 700; font-size: 16px; }
.venue-tag { font-size: 11px; color: #8a90a3; background: #0d0f16; padding: 2px 7px; border-radius: 4px; }
.venue-bal { color: #f5c542; font-weight: 700; margin-bottom: 8px; }
.venue-row { display: flex; gap: 6px; margin-top: 6px; }
.venue-row input { padding: 8px; }
.venue-row .btn { padding: 8px 10px; flex: 1; }

/* bet cells */
.stake-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; max-width: 320px; }
.stake-row input { width: 120px; }
.bet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.bet-cell {
  position: relative; background: #171a24; border: 1px solid #262b3a; border-radius: 10px;
  padding: 10px; cursor: pointer; text-align: center; color: #e8eaf0;
}
.bet-cell:hover { border-color: #f5c542; }
.bet-name { font-weight: 700; display: block; }
.bet-desc { font-size: 11px; color: #8a90a3; display: block; }
.bet-odds { font-size: 11px; color: #f5c542; display: block; margin-top: 2px; }
.bet-amt { position: absolute; top: -8px; right: -8px; background: #f5c542; color: #14100a; border-radius: 999px; padding: 2px 7px; font-size: 11px; font-weight: 800; }

/* slip */
.slip-bar { background: #141826; border: 1px solid #262b3a; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.slip-item { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #262b3a; }
.slip-total { text-align: right; font-weight: 800; color: #f5c542; margin: 8px 0; }
.mini { background: #262b3a; color: #e8eaf0; border: none; border-radius: 6px; cursor: pointer; padding: 2px 8px; }

/* result */
.result { background: #141826; border: 1px solid #262b3a; border-radius: 12px; padding: 16px; }
.result.win { border-color: #2ecc71; }
.result.lose { border-color: #e74c3c; }
.result h3 { margin: 0 0 10px; }
.result-cards { display: flex; gap: 20px; justify-content: center; }
.hand { text-align: center; }
.cards { display: flex; gap: 4px; }
.card { background: #fff; color: #111; border-radius: 6px; padding: 8px 6px; font-weight: 700; min-width: 34px; text-align: center; }
.card.red { color: #d32f2f; }
.dice-row { text-align: center; font-size: 40px; }
.dice-sum { text-align: center; color: #aab0c4; }
.reels { display: flex; gap: 10px; justify-content: center; font-size: 44px; margin: 12px 0; }
.reel { width: 72px; height: 72px; line-height: 72px; background: #0d0f16; border: 1px solid #262b3a; border-radius: 10px; text-align: center; }
.result-line { text-align: center; color: #aab0c4; margin-top: 6px; }

/* panels / lists */
.panel { background: #171a24; border: 1px solid #262b3a; border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.wallet-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.wallet-cards input { margin-bottom: 10px; }
.list { display: flex; flex-direction: column; gap: 2px; }
.tx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #1f2433; font-size: 14px; }
.pos { color: #2ecc71; font-weight: 700; }
.neg { color: #e74c3c; font-weight: 700; }
.admin-row .adjust { display: flex; gap: 6px; }
.adj-input { width: 110px; padding: 6px; }

/* overlay (venue iframe) */
.overlay { position: fixed; inset: 0; background: rgba(4, 6, 12, .85); z-index: 100; display: flex; flex-direction: column; }
.overlay-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: #141826; }
.overlay-head #overlayBody { flex: 1; }
#overlayBody iframe { width: 100%; height: calc(100vh - 56px); border: 0; }

/* toast */
#toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: #171a24; color: #e8eaf0; border: 1px solid #2c3242; border-radius: 10px;
  padding: 12px 20px; z-index: 200; transition: transform .25s; font-size: 15px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err { border-color: #e74c3c; color: #ff8d9f; }
#toast.ok { border-color: #2ecc71; }

/* slots (电子) */
.slot-page { border-radius: 16px; padding: 20px; border: 1px solid #262b3a; }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.slot-machine { background: rgba(6,8,14,.55); border: 2px solid #262b3a; border-radius: 14px; padding: 16px; max-width: 520px; margin: 0 auto; }
.slot-grid { display: flex; flex-direction: column; gap: 8px; }
.slot-row { display: flex; gap: 8px; justify-content: center; }
.slot-cell { width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg,#202638,#12151f); border: 1px solid #2c3242; border-radius: 10px; font-size: 34px; }
.slot-cell.card { background: linear-gradient(180deg,#fff,#e6e6f0); color: #14100a; font-weight: 800; font-size: 26px; }
.slot-cell.hot { border-color: #f5c542; box-shadow: 0 0 16px rgba(245,197,66,.75); animation: pulse .6s ease-in-out infinite alternate; }
.slot-cell.small { width: 30px; height: 30px; font-size: 16px; border-radius: 6px; }
.slot-grid.spinning { filter: blur(2px); }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }
.slot-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; }
.chip { background: #262b3a; color: #e8eaf0; border: 1px solid #2c3242; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.chip.on { background: #f5c542; color: #14100a; font-weight: 800; }
.slot-win { text-align: center; font-size: 26px; font-weight: 800; color: #f5c542; margin-top: 10px; min-height: 34px; text-shadow: 0 0 12px rgba(245,197,66,.6); }
.free-banner { text-align: center; background: linear-gradient(90deg,#5a2130,#7a2a3f); color: #ffd9a0; border-radius: 8px; padding: 8px; margin-bottom: 10px; font-weight: 700; }
.paytable { max-width: 420px; margin: 16px auto 0; }
.pt-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #262b3a; }
.pt-row span:last-child { flex: 1; text-align: right; color: #aab0c4; }
