/* Espresso Machine assembly puzzle · game page styles (en/zh share this file) */
[hidden] { display: none !important; }

.panel {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  width: 100%;
  margin-top: 16px;
}

.assembly {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.assembly svg { display: block; width: 100%; height: auto; touch-action: none; }

/* ===== HUD ===== */
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
}
.stats { display: flex; flex-wrap: wrap; gap: 20px; }
.stat { font-size: 14px; font-weight: 600; color: #475569; }
.stat .hl { color: #2563eb; font-weight: 700; }
.stat .err { color: #be123c; font-weight: 700; }

button.act {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  padding: 10px 20px;
  transition: all 0.2s;
  font-family: inherit;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
button.act.primary { background: #2563eb; color: #ffffff; }
button.act:hover { opacity: 0.88; transform: translateY(-1px); }
button.act:active { transform: translateY(0); }

/* ===== parts tray ===== */
.tray {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px;
  padding: 16px;
}
.chip {
  padding: 10px 4px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: grab;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, opacity 0.25s;
  user-select: none;
  touch-action: none;
  -webkit-user-select: none;
}
.chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  transform: translateY(-2px);
}
.chip svg { width: 42px; height: 42px; pointer-events: none; }
.chip .chip-name {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
}
.chip.dragging { opacity: 0.3; }
.chip.placed {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}
.chip.drag-ghost {
  position: fixed;
  left: 0; top: 0;
  width: 90px;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.06);
  opacity: 0.96;
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
}

.status-bar {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  min-height: 20px;
}
.status-bar .ok { color: #047857; font-weight: 700; }
.status-bar .no { color: #be123c; font-weight: 700; }

.action-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
}
.controls { display: flex; gap: 12px; flex: 0 0 auto; }

/* ===== completion panel ===== */
.result { text-align: center; padding: 30px 20px; }
.result h2 { font-size: 20px; color: #1e293b; margin-bottom: 10px; }
.result .result-score { font-size: 18px; color: #475569; font-weight: 600; }
.result .result-score strong { color: #2563eb; font-size: 24px; }
.result .result-score .er { color: #be123c; }
.result .result-msg { margin-top: 10px; font-size: 14px; color: #5b6472; line-height: 1.6; }
.result button { margin-top: 18px; }

/* ===== SVG part visibility & animation ===== */
.part { opacity: 0; transition: opacity 0.35s ease; }
.part.visible { opacity: 1; }
.label { opacity: 0; transition: opacity 0.4s ease; }
.label.visible { opacity: 1; }

.part.pop { animation: pop 0.45s ease; transform-box: fill-box; transform-origin: center; }
@keyframes pop {
  0%   { transform: scale(0.82); }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ===== placement dashed boxes ===== */
.ghost {
  fill: #eef4ff;
  fill-opacity: 0.35;
  stroke: #2563eb;
  stroke-width: 2;
  stroke-dasharray: 9 8;
  opacity: 0.6;
  transition: opacity 0.2s, stroke 0.2s, fill-opacity 0.2s;
}
.ghost.target {
  stroke: #16a34a;
  fill: #dcfce7;
  fill-opacity: 0.5;
  opacity: 1;
}
.ghost.hint { animation: hintPulse 1.1s ease-in-out 2; }
@keyframes hintPulse {
  0%, 100% { opacity: 0.45; stroke: #2563eb; }
  50%      { opacity: 1; stroke: #16a34a; }
}
.ghost.shake { animation: zoneShake 0.45s ease; stroke: #be123c; }
@keyframes zoneShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-9px); }
  75%      { transform: translateX(9px); }
}

.steam-wave { fill: none; stroke: #cbd5e1; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.coffee-drop { fill: #7c2d12; opacity: 0; }
.pulse-glow { animation: glowPulse 1s ease-in-out infinite; }
@keyframes glowPulse {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .part, .label { transition: none; }
  .chip { transition: none; }
  .part.pop { animation: none; }
  .ghost.hint, .ghost.shake { animation: none; }
  .pulse-glow { animation: none; opacity: 0.3; }
  button.act { transition: none; }
}

@media (max-width: 600px) {
  .tray { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
  .chip svg { width: 36px; height: 36px; }
  .hud { padding: 12px 14px; }
  .stats { gap: 14px; }
  .action-panel { justify-content: center; }
  .action-panel .controls { width: 100%; justify-content: center; }
}