:root{
  /* Brighter, more colorful palette */
  --bg: #0b1020;            /* deep navy base */
  --card: #0f1724;          /* dark slate card */
  --accent: #ff6b6b;        /* coral accent */
  --accent-2: #4dd0e1;      /* teal highlight */
  --sunset: linear-gradient(135deg,#ff9a76,#ff6b6b 48%,#ffd86b 100%);
  --muted: #c8d6e5;
  --glass: rgba(255,255,255,0.035);
  --rounded: 14px;
  --touch: 52px;
  --shadow: 0 10px 36px rgba(6,10,30,0.6);
  --glass-2: rgba(255,255,255,0.04);
  --glass-3: rgba(255,255,255,0.02);
}

*{box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
html,body,#app{height:100%}
body{
  margin:0;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(210,166,106,0.06), transparent),
              linear-gradient(180deg,#0b0c0b 0%, #0f1110 100%);
  color:#efeae3;
  -webkit-user-select:none;
  -ms-user-select:none;
  user-select:none;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  -webkit-font-smoothing:antialiased;
}

/* main container sized for a mobile iframe experience (one-screen) */
main#app{
  width:100%;
  max-width:430px;
  height:100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
  border-radius:18px;
  overflow:hidden;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  transform: translateZ(0);
}

/* Notification banner */
.notification{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  background: linear-gradient(90deg, rgba(255,107,107,0.12), rgba(77,208,225,0.06));
  border-bottom: 1px solid rgba(255,107,107,0.08);
  gap:10px;
  min-height:52px;
  box-shadow: 0 10px 36px rgba(6,10,30,0.55);
  z-index:6;
  will-change:transform,opacity;
  animation: notifIn .6s cubic-bezier(.16,.9,.3,1) both;
}
@keyframes notifIn {
  0% { opacity:0; transform: translateY(-10px) }
  60% { opacity:1; transform: translateY(4px) }
  100% { opacity:1; transform: translateY(0) }
}
.notif-content{
  width:100%;
  max-width:400px;
  display:flex;
  align-items:center;
  gap:10px;
}
.notif-icon{
  width:36px;
  height:36px;
  border-radius:10px;
  background: linear-gradient(135deg,#fff9f0,#d4a66a);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#2b2b2b;
  font-size:16px;
  flex:0 0 36px;
  transform-origin:center;
  animation: pulseIcon 2000ms ease-in-out infinite;
  box-shadow: 0 6px 18px rgba(212,166,106,0.06), inset 0 -6px 18px rgba(255,255,255,0.02);
}
@keyframes pulseIcon{
  0%{ transform: scale(1) rotate(0.5deg) }
 50%{ transform: scale(1.06) rotate(-0.5deg) }
 100%{ transform: scale(1) rotate(0.5deg) }
}
.notif-text{ color:#fff8ef; font-size:13px; line-height:1.1; flex:1; min-width:0 }
.notif .btn{ min-height:36px; padding:6px 10px; background:transparent; border:0; color:var(--muted) }
.notif .btn:hover{ transform:translateY(-2px) scale(1.02) }
@media (max-width:420px){
  .notif-text{ font-size:12px }
}

/* Hero */
.hero{
  position:relative;
  height:32%;
  min-height:180px;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(77,208,225,0.06), transparent),
    linear-gradient(180deg, rgba(255,154,118,0.06), rgba(11,16,32,0.08));
  display:flex;
  align-items:flex-end;
  padding:14px;
  overflow:hidden;
  border-bottom-left-radius:18px;
  border-bottom-right-radius:18px;
  box-shadow: inset 0 -40px 80px rgba(255,107,107,0.02);
}
.hero-overlay{
  width:100%;
  display:flex;
  gap:14px;
  align-items:flex-end;
  z-index:2;
  transform: translateY(0);
  transition: transform 420ms cubic-bezier(.2,.9,.2,1);
  will-change:transform;
}
.portrait{
  width:96px;
  height:96px;
  flex:0 0 96px;
  border-radius:18px;
  background:linear-gradient(135deg, rgba(255,255,255,0.02), rgba(0,0,0,0.12));
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  transform: translateY(8px);
  animation: float 4.6s ease-in-out infinite;
  will-change:transform;
}
@keyframes float {
  0%{ transform: translateY(8px) }
  50%{ transform: translateY(-8px) }
  100%{ transform: translateY(8px) }
}

.title-block{
  flex:1;
  padding:8px 4px 14px 6px;
}
.name{
  margin:0;
  font-size:20px;
  letter-spacing:0.6px;
  font-weight:800;
  text-shadow: 0 6px 18px rgba(0,0,0,0.6);
  will-change:transform,opacity;
  opacity:0;
  transform: translateY(6px);
  animation: nameIn .9s cubic-bezier(.16,.9,.3,1) 200ms both;
}
@keyframes nameIn {
  0%{ opacity:0; transform: translateY(10px) }
  60%{ opacity:1; transform: translateY(-4px) }
  100%{ opacity:1; transform: translateY(0) }
}
.subtitle{
  margin:6px 0 12px 0;
  color:var(--muted);
  font-size:12px;
  opacity:0;
  transform: translateY(6px);
  animation: subtitleIn .9s cubic-bezier(.16,.9,.3,1) 360ms both;
}
@keyframes subtitleIn {
  0%{ opacity:0; transform: translateY(10px) }
  60%{ opacity:1; transform: translateY(-2px) }
  100%{ opacity:1; transform: translateY(0) }
}

/* buttons */
.btn{
  background:var(--sunset);
  color:#161616;
  border:1px solid rgba(255,255,255,0.06);
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  min-height:var(--touch);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s;
  box-shadow: 0 10px 36px rgba(6,10,30,0.5);
  font-size:14px;
}
.btn:active{ transform: translateY(2px) scale(0.995) }
.btn.ghost{
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(77,208,225,0.02));
  color:#0b1020;
  border:1px solid rgba(77,208,225,0.12);
  filter: saturate(1.05);
}
.btn.small{
  padding:8px 12px;
  min-height:40px;
  font-size:13px;
}

/* animated waves with subtle parallax */
.animated-waves{
  position:absolute;
  left:0;right:0;bottom:-6px;
  height:120px;
  pointer-events:none;
  display:block;
  z-index:1;
  transform: translateZ(0);
}
.wave{
  position:absolute;
  left:-10%;
  width:120%;
  height:140px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(255,107,107,0.14), rgba(77,208,225,0.06));
  transform-origin:center;
  border-radius:50%;
  opacity:0.85;
  animation: rise 7.5s linear infinite;
  will-change:transform,opacity,filter;
  filter: contrast(1.02) saturate(1.05);
}
.wave.w1{ bottom:0; filter: blur(10px); animation-duration:7.2s; transform-origin:center; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
.wave.w2{ bottom:-10px; transform: scaleX(1.05); animation-duration:9.3s; opacity:0.5; }
.wave.w3{ bottom:-22px; transform: scaleX(1.12); animation-duration:11.8s; opacity:0.34; }
@keyframes rise {
  0%{ transform: translateY(18px) scale(0.98); opacity:0 }
  30%{ opacity:0.45; transform: translateY(6px) scale(1.02) }
  60%{ opacity:0.6; transform: translateY(-6px) scale(1.06) }
  100%{ transform: translateY(-36px) scale(1.12); opacity:0 }
}

/* Panels */
.panel{
  flex:1;
  padding:14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.008));
  backdrop-filter: blur(6px);
  border-top-left-radius:16px;
  border-top-right-radius:16px;
  margin-top:8px;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow:hidden;
  transform: translateZ(0);
}

