body {
  margin:0;
  min-height:100vh;
  min-height:100dvh;
  width:100vw;
  overflow:hidden;
  position:relative;
}

#app {
  position:fixed;
  inset:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  touch-action:pan-y;
}

.app-header {
  min-height:52px;
  background:var(--card);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 20px;
  padding-top:env(safe-area-inset-top);
  flex-shrink:0;
  position:relative;
  z-index:200;
  border-bottom:1px solid var(--border-color);
}

.app-header-burger {
  width:38px;
  height:38px;
  border-radius:12px;
  background:var(--bg);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:transform 0.15s, background 0.2s;
  flex-shrink:0;
}

.app-header-burger:active { transform:scale(0.9); }
.app-header-burger svg { width:20px; height:20px; color:var(--header-icon); }

.app-header-logo {
  font-size:20px;
  font-weight:900;
  color:var(--brown);
  letter-spacing:-0.3px;
  position:absolute;
  left:50%;
  transform:translateX(-50%);
}

.app-header-logo span { color:var(--primary); }

.app-header-settings {
  width:38px;
  height:38px;
  border-radius:12px;
  background:var(--bg);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:transform 0.15s;
  flex-shrink:0;
  font-size:18px;
}

.app-header-settings:active { transform:scale(0.9); }

/* ── Pet Bar ─────────────────────────────────────────────── */

.pet-bar {
  display: flex;
  align-items: center;
  padding: 10px 16px 10px;
  gap: 14px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  background: var(--card);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
.pet-bar::-webkit-scrollbar { display: none; }

/* Singola bolla pet */
.pet-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1);
}
.pet-bubble:active { transform: scale(0.9); }

/* Anello esterno — gradient quando attivo */
.pet-bubble-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  padding: 3px;
  background: var(--border-color);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}
.pet-bubble-ring.active {
  background: linear-gradient(135deg, #FF6B6B, #FFB347);
  box-shadow: 0 0 0 0 rgba(255,107,107,0.4);
  animation: pet-pulse 2.4s ease-in-out infinite;
}
@keyframes pet-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.35); }
  50%      { box-shadow: 0 0 0 5px rgba(255,179,71,0.15); }
}

/* Cerchio interno con foto o emoji */
.pet-bubble-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
  border: 2px solid var(--card);
}

/* Nome sotto la bolla */
.pet-bubble-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--brown2);
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  transition: color 0.2s;
}
.pet-bubble.active .pet-bubble-name {
  color: var(--primary);
}

/* Pulsante + aggiungi */
.pet-add-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1);
}
.pet-add-bubble:active { transform: scale(0.9); }

.pet-add-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px dashed var(--brown3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: border-color 0.2s, background 0.2s;
  opacity: 0.6;
}
.pet-add-bubble:active .pet-add-ring {
  border-color: var(--primary);
  background: rgba(255,107,107,0.08);
  opacity: 1;
}
.pet-add-ring svg {
  width: 22px;
  height: 22px;
  color: var(--brown3);
  transition: color 0.2s;
}
.pet-add-bubble:active .pet-add-ring svg { color: var(--primary); }

.pet-add-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--brown3);
  letter-spacing: 0.2px;
  opacity: 0.7;
}

.sidebar-overlay {
  position:absolute;
  inset:0;
  background:rgba(61,43,31,0.45);
  z-index:400;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.35s ease;
}

.sidebar-overlay.open { opacity:1; pointer-events:auto; }

.sidebar {
  position:absolute;
  top:0;
  left:0;
  bottom:0;
  width:78%;
  background:var(--bg);
  z-index:450;
  transform:translateX(-100%);
  transition:transform 0.35s cubic-bezier(0.4,0,0.2,1);
  display:flex;
  flex-direction:column;
  border-radius:0 16px 16px 0;
  overflow:hidden;
  box-shadow:8px 0 40px rgba(61,43,31,0.2);
}

.sidebar.open { transform:translateX(0); }

.sb-dark-row {
  cursor:pointer;
  min-height:52px;
}

.sb-dark-row .tog {
  flex-shrink:0;
  margin-left:auto;
  min-width:46px;
  min-height:32px;
}

.dark-mode-tog.off { background:rgba(61,43,31,0.15); }

[data-theme="dark"] .dark-mode-tog.off { background:rgba(255,255,255,0.15); }

