/* ==========================================================================
   Parentia v111 — Pio Live 2.5D Interactive Pet Engine Styles
   ========================================================================== */

.pl-wrap {
  max-width: 940px;
  margin: 16px auto 52px;
  padding: 0 14px;
}

.pl-stage-shell {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: #1E183C;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 48px -22px rgba(26, 16, 51, 0.42);
  margin-bottom: 14px;
  user-select: none;
  -webkit-user-select: none;
}

.pl-canvas-box {
  position: relative;
  width: 100%;
  height: 450px;
  touch-action: none;
  cursor: grab;
}
.pl-canvas-box:active {
  cursor: grabbing;
}

@media (max-width: 640px) {
  .pl-canvas-box {
    height: 416px;
  }
}
@media (max-width: 360px) {
  .pl-canvas-box {
    height: 396px;
  }
}

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

/* Overlay Atas Terpadu (HUD + Balon Bicara tidak pernah saling timpa!) */
.pl-top-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.pl-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  pointer-events: none;
}

.pl-star-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 251, 235, 0.95);
  color: #92400E;
  border: 2px solid #FCD34D;
  border-radius: 99px;
  padding: 6px 13px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.pl-hud-right {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pl-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  color: #1E1B4B;
  border-radius: 12px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}
.pl-stat-bar {
  width: 34px;
  height: 7px;
  border-radius: 99px;
  background: #E2E8F0;
  overflow: hidden;
}
.pl-stat-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition-property: width, background-color;
  transition-duration: 240ms;
  transition-timing-function: ease-out;
}

.pl-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  color: #1E1B4B;
  font-size: 19px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
  transition-property: transform, background-color;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}
.pl-icon-btn:active {
  transform: scale(0.93);
}
.pl-icon-btn.night-on {
  background: #312E81;
  color: #FDE047;
  border-color: #818CF8;
}

@media (max-width: 560px) {
  .pl-stat-bar,
  .pl-star-word {
    display: none;
  }
  .pl-stat-chip {
    padding: 4px 7px;
    font-size: 11px;
    gap: 3px;
  }
  .pl-star-pill {
    font-size: 14px;
    padding: 5px 10px;
  }
  .pl-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 16px;
  }
}

/* Balon Bicara Pio Mengambang */
.pl-speech-wrap {
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.pl-speech {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  color: #1E1B4B;
  border: 2px solid rgba(124, 92, 252, 0.25);
  border-radius: 16px;
  padding: 6px 13px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.3;
  max-width: 470px;
  text-align: center;
  text-wrap: balance;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  transition-property: transform, opacity;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
.pl-speech.pop {
  transform: scale(1.04);
}

/* Petunjuk Zona Sentuh Halus di Bawah Panggung */
.pl-stage-hint {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.pl-stage-hint span {
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 99px;
  text-align: center;
}
@media (max-width: 520px) {
  .pl-stage-hint {
    bottom: 7px;
  }
  .pl-stage-hint span {
    font-size: 10.8px;
    line-height: 1.25;
    padding: 4px 10px;
    border-radius: 12px;
  }
}

/* Nampan Alat Interaktif Langsung (5 Mode Aksi) */
.pl-mode-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pl-mode-btn {
  min-height: 60px;
  border-radius: 18px;
  border: 2px solid #E5DFF6;
  background: #fff;
  color: var(--navy);
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.15;
  box-shadow: 0 4px 0 #E5DFF6;
  transition-property: transform, border-color, background-color, box-shadow;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}
.pl-mode-btn .pm-ic {
  font-size: 23px;
  line-height: 1;
}
.pl-mode-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #E5DFF6;
}
.pl-mode-btn.on {
  border-color: #7C5CFC;
  background: linear-gradient(180deg, #F5F0FF 0%, #EDE5FF 100%);
  color: #5B21B6;
  box-shadow: 0 4px 0 #7C5CFC;
}

@media (max-width: 420px) {
  .pl-mode-bar {
    gap: 5px;
  }
  .pl-mode-btn {
    min-height: 56px;
    border-radius: 15px;
    font-size: 11px;
    padding: 6px 2px;
  }
  .pl-mode-btn .pm-ic {
    font-size: 20px;
  }
}

/* Sub-Tray Kontekstual (Seret Makanan / Alat Mandi / Mikrofon Tiru Suara / Bola) */
.pl-subtray {
  background: #fff;
  border: 2px solid #E9E2FA;
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: 0 12px 26px -18px rgba(26, 16, 51, 0.22);
}

.pl-subtray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.pl-subtray-head b {
  font-family: 'Baloo 2', cursive;
  font-size: 17px;
  color: var(--navy);
  line-height: 1.2;
}
.pl-subtray-head span {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate);
}

/* Grid Makanan Seret-Lepas */
.pl-food-tray {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 480px) {
  .pl-food-tray {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pl-food-card {
  position: relative;
  background: #FCFBF8;
  border: 2px dashed #FCD34D;
  border-radius: 16px;
  padding: 10px 8px;
  text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition-property: transform, background-color, border-color;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}
.pl-food-card:hover {
  background: #FFFBEB;
  border-color: #F59E0B;
}
.pl-food-card:active {
  transform: scale(0.96);
}
.pl-food-card .fc-em {
  font-size: 34px;
  line-height: 1.1;
  display: block;
  pointer-events: none;
}
.pl-food-card b {
  display: block;
  font-size: 13px;
  color: var(--navy);
  margin-top: 3px;
  pointer-events: none;
}
.pl-food-card small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #B45309;
  margin-top: 2px;
  pointer-events: none;
}

/* Hantu Item Melayang saat Diseret Jari */
.pl-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 68px;
  height: 68px;
  margin-left: -34px;
  margin-top: -34px;
  z-index: 999;
  pointer-events: none;
  display: grid;
  place-items: center;
  font-size: 48px;
  filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.32));
  will-change: transform;
}

/* Alat Mandi & Main & Sentuh Cepat */
.pl-tool-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
}

.pl-tool-chip {
  min-height: 54px;
  border-radius: 16px;
  border: 2px solid #E2E8F0;
  background: #F8FAFC;
  color: var(--navy);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-weight: 800;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition-property: transform, border-color, background-color;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}
.pl-tool-chip .tc-ic {
  font-size: 26px;
  flex: none;
}
.pl-tool-chip small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate);
}
.pl-tool-chip.active {
  border-color: #0EA5E9;
  background: #E0F2FE;
  color: #0369A1;
}
.pl-tool-chip:active {
  transform: scale(0.98);
}

/* Panel Rekam Suara (Talking Pio) */
.pl-mimic-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pl-mic-btn {
  min-height: 52px;
  border: none;
  border-radius: 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #EC4899, #DB2777);
  color: #fff;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 5px 0 #9D174D;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition-property: transform, box-shadow, opacity;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}
.pl-mic-btn:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #9D174D;
}
.pl-mic-btn.rec {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 5px 0 #991B1B;
  animation: plPulseRec 0.9s ease-in-out infinite alternate;
}
@keyframes plPulseRec {
  from { transform: scale(1); }
  to   { transform: scale(1.04); }
}

/* Judul Seksi Lemari Bintang */
.pl-wardrobe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
  flex-wrap: wrap;
}
.pl-wardrobe-head h3 {
  font-family: 'Baloo 2', cursive;
  font-size: 21px;
  color: var(--navy);
  margin: 0;
}

@media print {
  .pl-stage-shell,
  .pl-mode-bar,
  .pl-subtray,
  .pl-wardrobe-head,
  .pio-shop-tabs,
  .pio-items {
    display: none !important;
  }
}
