@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
}

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes bubbleUp {
  from { transform: translateY(20px) scale(0.8); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: scale(0.8); }
}

@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 7px rgba(0,0,0,1)) drop-shadow(0 0 12px rgba(0,0,0,0.7)) drop-shadow(0 0 18px rgba(0,0,0,0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(0,0,0,1)) drop-shadow(0 0 18px rgba(0,0,0,0.7)) drop-shadow(0 0 24px rgba(0,0,0,0.3)); }
}

@keyframes pcx-sheen { from { background-position: -200% 0; } to { background-position: 200% 0; } }

@keyframes pcx-glow-pulse { 0%, 100% { opacity: .5; } 50% { opacity: .8; } }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  -webkit-text-size-adjust: 100%;
  background: #000;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  width: 100vw;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.messenger-container {
  display: flex;
  height: 100vh;
  height: 100dvh;
  position: fixed;
  width: 100vw;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

body.dark-mode {
  background: #000;
  color: #fff;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 16px;
}

.empty-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0;
  height: 100%;
  width: 100%;
  position: relative;
  pointer-events: none;
  overflow: hidden;
}

.empty-logo.hidden {
  display: none;
}

.empty-logo .theme-toggle,
.empty-logo a,
.empty-logo button,
.empty-logo #today-messages,
.empty-logo #calendar-events {
  pointer-events: auto;
}

.empty-logo img {
  pointer-events: auto;
  cursor: pointer;
}

body.dark-mode .empty-logo img {
  filter: invert(1);
}

.date-separator {
  text-align: center;
  margin: 20px 0 12px 0;
  font-size: 12px;
  color: #8e8e93;
  font-weight: 500;
}

body.dark-mode .date-separator {
  color: #8e8e93;
}

.icon-button {
  background: #9333ea;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: background 0.2s;
}

.icon-button:hover {
  background: #be123c;
}

body.dark-mode .icon-button {
  background: #9333ea;
}

body.dark-mode .icon-button:hover {
  background: #9333ea;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background 0.2s;
}

.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-toggle svg {
  position: absolute;
  transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

body.dark-mode .theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

body.dark-mode .theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

body.dark-mode .pill-btn {
  color: #9333ea;
}

body.dark-mode .pill-btn:hover {
  background: rgba(147, 51, 234, 0.2);
}

:root { --pcx-logo-img: url("https://images.squarespace-cdn.com/content/v1/63da9b98de095c4c9968e703/352bd58e-075b-4b66-9fa5-ebf58370533a/qw.png?format=1500w"); }
.pcx-logo-embed { position: relative; display: inline-block; isolation: isolate; overflow: visible; }
.pcx-logo-embed img { display: block; width: 100%; }
@supports ((-webkit-mask: url("#")) or (mask: url("#"))) {
  .pcx-logo-embed img { opacity: 0; }
  .pcx-logo-embed::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
    background:
      repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, rgba(0,0,0,0) 1px 3px),
      linear-gradient(160deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,.14) 8%, rgba(0,0,0,0) 35%),
      linear-gradient(-20deg, rgba(0,0,0,.40) 0%, rgba(0,0,0,.12) 14%, rgba(0,0,0,0) 45%),
      linear-gradient(135deg, #6f4a00 0%, #b9973e 24%, #e8d896 44%, #b88f27 60%, #5b3f00 100%);
    background-blend-mode: overlay, screen, multiply, normal;
    filter: saturate(1.08) contrast(1.06) drop-shadow(0.5px 0.5px 0 rgba(0,0,0,.55)) drop-shadow(1px 1px 0 rgba(0,0,0,.40)) drop-shadow(2px 2px 1px rgba(0,0,0,.22));
    -webkit-mask: var(--pcx-logo-img) center/contain no-repeat;
            mask: var(--pcx-logo-img) center/contain no-repeat;
  }
  .pcx-logo-embed::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
    background: linear-gradient(90deg, rgba(255,215,130,.14) 0%, rgba(181,133,0,.28) 22%, #ffe7a8 50%, rgba(181,133,0,.28) 78%, rgba(255,215,130,.14) 100%);
    background-size: 200% 100%;
    animation: pcx-sheen 8.4s linear infinite;
    -webkit-mask: var(--pcx-logo-img) center/contain no-repeat;
            mask: var(--pcx-logo-img) center/contain no-repeat;
  }
}
.pcx-logo-embed .pcx-glow {
  position: absolute; inset: -12%; z-index: 0; pointer-events: none;
  background: radial-gradient(55% 65% at 50% 55%, rgba(255,215,130,.25), rgba(255,215,130,0) 70%);
  filter: blur(12px); opacity: .6; mix-blend-mode: screen;
  animation: pcx-glow-pulse 5.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .pcx-logo-embed::after { animation: none; }
  .pcx-logo-embed .pcx-glow { animation: none; }
}

@media (max-width: 768px) {
  html, body {
    touch-action: pan-y;
    overscroll-behavior: none;
  }

  .messenger-container {
    touch-action: pan-y;
  }

  body {
    height: 100vh;
    height: 100dvh;
  }

  .messenger-container {
    height: 100vh;
    height: 100dvh;
  }

  .empty-logo .balance {
    bottom: 70px !important;
  }

  .empty-logo #admin-link {
    bottom: 110px !important;
  }
}
