
/* ===========================================================
   lobby.css — drawpixel lobby (land here after login)
   shares the cozy design system
   =========================================================== */

:root {
  --cream:      #F3EADA;
  --cream-deep: #ECE0CB;
  --surface:    #FCF8F0;
  --surface-2:  #FAF2E4;
  --ink:        #4A3F35;
  --ink-soft:   #7C6F5E;
  --muted:      #A89A83;
  --line:       #E8DBC4;
  --line-soft:  #F0E6D4;
  --coral:      oklch(0.74 0.105 38);
  --coral-deep: oklch(0.66 0.115 36);
  --sage:       oklch(0.74 0.105 140);
  --sage-deep:  oklch(0.64 0.10 142);
  --sky:        oklch(0.74 0.085 235);

  --sh-sm: 0 1px 2px rgba(74,63,53,.06), 0 2px 6px rgba(74,63,53,.05);
  --sh-md: 0 2px 6px rgba(74,63,53,.07), 0 8px 22px rgba(74,63,53,.09);
  --sh-lg: 0 6px 16px rgba(74,63,53,.10), 0 20px 50px rgba(74,63,53,.14);

  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --font-pixel: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body:  Nunito, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 78% -8%, #FBEEDC 0%, transparent 60%),
    radial-gradient(900px 600px at 4% 108%, #F1ECDD 0%, transparent 55%),
    var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* ===========================================================
   App layout — matches room canvas .app grid
   =========================================================== */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 14px;
}

/* ===========================================================
   Top bar — matches room canvas topbar
   =========================================================== */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px 16px;
  box-shadow: var(--sh-sm);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr);
  overflow: hidden; box-shadow: var(--sh-sm), inset 0 0 0 2px rgba(255,255,255,.5);
  transform: rotate(-3deg);
}
.brand-mark i { display: block; }
.brand-name { font-family: var(--font-pixel); font-size: 26px; line-height: 1; color: var(--ink); }
.brand-name b { color: var(--coral-deep); font-weight: 700; }
.spacer { flex: 1; }
.top-spacer { flex: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px;
  font-weight: 700; font-size: 13.5px; color: var(--ink-soft); white-space: nowrap;
}
.pill .num { font-family: var(--font-pixel); font-size: 16px; color: var(--ink); letter-spacing: .5px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sage-deep); box-shadow: 0 0 0 0 rgba(126,154,99,.5); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(126,154,99,.45);}70%{box-shadow:0 0 0 7px rgba(126,154,99,0);}100%{box-shadow:0 0 0 0 rgba(126,154,99,0);} }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: #fff;
  background: var(--coral);
  box-shadow: var(--sh-sm), inset 0 -3px 0 rgba(0,0,0,.08);
  flex: 0 0 auto;
}
.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  transition: transform .12s, background .15s;
  cursor: pointer;
}
.icon-btn:hover { background: #fff; transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.logout-inline { display: contents; }

/* ===========================================================
   Page
   =========================================================== */
.wrap { flex: 1; max-width: 1080px; width: 100%; margin: 0 auto; padding: 14px 0 40px; }

.greet { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.greet h1 {
  font-family: var(--font-body); font-weight: 800;
  font-size: clamp(28px, 4vw, 40px); letter-spacing: -.6px; line-height: 1.05;
}
.greet h1 .name { color: var(--coral-deep); }
.greet h1 .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.6s ease-in-out 1s 2; }
@keyframes wave { 0%,100%{transform:rotate(0);}20%{transform:rotate(16deg);}40%{transform:rotate(-8deg);}60%{transform:rotate(12deg);}80%{transform:rotate(-4deg);} }
.greet .sub { color: var(--ink-soft); font-weight: 600; font-size: 15.5px; margin-top: 8px; }

/* stat chips */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.stat {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 13px 18px; box-shadow: var(--sh-sm);
}
.stat .ic {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
}
.stat .ic svg { width: 19px; height: 19px; }
.stat .v { font-family: var(--font-pixel); font-size: 21px; line-height: 1; color: var(--ink); }
.stat .l { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 4px; letter-spacing: .2px; }

/* section heading */
.sec-head { display: flex; align-items: baseline; gap: 12px; margin: 42px 0 18px; }
.sec-head h2 { font-family: var(--font-body); font-weight: 800; font-size: 20px; letter-spacing: -.3px; }
.sec-head .count { font-family: var(--font-pixel); font-size: 14px; color: var(--coral-deep); }
.sec-head .sub { color: var(--muted); font-weight: 600; font-size: 13.5px; margin-left: auto; }

/* ===========================================================
   Canvas gallery
   =========================================================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(296px, 1fr));
  gap: 20px;
}

.ccard {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--sh-sm);
  transition: transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .16s;
}
.ccard:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.ccard:hover .join { background: var(--coral-deep); }
.ccard:hover .preview canvas { transform: scale(1.04); }

.preview {
  position: relative; aspect-ratio: 168 / 112; overflow: hidden;
  background: var(--cream-deep);
  border-bottom: 1px solid var(--line);
}
.preview canvas {
  width: 100%; height: 100%; display: block;
  image-rendering: pixelated; object-fit: cover;
  transition: transform .3s ease;
}
.badge {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 12px; letter-spacing: .2px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(252,248,240,.92); backdrop-filter: blur(4px);
  box-shadow: var(--sh-sm); color: var(--ink-soft);
}
.badge.live { left: 12px; top: 12px; }
.badge.live .num { font-family: var(--font-pixel); color: var(--ink); }
.badge.tag {
  right: 12px; top: 12px; background: var(--coral); color: #fff;
  font-family: var(--font-pixel); font-weight: 400; letter-spacing: .5px;
}

.cbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cbody h3 { font-family: var(--font-body); font-weight: 800; font-size: 18px; letter-spacing: -.2px; }
.cbody p { color: var(--ink-soft); font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.cmeta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); font-weight: 700;
}
.cmeta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.cmeta .res { font-family: var(--font-pixel); font-size: 12.5px; color: var(--ink-soft); }

.cfoot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 6px; }
.avstack { display: flex; }
.avstack i {
  width: 24px; height: 24px; border-radius: 7px; margin-left: -7px;
  border: 2px solid var(--surface);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.10);
  display: block;
}
.avstack i:first-child { margin-left: 0; }
.avstack .more {
  width: 24px; height: 24px; border-radius: 7px; margin-left: -7px;
  border: 2px solid var(--surface); background: var(--surface-2);
  display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--ink-soft);
}
.join {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--coral); color: #fff;
  font-weight: 800; font-size: 13.5px;
  padding: 10px 15px; border-radius: 12px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
  transition: background .15s;
}
.join svg { width: 16px; height: 16px; }

/* new-canvas card */
.newcard {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center;
  border: 2px dashed var(--line); border-radius: 20px;
  background: transparent; color: var(--ink-soft);
  padding: 28px; cursor: pointer; min-height: 220px;
  transition: border-color .15s, background .15s, transform .16s;
}
.newcard:hover { border-color: var(--coral); background: rgba(232,146,124,.05); transform: translateY(-3px); }
.newcard .plus {
  width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--coral-deep);
}
.newcard .plus svg { width: 24px; height: 24px; }
.newcard h3 { font-family: var(--font-body); font-weight: 800; font-size: 16px; color: var(--ink); }
.newcard p { font-size: 12.5px; font-weight: 600; max-width: 200px; }
.newcard .soon {
  font-family: var(--font-pixel); font-size: 11px; letter-spacing: .5px;
  color: var(--coral-deep); background: var(--surface-2);
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}

/* footer tip */
.tip {
  margin-top: 40px; text-align: center;
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.tip b { color: var(--ink-soft); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #FBF2E2;
  font-weight: 700; font-size: 13.5px;
  padding: 12px 18px; border-radius: 13px; box-shadow: var(--sh-lg);
  opacity: 0; pointer-events: none; transition: .22s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 620px) {
  .app { padding: 10px; gap: 10px; }
  .topbar { top: 10px; padding: 8px 12px; gap: 10px; }
  .user-btn .nm { display: none; }
  .greet h1 { font-size: 26px; }
  .stat { padding: 11px 14px; flex: 1; min-width: 140px; }
  .gallery { grid-template-columns: 1fr; }
  .sec-head .sub { display: none; }
}
