:root{
  --bg:#0f1218;
  --card:#151a22;
  --ink:#eaf2ff;
  --muted:rgba(234,242,255,.65);

  --teal:#30D5C8;
  --pink:#FF4D88;
  --yellow:#FFD700;

  --ui-font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --hand-font: "Segoe Print","Bradley Hand","Comic Sans MS","Chalkboard SE","Marker Felt",cursive;

  --vh: 1vh; /* fallback */
}

*{ box-sizing:border-box; }

html, body{ height:100%; }
html{ background:#0f1218; }

@supports (height: 100dvh){ :root{ --vh: 1dvh; } }
@supports (height: 100svh){ :root{ --vh: 1svh; } }

body{
  margin:0;
  font-family: var(--ui-font);

  background: url("assets/bg-office.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color:#1a1f2b;
  position: relative;
}

.hidden{ display:none !important; }

/* White veil overlay */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.68), rgba(255,255,255,0.68));
}

/* Keep UI above veil */
.auth, .app{
  position: relative;
  z-index: 1;
}

/* =========================================================
   AUTH
========================================================= */
.auth{
  min-height: calc(var(--vh) * 100);
  display:grid;
  place-items:center;
  padding:18px;
}

.authWrap{
  width:min(900px, 94vw);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:0;
  margin:0 auto;
  position:relative;
  transform: translateX(90px);
}

/* HERO */
.heroWrap{
  position:relative;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  width:420px;
  margin-left:-128px;
  z-index:2;
  pointer-events:none;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,0.18));

  opacity:0;
  transform: translateY(10px) scale(0.98);
  animation: heroFadeIn 850ms ease-out 180ms forwards;
}
.heroWrap img{
  height: clamp(600px, calc(var(--vh) * 72), 840px);
  width:auto;
  transform-origin: 50% 100%;
  animation: heroIdle 6s ease-in-out 1.2s infinite;
}
@keyframes heroIdle{
  0%,100%{ transform: translateY(0px) rotate(-0.35deg); }
  50%{ transform: translateY(-2px) rotate(0.35deg); }
}
@keyframes heroFadeIn{
  to{ opacity:1; transform: translateY(0px) scale(1); }
}

.heelShadow{
  position:absolute;
  bottom:12px;
  left:50%;
  transform: translateX(-50%);
  width:170px;
  height:28px;
  background: radial-gradient(closest-side, rgba(0,0,0,0.22), transparent 70%);
  filter: blur(6px);
  opacity:.55;
}

.blinkMask{
  position:absolute;
  left:48%;
  top:18%;
  transform: translateX(-50%);
  width:30%;
  height:7%;
  border-radius:999px;
  background: rgba(0,0,0,0.22);
  opacity:0;
  mix-blend-mode:multiply;
  animation: blink 6.5s ease-in-out 2.2s infinite;
}
@keyframes blink{
  0%,94%,100%{ opacity:0; transform: translateX(-50%) scaleY(0.15); }
  95%{ opacity:0.12; transform: translateX(-50%) scaleY(1); }
}

/* Steam */
.steam{
  position:absolute;
  left:23%;
  top:10%;
  width:74px;
  height:74px;
  opacity:.55;
  transform: rotate(-8deg);
}
.steam path{
  stroke: rgba(255,255,255,0.85);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: steamUp 2.8s ease-in-out infinite;
}
.steam path:nth-child(2){ animation-delay:.25s; opacity:.75; }
.steam path:nth-child(3){ animation-delay:.5s; opacity:.6; }
@keyframes steamUp{
  0%   { stroke-dashoffset:120; opacity:0; transform: translateY(10px); }
  20%  { opacity:.6; }
  55%  { opacity:.55; }
  100% { stroke-dashoffset:0; opacity:0; transform: translateY(-12px); }
}

/* Welcome sequence */
.welcomeSeq{
  margin: 8px 0 14px;
  display:flex;
  gap:10px;
  font-weight:900;
  letter-spacing:.2px;
  color: rgba(26,31,43,.78);
}
.welcomeSeq span{
  opacity:0;
  transform: translateY(6px);
  animation: wordIn 800ms ease-out forwards;
}
.welcomeSeq .w1{ animation-delay:.15s; }
.welcomeSeq .w2{ animation-delay:.45s; }
.welcomeSeq .w3{ animation-delay:.75s; }
@keyframes wordIn{ to{ opacity:1; transform: translateY(0px); } }

