/* -*- 浮空岛翻牌（2026-11-01，nbfl- 前缀独立模块；index.html 引入 ?v=1） -*-
 * 铁律：preserve-3d 容器（.nbfl-inner）禁 filter/overflow/opacity<1/mask；
 *       翻转动画走 .go 门控 + forwards；@keyframes 本文件内唯一（nbflPulse）。 */

/* ===== 左下角入口按钮（截图红框位：? 图鉴钮正下方，同款 34px 圆钮） ===== */
#nb-flip-btn { position: absolute; top: 100px; left: 10px; z-index: 6;
  width: 34px; height: 34px; padding: 0; font-size: 17px; line-height: 34px;
  border-radius: 50%; border: 1px solid rgba(209,179,255,.55); cursor: pointer;
  background: linear-gradient(135deg, rgba(64,28,128,.92), rgba(38,10,84,.92));
  color: #f3e9ff; text-align: center; box-shadow: 0 2px 8px rgba(20,8,50,.5);
  transition: transform .15s ease, box-shadow .15s ease; }
#nb-flip-btn:hover { transform: scale(1.08); filter: brightness(1.15); }
#nb-flip-btn:active { transform: scale(.95); }
#nb-flip-btn.hidden { display: none; }
#nb-flip-btn.ready::after { content: ''; position: absolute; top: -2px; right: -2px;
  width: 10px; height: 10px; border-radius: 50%; background: #ff5252;
  box-shadow: 0 0 6px rgba(255,82,82,.9); animation: nbflPulse 1.1s ease-in-out infinite; }
@keyframes nbflPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.45); opacity: .6; } }

/* ===== 弹层 ===== */
#nbfl-ov { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 4, 30, .78); backdrop-filter: blur(3px); }
#nbfl-ov.hidden { display: none; }
#nbfl-panel { width: min(430px, 92vw); max-height: min(92vw, 88vh); overflow-y: auto;
  border-radius: 16px; padding: 14px 16px 16px; position: relative;
  background: radial-gradient(120% 90% at 50% 0%, #3a2170 0%, #241252 55%, #150a38 100%);
  border: 1px solid rgba(209,179,255,.4); box-shadow: 0 10px 40px rgba(8,2,26,.8);
  color: #efe6ff; text-align: center; }
#nbfl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
#nbfl-head span { font-size: 16px; font-weight: bold; color: #ffe9b0; letter-spacing: 1px; }
#nbfl-x { width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.12); color: #e8dbff; font-size: 16px; line-height: 28px; padding: 0; }
#nbfl-x:hover { background: rgba(255,255,255,.22); }
#nbfl-tip { font-size: 12px; color: #c9b3f0; margin-bottom: 8px; line-height: 1.5; }
#nbfl-bless { min-height: 0; margin-bottom: 6px; }
.nbfl-bless-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px;
  background: linear-gradient(135deg, rgba(120,80,20,.55), rgba(80,52,10,.55));
  border: 1px solid rgba(255,214,120,.45); color: #ffe9b0; }
.nbfl-load { padding: 34px 10px; font-size: 14px; color: #cdb6f2; line-height: 1.8; }

/* ===== 三张牌：3D 翻转 ===== */
#nbfl-cards { display: flex; justify-content: center; gap: 14px; padding: 10px 0 6px; min-height: 168px;
  align-items: center; perspective: 800px; }
.nbfl-card { width: 112px; height: 158px; cursor: pointer; flex: 0 0 auto; }
.nbfl-card.locked { cursor: not-allowed; filter: brightness(.72); }
.nbfl-card:not(.locked):hover { transform: translateY(-6px); }
.nbfl-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.2,.7,.25,1); }
.nbfl-card.go .nbfl-inner { transform: rotateY(180deg); }
.nbfl-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(209,179,255,.5); box-shadow: 0 4px 14px rgba(8,2,26,.55); }
.nbfl-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nbfl-emoji { font-size: 44px; text-shadow: 0 2px 10px rgba(0,0,0,.5); z-index: 0; }
/* 渐变兜底（素材缺失时露出） */
.g-back    { background: linear-gradient(160deg,#2b1a5e 0%,#4a2a8f 45%,#1a0f3d 100%); }
.g-bless   { background: linear-gradient(160deg,#5a3a10 0%,#8a6a20 45%,#3a2508 100%); }
.g-starbox { background: linear-gradient(160deg,#1a3a6e 0%,#2a5a9f 45%,#0f1f42 100%); }
.g-bait    { background: linear-gradient(160deg,#4a3a10 0%,#7a6218 45%,#2a2008 100%); }
.nbfl-front { transform: rotateY(180deg); }
.nbfl-card.revealed .nbfl-front { border-color: #ffd66e; box-shadow: 0 0 18px rgba(255,214,110,.55); }
.nbfl-card.revealed .nbfl-inner { transition: transform .7s cubic-bezier(.2,.7,.25,1); }

/* ===== 底部进度 ===== */
#nbfl-foot { padding-top: 4px; }
.nbfl-left { font-size: 15px; color: #ffe9b0; font-weight: bold; margin-bottom: 4px; }
.nbfl-progress { height: 10px; border-radius: 999px; background: rgba(255,255,255,.12);
  margin: 6px auto 4px; width: 82%; overflow: hidden; }
.nbfl-bar { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #7c5cff, #d1b3ff); transition: width .4s ease; }
.nbfl-sub { font-size: 12px; color: #b39ddb; }

/* ===== 移动端窄屏 ===== */
@media (max-width: 480px) {
  #nbfl-cards { gap: 10px; }
  .nbfl-card { width: 96px; height: 136px; }
  .nbfl-emoji { font-size: 38px; }
}
/* ===== 横屏反制（body.lm-rot 旋转态：视口仍竖屏，@media 窄屏会误命中 → 按旋转态放宽） ===== */
body.lm-rot #nbfl-cards { gap: 16px; }
body.lm-rot .nbfl-card { width: 118px; height: 164px; }
