/* ============================================================
   FLINGO! — funky neobrutalist candy design
   ============================================================ */

:root {
  --cream: #FFF6E5;
  --ink: #1B1B1F;
  --pink: #FF4D8D;
  --purple: #7C4DFF;
  --yellow: #FFD644;
  --lime: #B7F04A;
  --cyan: #4DD9FF;
  --orange: #FF8A3D;
  --white: #FFFFFF;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --border: 3px solid var(--ink);
  --radius: 18px;
  --font-head: 'Fredoka', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Space Grotesk', ui-monospace, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(var(--ink) 1.2px, transparent 1.2px);
  background-size: 34px 34px;
  background-position: 0 0;
}

/* subtle dot grid fades so it's not overwhelming */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: var(--cream);
  opacity: .88;
  pointer-events: none;
  z-index: -2;
}

.hidden { display: none !important; }

/* file inputs: offscreen but RENDERED — display:none stops Safari and
   webviews from opening the picker at all */
.vis-hidden {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  pointer-events: none;
}
.muted { opacity: .55; font-weight: 400; }

/* ============ floating doodads ============ */
.bg-doodads { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.doodad {
  position: absolute;
  font-size: 28px;
  opacity: .5;
  animation: floaty 9s ease-in-out infinite;
}
.d1 { top: 12%; left: 5%;  color: var(--pink);   animation-delay: 0s;  font-size: 34px; }
.d2 { top: 25%; right: 7%; color: var(--purple); animation-delay: -2s; }
.d3 { top: 65%; left: 8%;  color: var(--cyan);   animation-delay: -4s; font-size: 22px; }
.d4 { top: 78%; right: 12%;color: var(--orange); animation-delay: -1s; font-size: 30px; }
.d5 { top: 45%; right: 3%; color: var(--lime);   animation-delay: -5s; font-size: 20px; }
.d6 { top: 88%; left: 40%; color: var(--pink);   animation-delay: -3s; font-size: 18px; }
.d7 { top: 8%;  left: 45%; color: var(--purple); animation-delay: -6s; font-size: 24px; }
.d8 { top: 55%; left: 55%; color: var(--yellow); animation-delay: -7s; font-size: 16px; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-18px) rotate(10deg); }
  50%      { transform: translateY(6px) rotate(-6deg); }
  75%      { transform: translateY(-10px) rotate(4deg); }
}

/* ============ topbar ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  max-width: 1200px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark {
  font-size: 34px; display: inline-block;
  animation: spin-fling 5s ease-in-out infinite;
}
@keyframes spin-fling {
  0%, 70%, 100% { transform: rotate(0); }
  75% { transform: rotate(-20deg); }
  85% { transform: rotate(380deg); }
  92% { transform: rotate(352deg); }
  96% { transform: rotate(363deg); }
}
.logo-text {
  font-family: var(--font-head);
  font-weight: 700; font-size: 30px; letter-spacing: -0.5px;
}
.logo-bang { color: var(--pink); display: inline-block; animation: bang-bounce 2.4s ease infinite; }
@keyframes bang-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  70% { transform: translateY(-6px) scale(1.2); }
  80% { transform: translateY(0); }
}
.topbar-right { display: flex; gap: 10px; margin-left: auto; }

/* ☰ menu — top-right of the whole screen */
.menu-wrap { position: relative; margin-left: 14px; flex: 0 0 auto; }
.menu-wrap .menu-pop { right: 0; left: auto; }

/* ============ badges & stickers ============ */
.badge {
  font-family: var(--font-head); font-weight: 600; font-size: 13px;
  padding: 6px 14px; border: var(--border); border-radius: 999px;
  box-shadow: var(--shadow-sm); background: var(--white);
  display: inline-block; white-space: nowrap;
}
.badge-lime { background: var(--lime); }
.badge-pink { background: var(--pink); color: var(--white); }
.badge-gold { background: var(--yellow); }
.tilt-l { transform: rotate(-3deg); }
.tilt-r { transform: rotate(2.5deg); }

.sticker {
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  padding: 9px 16px; border: var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm); display: inline-block;
  transition: transform .15s ease;
}
.sticker:hover { transform: rotate(0deg) scale(1.08); }
.st-yellow { background: var(--yellow); }
.st-cyan   { background: var(--cyan); }
.st-pink   { background: var(--pink); color: var(--white); }
.sticker-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

/* ============ layout ============ */
.screen { max-width: 1200px; margin: 0 auto; padding: 20px 28px 60px; }

.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  align-items: center; padding: 30px 0 60px;
}

/* ============ dropzone ============ */
.dropzone {
  position: relative;
  border: 4px dashed var(--ink);
  border-radius: 26px;
  background: var(--white);
  min-height: 380px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 8px 8px 0 var(--ink);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, background .18s;
  animation: dz-breathe 4s ease-in-out infinite;
}
@keyframes dz-breathe {
  0%, 100% { transform: rotate(-0.6deg) scale(1); }
  50% { transform: rotate(0.6deg) scale(1.012); }
}
.dropzone:hover {
  background: #FFFDF4;
  transform: rotate(0deg) scale(1.02);
  box-shadow: 11px 11px 0 var(--ink);
  animation-play-state: paused;
}
.dropzone.dragover {
  background: var(--lime);
  transform: scale(1.05) rotate(1deg);
  box-shadow: 13px 13px 0 var(--ink);
  animation: dz-party .35s ease infinite alternate;
}
@keyframes dz-party {
  from { transform: scale(1.04) rotate(-1.2deg); }
  to   { transform: scale(1.06) rotate(1.2deg); }
}
.dz-inner { text-align: center; padding: 30px; pointer-events: none; }
.dz-plus {
  width: 92px; height: 92px; margin: 0 auto 20px;
  border: var(--border); border-radius: 50%;
  background: var(--pink); color: var(--white);
  font-size: 54px; font-weight: 700; line-height: 86px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-head);
  animation: plus-bounce 2s cubic-bezier(.34,1.56,.64,1) infinite;
}
@keyframes plus-bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-10px) rotate(90deg); }
}
.dz-title { font-family: var(--font-head); font-size: 30px; font-weight: 700; }
.dz-sub { margin-top: 6px; font-size: 15px; opacity: .6; }

.btn-note { margin-top: 18px; }
.home-actions { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.addmore-row { display: flex; gap: 12px; flex-wrap: wrap; }
.file-path { font-size: 11px; opacity: .45; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "got a code?" mini entry */
.code-entry {
  margin-top: 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: var(--border); border-radius: 16px;
  background: var(--white); box-shadow: var(--shadow-sm);
  padding: 12px 16px; width: fit-content;
  transform: rotate(-0.5deg);
}
.code-entry label { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.code-entry input {
  width: 118px; border: var(--border); border-radius: 10px;
  padding: 8px 10px; font-family: var(--font-body); font-weight: 700;
  font-size: 16px; letter-spacing: 3px; text-transform: uppercase;
  background: var(--cream); text-align: center;
}
.code-entry input:focus { outline: none; background: var(--white); box-shadow: 2px 2px 0 var(--ink); }

/* ============ mascot ============ */
.hero-right { position: relative; }
.mascot-wrap { position: relative; height: 150px; margin-bottom: 8px; }
.mascot {
  width: 130px; height: 118px;
  position: absolute; left: 0; top: 0;
  animation: mascot-bob 3.4s ease-in-out infinite;
}
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}
.mascot-svg { width: 100%; height: 100%; }
.blob-body { fill: var(--purple); stroke: var(--ink); stroke-width: 5; }
.eye-white { fill: var(--white); stroke: var(--ink); stroke-width: 4; }
.pupil { fill: var(--ink); }
.smile { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.cheek { fill: var(--pink); opacity: .75; }
.speech {
  position: absolute; left: 140px; top: 18px;
  background: var(--white); border: var(--border); border-radius: 14px;
  padding: 8px 14px; font-family: var(--font-head); font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow-sm);
  animation: speech-pop 5s ease infinite;
  white-space: nowrap;
}
.speech::before {
  content: ""; position: absolute; left: -10px; top: 16px;
  border: 6px solid transparent; border-right: 10px solid var(--ink);
}
@keyframes speech-pop {
  0%, 8%, 92%, 100% { transform: scale(0); opacity: 0; }
  14%, 86% { transform: scale(1); opacity: 1; }
  17% { transform: scale(1.06) rotate(-2deg); }
  20% { transform: scale(1); }
}

/* ============ hero text ============ */
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700; line-height: 1.04; letter-spacing: -1px;
}
.hero-zap {
  color: var(--pink);
  text-shadow: 3px 3px 0 var(--yellow);
  display: inline-block;
  animation: zap-tilt 3s ease infinite;
}
@keyframes zap-tilt {
  0%, 80%, 100% { transform: rotate(0); }
  85% { transform: rotate(-3deg) scale(1.05); }
  90% { transform: rotate(2deg); }
}
.squiggle-under {
  position: relative; display: inline-block;
}
.squiggle-under::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 2px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 6 Q 12 0 25 6 T 50 6 T 75 6 T 100 6' fill='none' stroke='%234DD9FF' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
  background-size: 90px 10px;
  animation: squiggle-slide 3s linear infinite;
}
@keyframes squiggle-slide { to { background-position-x: 90px; } }
.hero-sub { margin-top: 20px; font-size: 17px; line-height: 1.55; max-width: 480px; }
.hero-sub em { font-style: normal; background: var(--yellow); padding: 0 6px; border-radius: 6px; font-weight: 700; }

