/* ================================================================
   Marketplace Matchmaker — TEAM '26 Anaheim
   Portrait-first dark mode kiosk experience — Figma-aligned
   ================================================================ */

/* --- Fonts: Charlie Display + Charlie Text --- */
@font-face {
  font-family: 'Charlie Display';
  src: url('fonts/CharlieDisplay-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Charlie Display';
  src: url('fonts/CharlieDisplay-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Charlie Text';
  src: url('fonts/CharlieText-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Charlie Text';
  src: url('fonts/CharlieText-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Design tokens — anchored to Figma --- */
:root {
  --bg-dark: #303134;
  --bg-header: #101214;

  /* Lavender / purple system */
  --tile-lavender: #efe4ff;        /* tile background */
  --tile-grid: rgba(159, 109, 245, 0.18);
  --pink-press: #f0a3ff;            /* selected/pressed state */
  --pink-press-overlay: rgba(240, 163, 255, 0.55);
  --purple-500: #BF63F3;
  --purple-400: #C585F6;
  --purple-200: #EED7FC;
  --purple-100: #F8EEFE;

  --white: #FFFFFF;
  --black: #101214;
  --grey-100: #F5F5F5;
  --grey-200: #F0F1F2;
  --grey-400: #B7B9BE;
  --grey-500: #8C8F97;
  --grey-700: #6C6F77;
  --grey-800: #505258;

  --blue-700: #1868DB;
  --yellow-400: #FCA700;
  --lime-500: #82B536;

  --font-display: 'Charlie Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-text: 'Charlie Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-pill: 999px;
  --radius-card: 18px;
  --radius-input: 12px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg-dark);
  color: var(--white);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
img { display: block; }

/* --- App shell — portrait kiosk frame --- */
#app {
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}

/* ================================================================
   HEADER — Atlassian A + ATLASSIAN Marketplace lockup
   ================================================================ */
.header {
  background: var(--bg-header);
  padding: 22px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo-mark { height: 32px; width: auto; }
.header-logo-word-atlassian { height: 24px; width: auto; }
.header-logo-word-marketplace { height: 24px; width: auto; opacity: 0.95; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.progress-track {
  display: flex;
  gap: 5px;
}
.progress-seg {
  width: 28px;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  transition: background 0.3s var(--ease-out);
}
.progress-seg.active { background: var(--purple-500); }
.progress-seg.done { background: var(--purple-400); }

/* ================================================================
   SCREEN BASE — all screens occupy the same kiosk frame
   ================================================================ */
.screen {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  padding: 36px;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--bg-dark);
}
.screen::-webkit-scrollbar { display: none; }
.screen.active {
  display: flex;
  animation: screenEnter 0.4s var(--ease-out);
}
/* Below-header stage that holds all screens */
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@keyframes screenEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Back button --- */
.back-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  transition: all 0.18s var(--ease-out);
  align-self: flex-start;
}
.back-btn:hover { background: rgba(255, 255, 255, 0.16); }
.back-btn:active { transform: scale(0.96); }
.back-btn svg { width: 22px; height: 22px; }

/* ================================================================
   BUTTONS — fully-rounded purple pills
   ================================================================ */
.btn {
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  padding: 18px 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.18s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--purple-500);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(191, 99, 243, 0.35);
}
.btn-primary:hover { background: var(--purple-400); transform: translateY(-1px); }
.btn-primary:disabled {
  background: rgba(191, 99, 243, 0.40);
  color: rgba(255, 255, 255, 0.65);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: var(--grey-100);
  color: var(--grey-500);
}
.btn-secondary:hover { background: var(--white); color: var(--grey-700); }

.btn-arrow {
  display: inline-block;
  font-weight: 700;
  margin-left: 4px;
  transform: translateY(-1px);
}

/* ================================================================
   SCREEN 1 — WELCOME
   ================================================================ */
#screen-welcome {
  text-align: center;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.welcome-inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.welcome-pretitle {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.18;
  color: var(--white);
  margin-bottom: 28px;
}
.welcome-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  line-height: 1.12;
  color: var(--white);
  margin-bottom: 36px;
}
.highlight-pill {
  display: inline-block;
  background: var(--purple-400);
  color: var(--white);
  padding: 6px 22px 8px;
  border-radius: 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.welcome-hint {
  font-family: var(--font-text);
  font-size: 22px;
  line-height: 1.45;
  color: var(--white);
  max-width: 600px;
  margin-bottom: 18px;
}
.welcome-hint-sm {
  font-family: var(--font-text);
  font-size: 16px;
  color: var(--grey-400);
  margin-bottom: 56px;
}
.btn-welcome { padding: 20px 56px; font-size: 22px; }

/* ================================================================
   FORM SCREENS — Name, Problem, Industry
   ================================================================ */
.form-inner {
  width: 100%;
  max-width: 720px;
  margin: 80px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.form-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 56px;
}
.form-sub {
  font-family: var(--font-text);
  font-size: 20px;
  color: var(--white);
  margin-top: -36px;
  margin-bottom: 40px;
}
.form-input {
  width: 100%;
  height: 64px;
  padding: 0 22px;
  background: var(--white);
  border: 1px solid var(--grey-400);
  border-radius: var(--radius-input);
  font-family: var(--font-text);
  font-size: 22px;
  color: var(--black);
  outline: none;
  transition: all 0.18s var(--ease-out);
}
.form-input::placeholder { color: var(--grey-500); }
.form-input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(191,99,243,0.18); }

/* Select with chevron */
.form-select-wrap {
  width: 100%;
  position: relative;
}
.form-select {
  width: 100%;
  height: 64px;
  padding: 0 56px 0 22px;
  background: var(--white);
  border: 1px solid var(--grey-400);
  border-radius: var(--radius-input);
  font-family: var(--font-text);
  font-size: 22px;
  color: var(--black);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.form-select:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(191,99,243,0.18); }
.form-select-chevron {
  position: absolute;
  right: 22px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--black);
  display: flex;
}

/* Form action rows */
.form-actions {
  display: flex;
  gap: 18px;
  margin-top: 48px;
  justify-content: center;
}
.form-actions-center { justify-content: center; }

/* ================================================================
   SCREEN 3 — TILES (lavender grid + pink pressed state)
   ================================================================ */
#screen-tiles { padding: 24px 36px 36px; }

.tiles-header {
  text-align: center;
  margin-bottom: 28px;
}
.tiles-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 18px;
}
.tiles-sub {
  font-family: var(--font-text);
  font-size: 20px;
  color: var(--white);
  margin-bottom: 8px;
}
.tiles-counter {
  font-family: var(--font-text);
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--grey-400);
  text-transform: uppercase;
}
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.tile {
  background: var(--tile-lavender);
  background-image:
    linear-gradient(var(--tile-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--tile-grid) 1px, transparent 1px);
  background-size: 18px 18px;
  border-radius: 14px;
  padding: 18px 18px 22px;
  color: var(--black);
  position: relative;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
  outline: 3px solid transparent;
  outline-offset: -3px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
}
.tile.tile-visible { opacity: 1; transform: translateY(0); }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.18); }
.tile.disabled { opacity: 0.35; pointer-events: none; }

