:root {
  --pp-bg-0: #f6f3ea;
  --pp-bg-1: #e6e2d5;
  --pp-panel: #fffdf8;
  --pp-border: #d2c9b8;
  --pp-ink: #3f372c;
  --pp-soft-ink: #655a4d;
  --pp-accent: #5d7f57;
  --pp-good: #507c4e;
  --pp-warn: #9f4b43;
  --pp-focus: #3f75d1;
}

html,
body {
  min-height: 100%;
}

body {
  color: var(--pp-ink);
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.45), transparent 34%),
    radial-gradient(circle at 88% 80%, rgba(222, 230, 216, 0.45), transparent 28%),
    linear-gradient(135deg, var(--pp-bg-0) 0%, var(--pp-bg-1) 100%);
}

.pp-shell {
  max-width: 1180px;
}

.pp-header,
.pp-panel {
  border: 1px solid var(--pp-border);
  border-radius: 16px;
  background: var(--pp-panel);
  box-shadow: 0 12px 30px rgba(68, 56, 39, 0.08);
}

.pp-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pp-soft-ink);
}

.pp-bag {
  border: 1px solid var(--pp-border);
  border-radius: 12px;
  padding: 0.75rem;
  background: #f8f5ed;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.75rem;
  align-items: center;
}

.pp-bag-image {
  width: 100%;
  max-width: 72px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(210, 201, 184, 0.25);
}

.pp-item-prompt {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.pp-queue {
  color: var(--pp-soft-ink);
  font-size: 0.95rem;
}

.pp-item-slot {
  min-height: 136px;
  border: 1px dashed #c6b9a1;
  border-radius: 12px;
  padding: 0.75rem;
  background: #fbf9f3;
}

.pp-item-card {
  border: 1px solid #b6ad9f;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(70, 59, 43, 0.14);
  min-height: 94px;
  display: grid;
  align-items: center;
  justify-items: center;
  font-size: 1.18rem;
  font-weight: 700;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.pp-item-card.is-dragging {
  position: fixed;
  z-index: 9999;
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.02);
}

.pp-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.pp-hud-card {
  border: 1px solid var(--pp-border);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  background: #f8f5ed;
}

.pp-hud-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--pp-soft-ink);
  letter-spacing: 0.05em;
}

.pp-hud-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.pp-feedback {
  min-height: 1.4rem;
  font-weight: 700;
}

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

.pp-tile {
  border: 1px solid #bfb39f;
  border-radius: 12px;
  background: #fdfbf5;
  min-height: 150px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.pp-tile.is-hovered {
  border-color: var(--pp-focus);
  background-color: #f2f7ff;
  box-shadow:
    0 0 0 3px rgba(63, 117, 209, 0.28),
    0 8px 16px rgba(63, 117, 209, 0.16);
  transform: translateY(-2px);
}

.pp-tile-media {
  display: grid;
  place-items: center;
  background:
    linear-gradient(170deg, rgba(235, 239, 229, 0.5), rgba(240, 234, 223, 0.6));
}

.pp-tile-media img {
  width: 84%;
  height: 84%;
  object-fit: contain;
}

.pp-tile-fallback {
  width: 84%;
  height: 84%;
  border-radius: 10px;
  border: 1px dashed #bcb09a;
  display: grid;
  place-items: center;
  color: #7d6f5f;
  font-weight: 700;
  padding: 0.25rem;
  text-align: center;
}

.pp-tile-label {
  border-top: 1px solid #d3cab9;
  background: #faf6ec;
  padding: 0.45rem 0.5rem;
  font-size: 0.92rem;
  text-align: center;
  font-weight: 700;
  transition: background-color 120ms ease, color 120ms ease;
}

.pp-tile.is-hovered .pp-tile-label {
  background: #e7f0ff;
  color: #244f95;
}

.pp-result {
  border: 1px solid var(--pp-border);
  border-radius: 10px;
  background: #faf7ef;
  padding: 0.6rem;
  display: grid;
  gap: 0.2rem;
}

.pp-result span {
  font-size: 0.73rem;
  color: var(--pp-soft-ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pp-result strong {
  font-size: 1.08rem;
}

.pp-good {
  color: var(--pp-good);
}

.pp-warn {
  color: var(--pp-warn);
}

@media (max-width: 991.98px) {
  .pp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .pp-tile {
    min-height: 120px;
  }

  .pp-tile-media img {
    width: 70%;
    height: 70%;
  }

  .pp-tile-label {
    font-size: 0.78rem;
    padding: 0.3rem 0.35rem;
  }
}

@media (max-width: 575.98px) {
  .pp-shell {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .pp-header {
    padding: 0.75rem;
    margin-bottom: 0.6rem;
  }

  .pp-header h1 {
    font-size: 1.55rem;
    margin-bottom: 0.35rem;
  }

  .pp-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .pp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .pp-tile {
    min-height: 104px;
    border-radius: 10px;
  }

  .pp-tile-media img {
    width: 64%;
    height: 64%;
  }

  .pp-tile-label {
    font-size: 0.72rem;
    padding: 0.24rem 0.25rem;
  }

  .pp-item-slot {
    min-height: 92px;
    padding: 0.5rem;
  }

  .pp-item-card {
    min-height: 68px;
    font-size: 1rem;
  }

  .pp-feedback {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
  }
}