/* ============ buttons ============ */
.btn {
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  border: var(--border); border-radius: 14px;
  background: var(--white); color: var(--ink);
  padding: 12px 22px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-mega {
  font-size: 24px; padding: 20px 44px; border-radius: 20px;
  background: var(--pink); color: var(--white);
  box-shadow: 6px 6px 0 var(--ink);
  animation: mega-pulse 2.2s ease infinite;
  letter-spacing: .5px;
}
.btn-mega:hover { background: var(--purple); transform: translate(-2px,-2px) rotate(-1deg); box-shadow: 8px 8px 0 var(--ink); animation-play-state: paused; }
.btn-mega:active { transform: translate(4px,4px); box-shadow: 0 0 0 var(--ink); }
@keyframes mega-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }
.btn-ghost:hover { transform: none; box-shadow: none; background: var(--yellow); border-radius: 10px; text-decoration: none; }
.btn-dashed { border-style: dashed; background: transparent; box-shadow: none; }
.btn-dashed:hover { background: var(--white); box-shadow: var(--shadow-sm); }
.btn-small { font-size: 13px; padding: 7px 14px; border-radius: 10px; }
.btn-copy { background: var(--yellow); font-size: 15px; }
.btn-copy.copied { background: var(--lime); }
.btn-grab { background: var(--cyan); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ============ marquee ============ */
.marquee {
  border-top: var(--border); border-bottom: var(--border);
  background: var(--yellow);
  overflow: hidden; white-space: nowrap;
  padding: 10px 0;
  transform: rotate(-1deg) scale(1.02);
  margin: 30px -10px;
}
.marquee-bottom { background: var(--purple); transform: rotate(1deg) scale(1.02); }
.marquee-bottom .marquee-track { color: var(--white); }
.marquee-track {
  display: inline-block;
  font-family: var(--font-head); font-weight: 600; font-size: 17px;
  animation: marquee-scroll 22s linear infinite;
}
@keyframes marquee-scroll { to { transform: translateX(-50%); } }

/* ============ how it works ============ */
.how { padding: 40px 0 20px; }
.how-title {
  font-family: var(--font-head); font-size: 38px; font-weight: 700;
  text-align: center; margin-bottom: 40px;
}
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.how-card {
  border: var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1);
}
.how-card:hover { transform: rotate(0) translateY(-8px) !important; }
.hc-yellow { background: var(--yellow); }
.hc-pink { background: var(--pink); color: var(--white); }
.hc-cyan { background: var(--cyan); }
.how-num {
  width: 46px; height: 46px; border-radius: 50%;
  border: var(--border); background: var(--white); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 22px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.how-card h3 { font-family: var(--font-head); font-size: 22px; margin-bottom: 8px; }
.how-card p { font-size: 15px; line-height: 1.5; }

/* ============ panels (share / receive) ============ */
.panel {
  background: var(--white); border: var(--border); border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 34px; margin-top: 10px;
  animation: panel-in .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes panel-in {
  from { transform: translateY(24px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.panel-title { font-family: var(--font-head); font-size: 32px; font-weight: 700; }
.wiggle { display: inline-block; animation: wiggle 2s ease infinite; }
@keyframes wiggle {
  0%, 70%, 100% { transform: rotate(0); }
  75% { transform: rotate(-12deg); }
  85% { transform: rotate(10deg); }
  95% { transform: rotate(-4deg); }
}

/* ============ file list ============ */
.file-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.file-item {
  display: flex; align-items: center; gap: 14px;
  border: var(--border); border-radius: 16px;
  padding: 14px 18px; background: var(--cream);
  box-shadow: var(--shadow-sm);
  animation: file-pop .3s cubic-bezier(.34,1.56,.64,1) backwards;
}
.file-item:nth-child(odd) { transform: rotate(-0.4deg); }
.file-item:nth-child(even) { transform: rotate(0.4deg); }
@keyframes file-pop {
  from { transform: scale(.8) translateY(10px); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.file-emoji {
  font-size: 30px; width: 54px; height: 54px; flex: 0 0 54px;
  display: grid; place-items: center;
  background: var(--white); border: var(--border); border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink);
}
.file-meta { flex: 1; min-width: 0; }
.file-name {
  font-weight: 700; font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-size { font-size: 13px; opacity: .55; margin-top: 2px; }
.file-x {
  flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 50%;
  border: var(--border); background: var(--white);
  font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .12s, background .12s;
}
.file-x:hover { background: var(--pink); color: var(--white); transform: rotate(90deg); }

/* progress bars — candy stripes! */
.prog {
  height: 20px; border: var(--border); border-radius: 999px;
  background: var(--white); overflow: hidden; margin-top: 8px;
  position: relative;
}
.prog-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(
    45deg,
    var(--pink) 0 12px,
    var(--orange) 12px 24px,
    var(--yellow) 24px 36px,
    var(--lime) 36px 48px,
    var(--cyan) 48px 60px,
    var(--purple) 60px 72px
  );
  background-size: 200% 100%;
  animation: candy-slide 1.2s linear infinite;
  transition: width .25s ease;
  border-radius: 999px;
}
@keyframes candy-slide { to { background-position-x: -72px; } }
.prog-label { font-size: 12px; font-weight: 700; margin-top: 5px; display: flex; justify-content: space-between; }
.file-item.done { background: var(--lime); }
.file-item.done .file-emoji { animation: done-spin .5s ease; }
@keyframes done-spin { from { transform: rotate(0) scale(.6); } to { transform: rotate(360deg) scale(1); } }

/* completion celebration: pop + progress-bar flash */
.celebrate { animation: row-pop .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes row-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.035) rotate(-0.6deg); }
  65% { transform: scale(0.995) rotate(0.4deg); }
  100% { transform: scale(1); }
}
.celebrate .prog-fill { animation: candy-slide .25s linear infinite, prog-flash .45s ease 3; }
@keyframes prog-flash {
  50% { filter: brightness(1.7) saturate(1.6); }
}

/* iOS: files can't auto-download, so the user taps a COMPACT save button in the
   row's action area (where GRAB was) to open the share sheet. This used to be a
   full-tile overlay that buried the file and, with several downloads, stacked
   into a wall of yellow boxes — see btn-save-ios in app.js deliverBlob(). */
.btn-save-ios {
  background: var(--yellow);
  animation: save-bounce 1.1s ease infinite;
}
.btn-saved-ios {
  background: var(--lime);
  opacity: .92;
}
@keyframes save-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.addmore-row { margin-top: 16px; }

/* long file lists: scroll inside a box, don't stretch the page */
.list-scroll {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px 6px 6px 2px;
  border: 3px dashed var(--ink);
  border-radius: 16px;
  background: rgba(255,255,255,.5);
}
.list-count {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  opacity: .6; margin: 4px 0 6px;
}
.btn-stop { background: var(--pink); color: var(--white); }
.btn-stop:hover { background: var(--ink); }
.file-item.stopped { opacity: .6; background: var(--cream); }

/* ============ note ============ */
.note-wrap { margin-top: 26px; }
.note-label { font-family: var(--font-head); font-weight: 600; font-size: 16px; display: block; margin-bottom: 8px; }
.note-input {
  width: 100%; border: var(--border); border-radius: 14px;
  padding: 14px 16px; font-family: var(--font-body); font-size: 15px;
  background: var(--cream); resize: vertical;
  box-shadow: inset 3px 3px 0 rgba(27,27,31,.08);
  transition: transform .15s;
}
.note-input:focus { outline: none; background: var(--white); box-shadow: var(--shadow-sm); transform: rotate(-0.3deg); }

.golink-wrap { margin-top: 30px; text-align: center; }

/* ============ link zone ============ */
.link-zone { margin-top: 30px; border-top: 3px dashed var(--ink); padding-top: 26px; }
.pulse-note {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  background: var(--yellow); border: var(--border); border-radius: 999px;
  padding: 10px 20px; box-shadow: var(--shadow-sm);
  width: fit-content; margin: 0 auto 26px;
  transform: rotate(-1deg);
}
.pulse-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--pink); border: 2px solid var(--ink);
  animation: pulse-dot 1.2s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.5); }
}

