@charset "UTF-8";
/* PC 大屏：设计基准 1920×1080，rem 动态缩放（offsetWidth/19.2，1rem=100px@1920），设计 px÷100=rem */
html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
ul, li, ol { list-style: none; }
img { border: none; display: block; }
button { font-family: inherit; }

body {
  width: 19.2rem;
  height: 10.8rem;
  overflow: hidden;
  background: #2a1b47;
  color: #fff;
}

/* 舞台：底图铺满，格子浮在其上 */
.stage {
  position: relative;
  width: 19.2rem;
  height: 10.8rem;
  background: url("../images/lottery-bg-1.jpg") no-repeat center center;
  background-size: 100% 100%;
}

.board { position: absolute; inset: 0; }

/* 单格：边框底图 + 奖品图，坐标由设计稿逐格测量（顺时针 slot_index 定位） */
.cell {
  position: absolute;
  width: 1.986rem;
  height: 1.536rem;
}
.cell .frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .96;
  transition: filter .1s, transform .1s;
}
.cell .gift {
  position: absolute;
  left: 0.013rem;
  top: 0.008rem;
  width: 1.96rem;
  height: 1.52rem;
  object-fit: cover;
  border-radius: 0.04rem;
}
.cell .gift.empty { background: rgba(30, 18, 55, .35); }

/* 高亮态：金边加粗 + 外发光 + 轻微缩放（跑马灯路过只亮格子，不出奖品名称） */
.cell.on .frame {
  filter: drop-shadow(0 0 0.12rem #ffd66b) brightness(1.18);
  transform: scale(1.06);
}
/* 中奖定格：额外呼吸闪烁 */
.cell.win .frame { animation: cellFlash .5s ease-in-out infinite; filter: drop-shadow(0 0 0.2rem #ffe89a) brightness(1.35); }
.cell.win .gift { animation: giftBreath 1s ease-in-out infinite; }
@keyframes cellFlash { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes giftBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* 18 格定位（列 x：2.133 4.287 6.436 8.589 10.743 12.891 15.045；行 y：1.486 3.147 4.813 6.479） */
.cell[data-i="0"]  { left: 2.133rem;  top: 1.486rem; }
.cell[data-i="1"]  { left: 4.287rem;  top: 1.486rem; }
.cell[data-i="2"]  { left: 6.436rem;  top: 1.486rem; }
.cell[data-i="3"]  { left: 8.589rem;  top: 1.486rem; }
.cell[data-i="4"]  { left: 10.743rem; top: 1.486rem; }
.cell[data-i="5"]  { left: 12.891rem; top: 1.486rem; }
.cell[data-i="6"]  { left: 15.045rem; top: 1.486rem; }
.cell[data-i="7"]  { left: 15.045rem; top: 3.147rem; }
.cell[data-i="8"]  { left: 15.045rem; top: 4.813rem; }
.cell[data-i="9"]  { left: 15.045rem; top: 6.479rem; }
.cell[data-i="10"] { left: 12.891rem; top: 6.479rem; }
.cell[data-i="11"] { left: 10.743rem; top: 6.479rem; }
.cell[data-i="12"] { left: 8.589rem;  top: 6.479rem; }
.cell[data-i="13"] { left: 6.436rem;  top: 6.479rem; }
.cell[data-i="14"] { left: 4.287rem;  top: 6.479rem; }
.cell[data-i="15"] { left: 2.133rem;  top: 6.479rem; }
.cell[data-i="16"] { left: 2.133rem;  top: 4.813rem; }
.cell[data-i="17"] { left: 2.133rem;  top: 3.147rem; }

/* 底部状态条 */
.statusbar {
  position: absolute;
  left: 0; right: 0; bottom: 0.34rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.statusbar .hint { font-size: 0.28rem; color: #ffe89a; text-shadow: 0 0.02rem 0.08rem rgba(0,0,0,.6); }
.statusbar .period { font-size: 0.18rem; color: #d9c4f2; background: rgba(80, 50, 130, .5); padding: 0.03rem 0.16rem; border-radius: 0.2rem; }

/* 空格键提示 */
.kbd-tip {
  position: absolute;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  font-size: 0.2rem;
  color: #fff;
  background: rgba(40, 24, 66, .55);
  border: 0.01rem solid rgba(212, 169, 78, .6);
  padding: 0.1rem 0.3rem;
  border-radius: 0.3rem;
  animation: tipBreath 2s ease-in-out infinite;
}
.kbd-tip b { color: #ffd66b; font-size: 0.24rem; padding: 0 0.06rem; }
.kbd-tip.hide { display: none; }
@keyframes tipBreath { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 中奖弹框 */
.win-mask {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 10, 40, .72);
  z-index: 20;
}
.win-mask.open { display: flex; }
.win-box {
  position: relative;
  width: 5.2rem;
  padding: 0.6rem 0.5rem 0.5rem;
  text-align: center;
  background: linear-gradient(160deg, #6b3fa0, #3a1f5e);
  border: 0.02rem solid #d4a94e;
  border-radius: 0.24rem;
  box-shadow: 0 0 0.8rem rgba(212, 169, 78, .5);
  animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.win-close {
  position: absolute;
  right: 0.16rem; top: 0.1rem;
  width: 0.44rem; height: 0.44rem;
  line-height: 0.4rem;
  font-size: 0.32rem;
  color: #f0e2c0;
  cursor: pointer;
}
.win-close:hover { color: #fff; }
.win-tag { font-size: 0.3rem; color: #ffd66b; letter-spacing: 0.04rem; }
.win-gift { width: 2.4rem; height: 1.92rem; object-fit: cover; margin: 0.3rem auto 0.1rem; border-radius: 0.12rem; border: 0.015rem solid rgba(255, 230, 160, .8); }
.win-name { font-size: 0.4rem; font-weight: 700; color: #fff; margin: 0.1rem 0 0.05rem; }
.win-no { font-size: 0.16rem; color: #cdb6ea; margin-bottom: 0.3rem; }
.win-again {
  display: inline-block;
  padding: 0.16rem 0.6rem;
  font-size: 0.24rem;
  color: #4a3568;
  background: linear-gradient(180deg, #ffe3a0, #d4a94e);
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
}
.win-again:hover { filter: brightness(1.06); }
.win-again[disabled] { opacity: .6; cursor: not-allowed; }

/* 状态弹层：抽奖中 / 已抽完 / 未开始 */
.notice { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(20, 10, 40, .55); z-index: 15; }
.notice.open { display: flex; }
.notice-in { font-size: 0.34rem; color: #ffe89a; background: rgba(58, 31, 94, .9); border: 0.015rem solid #d4a94e; padding: 0.4rem 0.8rem; border-radius: 0.2rem; }
