/* ── Layout ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  margin: 0;
  color: #1e293b;
  min-height: 100vh;
}

header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.header-btn {
  background: #6366f1;
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-block;
}
.header-btn:hover { background: #4f46e5; }

.page-main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease-in-out; }

.drag-card {
  cursor: grab;
  user-select: none;
  transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}
.drag-card:active { cursor: grabbing; }
.drag-card.dragging { opacity: 0.75; }
.drag-card.matched {
  border-color: #4ade80;
  background: #f0fdf4;
  color: #16a34a;
  cursor: default;
}
.drag-card.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.drop-slot {
  transition: border-color 0.15s, background 0.15s;
}
.drop-slot[draggable="true"] { cursor: grab; user-select: none; }
.drop-slot[draggable="true"]:active { cursor: grabbing; }
.drop-slot.dragging { opacity: 0.75; }
.drop-slot.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}
.drop-slot.matched {
  border-color: #4ade80;
  background: #f0fdf4;
  color: #16a34a;
  cursor: default;
}
