/* 七巧板专属样式（公共组件、变量见 ../../style.css）
   复用护眼童趣主题：暖色底、降饱和柔和配色、大圆角 */

/* 布局：与其他游戏统一的 grid 侧边栏 + 主区 */
#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
  width: 100%;
  max-width: 900px;
}

#sidebar {
  background: var(--panel);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.actions { display: flex; flex-direction: column; gap: 8px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row .btn { padding: 10px 8px; }

/* 主区 */
#play-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-height: 500px;
}

.tangram-svg {
  width: 100%;
  height: 100%;
  max-width: 550px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

/* 板块上禁用浏览器手势，确保任意方向拖拽都灵敏 */
.tangram-svg .piece {
  touch-action: none;
}

/* 目标轮廓外框 */
.outline-frame {
  fill: var(--panel);
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 8 4;
}

.puzzle-title {
  font-size: 18px;
  font-weight: 600;
  fill: var(--text);
  font-family: inherit;
}

/* 目标板块轮廓（浅灰虚线） */
.target-piece {
  fill: none;
  stroke: #cbb89a;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

/* 入门难度：分解式，分割线更明显 */
.beginner-outline {
  fill: #f3ead2;
  stroke: #c2b08a;
  stroke-width: 1;
}

/* 提示高亮 */
.hint-target {
  fill: #fbeecb;
  stroke: #f59e0b;
  stroke-width: 2.5;
  animation: hint-pulse 1s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 托盘背景 */
.tray-bg {
  fill: #f0e9d6;
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.tray-label {
  font-size: 14px;
  fill: #9a8d76;
  font-family: inherit;
  font-weight: 500;
}

/* 板块 */
.piece {
  cursor: grab;
  transition: filter 0.15s ease;
}
.piece:active { cursor: grabbing; }

.piece.selected path {
  stroke: var(--primary) !important;
  stroke-width: 3 !important;
  filter: drop-shadow(0 2px 6px rgba(61, 101, 148, 0.35));
}

.piece.snapped path {
  stroke: #10b981 !important;
  stroke-width: 2 !important;
  filter: drop-shadow(0 1px 3px rgba(16, 185, 129, 0.3));
}

/* 胜利弹窗按钮区 */
.win-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.win-actions .btn {
  padding: 10px 20px;
  font-size: 14px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: #9a8d76;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: #efe6cf;
  color: var(--text);
}

/* 响应式 */
@media (max-width: 640px) {
  #app { grid-template-columns: 1fr; max-width: 100%; }
  #play-area { padding: 22px 16px; min-height: 300px; }
  .hints-tip { display: none; }
}