/* Pink pressed/selected state — overlay + ring */
.tile.selected {
  background-color: var(--pink-press);
  outline-color: var(--pink-press);
  box-shadow: 0 6px 22px rgba(240,163,255,0.35);
}
.tile.selected::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--pink-press-overlay);
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.tile-illo {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.tile-illo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tile-body { flex: 1; }
.tile-copy {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
  color: var(--black);
  margin-bottom: 8px;
}
.tile-sub {
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.4;
  color: var(--grey-700);
}
.tile-check {
  position: absolute;
  top: 14px; right: 14px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(16, 18, 20, 0.10);
  border: 2px solid rgba(16, 18, 20, 0.20);
  transition: all 0.18s var(--ease-out);
}
.tile.selected .tile-check {
  background: var(--black);
  border-color: var(--black);
}
.tile.selected .tile-check::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 12px;
  border-right: 2.5px solid white;
  border-bottom: 2.5px solid white;
  transform: rotate(45deg);
}

.tiles-footer {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* ================================================================
   SCREEN 4 — PROBLEM (open-ended textarea)
   ================================================================ */
.problem-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 36px;
  text-align: center;
}
.open-textarea {
  width: 100%;
  min-height: 220px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--grey-400);
  border-radius: var(--radius-input);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.5;
  color: var(--black);
  resize: none;
  outline: none;
  transition: all 0.18s var(--ease-out);
}
.open-textarea::placeholder { color: var(--grey-500); }
.open-textarea:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(191,99,243,0.18); }

.char-count {
  display: block;
  text-align: center;
  font-family: var(--font-text);
  font-size: 12px;
  color: var(--grey-400);
  margin-top: 10px;
  letter-spacing: 0.4px;
}

/* ================================================================
   SCREEN 6 — RESULTS
   ================================================================ */
