/* 靈光腦 各小遊戲專屬動效、大尺寸圖示與觸控優化樣式 */

/* 通用遊戲容器 */
.game-play-area {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.game-header-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-badge {
  font-weight: 900;
  font-size: 16px;
  padding: 8px 18px;
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.category-badge.cat-identify { background: linear-gradient(135deg, #ff7675, #d63031); }
.category-badge.cat-memorize { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.category-badge.cat-analyze { background: linear-gradient(135deg, #55efc4, #00b894); color: #1e272e; }
.category-badge.cat-compute { background: linear-gradient(135deg, #feca57, #ff9f43); color: #2d3436; }
.category-badge.cat-visualize { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }

.level-indicator {
  font-size: 14px;
  font-weight: 800;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  padding: 6px 16px;
  border-radius: 16px;
  color: #4a5568;
}

.game-hint-text {
  font-size: 22px;
  font-weight: 900;
  color: #2d3436;
  text-align: center;
  margin: 4px 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 4 選 1 選擇卡片 (放大圖示與文字，極佳觸控) */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 540px;
  margin-top: auto;
  margin-bottom: 4px;
}

.choice-card {
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 24px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 0 #cbd5e0, 0 10px 15px rgba(0,0,0,0.05);
  transition: transform 0.12s, box-shadow 0.12s;
  min-height: 96px;
}

.choice-card:hover {
  border-color: #74b9ff;
  transform: translateY(-3px);
}

.choice-card:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #cbd5e0;
}

.choice-icon {
  font-size: 46px; /* 圖示顯著放大 */
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.choice-name {
  font-size: 18px; /* 字體加大 */
  font-weight: 900;
  color: #2d3436;
}

/* 答對 Q 彈與答錯晃動 */
.correct-bounce {
  animation: correctBounceAnim 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: #e6fffa !important;
  border-color: #38b2ac !important;
  box-shadow: 0 8px 0 #319795 !important;
}

@keyframes correctBounceAnim {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.wrong-shake {
  animation: wrongShakeAnim 0.3s ease-in-out;
  border-color: #ff4757 !important;
  background: #fff5f5 !important;
}

@keyframes wrongShakeAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ================== 【直覺】影子大師 ================== */
.shadow-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 170px;
  background: linear-gradient(135deg, #ffffff, #fff5f5);
  border: 3px solid #ffe3e3;
  border-radius: 30px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 10px 25px rgba(255, 118, 117, 0.12);
  margin: 6px 0;
}

.shadow-sprite {
  font-size: 108px; /* 影子大幅放大 */
  filter: brightness(0) drop-shadow(0 12px 18px rgba(0,0,0,0.32));
  transition: transform 0.2s ease-out;
  display: inline-block;
}

.overlap-stage {
  position: relative;
}

.overlap-1 {
  position: absolute;
  left: calc(50% - 85px);
  opacity: 0.88;
}

.overlap-2 {
  position: absolute;
  right: calc(50% - 85px);
  opacity: 0.88;
}

/* ================== 【記憶】順序記憶 ================== */
.memory-status-prompt {
  font-size: 18px;
  font-weight: 900;
  color: #2d3436;
  min-height: 32px;
}

.reverse-badge {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: #fff;
  padding: 6px 18px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.memory-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 160px;
}

.memory-display-box {
  width: 168px;
  height: 168px;
  background: #ffffff;
  border: 4px solid #dbeafe;
  border-radius: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 14px 30px rgba(116, 185, 255, 0.2);
}

.memory-placeholder {
  font-size: 60px;
  opacity: 0.4;
}

.memory-card-num {
  font-size: 14px;
  font-weight: 900;
  color: #2563eb;
}

.memory-card-icon {
  font-size: 78px; /* 符號大幅放大 */
}

.memory-progress-dots {
  display: flex;
  gap: 12px;
  margin: 6px 0;
}

.mem-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #64748b;
  box-shadow: 0 3px 6px rgba(0,0,0,0.06);
}

.mem-dot.dot-filled {
  background: #2ed573;
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(46, 213, 115, 0.4);
}

.memory-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 540px;
  margin-top: auto;
}

.mem-btn {
  background: #ffffff;
  border: 3px solid #cbd5e1;
  border-radius: 22px;
  padding: 16px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 6px 0 #94a3b8;
  transition: transform 0.12s;
  min-height: 72px;
}

.mem-btn:hover {
  border-color: #3b82f6;
}

.mem-btn:active, .mem-btn.correct-tap {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #94a3b8;
  background: #eff6ff;
}

.mem-btn-icon {
  font-size: 42px;
}

/* ================== 【分析】天平比重 ================== */
.analyze-question-header {
  font-size: 24px;
  font-weight: 900;
}

.heavy-tag {
  color: #d63031;
  background: #ffeaa7;
  padding: 6px 20px;
  border-radius: 24px;
  box-shadow: 0 4px 10px rgba(254, 202, 87, 0.35);
}

.light-tag {
  color: #0984e3;
  background: #dff9fb;
  padding: 6px 20px;
  border-radius: 24px;
  box-shadow: 0 4px 10px rgba(116, 185, 255, 0.35);
}

.seesaws-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
  width: 100%;
  flex: 1;
  min-height: 140px;
  flex-wrap: wrap;
}

.seesaw-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 175px;
}

.seesaw-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seesaw-beam {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 8px;
  background: #94a3b8;
  border-radius: 4px;
  z-index: 1;
}

.seesaw-pan {
  z-index: 2;
  font-size: 44px; /* 天平上動物加大 */
  background: #ffffff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
  border: 3px solid #e2e8f0;
}

.seesaw-fulcrum {
  font-size: 28px;
  color: #ff7675;
  margin-top: -10px;
  z-index: 0;
}

/* ================== 【數字】戳氣球加法 ================== */
.compute-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 560px;
  background: #ffffff;
  padding: 12px 22px;
  border-radius: 22px;
  border: 2px solid #fed330;
  box-shadow: 0 6px 18px rgba(254, 211, 48, 0.2);
}

.compute-target-tag {
  font-size: 18px;
  font-weight: 900;
  color: #2d3436;
}

.target-number {
  font-size: 30px; /* 目標數字加粗大 */
  color: #ff4757;
}

.compute-current-sum {
  font-size: 17px;
  font-weight: 800;
  color: #00b894;
}

.compute-current-sum span {
  font-size: 26px;
  font-weight: 900;
}

.balloons-sky {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 600px;
  padding: 16px 0;
}

.balloon-item {
  width: 96px;
  height: 120px; /* 氣球加大，方便手機戳擊 */
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  box-shadow: inset -8px -8px 16px rgba(0,0,0,0.18), 0 10px 22px rgba(0,0,0,0.15);
  transition: transform 0.15s, opacity 0.15s;
}

.balloon-item:hover {
  transform: scale(1.08) !important;
}

.balloon-num {
  font-size: 34px; /* 氣球數字超清晰 */
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.balloon-string {
  position: absolute;
  bottom: -18px;
  width: 3px;
  height: 18px;
  background: #b2bec3;
}

/* ================== 【知覺】鐵道接軌 ================== */
.visualize-prompt {
  font-size: 18px;
  font-weight: 900;
  color: #4a5568;
}

.railroad-world {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.train-depot {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  padding: 14px 10px;
  border-radius: 22px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  width: 76px;
}

.train-icon, .station-icon {
  font-size: 44px; /* 火車與車站加大 */
}

.depot-tag {
  font-size: 14px;
  font-weight: 900;
  color: #64748b;
  margin-top: 4px;
}

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  grid-template-rows: repeat(3, 92px);
  gap: 8px;
  background: #cbd5e1;
  padding: 10px;
  border-radius: 24px;
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.12);
  transition: box-shadow 0.3s;
}

.tracks-grid.grid-solved {
  box-shadow: 0 0 35px #2ed573, inset 0 0 20px #2ed573;
}

.track-cell {
  width: 92px;
  height: 92px;
  border: none;
  border-radius: 16px;
  background: #ffffff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #94a3b8;
  transition: transform 0.12s;
}

.track-cell:active {
  transform: scale(0.95);
}

.rock-icon {
  font-size: 42px;
}

/* ================== 【雙人對抗】 ================== */
.versus-arena-layout {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
}

.versus-scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-radius: 26px;
  padding: 14px 24px;
  border: 2px solid #e2e8f0;
}

.player-score-block {
  display: flex;
  flex-direction: column;
  width: 36%;
}

.p-score-val {
  font-size: 38px;
  font-weight: 900;
}

.vs-choices-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.vs-choice-btn {
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 20px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 6px 0 #cbd5e0;
  min-height: 85px;
}

.opt-emoji {
  font-size: 42px;
  margin: 4px 0;
}

.opt-name, .opt-number {
  font-size: 16px;
  font-weight: 900;
}

.opt-number {
  font-size: 26px;
}

/* 手機適配微調 */
@media (max-width: 600px) {
  .tracks-grid {
    grid-template-columns: repeat(3, 76px);
    grid-template-rows: repeat(3, 76px);
  }
  .track-cell {
    width: 76px;
    height: 76px;
  }
  .choices-grid {
    gap: 10px;
  }
  .choice-icon {
    font-size: 38px;
  }
  .choice-name {
    font-size: 16px;
  }
  .shadow-sprite {
    font-size: 84px;
  }
  .vs-choices-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
