body.is-spinning {
  overflow: hidden;
  touch-action: none;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  background: linear-gradient(180deg, #2b0606 0%, #5a0f0f 45%, #a22a1a 75%, #f27a24 100%);
  background-attachment: fixed;
}

/* 左上角返回首页 */
.back-to-home {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 6px 12px;
  font-size: 14px;
  color: #fff7ed;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.back-to-home:hover {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

.festival-banner-wrap {
  width: 100%;
  max-width: 360px;
  height: clamp(92px, 24vw, 150px);
  margin: 6px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.festival-banner {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.festival-banner-decor {
  position: absolute;
  inset: 0;
  z-index: 2;
  touch-action: none;
}

.festival-decoration {
  position: absolute;
  opacity: 0.9;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.festival-decoration.selectable {
  pointer-events: auto;
  cursor: grab;
  z-index: 3;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.festival-decoration.selected {
  outline: 2px dashed rgba(253, 230, 138, 0.9);
  outline-offset: 2px;
}

.festival-decor-controls {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 6px;
  z-index: 4;
}

.festival-decor-controls button {
  border-radius: 999px;
  border: 1px solid rgba(253, 230, 138, 0.7);
  background: rgba(15, 23, 42, 0.45);
  color: #fff7ed;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.6;
}

/* 九宫格抽奖区域：使用新年风背景图 */
.grid-section {
  background-image: url("./images/nine-grid-bg.webp");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: 3px solid #fbbf24;
  border-radius: 1rem;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0;
  /* 基于背景图的相对比例定位 */
  --grid-left: 18.33%;
  --grid-top: 22.5%;
  --grid-size: 64.44%;
  --grid-gap: 0.56%;
}

.grid-title-banner {
  position: absolute;
  left: 29px;
  top: 17px;
  width: 84%;
  height: 60px;
  line-height: 60px;
  text-align: center;
  font-size: 16.2px;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  user-select: none;
}

.grid-title-banner.title-draggable {
  pointer-events: auto;
  cursor: move;
}

.grid-title-coord {
  position: absolute;
  left: 8%;
  top: 0;
  font-size: 12px;
  color: #fde68a;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.filter-tag {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 10px;
  color: #475569;
  background: #f8fafc;
}

.filter-tag.active {
  border-color: #f59e0b;
  color: #f59e0b;
  background: #fffbeb;
}


.grid-board {
  display: grid;
  grid-template-columns: repeat(3, calc((100% - 2 * var(--grid-gap)) / 3));
  grid-template-rows: repeat(3, calc((100% - 2 * var(--grid-gap)) / 3));
  gap: var(--grid-gap);
  position: absolute;
  left: var(--grid-left);
  top: var(--grid-top);
  width: var(--grid-size);
  height: var(--grid-size);
}

.grid-cell {
  border-radius: 14px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fde68a;
  padding: 6px;
  min-height: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.grid-cell.active {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.9), 0 0 18px rgba(253, 224, 71, 0.8);
  transform: scale(1.02);
}

.grid-cell .grid-title {
  font-size: 14.4px;
  font-weight: 600;
  line-height: 1.2;
}

.grid-cell.center {
  background: transparent;
  box-shadow: none;
}

.grid-cell.center button {
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: transparent;
  color: #fff7ed;
  font-size: 14.4px;
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 320px;
  background: white;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