/* big bouncy code tiles */
.code-tiles { display: flex; gap: 10px; justify-content: center; margin-bottom: 22px; flex-wrap: wrap; }
.code-tile {
  width: 58px; height: 66px;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 34px;
  background: var(--white); border: var(--border); border-radius: 14px;
  box-shadow: var(--shadow-sm);
  animation: tile-drop .5s cubic-bezier(.34,1.56,.64,1) backwards;
}
.code-tile:nth-child(6n+1) { background: var(--pink); color: var(--white); transform: rotate(-3deg); }
.code-tile:nth-child(6n+2) { background: var(--yellow); transform: rotate(2deg); }
.code-tile:nth-child(6n+3) { background: var(--cyan); transform: rotate(-1.5deg); }
.code-tile:nth-child(6n+4) { background: var(--lime); transform: rotate(2.5deg); }
.code-tile:nth-child(6n+5) { background: var(--purple); color: var(--white); transform: rotate(-2deg); }
.code-tile:nth-child(6n+6) { background: var(--orange); transform: rotate(1.5deg); }
@keyframes tile-drop {
  from { transform: translateY(-40px) rotate(10deg) scale(.5); opacity: 0; }
}
.code-tile:hover { animation: tile-jump .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes tile-jump { 50% { transform: translateY(-12px) rotate(0); } }

.link-row { display: flex; gap: 12px; max-width: 620px; margin: 0 auto 30px; }
.link-input {
  flex: 1; border: var(--border); border-radius: 14px;
  padding: 13px 16px; font-family: var(--font-body); font-size: 15px; font-weight: 500;
  background: var(--cream); min-width: 0;
}
.link-input:focus { outline: none; background: var(--white); }

.share-flex { display: flex; gap: 30px; justify-content: center; align-items: stretch; flex-wrap: wrap; }
.qr-card {
  border: var(--border); border-radius: var(--radius);
  background: var(--white); padding: 18px 18px 10px;
  box-shadow: var(--shadow); text-align: center;
}
.qr-box { width: 164px; height: 164px; display: grid; place-items: center; }
.qr-box img, .qr-box canvas { border-radius: 6px; }
.qr-label { font-family: var(--font-head); font-weight: 600; margin-top: 8px; font-size: 15px; }

.waiting-card {
  border: var(--border); border-radius: var(--radius);
  background: var(--cream); padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; min-width: 260px; flex: 0 1 320px;
  font-family: var(--font-head); font-weight: 600; font-size: 16px; text-align: center;
}
.radar { position: relative; width: 70px; height: 70px; }
.radar span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--ink); background: rgba(124, 77, 255, .25);
  animation: radar-ring 2s ease-out infinite;
}
.radar span:nth-child(2) { animation-delay: .66s; }
.radar span:nth-child(3) { animation-delay: 1.33s; }
@keyframes radar-ring {
  from { transform: scale(.25); opacity: 1; }
  to   { transform: scale(1.15); opacity: 0; }
}

/* ============ peers ============ */
.peer-list { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.peer-card {
  border: var(--border); border-radius: 16px; background: var(--white);
  padding: 16px 20px; box-shadow: var(--shadow-sm);
  animation: file-pop .35s cubic-bezier(.34,1.56,.64,1) backwards;
}
.peer-head { display: flex; align-items: center; gap: 12px; }
.peer-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  border: var(--border); background: var(--cyan);
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 2px 2px 0 var(--ink);
}
.peer-name { font-family: var(--font-head); font-weight: 700; font-size: 18px; flex: 1; }
.peer-status { font-size: 13px; font-weight: 700; opacity: .6; }
.peer-card.done { background: var(--yellow); }
.peer-card.gone { opacity: .5; filter: grayscale(1); }

/* ============ receive screen ============ */
.rx-connecting { text-align: center; padding: 40px 0 30px; }
.bigspin { font-size: 72px; display: inline-block; animation: bigspin 1.6s cubic-bezier(.6,.05,.3,.95) infinite; }
@keyframes bigspin {
  0% { transform: rotate(0) translateX(0); }
  50% { transform: rotate(180deg) translateX(30px); }
  100% { transform: rotate(360deg) translateX(0); }
}
.rx-connecting p { font-family: var(--font-head); font-weight: 600; font-size: 19px; margin-top: 18px; }

.note-card {
  border: var(--border); border-radius: 16px; background: var(--yellow);
  box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 22px;
  transform: rotate(-0.5deg);
}
.note-card-head { font-family: var(--font-head); font-weight: 700; margin-bottom: 8px; }
.note-card p { white-space: pre-wrap; word-break: break-word; font-size: 15px; margin-bottom: 12px; }

.graball-wrap { text-align: center; margin-top: 28px; }

.rx-error { text-align: center; padding: 40px 0; }
.rx-error-emoji { font-size: 64px; animation: ghost-float 2.5s ease-in-out infinite; display: inline-block; }
@keyframes ghost-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}
.rx-error p { font-family: var(--font-head); font-weight: 600; font-size: 19px; margin: 16px 0 22px; }

/* grab buttons + chunky file button */
.file-actions { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.file-check { font-size: 26px; animation: done-spin .5s ease; }

/* ============ user IDs & receiving mode ============ */
.id-panel {
  margin-top: 24px;
  border: var(--border); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow);
  padding: 18px 20px;
  transform: rotate(-0.4deg);
  max-width: 480px;
}
.id-head { font-family: var(--font-head); font-size: 17px; margin-bottom: 12px; }
.id-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.id-at {
  font-family: var(--font-head); font-weight: 700; font-size: 24px;
  color: var(--purple);
}
.id-input {
  flex: 1; min-width: 120px; max-width: 220px;
  border: var(--border); border-radius: 10px;
  padding: 9px 12px; font-family: var(--font-body); font-weight: 700;
  font-size: 15px; background: var(--cream); text-transform: lowercase;
}
.id-input:focus { outline: none; background: var(--white); box-shadow: 2px 2px 0 var(--ink); }
.id-hint { font-size: 12px; margin-top: 8px; }
.id-badge {
  font-family: var(--font-head); font-weight: 700; font-size: 18px;
  background: var(--purple); color: var(--white);
  border: var(--border); border-radius: 999px;
  padding: 7px 16px; box-shadow: var(--shadow-sm);
}
.radar-handle { color: var(--purple); }

/* friend-request notifications */
.notif-dot {
  position: absolute; top: -6px; right: -6px; z-index: 5;
  min-width: 24px; height: 24px; padding: 0 6px;
  border: var(--border); border-radius: 999px;
  background: var(--pink); color: var(--white);
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
  animation: pulse-dot 1.4s ease infinite;
  pointer-events: none;
}
.notif-inline {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--pink); color: var(--white);
  font-size: 12px; font-weight: 700;
}
.friend-add-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }

/* top-of-page ID hub */
.id-panel-top {
  max-width: none;
  width: 100%;
  margin: 6px 0 30px;
  transform: rotate(0deg);
  border-width: 4px;
  box-shadow: 7px 7px 0 var(--ink);
  background: linear-gradient(135deg, var(--white) 60%, #F3EBFF);
}
.id-input-wide { max-width: 230px; }
.id-input-search { max-width: none; flex: 1; }
.search-row { margin-top: 12px; }

/* people rows (search results + friends) */
.person-list { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.person-row {
  display: flex; align-items: center; gap: 10px;
  border: var(--border); border-radius: 12px;
  background: var(--cream); padding: 8px 14px;
  box-shadow: 2px 2px 0 var(--ink);
  animation: file-pop .25s cubic-bezier(.34,1.56,.64,1) backwards;
}
.person-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; flex: 1; }
.person-dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--ink); background: #cfcfcf; flex: 0 0 auto;
}
.person-dot.online { background: var(--lime); animation: pulse-dot 1.6s ease infinite; }
.person-status { font-size: 12px; font-weight: 700; opacity: .55; }

/* sender identity + prominent send-back on receive screen */
.sender-id-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-head); font-size: 17px;
  border: var(--border); border-radius: 14px;
  background: var(--cyan); padding: 10px 16px;
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
  transform: rotate(-0.4deg);
}
.sendback-head {
  font-family: var(--font-head); font-weight: 700; font-size: 19px;
  margin-bottom: 4px;
}
.sendback {
  border: 3px dashed var(--ink);
  border-radius: var(--radius);
  background: #FFE9F2;
  padding: 16px 18px;
  margin: 0 0 22px;
  box-shadow: var(--shadow-sm);
  transform: rotate(0.3deg);
}
.or-divider {
  font-family: var(--font-head); font-weight: 600; opacity: .5;
  margin: 18px 0 14px; font-size: 15px;
}
.send-to-row { justify-content: center; }
.sendback { margin-top: 30px; border-top: 3px dashed var(--ink); padding-top: 22px; }
.sendback .addmore-row { margin: 12px 0 14px; }
.offer-head {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  margin: 14px 0 8px; opacity: .8;
}
.offer-list { margin-top: 4px; }
.peer-card .file-item { box-shadow: none; background: var(--white); }

/* ============ login / onboarding ============ */
.login-panel {
  max-width: 560px;
  margin: 60px auto 40px;
  border: 4px solid var(--ink); border-radius: 26px;
  background: var(--white); box-shadow: 10px 10px 0 var(--ink);
  padding: 44px 36px;
  text-align: center;
  animation: panel-in .4s cubic-bezier(.34,1.56,.64,1);
}
.login-logo { font-size: 64px; animation: mascot-bob 3s ease-in-out infinite; }
.login-title { font-family: var(--font-head); font-size: 52px; font-weight: 700; margin: 6px 0 4px; }
.login-sub { font-size: 15px; opacity: .65; margin-bottom: 28px; }
.gbtn-wrap { display: flex; justify-content: center; margin-bottom: 14px; min-height: 44px; }
.ob-title { font-family: var(--font-head); font-size: 22px; margin-bottom: 16px; }
.ob-row { justify-content: center; }
.btn-ob-go { font-size: 18px; padding: 14px 26px; }

/* ============ app bar (logged-in home) ============ */
.app-bar {
  width: 100%;
  margin: 2px 0 14px;
  border: none; background: none; box-shadow: none;
  padding: 4px 16px;
  display: flex; justify-content: center; align-items: center;
}
/* mascot greets from the top — sits directly on the page, no card behind it */
.app-mascot { position: relative; display: flex; align-items: center; gap: 14px; height: 84px; }
.app-mascot .mascot { position: static; height: 84px; width: 92px; }
.app-mascot .mascot-svg { width: 100%; height: 100%; }
/* FIXED-WIDTH bubble (fits the longest line): the rotating text can no longer
   resize the row and jog the mascot sideways — that was the "glitch" every 5s —
   while mascot+bubble stay a centered pair that still fits a phone screen. */