.sb-header {
  position:relative;
  overflow:hidden;
  padding:calc(8px + env(safe-area-inset-top, 0px)) 16px 14px;
  background:linear-gradient(168deg, #FF4F55 0%, #FF6B42 38%, #FF8F4A 72%, #FFA64D 100%);
}

/* Texture + profondità (sopra il gradient base) */
.sb-header-mesh {
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(ellipse 85% 70% at 100% -15%, rgba(255,255,255,0.28) 0%, transparent 52%),
    radial-gradient(ellipse 65% 55% at -5% 105%, rgba(255,255,255,0.12) 0%, transparent 48%),
    radial-gradient(circle at 18% 25%, rgba(255,255,255,0.09) 0%, transparent 35%),
    repeating-linear-gradient(
      -18deg,
      transparent 0,
      transparent 3px,
      rgba(255,255,255,0.025) 3px,
      rgba(255,255,255,0.025) 4px
    );
  opacity:0.95;
}

.sb-header-shine {
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:linear-gradient(
    118deg,
    transparent 0%,
    transparent 38%,
    rgba(255,255,255,0.22) 48%,
    rgba(255,255,255,0.38) 50.5%,
    rgba(255,255,255,0.2) 53%,
    transparent 62%,
    transparent 100%
  );
  width:55%;
  left:-20%;
  transform:translateX(-120%) skewX(-16deg);
  opacity:0;
  filter:blur(0.5px);
}

.sb-header--fx .sb-header-shine {
  animation:sbShineSweep 0.95s cubic-bezier(0.25, 0.85, 0.35, 1) forwards;
}

@keyframes sbShineSweep {
  0% {
    transform:translateX(-120%) skewX(-16deg);
    opacity:0;
  }
  12% {
    opacity:0.85;
  }
  100% {
    transform:translateX(320%) skewX(-16deg);
    opacity:0;
  }
}

.sb-header::before {
  content:'';
  position:absolute;
  top:-24px;
  right:-16px;
  width:92px;
  height:92px;
  background:rgba(255,255,255,0.07);
  border-radius:50%;
  pointer-events:none;
  z-index:0;
}

.sb-header::after {
  content:'';
  position:absolute;
  bottom:-32px;
  left:-20px;
  width:80px;
  height:80px;
  background:rgba(255,255,255,0.05);
  border-radius:50%;
  pointer-events:none;
  z-index:0;
}

.sb-header-main {
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  gap:14px;
  padding-right:36px;
  min-height:0;
}

.sidebar.open .sb-header-main {
  animation:sbHeaderEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sidebar.open .sb-avatar-ring {
  animation:sbAvatarPop 0.52s cubic-bezier(0.34, 1.4, 0.45, 1) 0.04s both;
}

@keyframes sbHeaderEnter {
  from {
    opacity:0;
    transform:translateX(-10px);
  }
  to {
    opacity:1;
    transform:translateX(0);
  }
}

@keyframes sbAvatarPop {
  from {
    opacity:0.85;
    transform:scale(0.92);
  }
  to {
    opacity:1;
    transform:scale(1);
  }
}

.sb-avatar-ring {
  flex-shrink:0;
  width:104px;
  height:104px;
  padding:4px;
  border-radius:50%;
  background:linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.2) 100%);
  box-shadow:
    0 12px 36px rgba(61,43,31,0.22),
    0 2px 8px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.5);
}

.sb-avatar {
  width:100%;
  height:100%;
  border-radius:50%;
  background:rgba(255,255,255,0.22);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:40px;
  line-height:1;
  border:none;
  margin:0;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.25);
  overflow:hidden;
  position:relative;
  z-index:1;
}

.sb-avatar img {
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
}

.sb-header-copy {
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding-top:2px;
  gap:0;
}

.sb-name {
  font-size:22px;
  font-weight:900;
  color:#fff;
  letter-spacing:-0.4px;
  line-height:1.15;
  text-transform:none;
  text-shadow:0 1px 2px rgba(61,43,31,0.15);
  word-break:break-word;
}

.sb-email { font-size:12px; font-weight:600; color:rgba(255,255,255,0.85); margin-top:3px; position:relative; z-index:1; }