/* Card */
.card{
  width:min(420px, 92vw);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius:22px;
  padding:20px;
  position:relative;
  overflow:hidden;
  z-index:1;
  transform: translateY(-70px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 2px 10px rgba(0,0,0,0.06);
}
.card::before{
  content:"";
  position:absolute;
  inset:-80px;
  background:
    radial-gradient(380px 260px at 20% 20%, rgba(48,213,200,0.22), transparent 60%),
    radial-gradient(380px 260px at 80% 10%, rgba(255,77,136,0.18), transparent 60%);
  pointer-events:none;
}
.card > *{ position:relative; }

h1{ margin:0 0 6px; color:#1a1f2b; font-size:30px; }
.muted{ color: rgba(26,31,43,.65); margin:0; }

label{
  display:block;
  margin:10px 0;
  color: rgba(26,31,43,.65);
  font-size:14px;
}

input, textarea{
  width:100%;
  margin-top:6px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  color:#1a1f2b;
  outline:none;

  font-family: var(--hand-font);
  font-size:16px;
  line-height:1.35;
  letter-spacing:.2px;
}
textarea{ min-height:180px; padding:14px; }
input::placeholder, textarea::placeholder{ opacity:.65; }

button{
  width:100%;
  padding:12px 14px;
  border-radius:16px;
  border:0;
  background: linear-gradient(90deg, var(--pink), var(--teal));
  color:#0b0f14;
  font-weight:900;
  cursor:pointer;
  margin-top:10px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}
button:hover{ filter: brightness(1.02); }

.msg{ margin:10px 0 0; color:#b42318; }

/* Auth padding fix */
.auth{ padding-top:48px; padding-bottom:48px; }

/* Mobile auth */
@media (max-width:900px){
  .authWrap{ flex-direction:column; gap:10px; transform:none; }
  .heroWrap{ margin-left:0; width:min(420px, 90vw); }
  .heroWrap img{ height: clamp(420px, calc(var(--vh) * 54), 560px); }
  .card{ transform:none; }
}

/* =========================================================
   APP SHELL
========================================================= */
.app{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* 🔥 IMPORTANT: kill “fixed position traps” */
#app, .app, main, .main{
  transform: none !important;
  filter: none !important;
  overflow: visible !important;
}

/* Center the app and stop it feeling too wide */
#app{
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 160px 28px 16px; /* right padding for dividers */
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 7000;
  overflow: visible;

  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:rgba(21,26,34,.65);
  backdrop-filter: blur(10px);
}
.brand{ font-weight:900; letter-spacing:.2px; color: var(--ink); }
.topbar-right{ position:relative; display:flex; gap:8px; align-items:center; }

.ghost{
  width:auto;
  background:rgba(255,255,255,.12);
  color:var(--ink);
  border:1px solid rgba(255,255,255,.12);
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
}

/* Pages */
.main{
  position:relative;
  flex:1;
  padding:16px 0 18px 0;
}
.page{ display:none; }
.page.active{ display:block; }

/* Panel */
.panel{
  background: rgba(250, 248, 244, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color:#1a1f2b;
  border: 1px solid rgba(0,0,0,0.035);
  border-radius:22px;
  padding:20px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.035);
}

/* Daily header */
.dailyHead{
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;

  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  flex-wrap: wrap !important;

  margin: 12px 0 18px !important;
  padding-left: 6px !important;
}
.datePill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 16px;
  border-radius:999px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.14);
  box-shadow: 0 14px 28px rgba(0,0,0,0.14);
  cursor:pointer;
}
.ghost.mini, #btnToday{
  width:auto !important;
  padding:8px 12px !important;
  border-radius:999px !important;
  background: rgba(255,255,255,0.82) !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  color:#1a1f2b !important;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
  font-weight:900 !important;
  letter-spacing:.2px;
}