#screen-results { padding: 24px 36px 36px; }

.results-header { text-align: center; margin-bottom: 24px; }
.results-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 22px;
}
.results-sub {
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.5;
  color: var(--white);
  max-width: 720px;
  margin: 0 auto;
}

/* Personality badge — single big pill card */
.personality-badge {
  background: var(--white);
  border: 1px solid var(--grey-400);
  border-radius: var(--radius-input);
  padding: 22px 24px;
  margin: 28px 0 22px;
  color: var(--black);
}
.personality-label {
  font-family: var(--font-text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--grey-500);
  margin-bottom: 6px;
}
.personality-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--black);
  margin-bottom: 6px;
}
.personality-desc {
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.45;
  color: var(--grey-700);
}

/* Result rows — illustration left, copy right */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
}
.result-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  align-items: center;
  background: var(--purple-100);
  border-radius: var(--radius-card);
  padding: 18px;
  text-decoration: none;
  color: var(--black);
  transition: all 0.18s var(--ease-out);
  opacity: 0;
  transform: translateY(8px);
}
.result-card.result-visible { opacity: 1; transform: translateY(0); }
.result-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.16); }

.result-logo {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  background: var(--white);
  object-fit: contain;
  padding: 6px;
  flex-shrink: 0;
}
.result-logo-fallback {
  background: linear-gradient(135deg, var(--purple-400), var(--purple-500));
}
.result-info {
  display: flex;
  flex-direction: column;
}
.result-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--black);
  margin-bottom: 4px;
}
.result-reason {
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.4;
  color: var(--grey-700);
}

.results-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.btn-save {
  background: var(--grey-100);
  color: var(--grey-500);
  font-size: 20px;
  padding: 16px 38px;
}
.btn-save:hover { background: var(--white); color: var(--grey-700); }
.btn-finish { padding: 18px 64px; }

/* ================================================================
   DECORATIVE TEAM '26 CONFETTI + SCRIBBLES
   ================================================================ */
.deco {
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  animation: decoIn 0.7s var(--ease-spring) forwards;
}
@keyframes decoIn {
  from { opacity: 0; transform: scale(0.6) rotate(0deg); }
  to   { opacity: 0.9; transform: scale(1) rotate(var(--rot, 0deg)); }
}

/* Results screen — confetti burst tightly clustered around the action buttons.
   On a 1920px frame: Email btn ~y1048-1104, Finish btn ~y1118-1181.
   Below the screen padding bottom of 36px, that means absolute pixel offsets
   from the bottom of the .screen are: Email ~bottom 740-790px, Finish ~bottom 660-720px.
   We anchor confetti from bottom 580px up to 880px to ring the buttons. */

/* TOP-RING — above and around the Email "Email my results" button */
.deco-r1  { bottom: 870px; left: 14%;  width: 90px; --rot: -22deg; animation-delay: .15s; } /* big purple bar top-left of buttons */
.deco-r13 { bottom: 880px; right: 12%; width: 70px; --rot: 22deg;  animation-delay: .2s; }  /* big purple bar top-right */
.deco-r3  { bottom: 820px; left: 30%;  width: 38px; --rot: 14deg;  animation-delay: .25s; } /* green tile up-left */
.deco-r12 { bottom: 820px; right: 28%; width: 30px; --rot: -22deg; animation-delay: .3s; }  /* small dot up-right */
.scribble-r1 { bottom: 850px; left: 6%;  width: 70px; --rot: -8deg; opacity: 0.9; animation-delay: .35s; }

/* MID-RING — beside the Email/Finish buttons */
.deco-r2  { bottom: 730px; left: 4%;   width: 80px; --rot: 18deg;  animation-delay: .35s; } /* big blue arc far left */
.deco-r5  { bottom: 700px; right: 4%;  width: 95px; --rot: 14deg;  animation-delay: .4s; }  /* big blue arc far right */
.deco-r4  { bottom: 760px; left: 24%;  width: 32px; --rot: -10deg; animation-delay: .25s; } /* small left-of-Email */
.deco-r9  { bottom: 770px; right: 22%; width: 36px; --rot: 18deg;  animation-delay: .3s; }  /* small right-of-Email */