.app-mascot .speech {
  position: relative; left: 0; top: 0;   /* relative (not static) so the ::before tail anchors HERE,
                                             but zero the base .speech offset so it stays in the flex flow */
  transform-origin: center; margin: 0;
  width: 200px; text-align: center; white-space: nowrap;
}

/* highlighted "you are @…" above the friends column */
.friends-me {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 3px solid var(--ink); border-radius: 16px;
  background: linear-gradient(135deg, var(--yellow), #FFE9A8);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 14px; margin-bottom: 12px;
}
.friends-me .me-label { font-family: var(--font-head); font-weight: 600; font-size: 13px; opacity: .7; }
.friends-me .id-badge { font-size: 18px; padding: 6px 14px; }

/* stage: "send to a friend" list reuses the members-card look */
.stage-friends {
  display: flex; flex-direction: column;
  border: 4px solid var(--ink); border-radius: 22px;
  background: linear-gradient(150deg, #FFE9F4, var(--white));
  box-shadow: 6px 6px 0 var(--ink);
  padding: 16px; max-height: 40vh;
}
.stage-friends.hidden { display: none; }
.app-id-row { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; position: relative; }
.app-id-row .id-badge {
  font-size: 22px; padding: 9px 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-burger {
  flex: 0 0 auto;
  width: 60px; height: 60px;
  border: var(--border); border-radius: 16px;
  background: var(--white); font-size: 30px; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn-burger:hover { background: var(--yellow); }
.btn-burger:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.menu-pop {
  position: absolute; top: calc(100% + 12px); left: 0; z-index: 30;
  border: var(--border); border-radius: 14px;
  background: var(--white); box-shadow: var(--shadow);
  padding: 8px; min-width: 170px;
  animation: file-pop .2s cubic-bezier(.34,1.56,.64,1);
}
.menu-item {
  display: block; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  padding: 11px 14px; border-radius: 10px; color: var(--ink);
}
.menu-item:hover { background: var(--yellow); }
.btn-visible-big {
  margin-left: auto; flex: 0 0 auto;
  font-size: 21px; padding: 14px 28px; border-radius: 16px;
  box-shadow: 5px 5px 0 var(--ink);
  animation: mega-pulse 2.2s ease infinite;
}
.btn-visible-big:hover { animation-play-state: paused; }

/* SEND / RECEIVE — free-floating, bobbing */
.sendrecv-row { display: flex; gap: 18px; margin: 0 0 28px; }
.btn-half { flex: 1; font-size: 24px; padding: 20px 10px; border-radius: 20px; }
.btn-recv { background: var(--cyan); color: var(--ink); }
.btn-recv:hover { background: var(--purple); color: var(--white); }
.btn-send-anim { animation: bob-tilt 2.8s ease-in-out infinite; }
.btn-recv-anim { animation: bob-tilt 2.8s ease-in-out infinite 1.4s; }
@keyframes bob-tilt {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50% { transform: translateY(-7px) rotate(0.6deg); }
}
.btn-send-anim:hover, .btn-recv-anim:hover {
  animation: none;
  transform: scale(1.04);
}
.btn-send-anim:active, .btn-recv-anim:active {
  animation: none;
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}

/* folder / text — proper buttons */
.btn-action { background: var(--yellow); font-size: 15px; }
.btn-action:hover { background: var(--lime); }
.radar-code { margin: 22px auto 6px; }

/* ============ upload hub + marketing ============ */
.upload-hub { max-width: 760px; margin: 0 auto 10px; }
.upload-hub .dropzone { min-height: 300px; }
.upload-hub .home-actions { justify-content: center; }
.upload-hub .code-entry { margin: 16px auto 0; }
.hero.marketing { grid-template-columns: 1fr; max-width: 720px; margin: 0 auto; text-align: center; padding-top: 40px; }
.hero.marketing .mascot-wrap { margin: 0 auto 8px; width: 290px; text-align: left; }
.hero.marketing .hero-sub { margin-left: auto; margin-right: auto; }
.hero.marketing .sticker-row { justify-content: center; }

@media (max-width: 700px) {
  .login-panel { margin: 20px 10px; padding: 30px 18px; }
  /* keep ☰ · @id · GO VISIBLE on ONE tidy row */
  .app-bar { padding: 14px; }
  .app-id-row { gap: 8px; }
  .app-id-row .id-badge { font-size: 16px; padding: 9px 14px; min-width: 0; flex: 1 1 auto; text-align: center; }
  .btn-burger { width: 52px; height: 52px; font-size: 26px; }
  .btn-visible-big { font-size: 15px; padding: 12px 14px; }
  /* the ☰ needs room in the header on phones */
  .topbar { padding: 12px 14px; }
  .topbar-right { display: none; }
  .logo-text { font-size: 26px; }
  .btn-half { font-size: 19px; padding: 16px 8px; }
  /* no drag-and-drop on touch — SEND / folder / text buttons do the job */
  .dropzone { display: none; }
  .upload-hub .home-actions { justify-content: center; margin-top: 0; }
  .btn-action { font-size: 16px; padding: 14px 20px; }
}

/* ============ search hero (top of app, unmissable) ============ */
.search-hero {
  position: relative;
  margin: 4px 0 14px;
}
.search-hero-input {
  width: 100%;
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 18px 20px;
  font-family: var(--font-head); font-weight: 600; font-size: 18px;
  background: var(--yellow);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.search-hero-input::placeholder { color: rgba(27,27,31,.55); font-weight: 600; }
.search-hero-input:focus {
  outline: none;
  background: var(--white);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink), 0 0 0 6px rgba(255,214,68,.55);
}
.search-hero-results:not(:empty) {
  margin: 0 0 18px;
  border: var(--border); border-radius: 16px;
  background: var(--white); box-shadow: var(--shadow-sm);
  padding: 10px;
}

/* ============ lobby ============ */
.lobby-banner {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  border: 4px solid var(--ink); border-radius: 22px;
  background: linear-gradient(135deg, var(--lime) 0%, var(--cyan) 100%);
  box-shadow: 7px 7px 0 var(--ink);
  padding: 20px 22px; margin-bottom: 24px;
}
.lobby-left { flex: 1 1 280px; min-width: 0; }
.lobby-label { font-family: var(--font-head); font-weight: 600; font-size: 14px; opacity: .7; }
.lobby-code {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(38px, 8vw, 60px); letter-spacing: 7px;
  line-height: 1.1; margin: 2px 0 12px;
  text-shadow: 3px 3px 0 var(--white);
}
.lobby-link-row { max-width: 420px; margin: 0; }
.lobby-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  background: var(--white); border: var(--border); border-radius: 999px;
  padding: 7px 14px; box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
}
.lobby-toggle input { width: 17px; height: 17px; accent-color: var(--purple); cursor: pointer; }
.lobby-qr-card { flex: 0 0 auto; }
.lobby-waiting { margin-bottom: 14px; }
.join-req-wrap {
  border: 3px dashed var(--ink); border-radius: 16px;
  background: #FFF3D6; padding: 14px 16px; margin-bottom: 20px;
}

/* ============ ➕ FAB ============ */
.fab-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 90; }
.fab {
  width: 92px; height: 92px; border-radius: 50%;
  border: 5px solid var(--ink); background: var(--pink); color: var(--white);
  font-family: var(--font-head); font-weight: 700; font-size: 56px; line-height: 1;
  cursor: pointer; box-shadow: 7px 7px 0 var(--ink);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), background .15s;
}
.fab:hover { background: var(--purple); transform: scale(1.07) rotate(90deg); }
.fab:active { transform: translate(3px, 3px) scale(1); box-shadow: 0 0 0 var(--ink); }
.fab.open { background: var(--ink); transform: rotate(135deg); }
.fab-menu {
  position: absolute; right: 6px; bottom: 106px;
  display: flex; flex-direction: column; gap: 10px;
}
.fab-item {
  display: flex; align-items: center; gap: 10px;
  border: var(--border); border-radius: 999px;
  background: var(--white); cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  padding: 11px 20px 11px 14px; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  animation: fab-pop .22s cubic-bezier(.34,1.56,.64,1) backwards;
}
.fab-item span { font-size: 21px; }
.fab-item:hover { background: var(--yellow); transform: translateX(-4px); }
.fab-item:nth-child(1) { animation-delay: .02s; }
.fab-item:nth-child(2) { animation-delay: .06s; }
.fab-item:nth-child(3) { animation-delay: .10s; }
.fab-item:nth-child(4) { animation-delay: .14s; }
@keyframes fab-pop { from { opacity: 0; transform: translateY(14px) scale(.85); } }

/* ============ chat-style transfer rows ============ */
.file-item.dir-in  { margin-right: 12%; border-left: 10px solid var(--cyan); }
.file-item.dir-out { margin-left: 12%; border-right: 10px solid var(--pink); flex-direction: row-reverse; text-align: right; }
.file-item.dir-out .file-meta { text-align: right; }
.msg-bubble {
  max-width: 78%; padding: 12px 16px; margin-bottom: 10px;
  border: var(--border); border-radius: 18px;
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
  box-shadow: var(--shadow-sm);
  animation: file-pop .25s cubic-bezier(.34,1.56,.64,1);
}
.msg-in  { background: var(--white); border-bottom-left-radius: 4px; margin-right: auto; }
.msg-out { background: var(--lime); border-bottom-right-radius: 4px; margin-left: auto; }

@media (max-width: 700px) {
  .fab-wrap { right: 16px; bottom: 16px; }
  .fab { width: 78px; height: 78px; font-size: 46px; }
  .fab-menu { bottom: 92px; }
  .lobby-banner { padding: 16px; gap: 14px; }
  .lobby-code { letter-spacing: 5px; }
  .search-hero-input { font-size: 16px; padding: 15px 16px; }
  .file-item.dir-in { margin-right: 4%; }
  .file-item.dir-out { margin-left: 4%; }
}

/* ============ LOBBY: clan-chat layout ============ */
.clan {
  max-width: 640px; margin: 0 auto;
  border: 4px solid var(--ink); border-radius: 22px;
  background: var(--cream);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}

/* ---- roomy lobby: the card grows to use the space, still a card ---- */
/* keep the topbar (☰ lives there); drop the decorative clutter.
   The pink ➕ FAB stays — it's the one and only "add" control. */
body.lobby-full .marquee,
body.lobby-full .footer { display: none; }
/* lift it clear of the composer / send button */
body.lobby-full .fab-wrap { bottom: 96px; }

body.lobby-full #screen-radar {
  max-width: 1420px;
  padding: 10px 18px 18px;
}
/* invite rail on the left, tabbed clan box on the right */
.lobby-split {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
body.lobby-full .clan {
  max-width: none; width: 100%;
  /* fill the window minus the header, but never get cramped */
  height: calc(100vh - 118px);
  min-height: 480px;
  margin: 0;
  display: flex; flex-direction: column;
}

/* ---- the permanent left rail: invite card + a separate nav card ---- */
.lobby-left {
  display: flex; flex-direction: column; gap: 14px;
  align-self: start; max-height: calc(100vh - 118px);
}
.invite-panel {
  border: var(--border); border-radius: 22px;
  background: linear-gradient(150deg, var(--lime), var(--cyan));
  box-shadow: var(--shadow);
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
  flex: 0 1 auto; min-height: 0; overflow-y: auto;
}
/* nav / exit — its own block, entirely separate from the invite card */
.lobby-nav {
  flex: 0 0 auto;
  border: var(--border); border-radius: 22px;
  background: var(--white); box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.lobby-nav .btn-tolobby,
.lobby-nav .btn-back-stage { width: 100%; margin: 0; }
.invite-label {
  font-family: var(--font-head); font-weight: 600;
  font-size: 13px; opacity: .75;
}
.invite-panel .lobby-code {
  font-family: var(--font-head); font-weight: 700;
  font-size: 40px; letter-spacing: 3px; line-height: 1;
  -webkit-text-stroke: 2px var(--ink);
  color: var(--white);
}
.invite-qr { align-self: center; margin: 2px 0; }
.invite-qr .qr-box { width: 150px; height: 150px; }
.invite-panel .link-row { display: flex; gap: 8px; }
.invite-panel .link-input { flex: 1 1 auto; min-width: 0; font-size: 13px; }
.invite-panel .code-entry { margin-top: 2px; }
/* on narrow screens the rail becomes a normal block on top */
@media (max-width: 900px) {
  .lobby-split { grid-template-columns: 1fr; }
  .invite-panel { max-height: none; }
  body.lobby-full .clan { height: auto; min-height: 60vh; }
}
/* header pieces keep their height, the pane flexes */
body.lobby-full .clan-tabs,
body.lobby-full .clan-banner,
body.lobby-full .avatar-strip,
body.lobby-full #joinReqWrap { flex: 0 0 auto; }
.clan-banner { position: relative; }

body.lobby-full .clan-pane {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
body.lobby-full .clan-pane.hidden { display: none; }
/* scrollable regions inside a pane */
body.lobby-full .clan-feed {
  flex: 1 1 auto; min-height: 0; max-height: none;
  overflow-y: auto;
}
body.lobby-full #paneFiles,
body.lobby-full #paneMembers,
body.lobby-full #paneTransfers { overflow-y: auto; padding: 16px; }
body.lobby-full .clan-composer {
  flex: 0 0 auto;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
/* leaving the lobby: a small close button in the tab row */
.clan-close {
  flex: 0 0 auto; width: 44px;
  border: 3px solid var(--ink); border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: var(--pink); color: var(--white);
  font-family: var(--font-head); font-weight: 700; font-size: 18px;
  cursor: pointer;
}
.clan-close:hover { background: var(--ink); }

/* tabs */
.clan-tabs { display: flex; gap: 4px; padding: 10px 10px 0; background: var(--purple); }
.clan-tab {
  flex: 1; cursor: pointer;
  border: 3px solid var(--ink); border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: #6a3fd6; color: rgba(255,255,255,.75);
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  padding: 11px 6px;
  transition: background .15s, color .15s, transform .12s;
}
.clan-tab:hover { color: var(--white); }
.clan-tab.active {
  background: var(--cream); color: var(--ink);
  transform: translateY(2px);
}
.tab-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 5px; margin-left: 4px; border-radius: 999px;
  background: var(--pink); color: var(--white); font-size: 11px;
  border: 2px solid var(--ink);
}

/* banner */
.clan-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #efe6ff 0%, var(--white) 100%);
  border-bottom: 4px solid var(--ink);
}
.clan-crest {
  width: 58px; height: 58px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 30px;
  border: var(--border); border-radius: 14px;
  background: var(--yellow); box-shadow: var(--shadow-sm);
}
.clan-info { flex: 1; min-width: 0; }
.clan-name {
  font-family: var(--font-head); font-weight: 700;
  font-size: 27px; letter-spacing: 3px; line-height: 1.1;
}
.clan-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; opacity: .75; }
.clan-stat b { font-family: var(--font-head); }
.clan-online { text-align: right; flex: 0 0 auto; }
.clan-online-label { font-size: 11px; opacity: .6; font-weight: 700; }
.clan-online-num {
  font-family: var(--font-head); font-weight: 700; font-size: 20px;
  color: #1a9c3e;
}

/* panes */
.clan-pane { padding: 14px; }
#paneChat { padding: 0; }

/* the feed */
.clan-feed {
  min-height: 260px; max-height: 52vh; overflow-y: auto;
  padding: 16px 14px;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.02) 0 2px, transparent 2px 4px),
    var(--cream);
}
.feed-empty { text-align: center; padding: 40px 20px; font-family: var(--font-head); font-size: 17px; }
.feed-empty .muted { font-size: 13px; margin-top: 8px; font-family: var(--font-body); }

