/* ✅ 只保留黑色作为初始背景 */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background: black;  /* 用于封面阶段 */
}

/* ✅ 把背景图设置在游戏主体上 */
#game {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-image: url('horizontal2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}


#hoop {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 60px;
}

.backboard {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 60px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid #888;
  border-radius: 5px;
}

.rim {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 20px;
  background: none;
  border: 4px solid red;
  border-radius: 50%;
  box-sizing: border-box;
}

.net {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 30px;
  border-left: 2px solid white;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  border-radius: 0 0 50% 50%;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    white 2px,
    white 4px
  );
  opacity: 0.4;
}

.cube {
  width: 80px;
  height: 80px;
  position: absolute;
  transform-style: preserve-3d;
  animation: spin 1.2s infinite linear;
  transform-origin: center;
}

.face {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  background:
    linear-gradient(to right, transparent 48%, black 50%, transparent 52%),
    linear-gradient(to bottom, transparent 48%, black 50%, transparent 52%),
    radial-gradient(circle at 30% 30%, #ff9933, #cc5500);
  background-blend-mode: multiply;
  box-shadow: inset 0 0 10px #000;
}

.front  { transform: translateZ(40px); }
.back   { transform: rotateY(180deg) translateZ(40px); }
.right  { transform: rotateY(90deg) translateZ(40px); }
.left   { transform: rotateY(-90deg) translateZ(40px); }
.top    { transform: rotateX(90deg) translateZ(40px); }
.bottom { transform: rotateX(-90deg) translateZ(40px); }

@keyframes spin {
  from { transform: rotateX(0deg); }
  to   { transform: rotateX(360deg); }
}


#feedback {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: bold;
  color: #0f0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  text-shadow: 0 0 10px #0f0;
}

#scoreBoard {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 24px;
  color: white;
  font-family: Arial, sans-serif;
  font-weight: bold;
  text-shadow: 0 0 5px #0f0;
}

#startScreen {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

#startButton {
  padding: 20px 40px;
  font-size: 24px;
  cursor: pointer;
  border: none;
  background: #0f0;
  color: black;
  border-radius: 10px;
  font-weight: bold;
  box-shadow: 0 0 10px #0f0;
}

#timer {
  position: absolute;
  top: 20px;
  left: 30px;
  font-size: 24px;
  color: white;
  font-family: Arial, sans-serif;
  font-weight: bold;
  text-shadow: 0 0 5px #0f0;
  display: none;
}

#endScreen {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 11;
  top: 0;
  left: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 32px;
  text-align: center;
}

#endScreen button {
  margin-top: 20px;
  padding: 16px 32px;
  font-size: 20px;
  background: #00f0ff;
  color: #000;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 0 10px #00f0ff;
}

#restartButton button {
  margin-top: 20px;
  padding: 16px 32px;
  font-size: 20px;
  background: #00f0ff;
  color: #000;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 0 10px #00f0ff;
}

#levelInfo {
  position: absolute;
  top: 60px;
  left: 30px;
  font-size: 20px;
  color: #ccc;
  font-family: Arial, sans-serif;
  text-shadow: 0 0 5px #0ff;
}

#money {
  position: absolute;
  top: 20px;
  right: 160px;
  font-size: 24px;
  color: gold;
  font-family: Arial, sans-serif;
  font-weight: bold;
  text-shadow: 0 0 5px #ff0;
}

#shopScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111;
  color: white;
  display: none;
  flex-direction: column;
  padding: 20px;
  z-index: 12;
}

#shopHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#shopMoney {
  font-size: 24px;
  color: gold;
}

#closeShop {
  padding: 10px 20px;
  font-size: 16px;
  background: #0ff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#shopItems {
  position: relative;           /* ✅ 容器变成相对定位，供内部绝对定位 */
  width: 100%;
  height: 100%;
}
.shopItem {
  background: #222;
  padding: 20px;
  text-align: center;
  border: 2px solid #0f0;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.3s ease;
  position: absolute;           /* ✅ 每个 item 自己控制位置 */
  width: 120px;                 /* ✅ 更大图标 */
  height: 120px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.shopItem:hover {
  background: #333;
}

.shopItem.purchased {
  opacity: 0.4;
  pointer-events: none;
  position: relative;
}

.shopItem.purchased::after {
  content: "已购买";
  position: absolute;
  top: 10px;
  right: 10px;
  color: #ff4444;
  font-size: 14px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 6px;
  border-radius: 4px;
}

#backpack {
  margin-top: 30px;
  border-top: 1px solid #444;
  padding-top: 10px;
  color: #ccc;
}

