/* ============ 幸运水果机 - 网页轻量客户端 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(ellipse at 50% 20%, #14553f 0%, #0b3d2e 55%, #06251b 100%);
  color: #fff; user-select: none; touch-action: manipulation;
  max-width: 480px; margin: 0 auto; min-height: 100%;
  display: flex; flex-direction: column;
}
.hidden { display: none !important; }
.flex1 { flex: 1; }

/* ---------- 通用 ---------- */
.btn {
  border: none; border-radius: 10px; padding: 10px 14px; font-size: 15px; font-weight: 700;
  color: #fff; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.35); transition: transform .08s;
}
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-gold  { background: linear-gradient(#ffd54a, #e8a020); color: #6b3d00; text-shadow: 0 1px 0 #ffe9a8; }
.btn-green { background: linear-gradient(#4caf6d, #2e8b4a); }
.btn-blue  { background: linear-gradient(#54a6d8, #2c72ad); }
.btn-purple{ background: linear-gradient(#a06ce0, #6f3fb5); }
.btn-gray  { background: linear-gradient(#8a8a8a, #5c5c5c); }
.btn-mini  { font-size: 12px; padding: 5px 10px; border-radius: 8px; background: linear-gradient(#8a8a8a, #5c5c5c); }
.btn-block { width: 100%; }
.inp {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 2px solid #3d7a5f;
  background: rgba(0,0,0,.35); color: #fff; font-size: 15px; outline: none;
}
.inp:focus { border-color: #ffd54a; }

/* ---------- 遮罩/弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
  width: 100%; max-width: 360px; background: linear-gradient(#124c38, #0b3d2e);
  border: 2px solid #ffd54a; border-radius: 18px; padding: 26px 22px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.6);
}
.auth-logo { text-align: center; font-size: 26px; font-weight: 900; color: #ffd54a; margin-bottom: 4px; }
.auth-tabs { display: flex; gap: 10px; }
.tab {
  flex: 1; padding: 9px; border-radius: 10px; border: 1px solid #3d7a5f; background: transparent;
  color: #9fd4bb; font-size: 15px; font-weight: 700; cursor: pointer;
}
.tab.active { background: #ffd54a; color: #6b3d00; border-color: #ffd54a; }
.auth-tip { font-size: 11px; color: #8fc7ab; text-align: center; line-height: 1.6; }

.dialog {
  width: 100%; max-width: 360px; background: linear-gradient(#124c38, #0b3d2e);
  border: 2px solid #ffd54a; border-radius: 16px; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.dlg-title { font-size: 15px; font-weight: 800; color: #ffd54a; }
.dlg-row { display: flex; gap: 8px; align-items: center; }
.dlg-row.quick .chip.big { font-size: 14px; padding: 8px 12px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: rgba(0,0,0,.3);
}
.brand { font-size: 17px; font-weight: 900; color: #ffd54a; }
.wallet { display: flex; gap: 10px; font-size: 12px; color: #cfeee0; }
.wallet b { color: #ffd54a; font-size: 14px; }

/* ---------- 轮盘 ---------- */
.wheel-wrap { position: relative; width: 100%; max-width: 420px; margin: 6px auto 0; }
#wheel { width: 100%; height: auto; display: block; }
.pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 30px; color: #ff5252; text-shadow: 0 2px 4px rgba(0,0,0,.7); z-index: 5;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.6));
}
.hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 26%; aspect-ratio: 1; z-index: 4;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #e8a020 70%);
  border-radius: 50%; border: 4px solid #fff3c9;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.55);
}
.hub-btn {
  width: 82%; height: 82%; border-radius: 50%; font-size: 17px; line-height: 1.25;
  background: linear-gradient(#ff7043, #d84315); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* ---------- 结果横幅 ---------- */
.banner {
  margin: 8px auto 0; padding: 10px 18px; border-radius: 12px; text-align: center;
  font-size: 17px; font-weight: 900; letter-spacing: 1px;
  background: linear-gradient(90deg, rgba(255,213,74,.15), rgba(255,213,74,.4), rgba(255,213,74,.15));
  border: 1px solid #ffd54a; color: #ffd54a; max-width: 420px; width: calc(100% - 24px);
}
.banner.lose { color: #9fd4bb; border-color: #3d7a5f; background: linear-gradient(90deg, rgba(61,122,95,.15), rgba(61,122,95,.35), rgba(61,122,95,.15)); }
.banner.jack { color: #ff5252; border-color: #ff5252; font-size: 20px; }

/* ---------- 下注面板 ---------- */
.bet-panel { padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.chip-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #cfeee0; }
.chip-label { white-space: nowrap; }
.chip {
  min-width: 44px; padding: 6px 8px; border-radius: 50px; border: 2px dashed #ffd54a;
  background: rgba(255,213,74,.12); color: #ffd54a; font-weight: 900; font-size: 13px; cursor: pointer;
}
.chip.active { background: #ffd54a; color: #6b3d00; border-style: solid; }
.total-bet { white-space: nowrap; }
.total-bet b { color: #ffd54a; font-size: 15px; }

.bet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fruit {
  position: relative; border-radius: 12px; padding: 8px 4px 7px; text-align: center; cursor: pointer;
  border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.28);
  display: flex; flex-direction: column; align-items: center; gap: 1px; overflow: hidden;
}
.fruit .emoji { font-size: 24px; line-height: 1.15; }
.fruit .emoji.txt { color: #fff; font-weight: 900; font-size: 20px; letter-spacing: 1px; }
.fruit .name { font-size: 11px; color: #cfeee0; }
.fruit .odds { font-size: 11px; color: #ffd54a; font-weight: 800; }
.fruit .bet-badge {
  position: absolute; top: 3px; right: 3px; min-width: 20px; padding: 1px 5px; border-radius: 9px;
  background: #ff5252; color: #fff; font-size: 10px; font-weight: 800; display: none;
}
.fruit.has-bet .bet-badge { display: block; }
.fruit.win-flash { animation: winflash .5s ease-in-out 4; border-color: #ffd54a; }
@keyframes winflash { 50% { background: rgba(255,213,74,.45); } }

.act-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act-row .btn { font-size: 13px; padding: 9px 4px; }

/* ---------- 礼品码列表 ---------- */
.gift-list { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.gift-item {
  display: flex; justify-content: space-between; align-items: center; font-size: 12px;
  background: rgba(0,0,0,.3); border: 1px solid #3d7a5f; border-radius: 8px; padding: 7px 10px;
}
.gift-item .code { font-family: monospace; color: #ffd54a; font-size: 13px; font-weight: 700; }
.gift-item .ok { color: #7ce29a; } .gift-item .used { color: #888; text-decoration: line-through; }
.gift-empty { text-align: center; color: #8fc7ab; font-size: 12px; padding: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 14%; left: 50%; transform: translateX(-50%); z-index: 99;
  background: rgba(0,0,0,.85); border: 1px solid #ffd54a; color: #ffd54a;
  padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 700; max-width: 86vw;
  text-align: center; animation: fadein .2s;
}
@keyframes fadein { from { opacity: 0; transform: translate(-50%, -8px); } }