/* one entry (message or file card) */
.feed-item { margin-bottom: 12px; display: flex; flex-direction: column; animation: file-pop .25s cubic-bezier(.34,1.56,.64,1); }
.feed-item.mine { align-items: flex-end; }
.feed-who {
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  margin-bottom: 3px; padding: 0 4px;
  display: flex; gap: 8px; align-items: baseline;
}
.feed-role { font-size: 11px; color: var(--purple); font-weight: 700; }
.feed-time { font-size: 10px; opacity: .45; font-weight: 400; }

/* text bubble */
.feed-msg {
  max-width: 84%; padding: 10px 14px;
  border: var(--border); border-radius: 16px;
  background: var(--cyan); font-size: 15px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: 2px 2px 0 var(--ink);
}
.feed-item.mine .feed-msg { background: var(--lime); }

/* file card — the "requesting cards" panel equivalent */
.feed-card {
  width: 100%; max-width: 92%;
  border: var(--border); border-radius: 16px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}
.feed-item.mine .feed-card { background: #FFE1EC; }
.feed-card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: rgba(0,0,0,.10);
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
}
.feed-card-body { display: flex; align-items: center; gap: 12px; padding: 12px; }
.feed-card-icon {
  width: 52px; height: 52px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 26px;
  border: var(--border); border-radius: 12px; background: var(--white);
  box-shadow: 2px 2px 0 var(--ink);
}
.feed-card-meta { flex: 1; min-width: 0; }
.feed-card-name {
  font-weight: 700; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-card-sub { font-size: 12px; opacity: .6; margin-top: 1px; }
.feed-card-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.feed-card .prog { margin: 0 12px 12px; }
.feed-card .prog-label { margin: 4px 12px 10px; font-size: 11px; }

/* ---- transfers tab ---- */
#transferList { list-style: none; gap: 14px; }
.transfer-item { list-style: none; }
.transfer-item .feed-card { max-width: none; width: 100%; }
/* finished transfers go green and stay visible */
.transfer-item.tdone .feed-card {
  background: var(--lime);
  border-color: var(--ink);
}
.transfer-item.tdone .feed-card-head::after { content: " · done ✅"; }
.transfer-item.tdone .prog-fill { animation: none; filter: saturate(.5) brightness(1.05); }
/* ---- Files tab: selection bar ---- */
.fm-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  border: 3px solid var(--ink); border-radius: 16px;
  background: var(--white); box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 10px 8px 14px; margin-bottom: 12px;
}
.fm-bar.hidden { display: none; }
.fm-selcount { font-family: var(--font-head); font-weight: 600; font-size: 14px; }
.fm-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-graball { background: var(--yellow); }
.btn-again { background: var(--cyan); }
.btn-del { background: #FFD9D9; padding-left: 10px; padding-right: 10px; }
.btn-del:hover { background: var(--pink); color: var(--white); }

/* tick box on a file tile */
.fm-tile { position: relative; }
.fm-check {
  position: absolute; top: 8px; left: 8px;
  width: 26px; height: 26px; border-radius: 8px;
  border: 3px solid var(--ink); background: var(--white);
  cursor: pointer; font-size: 15px; line-height: 1;
  font-family: var(--font-head); font-weight: 700;
  display: grid; place-items: center; padding: 0;
  transition: transform .12s, background .12s;
}
.fm-check:hover { transform: scale(1.12); }
.fm-check.on { background: var(--lime); }
.fm-tile.picked {
  background: #F0FFD9;
  box-shadow: 0 0 0 4px var(--lime), var(--shadow-sm);
}
.fm-acts { display: flex; gap: 6px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.fm-tile.done .fm-icon { opacity: .55; }

/* ---- join requests: someone's knocking ---- */
.knock-row {
  display: flex; align-items: center; gap: 12px;
  border: 3px solid var(--ink); border-radius: 16px;
  background: linear-gradient(100deg, var(--yellow), #FFE9A8);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 12px; margin-bottom: 10px;
  animation: knock-in .35s cubic-bezier(.34,1.56,.64,1) backwards,
             knock-glow 1.6s ease-in-out infinite .35s;
}
@keyframes knock-in {
  from { opacity: 0; transform: translateX(-24px) rotate(-3deg); }
}
@keyframes knock-glow {
  0%, 100% { box-shadow: 4px 4px 0 var(--ink); }
  50%      { box-shadow: 4px 4px 0 var(--ink), 0 0 0 6px rgba(255, 90, 160, .35); }
}
.knock-av {
  width: 42px; height: 42px; flex: 0 0 auto;
  border: 3px solid var(--ink); border-radius: 50%;
  background: var(--white); display: grid; place-items: center;
  font-size: 22px;
  animation: knock-wobble 1s ease-in-out infinite;
}
@keyframes knock-wobble {
  0%, 100% { transform: rotate(-9deg); }
  50%      { transform: rotate(9deg) scale(1.06); }
}
.knock-text { display: flex; flex-direction: column; line-height: 1.15; margin-right: auto; }
.knock-sub { font-size: 12px; opacity: .7; }
.knock-row .btn { flex: 0 0 auto; }
/* the tab badge nags while people are waiting */
#joinReqWrap .notif-inline { animation: knock-pop .9s ease-in-out infinite; }
@keyframes knock-pop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.22); } }