.sb-breed {
  font-size:11.5px;
  font-weight:600;
  color:rgba(255,255,255,0.88);
  margin-top:5px;
  letter-spacing:0.02em;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.sb-user {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:6px;
  margin-top:7px;
  min-width:0;
  width:100%;
  max-width:100%;
}

.sb-user-ico {
  flex-shrink:0;
  font-size:13px;
  line-height:1;
  opacity:0.92;
  filter:drop-shadow(0 1px 1px rgba(61,43,31,0.12));
}

.sb-user-name {
  flex:1;
  min-width:0;
  font-size:11.5px;
  font-weight:600;
  letter-spacing:0.01em;
  color:rgba(255,255,255,0.9);
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sb-version {
  font-size:9px;
  font-weight:800;
  color:rgba(255,255,255,0.72);
  margin-top:7px;
  align-self:flex-start;
  background:rgba(255,255,255,0.18);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  display:inline-block;
  padding:3px 9px;
  border-radius:999px;
  letter-spacing:0.06em;
}

.sb-scroll {
  flex:1;
  overflow-y:auto;
  padding:16px 16px 20px;
  scrollbar-width:none;
}

.sb-scroll::-webkit-scrollbar { display:none; }

.sb-section-title {
  font-size:11px;
  font-weight:800;
  color:var(--brown3);
  letter-spacing:1.5px;
  text-transform:uppercase;
  margin:18px 4px 10px;
  padding-top:4px;
}

.sb-section-title:first-child { margin-top:4px; }

.sb-item {
  display:flex;
  align-items:center;
  gap:14px;
  background:var(--card);
  border-radius:14px;
  padding:14px 16px;
  margin-bottom:8px;
  box-shadow:0 2px 10px rgba(61,43,31,0.06);
  cursor:pointer;
  transition:all 0.2s ease;
  border:1px solid rgba(61,43,31,0.04);
}

.sb-item:active { transform:scale(0.97); box-shadow:var(--shadow); }

.sb-item-icon {
  width:40px;
  height:40px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  flex-shrink:0;
}

.sb-item-icon.coral { background:#FFF0F0; }
.sb-item-icon.green { background:#F0FFF4; }
.sb-item-icon.gold { background:#FFF8E1; }
.sb-item-icon.blue { background:#E3F2FD; }
.sb-item-icon.purple { background:#F3E5F5; }

[data-theme="dark"] .sb-item-icon.coral { background:rgba(255,133,133,0.2); }
[data-theme="dark"] .sb-item-icon.green { background:rgba(76,175,80,0.2); }
[data-theme="dark"] .sb-item-icon.gold { background:rgba(255,193,7,0.2); }
[data-theme="dark"] .sb-item-icon.blue { background:rgba(33,150,243,0.2); }
[data-theme="dark"] .sb-item-icon.purple { background:rgba(156,39,176,0.2); }

.sb-item-text { flex:1; font-size:14px; font-weight:800; color:var(--brown); }
.sb-item-arrow { font-size:14px; color:var(--brown3); font-weight:700; }

.sb-item.sb-active {
  background:linear-gradient(135deg,#FFF0F0,#FFE8E0);
  border:1.5px solid rgba(255,107,107,0.2);
}

[data-theme="dark"] .sb-item.sb-active {
  background:linear-gradient(135deg,rgba(255,133,133,0.25),rgba(255,193,112,0.2));
  border-color:rgba(255,133,133,0.35);
}

.sb-item.sb-active .sb-item-text { color:var(--primary); }

.sb-item-badge {
  font-size:9px;
  font-weight:800;
  color:#E65100;
  background:#FFF3E0;
  padding:2px 8px;
  border-radius:10px;
  letter-spacing:0.5px;
}

.sb-close {
  position:absolute;
  top:calc(6px + env(safe-area-inset-top, 0px));
  right:12px;
  z-index:4;
  width:34px;
  height:34px;
  border:none;
  border-radius:50%;
  background:rgba(255,255,255,0.22);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:15px;
  color:#fff;
  line-height:1;
  padding:0;
  box-shadow:0 2px 10px rgba(61,43,31,0.12);
  transition:transform 0.15s ease, background 0.2s ease;
}

.sb-close:hover { background:rgba(255,255,255,0.32); }

.sb-close:active { transform:scale(0.9); }

.view {
  position:absolute;
  top:calc(52px + env(safe-area-inset-top));
  left:0;
  right:0;
  bottom:0;
  display:flex;
  flex-direction:column;
  background:var(--bg);
  transition:transform 300ms cubic-bezier(0.4,0,0.2,1);
  will-change:transform;
  z-index:10;
}

.view.hidden { transform:translateX(100%); visibility:hidden; opacity:1; pointer-events:none; z-index:5; }
.view.base { transform:translateX(0); opacity:1; z-index:10; }
.view.behind { transform:translateX(-22%); visibility:hidden; opacity:1; pointer-events:none; z-index:5; }

.scroll {
  flex:1;
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-width:none;
  padding-bottom:16px;
}

.scroll::-webkit-scrollbar { display:none; }

.home-hero-fixed { flex-shrink:0; }

.page-header {
  padding:14px 20px 10px;
  display:flex;
  align-items:center;
  gap:12px;
  background:var(--card);
  border-bottom:1px solid var(--border-color);
  flex-shrink:0;
}

.back {
  width:40px;
  height:40px;
  background:var(--bg);
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:0;
  transition:transform 0.15s;
  flex-shrink:0;
  position:relative;
  overflow:hidden;
}

/* Paw print icon — light mode: blue */
.back::after {
  content:'';
  display:block;
  width:24px;
  height:24px;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%231565C0' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='9' cy='5.5' rx='2.2' ry='2.8'/%3E%3Cellipse cx='15' cy='5.5' rx='2.2' ry='2.8'/%3E%3Cellipse cx='5' cy='10.5' rx='1.8' ry='2.3'/%3E%3Cellipse cx='19' cy='10.5' rx='1.8' ry='2.3'/%3E%3Cpath d='M12 9c-3.2 0-6 2.2-6 5.2 0 1.8.8 3 2.2 3.8.8.5 1.8.8 2.5 1.4.3.3.8.6 1.3.6s1-.3 1.3-.6c.7-.6 1.7-.9 2.5-1.4 1.4-.8 2.2-2 2.2-3.8C18 11.2 15.2 9 12 9z'/%3E%3C/svg%3E");
  background-size:contain;
  background-repeat:no-repeat;
  background-position:center;
  animation:paw-back-bounce 2.4s ease-in-out infinite;
}

/* Dark mode: orange paw */
:root[data-theme="dark"] .back::after {
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%23FF9800' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='9' cy='5.5' rx='2.2' ry='2.8'/%3E%3Cellipse cx='15' cy='5.5' rx='2.2' ry='2.8'/%3E%3Cellipse cx='5' cy='10.5' rx='1.8' ry='2.3'/%3E%3Cellipse cx='19' cy='10.5' rx='1.8' ry='2.3'/%3E%3Cpath d='M12 9c-3.2 0-6 2.2-6 5.2 0 1.8.8 3 2.2 3.8.8.5 1.8.8 2.5 1.4.3.3.8.6 1.3.6s1-.3 1.3-.6c.7-.6 1.7-.9 2.5-1.4 1.4-.8 2.2-2 2.2-3.8C18 11.2 15.2 9 12 9z'/%3E%3C/svg%3E");
}

/* Paw bounce + pulse animation */
@keyframes paw-back-bounce {
  0%   { transform:scale(1) rotate(-8deg); opacity:0.85; }
  20%  { transform:scale(1.18) rotate(0deg); opacity:1; }
  40%  { transform:scale(1) rotate(8deg); opacity:0.85; }
  60%  { transform:scale(1.12) rotate(-4deg); opacity:1; }
  80%  { transform:scale(1) rotate(4deg); opacity:0.85; }
  100% { transform:scale(1) rotate(-8deg); opacity:0.85; }
}

.back:active { transform:scale(0.88); }

/* Hide any inline SVG inside .back — paw is handled via ::after */
.back svg { display:none; }

.page-title { font-size:20px; font-weight:900; color:var(--brown); flex:1; }
.page-action { font-size:13px; font-weight:800; color:var(--primary); cursor:pointer; }

.section { padding:0 20px; }
.st { font-size:16px; font-weight:900; color:var(--brown); margin:18px 0 10px; }

/* ── Sidebar "Developed by" footer ── */
.sb-devby {
  padding:14px 20px 20px;
  border-top:1px solid rgba(255,255,255,0.10);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
.sb-devby-label {
  font-size:9px;
  font-weight:700;
  color:rgba(255,255,255,0.45);
  letter-spacing:1.5px;
  text-transform:uppercase;
}
.sb-devby-brand {
  font-size:17px;
  font-weight:900;
  color:rgba(255,255,255,0.90);
  letter-spacing:1px;
  perspective:400px;
  display:inline-block;
  animation:sb-brand-flip 6s ease-in-out infinite;
  transform-origin:center;
}
.sb-devby-7 {
  color:#FFB347;
  font-style:italic;
}
.sb-devby-o {
  display:inline-block;
  color:#FFB347;
  font-weight:900;
}
@keyframes sb-brand-flip {
  0%,40%   { transform:rotateY(0deg); }
  50%      { transform:rotateY(180deg); }
  60%,100% { transform:rotateY(360deg); }
}

/* ── Sev7n Sounz banner — light mode fix ── */
:root:not([data-theme="dark"]) .sb-devby {
  border-top-color: rgba(61,43,31,0.10);
}
:root:not([data-theme="dark"]) .sb-devby-label {
  color: rgba(61,43,31,0.45);
}
:root:not([data-theme="dark"]) .sb-devby-brand {
  color: rgba(61,43,31,0.85);
}

/* ── Desktop: centra l'app come se fosse su mobile ── */
@media (min-width: 768px) {
  html {
    background: #0d0d0d;
  }

  body {
    background: #0d0d0d;
    overflow: hidden;
  }

  #app {
    left: calc(50% - 215px) !important;
    right: auto !important;
    width: 430px !important;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
    border-radius: 0;
  }

  /* Pet sheet e backdrop centrati come l'app */
  .pet-sheet-backdrop {
    left: calc(50% - 215px) !important;
    right: auto !important;
    width: 430px !important;
  }

  .pet-sheet {
    left: calc(50% - 215px) !important;
    right: auto !important;
    width: 430px !important;
  }
}