/* BOTTOM-RING — below and around Finish */
.deco-r6  { bottom: 580px; left: 18%;  width: 50px; --rot: -22deg; animation-delay: .4s; }  /* purple tile below-left */
.deco-r7  { bottom: 560px; left: 48%;  width: 44px; --rot: 28deg;  animation-delay: .45s; } /* green square below center */
.deco-r8  { bottom: 590px; right: 18%; width: 78px; --rot: -14deg; animation-delay: .5s; }  /* big purple bar below-right */
.deco-r10 { bottom: 640px; left: 38%;  width: 28px; --rot: -18deg; animation-delay: .35s; } /* tiny between buttons */
.deco-r11 { bottom: 540px; left: 8%;   width: 36px; --rot: 8deg;   animation-delay: .55s; } /* small bottom-left */
.deco-r14 { bottom: 540px; right: 36%; width: 30px; --rot: -8deg;  animation-delay: .55s; } /* small bottom-right */
.scribble-r2 { bottom: 600px; right: 4%; width: 78px; --rot: 12deg; opacity: 0.9; animation-delay: .5s; }

/* Legacy confetti container (still used by JS celebration burst) */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0.9;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ================================================================
   IDLE TOAST
   ================================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(0);
  background: var(--bg-header);
  color: var(--white);
  padding: 14px 22px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  transition: transform 0.4s var(--ease-out), opacity 0.3s var(--ease-out);
  z-index: 100;
  font-family: var(--font-text);
  font-size: 15px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.toast.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.toast-icon { display: inline-flex; }
.toast-icon svg { width: 18px; height: 18px; }
.toast-btn {
  background: var(--purple-500);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ================================================================
   FOCUS, MOTION, RESPONSIVE
   ================================================================ */
.btn:focus-visible,
.tile:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.open-textarea:focus-visible,
.back-btn:focus-visible {
  outline: 3px solid var(--purple-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1024px) {
  .welcome-headline { font-size: 48px; }
  .form-title, .results-title, .tiles-title { font-size: 44px; }
  .problem-title { font-size: 36px; }
}
@media (max-width: 768px) {
  .header { padding: 16px 22px; }
  .header-logo-mark { height: 24px; }
  .header-logo-word-atlassian, .header-logo-word-marketplace { height: 18px; }
  .screen { padding: 22px; }
  .welcome-pretitle { font-size: 28px; }
  .welcome-headline { font-size: 36px; }
  .form-title, .results-title, .tiles-title { font-size: 34px; }
  .problem-title { font-size: 28px; }
  .welcome-hint { font-size: 18px; }
  .tiles-grid { gap: 10px; }
  .tile { min-height: 200px; padding: 14px; }
  .tile-copy { font-size: 15px; }
  .tile-sub { font-size: 12px; }
  .btn { font-size: 18px; padding: 14px 30px; }
}
@media (max-width: 480px) {
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .form-actions { flex-direction: column-reverse; width: 100%; }
  .form-actions .btn { width: 100%; }
  .results-actions { width: 100%; }
  .results-actions .btn { width: 100%; }
}

/* ================================================================
   APP DETAIL OVERLAY (modal)
   ================================================================ */
.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out), visibility 0s linear 0.25s;
}
.app-overlay.visible {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.25s var(--ease-out);
}
.app-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 20, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.app-overlay-card {
  position: relative;
  background: var(--white);
  color: var(--black);
  border-radius: 22px;
  width: min(720px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  padding: 36px 36px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.32s var(--ease-spring);
}
.app-overlay.visible .app-overlay-card { transform: translateY(0) scale(1); }
.app-overlay-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--grey-100);
  color: var(--grey-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
}
.app-overlay-close:hover { background: var(--grey-200); color: var(--black); transform: rotate(90deg); }
.app-overlay-head {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
  padding-right: 50px;
}
.app-overlay-logo {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  background: var(--purple-100);
  padding: 6px;
  object-fit: contain;
}
.app-overlay-eyebrow {
  font-family: var(--font-text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--purple-500);
  margin-bottom: 6px;
  font-weight: 600;
}
.app-overlay-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.18;
  color: var(--black);
}
.app-overlay-desc {
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  color: var(--grey-700);
  margin-bottom: 22px;
}
.app-overlay-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  background: var(--purple-100);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 24px;
}
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label {
  font-family: var(--font-text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey-500);
}
.meta-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--black);
  line-height: 1.3;
}
.app-overlay-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.app-overlay-actions .btn { font-size: 17px; padding: 14px 26px; }
.app-overlay-actions .btn-secondary {
  background: var(--grey-100);
  color: var(--grey-700);
}
.app-overlay-actions .btn-primary { text-decoration: none; }

