/* =============================================
   🏥 CLÍNICA DOS PETS — CSS v3
   ============================================= */

* { box-sizing: border-box; }

/* ── WRAPPER EXTERNO ── */
.ak-pet-game-box {
  max-width: 780px;
  margin: 0 auto 28px;
  background: #ffffff;
  border-radius: 30px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 18px 42px rgba(50,35,90,.14);
  font-family: "Segoe UI", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* ── INNER WRAP (borda colorida) ── */
.ak-pet-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  background: linear-gradient(135deg,#eaf9ff,#f0eeff);
  border: 5px solid #c8e8ff;
  border-radius: 26px;
  overflow: hidden;
}

/* ── CANVAS: aspect-ratio 720/500 = 1.44 ── */
#akPetCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 720 / 500;
  touch-action: none;
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* ── HUD (fora do canvas, dentro do inner) ── */
#akPetHud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 20;
  pointer-events: none;
}

.ak-pet-pill {
  background: rgba(255,255,255,.88);
  border: 2px solid rgba(200,232,255,.9);
  border-radius: 999px;
  padding: 6px 11px;
  color: #20205f;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(50,35,90,.10);
  line-height: 1.2;
}

/* ── BOTÃO FULLSCREEN (canto sup direito — IGUAL confeitaria) ── */
#akPetFsBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 30;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(200,232,255,.9);
  border-radius: 10px;
  background: rgba(255,255,255,.88);
  color: #20205f;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(50,35,90,.12);
  transition: transform .12s, background .12s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: all;
}
#akPetFsBtn:hover { transform: scale(1.1); background: #fff; }

/* ── BOTÃO CHAMAR / DAR ALTA ── */
#akPetNextBtn {
  position: absolute;
  right: 10px;
  top: 52px;
  z-index: 28;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg,#ff5fa2,#8c55ff);
  color: #fff;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(140,85,255,.38);
  transition: transform .12s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
#akPetNextBtn:hover { transform: scale(1.05); }

/* ── MENSAGEM FLUTUANTE ── */
#akPetMessage {
  position: absolute;
  left: 50%;
  /* posição em % do canvas para manter proporção */
  bottom: 20%;
  transform: translateX(-50%);
  background: rgba(32,24,82,.88);
  color: #fff;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 850;
  z-index: 30;
  max-width: 86%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: opacity .3s;
}

/* ── TOOLBAR FERRAMENTAS — fora do canvas, abaixo do inner ── */
#akPetTools {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 8px;
  padding: 10px 0 4px;
}

#akPetTools button {
  min-height: 58px;
  border: 3px solid rgba(180,220,255,.5);
  border-radius: 16px;
  background: linear-gradient(180deg,#ffffff,#eaf6ff);
  color: #20205f;
  font-size: 20px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(50,35,90,.12);
  transition: transform .12s, border-color .12s, background .12s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
#akPetTools button span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #6b6485;
  margin-top: 3px;
}
#akPetTools button:hover { transform: scale(1.05); border-color: #7ec8f8; }
#akPetTools button.ak-tool-active {
  background: linear-gradient(135deg,#59c8ff,#7c5cff);
  border-color: #7c5cff;
  color: #fff;
}
#akPetTools button.ak-tool-active span { color: rgba(255,255,255,.85); }

/* ── OVERLAY DE INÍCIO ── */
#akPetStartOverlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 21px;
  background:
    linear-gradient(rgba(16,8,50,.54),rgba(16,8,50,.54)),
    url("http://atividadekids.com/wp-content/uploads/2026/06/clinica-pets-bg.jpg") center/cover no-repeat;
  text-align: center;
}
#akPetStartOverlay.ak-hide { display: none; }

#akPetStartOverlay h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(24px,5vw,38px);
  font-weight: 950;
  line-height: 1.05;
  text-shadow: 0 4px 18px rgba(0,0,0,.32);
}
#akPetStartOverlay p {
  margin: 0 0 22px;
  max-width: 380px;
  color: #fff;
  font-size: clamp(13px,2.4vw,16px);
  font-weight: 800;
  line-height: 1.5;
}
.ak-start-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 36px;
  background: linear-gradient(135deg,#ff5f8f,#ff9f43);
  color: #fff;
  font-size: clamp(15px,2.8vw,18px);
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(255,95,143,.38);
  transition: transform .12s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.ak-start-btn:hover { transform: scale(1.04); }

/* ══════════════════════════════════════════
   FULLSCREEN — canvas estica, toolbar some
   ══════════════════════════════════════════ */
.ak-pet-game-box:fullscreen,
.ak-pet-game-box:-webkit-full-screen,
.ak-pet-game-box:-moz-full-screen {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  padding: 0;
  border-radius: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #0a0520;
}

.ak-pet-game-box:fullscreen .ak-pet-inner,
.ak-pet-game-box:-webkit-full-screen .ak-pet-inner,
.ak-pet-game-box:-moz-full-screen .ak-pet-inner {
  flex: 1;
  max-width: 100%;
  border-radius: 0;
  border: none;
}

.ak-pet-game-box:fullscreen #akPetCanvas,
.ak-pet-game-box:-webkit-full-screen #akPetCanvas,
.ak-pet-game-box:-moz-full-screen #akPetCanvas {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

/* toolbar fica visível mesmo em fullscreen (abaixo) */
.ak-pet-game-box:fullscreen #akPetTools,
.ak-pet-game-box:-webkit-full-screen #akPetTools,
.ak-pet-game-box:-moz-full-screen #akPetTools {
  padding: 8px 12px;
  background: #0a0520;
  flex-shrink: 0;
}

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 600px) {
  .ak-pet-game-box { padding: 8px; border-radius: 20px; }

  .ak-pet-inner { border-radius: 18px; border-width: 3px; }

  .ak-pet-pill  { font-size: 10px; padding: 5px 8px; }

  #akPetFsBtn   { width: 30px; height: 30px; font-size: 13px; top: 8px; right: 8px; }

  #akPetNextBtn { font-size: 10px; padding: 7px 12px; top: 46px; right: 8px; }

  #akPetMessage { font-size: 11px; padding: 6px 12px; bottom: 19%; }

  #akPetTools { gap: 5px; }
  #akPetTools button { min-height: 50px; border-radius: 12px; font-size: 18px; }
  #akPetTools button span { font-size: 9px; }
}