/* Layout helpers */
.row{ display:grid; grid-template-columns:1fr; gap:18px; }
.priGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 10px 12px;
}

@media (max-width:820px){
  .row{ grid-template-columns:1fr; }
}
@media (max-width:520px){
  .dailyHead{ gap:8px !important; padding-left:0 !important; }
}

/* =========================================================

/* =========================================================
   STICKERS (single source of truth)
========================================================= */

/* Drawer pinned to bottom (all pages) */
.stickerDrawer{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(1100px, 92vw);
  z-index: 6000;
  margin: 0;
}

.stickerToggle{
  width:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  padding:10px 14px !important;
  border-radius:14px !important;
  background: rgba(255,255,255,0.55) !important;
  color: #1a1f2b !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,0.10) !important;
  font-weight:800 !important;
  cursor:pointer !important;
}

.stickerShelf{
  margin-top:10px;
  background: rgba(255,255,255,0.40);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius:16px;
  padding:12px;
  max-height: 34vh;
  overflow:auto;
}

.stickerPack{ margin-bottom: 12px; }
.stickerPackTitle{ font-weight: 900; margin: 6px 0 10px; color:#1a1f2b; }

.stickerGrid{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 820px){
  .stickerGrid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .stickerGrid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.stickerThumb{
  all: unset;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.78);
  display:grid;
  place-items:center;
  padding:8px;
  cursor: pointer;
}
.stickerThumb img{
  width: 56px;
  height: 56px;
  object-fit: contain;
  display:block;
}

.stickerPlaceholder{
  height:64px;
  border-radius:12px;
  background: rgba(255,255,255,0.55);
  border: 1px dashed rgba(0,0,0,0.10);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  opacity:.85;
}
.stickerPlaceholder.locked{ opacity:.55; }

/* Full-screen sticker stage (stickers only) */
.stickerStage{
  position: fixed;
  inset: 0;
  z-index: 5200;       /* below drawer, above content */
  pointer-events: none;
}

.placedSticker{
  position:absolute;
  width: 110px;
  transform: translate3d(0,0,0) rotate(var(--rot, 0deg));
  cursor: grab;
  user-select:none;
  touch-action:none;
  pointer-events:auto;
}
.placedSticker:active{ cursor: grabbing; }

.placedSticker img{
  width:100%;
  height:auto;
  display:block;
  pointer-events:none;
}

.placedSticker.selected{
  outline: 2px solid rgba(48,213,200,0.55);
  outline-offset: 4px;
  border-radius: 14px;
}

/* Sticker mini-controls (no resize dot) */
.stickerControls{
  position:absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -44px;
  display:flex;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 14px 28px rgba(0,0,0,0.14);
}
.stickerControls button{
  width: auto;
  margin: 0;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(21,26,34,0.12);
  border: 1px solid rgba(0,0,0,0.10);
  color:#1a1f2b;
  font-weight: 900;
  box-shadow: none;
}

/* =========================================================
   DIVIDERS (single source of truth)
========================================================= */

:root{ --appMax: 1100px; }

.dividers{
  position: fixed;
  top: 130px;
  right: clamp(10px, calc(50% - (var(--appMax) / 2) - 10px), 26px);
  z-index: 7000;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.dividers .tab{
  all: unset;
  box-sizing: border-box;
  display:grid;
  place-items:center;
  width: 44px;
  height: 92px;
  border-radius: 18px 0 0 18px;
  border: 1px solid rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.92);
  color: #1a1f2b;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 900;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: -8px 10px 24px rgba(0,0,0,0.12);
}

.dividers .tab.active{
  background: linear-gradient(180deg, var(--pink), var(--teal));
  color: #fff;
  border: none;
}

/* =========================================================
   LAYOUT CONSISTENCY
========================================================= */

/* Keep every page the same max width + centered */
.page{
  max-width: 720px;
  margin: 0 auto;
}

/* Make sure topbar can show the VIP dropdown */
.topbar{
  position: sticky;
  top: 0;
  z-index: 7500;
  overflow: visible;
}

/* Give space so the fixed sticker drawer doesn't cover content */
.main{ padding-bottom: 180px; }

