/* ============================================================================
   MIXLY — app.css  ·  CSS iPhone frame + animated app screens
   Used by the "see it in action" demo and the hosts visual.
   ========================================================================== */

.phone {
  --pw: clamp(230px, 64vw, 300px);
  width: var(--pw); aspect-ratio: 300 / 620;
  position: relative;
  border-radius: 46px;
  background: #050505;
  padding: 11px;
  box-shadow:
    inset 0 0 0 2px #2a2a2a,
    inset 0 0 0 11px #0d0d0d,
    0 40px 80px -30px rgba(0,0,0,0.9),
    0 0 0 1px rgba(var(--accent-rgb),0.08),
    0 0 60px -10px rgba(var(--accent-rgb),0.12);
}
.phone .screen {
  position: absolute; inset: 11px; border-radius: 36px; overflow: hidden;
  background: var(--bg-1);
  isolation: isolate;
}
.phone .notch {
  position: absolute; top: 13px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 26px; background: #050505; border-radius: 0 0 16px 16px; z-index: 30;
}
.phone .statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 46px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 0; font-size: 13px; font-weight: 700; color: var(--text);
}
.phone .statusbar .icons { display: flex; gap: 6px; align-items: center; }
.phone .statusbar .icons svg { width: 16px; height: 12px; }

/* screen stack — iOS-style push/pop navigation */
.app-screens { position: absolute; inset: 0; }
.app-screen {
  position: absolute; inset: 0; padding: 52px 16px 78px;
  background: var(--bg-1);
  transform: translateX(102%);
  transition: transform 430ms cubic-bezier(0.32, 0.72, 0, 1), opacity 340ms cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none; overflow: hidden; z-index: 1;
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.app-screen.enter-right { transition: none; transform: translateX(102%); opacity: 1; }
.app-screen.enter-left { transition: none; transform: translateX(-30%); opacity: 0.45; }
.app-screen.show { transform: none; opacity: 1; pointer-events: auto; z-index: 2; }
.app-screen.out-left { transform: translateX(-30%); opacity: 0.45; z-index: 1; }
.app-screen.out-right { transform: translateX(102%); z-index: 1; }

/* staggered content reveal once a screen lands */
.app-screen .rise { opacity: 0; }
.app-screen.show .rise { animation: app-rise 400ms cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--d, 0) * 0.6ms + 70ms); }
@keyframes app-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* home greeting (matches the app home header) */
.home-greet { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.home-greet .hg-date { font-size: 10.5px; color: var(--text-3); }
.home-greet .hg-name { font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -0.01em; }
.hg-icons { display: flex; gap: 7px; align-items: center; }
.hg-bell { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--text-2); }
.hg-bell svg { width: 14px; height: 14px; }
.hg-av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#5D7340,#385E3C); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #E9F5DC; }

/* DISCOVER header + search (matches the app) */
.disc-h { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 21px; letter-spacing: -0.02em; text-transform: uppercase; margin-bottom: 9px; }
.app-search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; margin-bottom: 10px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; color: var(--text-3);
}
.app-search svg { width: 14px; height: 14px; flex: none; }

/* floating + FAB (matches the app) */
.app-fab {
  position: absolute; right: 14px; bottom: 84px; z-index: 5;
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #0A0A0A;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.4);
}
.app-fab svg { width: 20px; height: 20px; }

/* filter chips row */
.app-filters { display: flex; gap: 7px; margin-bottom: 13px; overflow: hidden; }
.app-filter {
  height: 30px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2);
  transition: background var(--base) var(--ease), color var(--base) var(--ease), border-color var(--base) var(--ease);
}
.app-filter.on { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #0A0A0A; border-color: transparent; }
.app-filter svg { width: 12px; height: 12px; }

/* game card (matches the app: lime bar, sport pill, clock/pin rows, going + price) */
.game-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 13px 12px 18px; margin-bottom: 10px; overflow: hidden;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), border-color 320ms var(--ease), box-shadow 320ms var(--ease);
}
.game-card .gc-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.game-card.selected { border-color: rgba(var(--accent-rgb),0.7); transform: translateX(3px) scale(1.015); box-shadow: 0 0 0 1px rgba(var(--accent-rgb),0.5), 0 12px 26px -12px var(--accent-glow); }
.game-card.pressed { transform: translateX(3px) scale(0.975); }
.gc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gc-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 9px 0 6px;
  border-radius: 999px; background: var(--accent); color: #0A0A0A;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
}
.gc-pill .material-symbols-rounded { font-size: 13px; }
.gc-lvl { font-size: 10px; color: var(--text-3); }
.gc-title { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 6px; }
.gc-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.gc-row svg { width: 12px; height: 12px; color: var(--text-3); flex: none; }
.gc-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 9px; }
.gc-going { font-size: 11px; color: var(--text-2); font-weight: 600; }
.gc-price { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--accent); }

