/* ==========================================================================
   小鲶鱼大作战 —— 游戏页样式（中英文共用）
   全屏 Canvas + 玻璃拟态 HUD，配色沿用会员中心品牌色
   ========================================================================== */
:root {
  --g-primary: #2b6cb0;
  --g-primary-light: #4299e1;
  --g-primary-dark: #1a365d;
  --g-danger: #e53e3e;
  --g-warn: #dd6b20;
  --g-success: #38a169;
  --g-gold: #d69e2e;
  --g-panel: rgba(16, 24, 40, .78);
  --g-panel-solid: rgba(16, 24, 40, .96);
  --g-border: rgba(255, 255, 255, .14);
  --g-text: #e8eef7;
  --g-text-dim: #93a4bd;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; overflow: hidden; background: #070b14;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--g-text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#cv { position: fixed; inset: 0; display: block; cursor: crosshair; touch-action: none; }

/* ---------------- HUD ---------------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }

.panel {
  background: var(--g-panel);
  border: 1px solid var(--g-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

/* 左上：自身状态 */
.me-card {
  position: absolute; left: 14px; top: 14px; padding: 12px 14px;
  min-width: 190px; display: flex; gap: 12px; align-items: center;
}
.me-logo { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }

/* 小鲶鱼 LOGO 图片：页面上原本放 🐟 emoji 的地方统一换成它（所有人本体都一样） */
.logo-img {
  display: inline-block; vertical-align: middle;
  border-radius: 50%; background: rgba(255,255,255,.06);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}
.me-logo .logo-img { width: 34px; height: 34px; }
.card h1 .logo-img { width: 32px; height: 32px; flex: none; }
.rule b .logo-img { width: 15px; height: 15px; margin-right: 5px; vertical-align: -3px; }
.lb-row .lg .logo-img { width: 17px; height: 17px; }
.feed-item .lg .logo-img { width: 15px; height: 15px; }
.me-info { flex: 1; min-width: 0; }
.me-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-mass { font-size: 22px; font-weight: 800; color: #7dd3fc; line-height: 1.15; }
.me-mass small { font-size: 11px; font-weight: 500; color: var(--g-text-dim); margin-left: 4px; }
.hp-bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; margin-top: 6px; }
.hp-bar i { display: block; height: 100%; width: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #48bb78, #9ae6b4); transition: width .12s linear, background .2s; }
.hp-bar.low i { background: linear-gradient(90deg, #e53e3e, #fc8181); }
.hp-bar.mid i { background: linear-gradient(90deg, #dd6b20, #f6ad55); }

/* 右上：全服信息 */
.world-card {
  position: absolute; right: 14px; top: 14px; padding: 9px 14px;
  display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--g-text-dim);
}
.world-card b { color: var(--g-text); font-size: 14px; margin-left: 3px; }
.world-card .dot { width: 7px; height: 7px; border-radius: 50%; background: #48bb78; display: inline-block;
  margin-right: 5px; box-shadow: 0 0 8px #48bb78; animation: pulse 2s infinite; }
.world-card .dot.off { background: #e53e3e; box-shadow: 0 0 8px #e53e3e; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* 左下：小地图 */
.minimap-wrap { position: absolute; left: 14px; bottom: 14px; padding: 7px; }
#minimap { display: block; width: 168px; height: 168px; border-radius: 8px; background: #0b1220; }
.minimap-tip { text-align: center; font-size: 10px; color: var(--g-text-dim); margin-top: 4px; }

/* 右下：排行榜 */
.lb-card { position: absolute; right: 14px; bottom: 14px; width: 250px; max-height: 46vh; display: flex; flex-direction: column; }
.lb-tabs { display: flex; border-bottom: 1px solid var(--g-border); }
.lb-tabs button {
  flex: 1; background: none; border: 0; color: var(--g-text-dim); font-size: 12px;
  padding: 9px 4px; cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent; transition: .15s;
}
.lb-tabs button:hover { color: var(--g-text); }
.lb-tabs button.on { color: #7dd3fc; border-bottom-color: #7dd3fc; font-weight: 700; }
.lb-list { overflow-y: auto; padding: 4px 0; }
.lb-list::-webkit-scrollbar { width: 5px; }
.lb-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
.lb-row { display: flex; align-items: center; gap: 7px; padding: 5px 11px; font-size: 12px; }
.lb-row .rk { width: 18px; text-align: center; color: var(--g-text-dim); font-weight: 700; flex: none; }
.lb-row.top1 .rk { color: #f6e05e; }
.lb-row.top2 .rk { color: #cbd5e0; }
.lb-row.top3 .rk { color: #ed8936; }
.lb-row .lg { font-size: 14px; flex: none; }
.lb-row .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row .vl { color: #7dd3fc; font-weight: 700; flex: none; }
.lb-row.self { background: rgba(66, 153, 225, .2); border-radius: 6px; }
.lb-empty { padding: 18px 12px; text-align: center; font-size: 12px; color: var(--g-text-dim); }
.sleep-tag { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: rgba(56,161,105,.22);
  color: #9ae6b4; flex: none; }

/* 顶部中间：战报 */
.feed { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: 340px;
  display: flex; flex-direction: column; align-items: center; gap: 5px; }
.feed-item { font-size: 12px; padding: 4px 12px; border-radius: 20px; background: rgba(10,16,28,.8);
  border: 1px solid var(--g-border); animation: feedIn .25s ease-out; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .k { color: #f6ad55; font-weight: 700; }
.feed-item .v { color: #fc8181; font-weight: 700; }
.feed-item.hunt { border-color: rgba(214,158,46,.6); background: rgba(60,42,6,.86); }
.feed-item.hunt .k { color: #f6e05e; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-8px); } }

/* 底部中间：操作区 */
.actions { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; }
.btn {
  position: relative; border: 1px solid var(--g-border); border-radius: 10px; padding: 10px 18px;
  font-size: 14px; font-family: inherit; cursor: pointer; color: var(--g-text);
  background: rgba(20,30,48,.86); transition: .15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(38,54,80,.95); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--g-primary), var(--g-primary-light)); border-color: transparent; font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--g-primary-light), #63b3ed); }
.btn-sleep { background: linear-gradient(135deg, #2f855a, #48bb78); border-color: transparent; font-weight: 700; }
.btn-sleep:disabled { background: rgba(20,30,48,.86); }
.btn-danger { background: linear-gradient(135deg, #9b2c2c, #e53e3e); border-color: transparent; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.still-ring { width: 34px; height: 34px; flex: none; }
.ctrl-hint { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%);
  font-size: 11px; color: var(--g-text-dim); white-space: nowrap; }

/* 移动端虚拟摇杆 */
.stick { position: absolute; width: 132px; height: 132px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.05); display: none;
  touch-action: none; }
.stick.on { display: block; }
.stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(255,255,255,.28); }

/* 复活/无敌提示 */
.center-tip { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%);
  font-size: 15px; font-weight: 700; text-shadow: 0 2px 12px #000; text-align: center; }

/* ---------------- 全屏遮罩层 ---------------- */
.screen {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, #16233c 0%, #070b14 70%);
  padding: 20px; overflow-y: auto;
}
.screen.hidden { display: none; }

.card {
  width: 100%; max-width: 720px; background: var(--g-panel-solid);
  border: 1px solid var(--g-border); border-radius: 18px; padding: 26px 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.card h1 { font-size: 26px; line-height: 1.25; display: flex; align-items: center; gap: 10px; }
.card h1 span.tagline { font-size: 12px; font-weight: 400; color: var(--g-text-dim); }
.card .sub { color: var(--g-text-dim); font-size: 13px; margin-top: 7px; line-height: 1.7; }
.card h3 { font-size: 14px; margin: 18px 0 8px; color: #7dd3fc; }

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 8px; }
.rule { background: rgba(255,255,255,.045); border: 1px solid var(--g-border); border-radius: 10px; padding: 11px 13px; }
.rule b { display: block; font-size: 13px; margin-bottom: 4px; }
.rule p { font-size: 12px; color: var(--g-text-dim); line-height: 1.65; }
.rule.warn { border-color: rgba(214,158,46,.42); background: rgba(214,158,46,.09); }
.rule.warn b { color: #f6e05e; }
.rule.danger { border-color: rgba(229,62,62,.42); background: rgba(229,62,62,.09); }
.rule.danger b { color: #fc8181; }

.logo-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.logo-picker button { width: 40px; height: 40px; font-size: 21px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 2px solid transparent; transition: .15s; }
.logo-picker button:hover { background: rgba(255,255,255,.14); }
.logo-picker button.on { border-color: var(--g-primary-light); background: rgba(66,153,225,.2); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.stat { background: rgba(255,255,255,.045); border-radius: 10px; padding: 9px; text-align: center; }
.stat b { display: block; font-size: 18px; color: #7dd3fc; }
.stat span { font-size: 11px; color: var(--g-text-dim); }

.row { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.row .grow { flex: 1; }
.link-btn { background: none; border: 0; color: var(--g-text-dim); font-size: 13px; cursor: pointer;
  font-family: inherit; text-decoration: underline; padding: 4px; }
.link-btn:hover { color: var(--g-text); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; z-index: 80; background: rgba(4,7,14,.78);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.hidden { display: none; }
.modal { max-width: 460px; width: 100%; background: var(--g-panel-solid); border: 1px solid var(--g-border);
  border-radius: 16px; padding: 24px; box-shadow: 0 24px 64px rgba(0,0,0,.7); }
.modal h2 { font-size: 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.modal p { font-size: 13px; color: var(--g-text-dim); line-height: 1.8; }
.modal .hl { color: #fc8181; font-weight: 700; }
.modal .hl-ok { color: #9ae6b4; font-weight: 700; }

/* toast */
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%);
  background: rgba(16,24,40,.96); color: #fff; padding: 11px 20px; border-radius: 9px; font-size: 13px;
  z-index: 200; opacity: 0; pointer-events: none; transition: .2s; border: 1px solid var(--g-border);
  max-width: 86vw; text-align: center; }
.toast.on { opacity: 1; }
.toast.err { background: rgba(120,26,26,.96); }
.toast.ok { background: rgba(22,88,58,.96); }

/* 自适应 */
@media (max-width: 860px) {
  .lb-card { width: 190px; max-height: 34vh; }
  .lb-card .lb-tabs button { font-size: 11px; padding: 7px 2px; }
  #minimap { width: 118px; height: 118px; }
  .me-card { transform: scale(.92); transform-origin: top left; }
  .world-card { transform: scale(.92); transform-origin: top right; }
  .feed { width: 58vw; }
  .actions { bottom: 12px; }
  .btn { padding: 9px 13px; font-size: 13px; }
  .ctrl-hint { display: none; }
  .card { padding: 20px 18px; }
  .card h1 { font-size: 21px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .lb-card { display: none; }
  .minimap-wrap { display: none; }
}
