/* ============================================================================
 * OUYI PAL-OS · iOS/ANDROID DYNAMIC ISLAND, FULL-BODY MONSTER COMPANION &
 * POKEMON / PALWORLD / DIGIMON GENERATOR STUDIO (`unified_companion.css`)
 * ============================================================================ */

/* Reserve sleek 44px top OS status strip when inside an app so Dynamic Island never overlaps app buttons */
body.has-palos-island {
  padding-top: 44px !important;
}
body.has-palos-island .kid-screen {
  height: calc(100vh - 44px) !important;
}

/* 1. SLEEK iOS / iPadOS DYNAMIC ISLAND TOP PILL (Inside the 5 Apps) */
.ouyi-dynamic-island {
  position: fixed;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  color: #F8FAFC;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}
.ouyi-dynamic-island:hover {
  background: rgba(15, 23, 42, 0.95);
}

.odi-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.odi-home-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.03);
}

.odi-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 2px;
}

.odi-app-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.odi-mini-app {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, background 0.15s ease;
}
.odi-mini-app:hover {
  transform: translateY(-2px) scale(1.1);
  background: rgba(255, 255, 255, 0.22);
}
.odi-mini-app.active {
  border-color: #38BDF8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.38);
  background: rgba(56, 189, 248, 0.22);
}

.odi-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #F1F5F9;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.odi-pill-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.odi-pill-btn.voice {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-color: #6EE7B7;
  color: #FFF;
}

/* ============================================================================
 * 2. FULL-BODY ANIMATED PAL / DIGIMON COMPANION STAGE (`#ouyiCompanionDock`)
 * ============================================================================ */
.ouyi-companion-dock {
  position: fixed;
  bottom: 12px;
  left: 14px;
  z-index: 99985;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", sans-serif;
  pointer-events: none;
}

.uc-fullbody-stage {
  pointer-events: auto;
  width: 154px;
  height: 174px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: grab;
  user-select: none;
}
.uc-fullbody-stage:active {
  cursor: grabbing;
}

.uc-monster-canvas {
  width: 154px;
  height: 154px;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.32));
  transition: transform 0.2s ease;
}
.uc-fullbody-stage:hover .uc-monster-canvas {
  transform: scale(1.05);
}

.uc-nameplate {
  margin-top: -8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(250, 204, 21, 0.65);
  color: #FEF08A;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.uc-eq-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}
.uc-fullbody-stage.speaking .uc-eq-bars {
  display: inline-flex;
}
.uc-eq-bar {
  width: 2.5px;
  background: #4ADE80;
  border-radius: 2px;
  animation: ucEqBounce 0.32s ease-in-out infinite alternate;
}
.uc-eq-bar:nth-child(2) { animation-delay: 0.1s; }
.uc-eq-bar:nth-child(3) { animation-delay: 0.2s; }
@keyframes ucEqBounce {
  0% { height: 3px; }
  100% { height: 10px; }
}

/* Crisp Anime / Palworld Speech & Command Bubble */
.uc-speech-bubble {
  pointer-events: auto;
  max-width: 340px;
  min-width: 240px;
  margin-bottom: 18px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  border-radius: 20px 20px 20px 6px;
  padding: 11px 13px;
  color: #F8FAFC;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.uc-speech-bubble.collapsed {
  display: none;
}

.uc-bubble-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.uc-bubble-tag {
  font-size: 11px;
  font-weight: 900;
  color: #38BDF8;
}
.uc-bubble-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #CBD5E1;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}

.uc-bubble-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.48;
  color: #FFFFFF;
  max-height: 82px;
  overflow-y: auto;
}

.uc-bubble-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.uc-b-chip {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #F1F5F9;
  cursor: pointer;
  transition: all 0.14s ease;
}
.uc-b-chip:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #7DD3FC;
}
.uc-b-chip.primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-color: #6EE7B7;
  color: #FFF;
}

.uc-ask-mini {
  display: flex;
  gap: 5px;
}
.uc-ask-mini input {
  flex: 1;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #FFF;
  font-size: 11.5px;
  outline: none;
}
.uc-ask-mini button {
  padding: 5px 10px;
  border-radius: 9px;
  border: none;
  background: #38BDF8;
  color: #0F172A;
  font-weight: 900;
  font-size: 11.5px;
  cursor: pointer;
}

/* ============================================================================
 * 3. POKEMON / PALWORLD / DIGIMON COMPANION GENERATOR MODAL (`#ouyiStudioModal`)
 * ============================================================================ */
.uc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 24, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99995;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", sans-serif;
}
.uc-modal-backdrop.open {
  display: flex;
}

.uc-generator-card {
  width: 100%;
  max-width: 1080px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(155deg, #0F172A 0%, #1E293B 100%);
  border: 2px solid rgba(56, 189, 248, 0.45);
  border-radius: 28px;
  padding: 22px 26px;
  color: #F8FAFC;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7);
}

.uc-gen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 18px;
}
.uc-gen-title {
  font-size: 21px;
  font-weight: 900;
  background: linear-gradient(90deg, #38BDF8, #A855F7, #FACC15);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.uc-gen-close {
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

/* AI Prompt DNA Hatcher Bar */
.uc-prompt-hatcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(56, 189, 248, 0.09);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 18px;
  align-items: center;
}
.uc-prompt-hatcher input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.75);
  color: #FFF;
  font-size: 13.5px;
  font-weight: 700;
  outline: none;
}
.uc-prompt-hatcher input:focus {
  border-color: #38BDF8;
}

.uc-hatch-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 900;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.14s ease, filter 0.14s ease;
}
.uc-hatch-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.uc-hatch-btn.hatch {
  background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  color: #FFF;
}
.uc-hatch-btn.random {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  color: #FFF;
}
.uc-hatch-btn.evolve {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFF;
}

.uc-gen-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 22px;
}
@media (max-width: 820px) {
  .uc-gen-layout { grid-template-columns: 1fr; }
}

.uc-holo-chamber {
  background:
    radial-gradient(circle at 50% 62%, rgba(56, 189, 248, 0.25) 0%, rgba(15, 23, 42, 0.95) 72%);
  border: 2px solid rgba(56, 189, 248, 0.45);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.uc-preview-canvas {
  width: 240px;
  height: 240px;
  cursor: pointer;
}

.uc-part-group {
  margin-bottom: 13px;
}
.uc-part-title {
  font-size: 12px;
  font-weight: 900;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: block;
}
.uc-part-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.uc-part-pill {
  padding: 7px 12px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #E2E8F0;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}
.uc-part-pill:hover {
  background: rgba(255, 255, 255, 0.14);
}
.uc-part-pill.active {
  background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  border-color: #93C5FD;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