#backpack h3 {
  margin-bottom: 10px;
}

#ownedItemsList {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#ownedItemsList li {
  background: #222;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #666;
  font-size: 14px;
}

/* Tooltip 样式 */
#tooltip {
  position: absolute;
  background-color: rgba(30, 30, 30, 0.95);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 16px;
  max-width: 280px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  display: none;
  z-index: 1000;
  line-height: 1.5;
}

/* 商店物品卡片（可购买和已购买） */
.shopItem {
  background-color: #bcbcbc;
  border-radius: 8px;
  padding: 12px;
  margin: 10px;
  font-size: 18px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.shopItem:hover {
  transform: scale(1.05);
  background-color: #bcbcbc;
}

/* 已购买状态样式 */
.shopItem.purchased {
  background-color: #aaa;
  color: #555;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* 背包物品样式 */
#ownedItemsList li {
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 6px;
  background-color: #f8f8f8;
  font-size: 16px;
  position: relative;
  cursor: default;
  transition: background-color 0.2s ease;
}
#ownedItemsList li:hover {
  background-color: #eaeaea;
}

.hoopWrapper.bigger {
  transform: scale(1.3);
  transform-origin: center center;
  transition: transform 0.3s ease;
}

#shopScreen {
  position: relative;
  background: url('itemui/shopbackground.png') no-repeat center center;
  background-size: 60%;          /* 👈 比例更小一点 */
  background-color: white;       /* 👈 背景留白处变白 */
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  min-height: 90vh;              /* 固定最小高度，避免塌陷 */
}

.shopItem {
  background: transparent;
  border: none;
  padding: 0;
  margin: 10px;
  width: 180px;
  height: 180px;
  cursor: pointer;
  position: relative;
}

.shopItem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s;
}

.shopItem:hover img {
  transform: scale(1.1);
}

.price-tag {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
}


/* 全局控制滚动和尺寸 */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;     /* ✅ 禁止页面滚动 */
  width: 100vw;
  height: 100vh;
  background: black;
}

/* 封面全屏覆盖 */
#gameCover {
  position: fixed;      /* ✅ 盖住整个页面 */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background-color: black;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 封面图片 */
#coverImage {
  height: 100vh;    /* ✅ 高度占满整个视口 */
  width: auto;      /* ✅ 宽度根据原图比例自适应 */
  display: block;
}

/* 左下角按钮 */
#startButton {
  position: absolute;
  bottom: 40px;
  left: 600px;
  bottom: 200px; 
  padding: 20px 40px;   /* ✅ 更大的点击区域 */
  font-size: 24px;   
  background-color: lime;
  
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10000;
}




#startButton:hover {
  transform: scale(1.05);
}
.cube.golden .face {
  background:
    linear-gradient(to right, transparent 48%, gold 50%, transparent 52%),
    linear-gradient(to bottom, transparent 48%, gold 50%, transparent 52%),
    radial-gradient(circle at 30% 30%, #ffd700, #ffa500); /* 金黄色渐变 */
  background-blend-mode: screen;
  box-shadow: inset 0 0 20px gold, 0 0 12px gold;
}


.floating-feedback {
  position: absolute;
  font-size: 90px; /* 更大字体 */
  font-weight: 1000; /* 更粗 */
  color: rgb(83, 14, 172);
  text-shadow: 0 0 10px rgba(255,255,255,0.8); /* 发光 */
  pointer-events: none;
  transition: all 0.8s ease-out;
  opacity: 1;
  transform: translateY(0) scale(1);
  z-index: 1000;
}

.floating-feedback.gold {
  color: gold;
  text-shadow: 0 0 15px rgba(255, 215, 0, 1);
}

#levelInfo {
  background-color: rgba(0, 0, 0, 0.6);  /* 深色背景 */
  color: #fff;                          /* 白色文字 */
  font-weight: bold;
  font-size: 20px;
  padding: 8px 16px;
  border-radius: 8px;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}