@charset "utf-8";

.minipet-widget-floating {
  position: fixed;
  top: 100px;
  right: 40px;
  cursor: move;
  z-index: 9999;
}

/* =========================================================
   기본 위젯 컨테이너
========================================================= */
.minipet-widget {
  width: 270px;
  box-sizing: border-box;
  font-family: 'Mabiyet', sans-serif;
}

.minipet-widget-empty {
  width: 270px;
  padding: 10px 8px;
  text-align: center;
  font-size: 11px;

  color: rgba(255,255,255,0.9);
  background: rgba(5,5,15,0.9);
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.22);
}

.minipet-widget-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

/* ==============================
   TV 모양 본체
============================== */
.minipet-egg {
  position: relative;
  width: 270px;
  height: 190px;
  box-sizing: border-box;

  border-radius: 16px;
  border: 1px solid #fff;
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);

  background: radial-gradient(
    circle at 30% 30%,
    var(--egg-color1, #ffc164),
    var(--egg-color2, #f6a53b)
  );
}

.minipet-egg::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 14px;
  right: 14px;
  bottom: 20px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0.55;

  background: linear-gradient(
    to left bottom,
    rgba(255,255,255,0.9) 0%,
    rgba(255,255,255,0.1) 40%,
    rgba(255,255,255,0) 100%
  );
}



/* ==============================
   화면 영역 (흰색 직사각형)
============================== */
.minipet-egg-screen {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);

  width: 180px;
  height: 120px;

  border-radius: 16px;
  overflow: hidden;

  background-color: #ffffff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  box-shadow: inset 0 0 10px rgba(0,0,0,0.18);
}

.minipet-egg-screen-placeholder {
  width: 100%;
  height: 100%;
  opacity: 0.5;
  background-image: linear-gradient(
      135deg,
      rgba(0,0,0,0.02) 25%,
      transparent 25%,
      transparent 50%,
      rgba(0,0,0,0.02) 50%,
      rgba(0,0,0,0.02) 75%,
      transparent 75%,
      transparent
  );
  background-size: 12px 12px;
}

.minipet-egg-pet {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 10px;
}

.minipet-egg-pet img {
  max-width: 60%;
  max-height: 70%;
  image-rendering: auto;
  animation: minipet-bob 2.4s ease-in-out infinite;
}

/* ==============================
   대사 말풍선
============================== */
.minipet-egg-bubble {
  position: absolute;
  left: 50%;
  top: 32px;
  transform: translateX(-50%);

  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.4;
  color: #333;
  z-index: 99999;

  display: inline-block;
  width: auto;
  max-width: 90%;
  max-height: 80px;
  overflow-y: hidden;
  box-sizing: border-box;

  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  text-align: center;

  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.25) transparent;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}


.minipet-egg-bubble.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* ==============================
   하단 버튼 + 제목 바
============================== */

.minipet-egg-buttons {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);

  width: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.minipet-egg-button {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid #fff;
  background: var(--egg-button-color, #ffffff);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  flex-shrink: 0;
  position: relative;
}

.minipet-egg-button.btn-1,
.minipet-egg-button.btn-4 {
  top: -9px;
}

.minipet-egg-button.btn-2,
.minipet-egg-button.btn-3 {
  top: 5px;
}

.minipet-tv-title {
  flex: 1;
  margin: 0 6px;
  height: 18px;
}

.minipet-egg-button:active {
  transform: translateY(1px);
  box-shadow: 0 0 1px rgba(0,0,0,0.5);
}

.minipet-tv-title {
  flex: 1;
  margin: 0 1px;
  height: 18px;

  background: #111;
  border-radius: 999px;
  box-shadow:
    inset 0 0 3px rgba(0,0,0,0.8),
    0 0 4px rgba(0,0,0,0.4);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
  line-height: 1;
  font-family: 'Mabiyet', 'Courier New', monospace;
  color: #ccc;

  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  top: 5px;
}

.minipet-tv-title-text {
  animation: minipet-title-blink 1.7s steps(2, start) infinite;
}

@keyframes minipet-title-blink {
  0%, 50% { opacity: 1; }
  50.1%, 100% { opacity: 0.30; }
}



.minipet-egg-button:active {
  transform: translateY(1px);
  box-shadow: 0 0 1px rgba(0,0,0,0.5);
}

.minipet-select-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.minipet-select-box {
  width: 160px;
  padding: 12px;
  text-align: center;

  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.select-title {
  font-size: 13px;
  margin-bottom: 8px;
}

.minipet-select-list {
  width: 100%;
  font-size: 12px;
  margin-bottom: 10px;
}

.select-buttons {
  display: flex;
  justify-content: space-between;
}

.select-buttons button {
  width: 48%;
  padding: 4px 0;
  font-size: 12px;

  background: #f5f5f5;
  border: 1px solid #aaa;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 15px;
}

.minipet-color-overlay {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.minipet-color-box {
  width: 170px;
  padding: 12px;

  text-align: center;
  font-size: 12px;

  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.minipet-color-box .color-row {
  margin-bottom: 8px;
}

.minipet-color-box input[type="color"] {
  width: 70px;
  height: 24px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.minipet-color-buttons {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

.minipet-color-buttons button {
  flex: 1;
  padding: 3px 0;
  font-size: 11px;

  background: #f5f5f5;
  border: 1px solid #aaa;
  border-radius: 6px;
  cursor: pointer;
}

.minipet-egg-pet-img.egg-pet-shake { animation: eggShake 0.4s ease-in-out; }
.minipet-egg-pet-img.egg-pet-hop   { animation: eggHop   0.45s ease-out; }
.minipet-egg-pet-img.egg-pet-feed  { animation: eggFeed  0.5s ease-out; }

@keyframes eggShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-3px); }
  50%  { transform: translateX(3px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@keyframes eggHop {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-6px); }
  80%  { transform: translateY(0); }
  100% { transform: translateY(-2px); }
}

@keyframes eggFeed {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.04); }
  80%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}

.minipet-egg-pet-img {
  animation: minipet-bob 2.4s ease-in-out infinite;
}

@keyframes minipet-bob {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}