/* visitors panel sits higher for quick access and clearer visual hierarchy */
.visitors-panel{
  order:-1;
  padding-top:8px;
  padding-bottom:12px;
}

/* header */
.panel-header{
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:flex-start;
}
/* Make the panel header title very prominent and visible */
.panel-header h2{
  margin:0;
  font-size:16px;
  font-weight:900;
  letter-spacing:0.8px;
  text-transform:uppercase;
  color: var(--accent);
  text-shadow: 0 6px 18px rgba(0,0,0,0.6);
  transform-origin:left center;
  opacity:0;
  transform: translateX(-10px);
  animation: headerIn .7s cubic-bezier(.16,.9,.3,1) 120ms both;
}
@keyframes headerIn {
  0%{ opacity:0; transform: translateX(-12px) }
  60%{ opacity:1; transform: translateX(6px) }
  100%{ opacity:1; transform: translateX(0) }
}
.muted{ color:var(--muted); font-size:12px; }

/* visitors list */
.visitors-list{
  display:grid;
  grid-template-columns: 1fr;
  gap:8px;
  overflow:auto;
  padding-right:4px;
  padding-bottom:6px;
  will-change:transform,opacity;
}

/* visitor card */
.visitor{
  background: linear-gradient(180deg,var(--glass), var(--glass-2));
  border-radius:12px;
  padding:10px;
  display:flex;
  align-items:center;
  gap:12px;
  border:1px solid rgba(255,255,255,0.02);
  transform-origin:left center;
  transition: transform .28s cubic-bezier(.2,.9,.2,1), box-shadow .18s, border-color .18s;
  min-height:64px;
  opacity:0;
  transform: translateX(-8px) scale(.997);
  will-change:transform,opacity;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.visitor.show{
  opacity:1;
  transform: translateX(0) scale(1);
  animation: cardIn 720ms cubic-bezier(.16,.9,.3,1) both;
  will-change:transform,opacity;
}

/* small tactile avatar pop when card appears or when toggled met */
.visitor .avatar{
  transition: transform 360ms cubic-bezier(.2,.9,.3,1), box-shadow 360ms;
}
.visitor.show .avatar{
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}

/* subtle met-state shimmer/pulse for the card border */
.visitor.met{
  animation: metPulse 1200ms ease-out;
}
@keyframes metPulse {
  0% { box-shadow: 0 10px 36px rgba(30,120,80,0.06); transform: scale(0.998) }
  50% { box-shadow: 0 26px 60px rgba(30,120,80,0.11); transform: scale(1.002) }
  100% { box-shadow: 0 10px 36px rgba(30,120,80,0.08); transform: scale(0.998) }
}
.visitor:hover{
  transform: translateX(3px) scale(1.01);
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
}
.visitor:active{ transform: translateY(2px) }
.visitor .avatar{
  width:48px;
  height:48px;
  border-radius:12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display:flex;
  align-items:center;
  justify-content:center;
  color:#06121a;
  font-weight:800;
  font-size:16px;
  box-shadow: 0 12px 28px rgba(6,10,30,0.5);
  transform: translateZ(0);
  transition: transform .36s cubic-bezier(.2,.9,.3,1), box-shadow .36s;
}
.visitor .info{ flex:1; min-width:0 }
.visitor .name{ font-weight:700; font-size:15px; margin:0; letter-spacing:0.2px }
.visitor .meta{ color:var(--muted); font-size:12px; margin-top:4px }
.visitor.met{
  border:1px solid rgba(100,255,140,0.12);
  box-shadow: 0 10px 36px rgba(30,120,80,0.08), inset 0 0 48px rgba(100,255,140,0.03);
  transform: scale(0.998);
}

/* shimmer for avatars on load */
.avatar.shimmer{
  position:relative;
  overflow:hidden;
}
.avatar.shimmer:after{
  content:'';
  position:absolute;
  left:-120%;
  top:0;
  height:100%;
  width:120%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.06), rgba(255,255,255,0));
  transform: skewX(-12deg);
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0%{ left:-120% }
  100%{ left:120% }
}

