/* ===== 环球欢乐 Bingo · H5 主题 ===== */
:root {
  --bg1: #070b24;
  --bg2: #141046;
  --bg3: #2a1a63;
  --gold: #f7c948;
  --gold-2: #ffe08a;
  --gold-deep: #d9a514;
  --text: #f4f2ff;
  --muted: #a8a2d8;
  --card: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.12);
  --danger: #ff6b81;
  --ok: #4ade80;
  --radius: 18px;
}

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

html { font-size: 16px; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 60%, transparent) ,
    radial-gradient(1px 1px at 78% 8%, #ffe08a 60%, transparent),
    radial-gradient(1.5px 1.5px at 88% 32%, #fff 60%, transparent),
    radial-gradient(1px 1px at 30% 6%, #fff 60%, transparent),
    radial-gradient(1px 1px at 55% 22%, #cfd2ff 60%, transparent),
    radial-gradient(1.5px 1.5px at 40% 40%, #fff 60%, transparent),
    radial-gradient(1px 1px at 68% 52%, #fff 60%, transparent),
    radial-gradient(1px 1px at 8% 58%, #cfd2ff 60%, transparent),
    radial-gradient(1.5px 1.5px at 92% 74%, #fff 60%, transparent),
    radial-gradient(1px 1px at 22% 82%, #fff 60%, transparent),
    radial-gradient(1px 1px at 50% 92%, #ffe08a 60%, transparent),
    radial-gradient(1.5px 1.5px at 82% 90%, #fff 60%, transparent),
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(122, 90, 248, 0.55), transparent 70%),
    radial-gradient(ellipse 70% 45% at 85% 110%, rgba(247, 201, 72, 0.16), transparent 70%),
    linear-gradient(165deg, var(--bg1) 0%, var(--bg2) 48%, var(--bg3) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

#app { max-width: 480px; margin: 0 auto; padding: 0 14px calc(28px + env(safe-area-inset-bottom)); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; }

/* ===== 启动页 ===== */
.boot { min-height: 80vh; min-height: 80dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.boot-globe { font-size: 64px; animation: float 2.4s ease-in-out infinite; }
.boot-text { color: var(--muted); font-size: 14px; letter-spacing: 2px; }

/* ===== 通用组件 ===== */
.glass {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 14px 18px;
  border-radius: 999px;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-deep));
  color: #3a2a00;
  box-shadow: 0 6px 18px rgba(247, 201, 72, 0.35), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s;
  user-select: none;
}
.btn:active { transform: scale(.97); box-shadow: 0 2px 8px rgba(247,201,72,.3); }
.btn:disabled { opacity: .55; transform: none; }
.btn.ghost {
  background: rgba(255,255,255,.08); color: var(--text);
  border: 1px solid var(--card-border); box-shadow: none; font-weight: 500;
}
.btn.small { width: auto; padding: 8px 16px; font-size: 13px; }

.input {
  width: 100%; padding: 14px 16px;
  border-radius: 14px; border: 1px solid var(--card-border);
  background: rgba(0,0,0,.28); color: var(--text);
  font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247,201,72,.18); }
.input::placeholder { color: rgba(168,162,216,.55); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: rgba(247,201,72,.16); color: var(--gold-2);
  border: 1px solid rgba(247,201,72,.35);
}

/* ===== 登录 / 注册 ===== */
.auth-wrap { min-height: 92vh; min-height: 92dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-globe {
  position: relative; width: 108px; height: 108px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 62px; animation: float 3s ease-in-out infinite;
}
.auth-globe::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px dashed rgba(247,201,72,.55);
  animation: spin 9s linear infinite;
}
.auth-globe::after {
  content: "🎢"; position: absolute; top: -8px; right: -4px; font-size: 20px;
  animation: spin 9s linear infinite reverse;
}
.auth-title {
  font-size: 30px; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(180deg, #fff, var(--gold-2) 60%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 4px 24px rgba(247,201,72,.25);
}
.auth-sub { margin-top: 8px; color: var(--muted); font-size: 12px; letter-spacing: 4px; }
.auth-card { padding: 22px 18px; }
.auth-tabs { display: flex; background: rgba(0,0,0,.25); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 9px 0; text-align: center; border-radius: 9px;
  font-size: 15px; font-weight: 600; color: var(--muted); transition: all .18s;
}
.auth-tab.on { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #3a2a00; box-shadow: 0 2px 8px rgba(247,201,72,.3); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-tip { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.9; }
.auth-foot { text-align: center; margin-top: 22px; color: rgba(168,162,216,.6); font-size: 11px; letter-spacing: 2px; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 2px 10px;
  background: linear-gradient(180deg, rgba(10,12,38,.92), rgba(10,12,38,0));
}
.topbar .logo { font-size: 24px; }
.topbar .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.topbar .who .name {
  font-weight: 800; font-size: 16px; letter-spacing: .5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 17px;
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.92); }

/* ===== 连线横幅 ===== */
.lines-banner {
  margin: 6px 0 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.lines-banner .num {
  font-size: 34px; font-weight: 900; line-height: 1;
  background: linear-gradient(180deg, #fff, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lines-banner .lab { flex: 1; font-size: 13px; color: var(--muted); line-height: 1.5; }
.lines-banner .lab b { color: var(--text); font-size: 14px; }
.lines-banner.hot { border-color: rgba(247,201,72,.5); box-shadow: 0 0 24px rgba(247,201,72,.12) inset; }
.lines-banner .mini-trophy { font-size: 26px; }

/* ===== 九宫格 ===== */
.bingo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
  margin-bottom: 14px;
}
.cell {
  position: relative; aspect-ratio: 1; border-radius: 15px;
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 7px 6px 6px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: transform .15s ease, box-shadow .2s;
  user-select: none;
}
.cell:active { transform: scale(.95); }
.cell .tid {
  position: absolute; top: 5px; left: 7px;
  font-size: 10px; font-weight: 700; color: rgba(168,162,216,.85); letter-spacing: .5px;
}
.cell .emoji { font-size: 23px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.cell .tname {
  font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,.55);
}
.cell .tstate { font-size: 9.5px; color: var(--muted); }

.cell.done {
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 16px rgba(247,201,72,.28), inset 0 0 22px rgba(247,201,72,.08);
}
.cell.done .thumb-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .45;
}
.cell.done .thumb-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,12,38,.25), rgba(10,12,38,.72));
}
.cell.done > * { position: relative; z-index: 1; }
.cell .check {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  width: 19px; height: 19px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-deep));
  color: #3a2a00; font-size: 12px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  animation: pop .35s cubic-bezier(.34,1.56,.64,1);
}
.cell .pcount {
  position: absolute; bottom: 5px; right: 7px; z-index: 2;
  font-size: 9.5px; color: var(--gold-2); font-weight: 700;
}

.cell.inline { animation: lineGlow 1.6s ease-in-out infinite; }

/* ===== 进度 & 奖励 ===== */
.progress-card { padding: 14px 16px; margin-bottom: 14px; }
.progress-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.progress-row b { color: var(--gold-2); }
.progress-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; }
.progress-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-2));
  transition: width .5s cubic-bezier(.34,1.3,.64,1);
}
.reward-card { padding: 13px 16px; font-size: 12.5px; color: var(--muted); line-height: 2; }
.reward-card .rw { display: flex; align-items: center; gap: 8px; }
.reward-card .rw.hit { color: var(--gold-2); font-weight: 700; }
.reward-card .rw .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; flex: none; }

/* ===== 排行榜 ===== */
.rank-head { text-align: center; padding: 8px 0 16px; }
.rank-head .t { font-size: 22px; font-weight: 900; letter-spacing: 2px; }
.rank-head .s { color: var(--muted); font-size: 12px; margin-top: 5px; letter-spacing: 1px; }
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px;
  transition: transform .12s;
}
.rank-row:active { transform: scale(.97); }
.rank-row .medal { width: 30px; text-align: center; font-size: 20px; font-weight: 900; flex: none; }
.rank-row .medal.plain { font-size: 14px; color: var(--muted); }
.rank-row .info { flex: 1; min-width: 0; }
.rank-row .rname { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .rsub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.rank-row .rsub b { color: var(--gold-2); }
.rank-row.me { border-color: rgba(247,201,72,.55); box-shadow: 0 0 18px rgba(247,201,72,.1); }
.rank-row .chev { color: var(--muted); font-size: 18px; flex: none; }
.minimap { display: grid; grid-template-columns: repeat(3, 7px); gap: 2.5px; flex: none; }
.minimap i { width: 7px; height: 7px; border-radius: 2.5px; background: rgba(255,255,255,.14); }
.minimap i.on { background: linear-gradient(135deg, var(--gold-2), var(--gold-deep)); box-shadow: 0 0 4px rgba(247,201,72,.6); }
.rank-empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; line-height: 2; }