/* ---- lobby exit buttons ---- */
.lobby-exit-row { display: flex; gap: 8px; margin-top: auto; }
.lobby-exit-row .btn { flex: 1 1 auto; }
.btn-leave { background: var(--white); }
.btn-closelobby { background: #FFD9D9; }
.btn-closelobby:hover { background: var(--pink); color: var(--white); }
.invite-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-head); font-size: 12.5px; opacity: .85;
}
.invite-stat b { font-weight: 700; }
/* code entry now lives on the home screen */
.home-code { margin-top: 12px; }

/* ---- Transfers tab: "who are we looking at" chips ---- */
.who-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 3px dashed rgba(0, 0, 0, .18);
}
.who-row.hidden { display: none; }
.who-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 3px solid var(--ink); border-radius: 999px;
  background: var(--white); cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  padding: 5px 12px 5px 6px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, background .12s;
}
.who-chip:hover { transform: translate(-1px, -1px); background: var(--yellow); }
.who-chip.active { background: var(--purple); color: var(--white); }
.who-av {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--lime);
  display: grid; place-items: center; font-size: 15px;
}
.who-n {
  min-width: 20px; padding: 0 5px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--pink); color: var(--white);
  font-size: 12px; text-align: center;
}
.who-chip.active .who-n { background: var(--yellow); color: var(--ink); }

/* the other side pulled the plug */
.transfer-item.tstopped .feed-card {
  background: #FFE0E0;
  border-color: var(--ink);
}
.transfer-item.tstopped .feed-card-head::after { content: " · stopped ✋"; }
.transfer-item.tstopped .prog-fill { animation: none; }
.transfer-item.tstopped .feed-card-name { text-decoration: line-through; opacity: .75; }
/* a tab with something moving right now */
.clan-tab.busy .tab-count {
  background: var(--lime); color: var(--ink);
  animation: pulse-dot 1.1s ease infinite;
}

/* composer */
.clan-composer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px; border-top: 4px solid var(--ink);
  background: var(--white);
}
.composer-send {
  width: 46px; height: 46px; flex: 0 0 auto;
  border: var(--border); border-radius: 50%;
  font-size: 20px; cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .12s, background .12s;
  background: var(--pink); color: var(--white);
}
.composer-send:hover { background: var(--purple); }
.composer-send:active { transform: translate(2px,2px); box-shadow: none; }
.composer-input {
  flex: 1; min-width: 0;
  border: var(--border); border-radius: 999px;
  padding: 12px 18px; font-family: var(--font-body); font-size: 15px;
  background: var(--cream);
}
.composer-input:focus { outline: none; background: var(--white); box-shadow: inset 2px 2px 0 rgba(27,27,31,.08); }

@media (max-width: 700px) {
  .clan { border-radius: 16px; }
  .clan-name { font-size: 22px; letter-spacing: 2px; }
  .clan-crest { width: 48px; height: 48px; font-size: 25px; }
  .clan-tab { font-size: 14px; padding: 9px 4px; }
  .clan-feed { max-height: 46vh; }
}