@media (max-width: 600px) {
  .app-overlay-card { padding: 28px 22px 22px; }
  .app-overlay-head { grid-template-columns: 72px 1fr; gap: 14px; padding-right: 44px; }
  .app-overlay-logo { width: 72px; height: 72px; border-radius: 14px; }
  .app-overlay-name { font-size: 22px; }
  .app-overlay-meta { grid-template-columns: 1fr; gap: 10px; }
  .app-overlay-actions { flex-direction: column-reverse; }
  .app-overlay-actions .btn { width: 100%; }
}

/* ================================================================
   SCREEN 7 — SHARE CARD
   ================================================================ */
#screen-share { padding: 24px 28px 48px; overflow-y: auto; }

.share-inner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.share-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 38px;
  color: var(--white);
  text-align: center;
  margin-bottom: 10px;
}
.share-sub {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  color: var(--grey-400);
  text-align: center;
  margin-bottom: 22px;
}
.share-sub strong { color: var(--white); }

#shareCard {
  width: 390px;
  max-width: 100%;
  margin: 0 auto 20px;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.06);
  color: #101214;
  flex-shrink: 0;
}
.share-card-banner {
  display: block;
  width: 100%;
  height: auto;
}
.share-card-body {
  padding: 20px 22px 18px;
}
.share-card-greeting {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: #101214;
  margin-bottom: 8px;
}
.share-card-intro {
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.5;
  color: #6C6F77;
  margin-bottom: 14px;
}
.share-card-badge {
  background: #F8EEFE;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.share-card-badge-label {
  font-family: var(--font-text);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #BF63F3;
  font-weight: 600;
  margin-bottom: 3px;
}
.share-card-badge-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #101214;
  margin-bottom: 3px;
}
.share-card-badge-desc {
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 1.4;
  color: #6C6F77;
}
.share-card-section {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8C8F97;
  margin: 2px 0 10px;
}
.share-card-apps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.share-card-app {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid #F0F1F2;
  border-radius: 10px;
  background: #ffffff;
}
.share-card-app-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  padding: 3px;
  display: block;
}
.share-card-app-logo-fallback {
  background: linear-gradient(135deg, #C585F6, #BF63F3);
}
.share-card-app-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-card-app-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #101214;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.share-card-app-reason {
  font-family: var(--font-text);
  font-size: 11px;
  line-height: 1.35;
  color: #6C6F77;
  overflow-wrap: anywhere;
}
.share-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #F0F1F2;
  margin-top: 4px;
}
.share-card-footer-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.share-card-footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: #101214;
}
.share-card-footer-url {
  font-family: var(--font-text);
  font-size: 11px;
  color: #8C8F97;
}

/* Action buttons */
.share-actions {
  display: flex;
  gap: 14px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-download, .btn-share-native {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  padding: 16px 32px;
}
.share-status {
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--grey-400);
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

/* ================================================================
   RESPONSIVE — mobile-first polish
   ================================================================ */
@media (max-width: 480px) {
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .form-actions { flex-direction: column-reverse; width: 100%; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .results-actions { width: 100%; }
  .results-actions .btn { width: 100%; justify-content: center; }
  .share-actions { flex-direction: column; }
  .share-actions .btn { width: 100%; justify-content: center; }
  .share-title { font-size: 28px; }
}

@media (max-width: 390px) {
  .welcome-pretitle { font-size: 22px; }
  .welcome-headline { font-size: 28px; }
  .welcome-hint { font-size: 16px; }
  .form-title, .results-title, .tiles-title { font-size: 26px; }
  .problem-title { font-size: 22px; }
  .tiles-grid { gap: 8px; }
  .tile { min-height: 160px; padding: 12px; }
  .tile-copy { font-size: 13px; }
  .tile-sub { font-size: 11px; }
  .tile-illo { width: 44px; height: 44px; }
  .btn { font-size: 16px; padding: 14px 24px; }
  .result-card { grid-template-columns: 60px 1fr; gap: 12px; }
  .result-logo { width: 60px; height: 60px; }
  .personality-badge { padding: 16px 18px; }
  .personality-title { font-size: 18px; }
  .header { padding: 12px 16px; }
  .header-logo-mark { height: 20px; }
  .header-logo-word-atlassian, .header-logo-word-marketplace { height: 15px; }
  .screen { padding: 16px; }
  #screen-tiles { padding: 14px 16px 24px; }
  #screen-results { padding: 14px 16px 24px; }
  #screen-share { padding: 14px 16px 32px; }
}

@media print { .toast, .confetti-container, .app-overlay { display: none !important; } }