/* entrance card animation used for staggered, natural reveals */
@keyframes cardIn {
  0% { opacity:0; transform: translateX(-18px) scale(.995); filter: blur(6px); }
  45% { opacity:1; transform: translateX(8px) scale(1.006); filter: blur(0); }
  100% { opacity:1; transform: translateX(0) scale(1); filter: none; }
}

/* tiny idle pulse for avatars to keep scene feeling alive */
@keyframes avatarIdle {
  0%{ transform: translateY(0) scale(1) }
  50%{ transform: translateY(-2px) scale(1.02) }
  100%{ transform: translateY(0) scale(1) }
}

/* slight slow pulse on the hero waves to feel organic */
@keyframes waveDrift {
  0%{ transform: translateY(18px) scale(0.98); opacity:0 }
  30%{ opacity:0.45; transform: translateY(6px) scale(1.02) }
  60%{ opacity:0.6; transform: translateY(-6px) scale(1.06) }
  100%{ transform: translateY(-36px) scale(1.12); opacity:0 }
}

/* reuse waveDrift to keep naming consistent with the JS animations */
.wave{ animation-name: waveDrift; }

/* footer */
.footer{
  padding:10px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
  border-top: 1px solid rgba(255,255,255,0.02);
  font-size:13px;
  opacity:0;
  transform: translateY(6px);
  animation: footerIn .6s cubic-bezier(.16,.9,.3,1) 640ms both;
}
@keyframes footerIn {
  0%{ opacity:0; transform: translateY(10px) }
  100%{ opacity:1; transform: translateY(0) }
}

/* small responsive tweaks */
@media (min-width:400px){
  .hero{ height:44% }
}

/* Login modal tweaks + modal for upcoming visits */
#loginModal .modal-sheet input[type="text"],
#loginModal .modal-sheet input[type="password"]{
  -webkit-appearance:none;
  appearance:none;
  outline:none;
  color:inherit;
  font-size:14px;
}
#loginModal .modal-sheet .muted{ color:var(--muted) }

/* modal for upcoming visits */
.modal{
  position:fixed;
  inset:0;
  z-index:40;
  display:none;
  align-items:flex-end;
  justify-content:center;
  pointer-events:none;
}
.modal[aria-hidden="false"]{ display:flex; pointer-events:auto; }
.modal-backdrop{
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.6));
  backdrop-filter: blur(6px);
  opacity:0;
  transition: opacity 260ms ease;
}
.modal[aria-hidden="false"] .modal-backdrop{ opacity:1; }

.modal-sheet{
  width:100%;
  max-width:430px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.008));
  border-top-left-radius:16px;
  border-top-right-radius:16px;
  padding:12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transform: translateY(22px);
  transition: transform 300ms cubic-bezier(.16,.9,.3,1);
  z-index:45;
  pointer-events:auto;
  max-height:74vh;
  overflow:auto;
}
.modal[aria-hidden="false"] .modal-sheet{ transform: translateY(0); }

.modal-header{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
.modal-title{ font-weight:900; color:var(--accent); letter-spacing:0.6px; font-size:15px; text-transform:uppercase; }

#upcomingList{ padding-bottom:12px; }