/* ============ mode blocks on home ============ */
.mode-block {
  border: 4px solid var(--ink); border-radius: 20px;
  background: var(--white); box-shadow: 6px 6px 0 var(--ink);
  padding: 16px; margin-bottom: 20px;
}
.mode-lobby { background: linear-gradient(135deg, #F3EBFF 0%, var(--white) 100%); }
.mode-label {
  font-family: var(--font-head); font-weight: 700; font-size: 17px;
  margin-bottom: 12px;
}
.mode-block .sendrecv-row { margin: 0; }
.btn-lobby-create { background: var(--purple); color: var(--white); }
.btn-lobby-create:hover { background: var(--pink); }
.btn-lobby-join { background: var(--yellow); }
.btn-lobby-join:hover { background: var(--lime); }

/* ---- home: two big doors (SHARE / RECEIVE) ---- */
/* ---- home: two columns (give/get left, friends right) ---- */
/* accounts/friends removed → single centred column (just the two doors + dropzone) */
.home-split { max-width: 620px; margin: 0 auto 8px; }
.home-left { min-width: 0; }
.home-right {
  border: var(--border); border-radius: 22px;
  background: var(--white); box-shadow: var(--shadow);
  padding: 14px; display: flex; flex-direction: column;
  max-height: 560px;
}
.friends-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.friends-tab {
  flex: 1 1 0; border: 3px solid var(--ink); border-radius: 14px;
  background: var(--cream); cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  padding: 10px 8px; box-shadow: 3px 3px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .12s, background .12s;
}
.friends-tab:hover { background: var(--yellow); }
.friends-tab.active { background: var(--purple); color: var(--white); }
.friends-tab .tab-count {
  min-width: 20px; padding: 0 6px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--pink); color: var(--white);
  font-size: 12px;
}
.friends-tab.active .tab-count { background: var(--yellow); color: var(--ink); }
.friends-pane { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.friends-pane.hidden { display: none; }
.friend-search, .friend-search:focus {
  width: 100%; border: 3px solid var(--ink); border-radius: 12px;
  background: var(--cream); padding: 10px 12px; margin-bottom: 10px;
  font-family: var(--font-body); font-size: 14px; box-shadow: 2px 2px 0 var(--ink);
}
.friend-search:focus { outline: none; background: var(--white); border-color: var(--purple); }
.friends-scroll { overflow-y: auto; flex: 1 1 auto; min-height: 80px; margin: 0; }
#homeReqList { margin: 0 0 8px; }

/* add-friends: ID / mobile toggle */
.add-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.add-mode { flex: 1 1 0; background: var(--cream); font-size: 14px; }
.add-mode.active { background: var(--cyan); }
.add-method.hidden { display: none; }
.add-method { animation: chooser-fade .18s ease; }
.add-method .person-list { margin-top: 12px; max-height: 260px; overflow-y: auto; }

/* mobile picker */
.mobile-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.country-select {
  flex: 1 1 130px; min-width: 0; border: 3px solid var(--ink); border-radius: 12px;
  background: var(--white); padding: 10px; font-family: var(--font-body); font-size: 14px;
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
}
.mobile-input { flex: 2 1 120px; }
.mobile-row .btn-grab { flex: 0 0 auto; }
.mobile-pop { animation: mobile-pop .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes mobile-pop { from { transform: scale(.9); opacity: .4; } }

@media (max-width: 820px) {
  .home-split { grid-template-columns: 1fr; }
  .home-right { max-height: none; }
  .friends-scroll { max-height: 360px; }
}

.two-doors {
  display: flex; gap: 20px; margin: 0 0 24px;
}
.door {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 5px solid var(--ink); border-radius: 24px;
  padding: 30px 18px; cursor: pointer;
  box-shadow: 8px 8px 0 var(--ink);
  font-family: var(--font-head);
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .16s;
}
.door:hover { transform: translate(-2px, -2px); box-shadow: 11px 11px 0 var(--ink); }
.door:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.door-share { background: var(--pink); color: var(--white); }
.door-receive { background: var(--cyan); }
.door-emoji { font-size: 52px; line-height: 1; }
.door-title { font-size: 30px; font-weight: 700; letter-spacing: .5px; }
.door-sub { font-size: 13px; font-weight: 500; opacity: .9; }

/* ---- receive/share quick switch ---- */
.switch-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 18px 0 6px; flex-wrap: wrap;
}
.btn-switch { background: var(--pink); color: var(--white); }
.btn-switch:hover { background: var(--purple); }

/* ---- "what do you want to share?" chooser ---- */
.chooser-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30, 20, 40, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: chooser-fade .16s ease;
}
@keyframes chooser-fade { from { opacity: 0; } }
.chooser-box {
  width: 100%; max-width: 420px;
  border: 5px solid var(--ink); border-radius: 24px;
  background: var(--white); box-shadow: 9px 9px 0 var(--ink);
  padding: 24px; text-align: center;
  animation: chooser-pop .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes chooser-pop { from { transform: translateY(18px) scale(.94); opacity: 0; } }
.chooser-title { font-family: var(--font-head); font-weight: 700; font-size: 20px; margin: 0 0 18px; }
.chooser-opts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.chooser-opt {
  display: flex; align-items: center; gap: 14px;
  border: 4px solid var(--ink); border-radius: 16px;
  background: var(--cream); cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 18px;
  padding: 16px 20px; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .14s, background .14s;
}
.chooser-opt:hover { background: var(--yellow); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.chooser-opt:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chooser-emoji { font-size: 30px; }

/* themed confirm dialog */
.confirm-box { max-width: 400px; }
.confirm-emoji { font-size: 46px; line-height: 1; margin-bottom: 8px; }
.confirm-msg { font-family: var(--font-head); font-weight: 600; font-size: 17px; line-height: 1.4; margin: 0 0 18px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { flex: 1 1 0; }

/* full-screen "session ended" curtain */
.ended-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: ended-fade .25s ease;
}
.ended-overlay.hidden { display: none; }
@keyframes ended-fade { from { opacity: 0; } }
.ended-inner {
  text-align: center; max-width: 460px;
  border: 5px solid var(--ink); border-radius: 28px;
  background: var(--white); box-shadow: 10px 10px 0 var(--ink);
  padding: 40px 28px;
  animation: ended-pop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes ended-pop { from { transform: translateY(24px) scale(.9); opacity: 0; } }
.ended-emoji { font-size: 72px; line-height: 1; animation: ended-wave 1.2s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes ended-wave { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
.ended-title { font-family: var(--font-head); font-weight: 700; font-size: 24px; margin: 14px 0 8px; }
.ended-sub { font-size: 14px; opacity: .8; margin: 0 0 22px; line-height: 1.5; }

/* stage: actions in their own block, clear of the files */
.stage-buttons {
  margin-top: 18px; padding-top: 16px;
  border-top: 3px dashed rgba(0,0,0,.15);
  display: flex; flex-direction: column; gap: 10px;
}
.stage-buttons .btn-add-solid,
.stage-buttons .btn-copyall,
.stage-buttons .stage-actions { margin-top: 0; }
.btn-back-stage { background: var(--white); }
.btn-back-stage:hover { background: var(--yellow); }

/* direct download: two columns — list left, active transfer right */
#screen-direct { max-width: 1240px; }
.direct-wrap { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; justify-content: center; }
.direct-panel { flex: 1 1 560px; max-width: 720px; min-width: 0; margin: 0; }
.direct-active {
  flex: 0 0 320px; align-self: stretch;
  border: 5px solid var(--ink); border-radius: 24px;
  background: linear-gradient(150deg, #FFE9F4 0%, var(--white) 60%);
  box-shadow: 8px 8px 0 var(--ink); padding: 20px;
  animation: da-in .3s cubic-bezier(.34,1.56,.64,1);
}
.direct-active.hidden { display: none; }
@keyframes da-in { from { transform: translateX(24px); opacity: 0; } }
.direct-active-head {
  font-family: var(--font-head); font-weight: 700; font-size: 16px; margin-bottom: 16px;
  animation: da-head-pulse 1.4s ease-in-out infinite;
}
@keyframes da-head-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.direct-active-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.da-icon { font-size: 64px; line-height: 1; animation: da-bob 1s ease-in-out infinite; }
@keyframes da-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.da-name { font-family: var(--font-head); font-weight: 600; font-size: 16px; word-break: break-word; }
.da-prog {
  width: 100%; height: 20px; border: 3px solid var(--ink); border-radius: 999px;
  background: var(--white); overflow: hidden;
}
.da-fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(45deg, var(--pink) 0 12px, var(--purple) 12px 24px);
  background-size: 34px 34px; animation: da-stripe .6s linear infinite;
  transition: width .12s linear;
}
@keyframes da-stripe { from { background-position: 0 0; } to { background-position: 34px 0; } }
.da-label { font-family: var(--font-head); font-weight: 600; font-size: 14px; display: flex; gap: 4px; }
@media (max-width: 820px) {
  .direct-wrap { flex-direction: column; }
  .direct-active { flex-basis: 100%; }
}

/* direct list: square tiles, scrollable, buttons stay put */
.direct-grid {
  max-height: 46vh; overflow-y: auto; padding: 4px 4px 2px;
  margin-bottom: 4px;
}
.direct-foot { padding-top: 14px; border-top: 3px dashed rgba(0,0,0,.12); }
.direct-foot .graball-wrap { margin: 0 0 10px; }
.direct-tile .fm-sub { min-height: 1em; }
.direct-tile .prog, .direct-tile .prog-label { display: none; }
.direct-tile.queued { opacity: .82; }
.direct-tile.queued .da-tile-label { display: block; font-size: 12px; opacity: .8; margin-top: 4px; }
.direct-tile.done { background: var(--lime); }
.direct-tile.done .fm-icon { opacity: .6; }
.direct-tile.stopped { background: #FFE0E0; }

/* stop button in the big active panel */
#daStop { margin-top: 6px; background: #FFD9D9; }
#daStop:hover { background: var(--pink); color: var(--white); }

/* ---- stage (assemble a share) ---- */
/* wider than other screens so the card + members panel sit side by side */
#screen-stage { max-width: 1320px; }
/* the whole stage: the card + a members panel beside it, using the page width */
.stage-wrap { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; justify-content: center; }
.stage-panel { max-width: 880px; flex: 1 1 620px; min-width: 0; margin: 0; }
.stage-hint { font-size: 13px; opacity: .8; margin: 0 0 16px; line-height: 1.5; }
.stage-item .file-name { font-weight: 600; }
.stage-split { display: flex; gap: 22px; align-items: stretch; }
.stage-main { flex: 1 1 auto; min-width: 0; }
.stage-side { display: flex; flex-direction: column; gap: 16px; }

/* members panel — its own card in the empty space to the right of the stage */
/* right column of the stage: downloading-now + share QR, stacked */
.stage-rightcol {
  flex: 0 0 300px; display: flex; flex-direction: column; gap: 16px;
  align-self: stretch;
}
.stage-members {
  display: flex; flex-direction: column;
  border: 4px solid var(--ink); border-radius: 22px;
  background: var(--white); box-shadow: 6px 6px 0 var(--ink);
  padding: 16px; max-height: 46vh;
}
.stage-members.hidden { display: none; }
/* share code + QR block, matching the lobby rail */
.stage-qr-block {
  display: flex; flex-direction: column; gap: 10px;
  border: 4px solid var(--ink); border-radius: 22px;
  background: linear-gradient(150deg, var(--lime), var(--cyan));
  box-shadow: 6px 6px 0 var(--ink);
  padding: 16px;
}
.stage-qr-block .lobby-code { font-size: 30px; }
.stage-qr-block .qr-card { align-self: center; }
.stage-qr-block .link-row { display: flex; gap: 8px; }
.stage-qr-block .link-input { flex: 1 1 auto; min-width: 0; font-size: 13px; }
.stage-members-head {
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.stage-members-search {
  width: 100%; border: 3px solid var(--ink); border-radius: 12px;
  background: var(--cream); padding: 9px 12px; margin-bottom: 12px;
  font-family: var(--font-body); font-size: 14px; box-shadow: 2px 2px 0 var(--ink);
}
.stage-members-search:focus { outline: none; background: var(--white); border-color: var(--purple); }
.stage-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.stage-actions .btn-mega { width: 100%; }

/* solid "add more" button (was dashed) */
.btn-add-solid {
  width: 100%; background: var(--cyan); border: var(--border);
  box-shadow: var(--shadow-sm); margin-top: 4px;
}
.btn-add-solid:hover { background: var(--yellow); }

/* green animated "copy download link" — inline (phones/tablets) */
.btn-copyall {
  width: 100%; margin-top: 16px;
  background: var(--lime); color: var(--ink);
  animation: copyall-pulse 1.8s ease-in-out infinite;
}
.btn-copyall:hover { background: #A6E63C; }
.btn-copyall:disabled { opacity: .5; animation: none; cursor: not-allowed; }
@keyframes copyall-pulse {
  0%, 100% { box-shadow: 6px 6px 0 var(--ink); transform: translateY(0); }
  50%      { box-shadow: 6px 6px 0 var(--ink), 0 0 0 7px rgba(183, 240, 74, .45); }
}

/* big desktop CTA on the right of the stage panel */
.stage-bigcopy {
  width: 100%; min-height: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 5px solid var(--ink); border-radius: 24px;
  background: var(--lime); color: var(--ink); cursor: pointer;
  box-shadow: 8px 8px 0 var(--ink); padding: 24px;
  font-family: var(--font-head);
  animation: copyall-pulse 1.8s ease-in-out infinite;
}
.stage-bigcopy:hover { background: #A6E63C; transform: translate(-2px, -2px); }
.stage-bigcopy:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.stage-bigcopy:disabled { opacity: .5; animation: none; cursor: not-allowed; }
.bigcopy-emoji { font-size: 60px; line-height: 1; animation: bigcopy-bob 1.4s ease-in-out infinite; }
@keyframes bigcopy-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.bigcopy-title { font-size: 26px; font-weight: 700; text-align: center; }
.bigcopy-sub { font-size: 13px; font-weight: 500; opacity: .8; text-align: center; }

@media (min-width: 860px) {
  .stage-side { flex: 0 0 300px; }
  .stage-bigcopy { flex: 1 1 auto; } /* fill the column; who-block sits below it */
  .btn-copyall { display: none; } /* the big right-side button takes over */
}
/* files grid scrolls so the page can't grow forever as files pile up */
#stageGrid { max-height: 44vh; overflow-y: auto; padding: 2px 2px 4px; }
@media (max-width: 859px) {
  .stage-split { flex-direction: column; }
  #btnStageCopyBig { display: none; } /* inline copy button in the main column takes over */
  .stage-side { width: 100%; }
  /* right column drops full-width below the card */
  .stage-rightcol { flex-basis: 100%; }
  .stage-members { max-height: none; }
  .stage-who-list { max-height: 320px; }
  #stageGrid { max-height: 50vh; }
}

/* ---- "downloading now" list (stage members panel) ---- */
.who-count {
  min-width: 22px; padding: 0 7px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--lime);
  font-size: 13px; text-align: center;
}
.stage-who-list {
  list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 2px;
  overflow-y: auto; flex: 1 1 auto; /* scroll when there are many */
}
.dl-row {
  display: flex; align-items: center; gap: 12px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: var(--white); box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 12px;
  animation: knock-in .3s cubic-bezier(.34,1.56,.64,1) backwards;
}
.dl-av {
  position: relative; flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--cyan);
  display: grid; place-items: center; font-size: 20px;
}
.dl-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--lime);
  animation: dl-pulse 1.3s ease-in-out infinite;
}
@keyframes dl-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.dl-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.dl-name { font-family: var(--font-head); font-weight: 600; font-size: 14px; }
.dl-status { font-size: 12px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- direct download page ---- */
.direct-from { font-family: var(--font-head); font-size: 14px; opacity: .8; margin: 0 0 14px; }
.direct-from b { color: var(--purple); }
.direct-more { margin-top: 16px; padding-top: 14px; border-top: 3px dashed rgba(0,0,0,.15); }
.direct-more .btn { width: 100%; }

/* blue animated "go to lobby" (direct page) + "back to direct" (lobby rail) */
.btn-tolobby {
  background: #2E7BFF; color: var(--white);
  animation: tolobby-pulse 1.7s ease-in-out infinite;
}
.btn-tolobby:hover { background: var(--purple); }
@keyframes tolobby-pulse {
  0%, 100% { box-shadow: 5px 5px 0 var(--ink); transform: translateY(0); }
  50%      { box-shadow: 5px 5px 0 var(--ink), 0 0 0 6px rgba(46, 123, 255, .4); transform: translateY(-1px); }
}
#btnLobbyToDirect { width: 100%; margin-bottom: 8px; }
.btn-link { background: var(--cyan); }
.btn-link:hover { background: var(--lime); }

/* ---- queue: only the active row keeps a bar ---- */
.file-item.queued { opacity: .82; }
.file-item.queued .prog { display: none; }
.transfer-item.tqueued .feed-card { background: #FFF4D6; }
.transfer-item.tqueued .prog { display: none !important; }
.transfer-item.tqueued .feed-card-head::after { content: " · queued ⏳"; }
.transfer-item.tdone .prog,
.transfer-item.tstopped .prog { display: none !important; }
@media (max-width: 620px) {
  .two-doors { gap: 12px; }
  .door { padding: 22px 10px; border-width: 4px; }
  .door-emoji { font-size: 40px; }
  .door-title { font-size: 22px; }
  .door-sub { font-size: 11px; }
}

/* ============ join / code entry ============ */
.join-panel {
  max-width: 520px; margin: 40px auto;
  border: 4px solid var(--ink); border-radius: 26px;
  background: var(--white); box-shadow: 10px 10px 0 var(--ink);
  padding: 40px 28px; text-align: center;
  animation: panel-in .35s cubic-bezier(.34,1.56,.64,1);
}
.join-emoji { font-size: 60px; animation: mascot-bob 2.6s ease-in-out infinite; }
.join-title { font-family: var(--font-head); font-size: 32px; font-weight: 700; margin: 8px 0 4px; }
.join-sub { font-size: 15px; opacity: .6; margin-bottom: 26px; }
.code-boxes { display: flex; gap: 9px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.code-box {
  width: 56px; height: 68px;
  border: 4px solid var(--ink); border-radius: 14px;
  background: var(--cream);
  font-family: var(--font-head); font-weight: 700; font-size: 32px;
  text-align: center; text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .14s cubic-bezier(.34,1.56,.64,1), background .14s, box-shadow .14s;
}
.code-box:focus {
  outline: none; background: var(--yellow);
  transform: translateY(-6px) scale(1.06);
  box-shadow: 5px 8px 0 var(--ink);
}
.code-box.filled { background: var(--lime); animation: box-pop .28s cubic-bezier(.34,1.56,.64,1); }
@keyframes box-pop { 50% { transform: scale(1.18) rotate(-4deg); } }
.code-boxes.shake { animation: shake .4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-9px); }
  75% { transform: translateX(9px); }
}
.join-err { color: var(--pink); font-weight: 700; font-family: var(--font-head); margin-bottom: 12px; }
.join-go { display: block; width: 100%; margin-bottom: 12px; }

/* ============ member avatars ============ */
.avatar-strip {
  display: flex; gap: 8px; padding: 10px 16px; flex-wrap: wrap;
  border-bottom: 4px solid var(--ink); background: var(--white);
}
.avatar-strip:empty { display: none; }
.avatar-chip {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--cyan);
  display: grid; place-items: center; font-size: 21px;
  box-shadow: 2px 2px 0 var(--ink);
  position: relative;
}
.avatar-chip.me { background: var(--lime); }
.avatar-chip.pending { opacity: .5; filter: grayscale(1); }
.avatar-chip .dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--lime); border: 2px solid var(--ink);
}
.member-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.member-tile {
  text-align: center; padding: 12px 6px;
  border: var(--border); border-radius: 16px;
  background: var(--white); box-shadow: var(--shadow-sm);
}
.member-tile .avatar-chip { width: 54px; height: 54px; font-size: 26px; margin: 0 auto 8px; }
.member-name {
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-role { font-size: 11px; opacity: .55; }

/* ============ file manager ============ */
.filter-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip {
  border: 3px solid var(--ink); border-radius: 999px;
  background: var(--white); cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 13px;
  padding: 7px 13px; box-shadow: 2px 2px 0 var(--ink);
  transition: background .12s, transform .12s;
}
.filter-chip:hover { background: var(--yellow); }
.filter-chip.active { background: var(--purple); color: var(--white); }
.fm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}
.fm-tile {
  border: var(--border); border-radius: 16px;
  background: var(--white); box-shadow: var(--shadow-sm);
  padding: 14px 10px; text-align: center;
  animation: file-pop .25s cubic-bezier(.34,1.56,.64,1) backwards;
  transition: transform .14s;
}
.fm-tile:hover { transform: translateY(-4px) rotate(-1deg); }
.fm-tile.done { background: var(--lime); }
.fm-icon { font-size: 36px; margin-bottom: 6px; }
.fm-name {
  font-weight: 700; font-size: 13px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fm-sub { font-size: 11px; opacity: .55; margin: 3px 0 8px; }
.fm-tile .prog { height: 12px; margin: 6px 0 4px; }
.fm-tile .btn { width: 100%; font-size: 12px; padding: 7px 6px; }

@media (max-width: 700px) {
  .code-box { width: 44px; height: 56px; font-size: 25px; border-width: 3px; }
  .join-panel { margin: 16px 8px; padding: 28px 16px; }
  .fm-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 9px; }
  .member-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* ============ footer ============ */
.footer {
  text-align: center; padding: 30px 20px 40px;
  font-size: 14px; opacity: .65;
}

/* ============ confetti & toast ============ */
.confetti-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
}
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: var(--white);
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  padding: 14px 26px; border-radius: 999px;
  border: 3px solid var(--white);
  box-shadow: 0 6px 0 rgba(0,0,0,.25);
  z-index: 101;
  animation: toast-in .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes toast-in {
  from { transform: translateX(-50%) translateY(30px) scale(.8); opacity: 0; }
}

/* ============ responsive ============ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 10px; }
  .hero-right { order: -1; }
  .how-grid { grid-template-columns: 1fr; }
  .dropzone { min-height: 260px; }
  .screen { padding: 12px 18px 40px; }
  .panel { padding: 22px; }
  .hero-title { font-size: 38px; }
  .share-flex { flex-direction: column; align-items: center; }
  .topbar { padding: 14px 18px; }
  .topbar-right { display: none; }
  .code-tile { width: 46px; height: 54px; font-size: 26px; }
  .btn-mega { font-size: 19px; padding: 16px 30px; }
  .marquee { margin: 20px -18px; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .marquee-track { animation: none !important; }
}