/* mini avatar stack */
.avstack { display: flex; padding-left: 8px; margin-top: 9px; }
.gc-foot .avstack { padding-left: 0; margin-top: 0; }
.avstack span { width: 22px; height: 22px; border-radius: 50%; margin-left: -7px; border: 2px solid var(--surface); font-size: 9px; font-weight: 700; color: #0A0A0A; display: grid; place-items: center; }
.avstack span:first-child { margin-left: 0; }
.avstack .more { background: var(--surface-3); color: var(--text-2); }

/* ── detail screen — full-bleed volt hero with dotted texture (matches the app) ── */
.app-screen.detail { padding-top: 0; }
.d-hero {
  position: relative; height: 158px; margin: 0 -16px 12px; overflow: hidden;
  background:
    radial-gradient(rgba(10,10,10,0.16) 1px, transparent 1.4px) 0 0 / 7px 7px,
    var(--accent);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 80%, 0 92%);
  clip-path: polygon(0 0, 100% 0, 100% 80%, 0 92%);
}
.d-hero .d-mark {
  position: absolute; top: -10px; right: -22px;
  font-size: 150px; color: #0A0A0A; opacity: 0.13;
  transform: rotate(-12deg); pointer-events: none;
}
.d-hero .d-word {
  position: absolute; left: 16px; bottom: 34px; z-index: 1;
  font-family: var(--font-display); font-style: italic; font-weight: 900;
  text-transform: uppercase; letter-spacing: -0.04em; line-height: 0.9;
  color: #0A0A0A; font-size: 25px; white-space: nowrap;
}
.d-hero .d-nav {
  position: absolute; top: 48px; left: 14px; right: 14px; z-index: 2;
  display: flex; gap: 7px; align-items: center;
}
.d-hero .d-gap { flex: 1; }
.d-circ {
  width: 27px; height: 27px; border-radius: 50%; flex: none;
  background: rgba(10,10,10,0.88); color: #F5F5F3;
  display: grid; place-items: center;
}
.d-circ svg { width: 12px; height: 12px; }

/* spots-left / settled line */
.d-spots {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent);
}
.d-spots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.d-spots svg { width: 11px; height: 11px; }
.d-title { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; color: var(--text); margin-bottom: 7px; }
.d-host { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.d-host .dh-av { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.d-host b { color: var(--text); font-weight: 700; }

/* 2×2 info grid (When / Where / Players / Level — label, value, sub like the app) */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.info-cell {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px 11px; display: flex; flex-direction: column; gap: 3px;
}
.info-cell .ic-l { display: flex; align-items: center; gap: 5px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-3); font-weight: 700; }
.info-cell .ic-l svg { width: 12px; height: 12px; color: var(--accent); }
.info-cell .ic-v { font-size: 12.5px; font-weight: 700; color: var(--text); }
.info-cell .ic-s { font-size: 10px; color: var(--text-3); }

.join-btn {
  position: absolute; left: 16px; right: 16px; bottom: 78px; height: 46px; border-radius: 999px;
  background: var(--accent); color: #0A0A0A; border: 0; font-weight: 800; font-size: 13px; letter-spacing: 0.4px; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 0 var(--accent-dark), 0 10px 22px -8px var(--accent-glow);
  transition: background 280ms var(--ease), color 280ms var(--ease), transform 240ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 280ms var(--ease);
}
.join-btn.pressed { transform: scale(0.94); }
.join-btn.joined { background: var(--surface-2); color: var(--accent); box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb),0.55); }
.join-btn svg { width: 15px; height: 15px; }