/* ===== 底部弹层（格子详情） ===== */
.sheet-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,6,20,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-width: 480px; margin: 0 auto;
  background: linear-gradient(180deg, #221a52, #14103a);
  border: 1px solid var(--card-border); border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 14px 18px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .28s cubic-bezier(.32,.9,.35,1);
  max-height: 82vh; max-height: 82dvh; overflow-y: auto;
}
.sheet .grab { width: 40px; height: 4.5px; border-radius: 99px; background: rgba(255,255,255,.22); margin: 0 auto 14px; }
.sheet .task-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sheet .task-head .emoji { font-size: 30px; }
.sheet .task-head .tt { flex: 1; }
.sheet .task-head .tt .no { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.sheet .task-head .tt .nm { font-size: 19px; font-weight: 900; margin-top: 2px; }
.sheet .task-desc {
  font-size: 13.5px; line-height: 1.85; color: #d9d5f5;
  background: rgba(0,0,0,.22); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.sheet .sec-title { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin: 0 0 9px 2px; }
.photo-strip { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.photo-strip::-webkit-scrollbar { display: none; }
.ph {
  position: relative; width: 78px; height: 78px; flex: none;
  border-radius: 13px; overflow: hidden; border: 1px solid var(--card-border);
  background-size: cover; background-position: center;
}
.ph .del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.62); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.ph.add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1.5px dashed rgba(247,201,72,.5); color: var(--gold-2);
  font-size: 11px; background: rgba(247,201,72,.06);
}
.ph.add .plus { font-size: 22px; line-height: 1; }
.ph.uploading { opacity: .5; animation: pulse 1s infinite; }
.sheet .done-tag {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; border-radius: 12px; font-size: 14px; font-weight: 800;
  background: rgba(74,222,128,.13); color: var(--ok);
  border: 1px solid rgba(74,222,128,.3);
}
.sheet .btn-row { display: flex; gap: 10px; margin-top: 10px; }

/* ===== 照片查看器 ===== */
.viewer {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(2,3,12,.94);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .16s ease;
}
.viewer img { max-width: 96vw; max-height: 86vh; max-height: 86dvh; border-radius: 10px; box-shadow: 0 10px 50px rgba(0,0,0,.6); }
.viewer .close {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; font-size: 17px;
}

/* ===== 抽签动画 ===== */
.draw-wrap {
  position: fixed; inset: 0; z-index: 70;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(122,90,248,.5), transparent 70%), linear-gradient(165deg, #070b24, #1c1450);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .25s ease;
}
.draw-title { font-size: 23px; font-weight: 900; letter-spacing: 3px; margin-bottom: 6px; }
.draw-sub { color: var(--muted); font-size: 12.5px; letter-spacing: 2px; margin-bottom: 26px; }
.draw-grid { display: grid; grid-template-columns: repeat(3, 88px); gap: 10px; margin-bottom: 30px; }
.draw-cell {
  aspect-ratio: 1; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; text-align: center; padding: 6px; line-height: 1.3;
  transition: all .15s;
}
.draw-cell.rolling { color: var(--muted); border-style: dashed; }
.draw-cell.landed {
  background: linear-gradient(150deg, rgba(247,201,72,.24), rgba(247,201,72,.06));
  border: 1.5px solid var(--gold); color: var(--gold-2);
  box-shadow: 0 0 18px rgba(247,201,72,.3);
  animation: pop .4s cubic-bezier(.34,1.56,.64,1);
}
.draw-actions { width: min(300px, 80vw); }

/* ===== Toast ===== */
#toast-root { position: fixed; top: calc(16px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  max-width: 86vw; padding: 11px 20px; border-radius: 999px;
  background: rgba(20,16,58,.92); border: 1px solid rgba(247,201,72,.4);
  color: var(--text); font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: toastIn .3s cubic-bezier(.34,1.4,.64,1);
}
.toast.bye { animation: toastOut .3s ease forwards; }

/* ===== 彩带 ===== */
.confetti { position: fixed; top: -12px; z-index: 99; pointer-events: none; border-radius: 2px; animation: confettiFall linear forwards; }

/* ===== 动画 ===== */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: .45; } 50% { opacity: .9; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(46%); } to { transform: translateY(0); } }
@keyframes lineGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(247,201,72,.25), inset 0 0 18px rgba(247,201,72,.06); }
  50% { box-shadow: 0 0 30px rgba(247,201,72,.55), inset 0 0 26px rgba(247,201,72,.16); }
}
@keyframes toastIn { from { transform: translateY(-18px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-14px); opacity: 0; } }
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: .2; }
}

@media (min-width: 481px) {
  .draw-grid { grid-template-columns: repeat(3, 104px); }
}
