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

body {
  margin: 0;
  padding: 1.5rem;
  font-family: "Carlito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.wa-header {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
}

.wa-header h1 {
  margin: 0 0 .25rem;
  font-size: 1.6rem;
}

.wa-subtitle {
  margin: 0;
  font-size: .95rem;
  color: #4b5563;
}

.wa-section {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
}

/* Front-view examples */
.bird-example-strip {
  background: #ffffff;
  border: 1px solid #d8dee8;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.bird-example-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.bird-example-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.bird-example-header p {
  margin: 0;
  color: #4b5563;
  font-size: .9rem;
}

.bird-example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.bird-example-card {
  margin: 0;
  min-width: 0;
}

.bird-example-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: .75rem;
  border: 1px solid #e5e7eb;
  background: #e5e7eb;
}

.bird-example-card figcaption {
  margin-top: .35rem;
  font-size: .85rem;
  font-weight: 700;
  color: #374151;
}

/* Bird selector */
.wa-label {
  display: block;
  margin-bottom: .25rem;
  font-size: .95rem;
}

.wa-select {
  padding: .4rem .6rem;
  border-radius: .5rem;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: .95rem;
}

/* Panels */
.wa-panels {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.wa-panel {
  flex: 1 1 320px;
  background: #ffffff;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.wa-panel-title {
  margin: 0 0 .75rem;
  font-size: 1.1rem;
}

/* Video wrapper + overlay seek */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 0 0 .75rem;
  border-radius: .75rem;
  background: #000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: .75rem;
  cursor: pointer;
}

/* Overlay progress bar */
.overlay-seek {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  width: 100%;
  appearance: none;
  height: 5px;
  background: transparent;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.overlay-seek::-webkit-slider-runnable-track {
  height: 5px;
  background: rgba(255,255,255,0.35);
  border-radius: 999px;
}

.overlay-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

.overlay-seek::-moz-range-track {
  height: 5px;
  background: rgba(255,255,255,0.35);
  border-radius: 999px;
}

.overlay-seek::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

/* Controls row */
.controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .75rem 0 0;
  flex-wrap: wrap;
}

.wa-small-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
}

/* Speed slider */
.slider {
  appearance: none;
  width: 200px;
  max-width: 50vw;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  outline: none;
  transition: background 0.2s;
}

.slider:hover {
  background: #d1d5db;
}

.slider::-webkit-slider-thumb,
.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #111827;
  border: 2px solid #ffffff;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
  cursor: pointer;
}

/* Buttons */
.wa-btn {
  border: none;
  border-radius: 999px;
  padding: .35rem .9rem;
  font-size: .85rem;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  white-space: nowrap;
}

.wa-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.wa-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 7px rgba(37, 99, 235, 0.4);
}

.wa-btn-ghost {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 0 0 1px #d1d5db;
}

.wa-btn-ghost:hover {
  background: #f9fafb;
}

/* Snapshots */
.wa-snapshot {
  margin-top: .75rem;
  font-size: .8rem;
}

.wa-snapshot-label {
  display: block;
  margin-bottom: .3rem;
  color: #6b7280;
}

.wa-snapshot-img {
  min-height: 80px;
  border-radius: .75rem;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: #9ca3af;
  overflow: hidden;
}

.wa-snapshot-img img {
  width: 100%;
  display: block;
}

/* ONION-SKIN */

.wa-onion-wrap {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.wa-onion-title {
  margin: 0 0 .4rem;
  font-size: 1.05rem;
}

.wa-onion-hint {
  margin: 0 0 .6rem;
  font-size: .85rem;
  color: #4b5563;
}

.wa-onion-box {
  position: relative;
  min-height: 160px;
  border-radius: .75rem;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: .85rem;
}

/* container that holds both images */
.wa-onion-stack {
  position: relative;
  width: 100%;
  height: auto;       /* driven by start image */
}

/* base style */
.wa-onion-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Start image - defines height */
.wa-onion-start {
  opacity: 0.55;
  position: relative;
}

/* End image - overlaps */
.wa-onion-end {
  opacity: 0.55;
  mix-blend-mode: multiply;
  position: absolute;
  inset: 0;
}

/* POSE DESIGNER */

.pose-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.pose-header h2 {
  margin: 0 0 .25rem;
  font-size: 1.2rem;
}

.pose-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.pose-card {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.pose-card-header {
  min-height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .45rem;
}

.pose-card-header h3 {
  margin: 0;
  color: #111827;
  font-size: 1rem;
  line-height: 1.2;
}

.pose-pegboard {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 1.25rem;
  border: 1px solid #d1d5db;
  background-image:
    radial-gradient(circle, #d1d5db 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(249,250,251,1));
  background-size: 16px 16px, 100% 100%;
  background-position: center;
  box-shadow: 0 10px 18px rgba(148, 163, 184, 0.25);
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pose-pegboard canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.pose-btn {
  align-self: center;
  margin-top: .75rem;
  width: 80%;
}

/* DRAWING BOARD */

.wa-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wa-board-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.wa-board-hint {
  margin: .35rem 0 .75rem;
  font-size: .9rem;
  color: #4b5563;
}

.wa-board-wrap {
  border-radius: 1rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
  user-select: none;
}

#sketchCanvas {
  width: 100%;
  height: auto;
  display: block;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}


.pose-actions {
  margin-top: .75rem;
  display: flex;
  gap: .5rem;
  width: 100%;
  justify-content: center;
}

.pose-actions .pose-btn {
  width: auto;
  flex: 1 1 auto;
}

@media (max-width: 720px) {
  body {
    padding: 1rem;
  }

  .bird-example-header {
    display: block;
  }

  .bird-example-header p {
    margin-top: .25rem;
  }

  .bird-example-grid {
    grid-template-columns: 1fr;
  }

  .pose-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .pose-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

}