/* toast — "You're in! Chat unlocked." (matches the app toast) */
.app-toast {
  position: absolute; left: 14px; right: 14px; bottom: 78px; z-index: 6;
  display: flex; align-items: center; gap: 9px; padding: 12px 14px;
  border-radius: 13px; background: #181818; border: 1px solid var(--line-2);
  box-shadow: 0 14px 30px -10px rgba(0,0,0,0.8);
  font-size: 12px; font-weight: 600; color: var(--text);
  opacity: 0; transform: translateY(18px) scale(0.97); pointer-events: none;
  transition: opacity 360ms var(--ease), transform 540ms cubic-bezier(0.34,1.56,0.64,1);
}
.app-toast::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; background: var(--accent); }
.app-toast .t-ic { width: 18px; height: 18px; border-radius: 50%; background: rgba(var(--accent-rgb),0.15); color: var(--accent); display: grid; place-items: center; flex: none; }
.app-toast .t-ic svg { width: 10px; height: 10px; }
.app-toast.show { opacity: 1; transform: none; }

/* settled / wrap-up — final score card (matches the app) */
.final-card {
  background: linear-gradient(180deg, rgba(var(--accent-rgb),0.07), rgba(var(--accent-rgb),0.02)), var(--surface);
  border: 1px solid rgba(var(--accent-rgb),0.3); border-radius: 16px; padding: 13px 14px;
}
.fc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fc-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.1px; color: var(--accent); }
.fc-scores { display: flex; align-items: stretch; gap: 9px; }
.fc-team {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: 13px; padding: 10px 8px;
  transition: border-color 500ms var(--ease), box-shadow 500ms var(--ease);
}
.fc-team.win.lit { border-color: var(--accent); box-shadow: 0 0 18px -4px var(--accent-glow); }
.fc-team .ft-l { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); }
.fc-team.win .ft-l { color: var(--accent); }
.fc-team .ft-s { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 30px; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.fc-team .ft-p { font-size: 9.5px; color: var(--text-3); }
.fc-vs { align-self: center; font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.fc-wins { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-2); margin-top: 10px; }

/* tabbar (glass) */
.app-tabbar {
  position: absolute; left: 12px; right: 12px; bottom: 12px; height: 54px; z-index: 15;
  border-radius: 18px; display: flex; align-items: center; justify-content: space-around;
  background: rgba(17,17,17,0.7); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(var(--accent-rgb),0.1);
}
.app-tabbar .tab { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--text-3); position: relative; }
.app-tabbar .tab svg { width: 19px; height: 19px; }
.app-tabbar .tab.active { width: 46px; color: #0A0A0A; background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 4px 12px -4px var(--accent-glow); }
.app-tabbar .tab.dot::after { content: ""; position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* statusbar flips dark over the volt hero, like iOS */
.phone .statusbar { transition: color 400ms var(--ease); }
.phone.on-lime .statusbar { color: #0A0A0A; }

/* self-tap ripple — a soft pulse blooms from the card as it taps itself */
.game-card.tapping::after {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: 4;
  width: 12px; height: 12px; border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--accent-rgb),0.5), transparent 70%);
  animation: tap-ripple 520ms var(--ease) forwards;
}
@keyframes tap-ripple {
  from { width: 12px; height: 12px; opacity: 0.7; }
  to { width: 220px; height: 220px; opacity: 0; }
}

/* gentle continuous life so the browse screen never sits dead-still */
.app-fab { animation: fab-breathe 3s var(--ease) infinite; }
@keyframes fab-breathe {
  0%, 100% { box-shadow: 0 8px 20px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.4); }
  50% { box-shadow: 0 10px 30px -4px rgba(var(--accent-rgb),0.45), inset 0 1px 0 rgba(255,255,255,0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .app-screen { transition: opacity 200ms linear; transform: none !important; opacity: 0; }
  .app-screen.show { opacity: 1; }
  .app-screen .rise { opacity: 1; }
  .app-screen.show .rise { animation: none !important; }
  .app-fab { animation: none; }
}
