/* chatgpt-intro.css: the "ChatGPT has joined the party" card (js/chatgpt-intro.js), a card in the
 * banner carousel (js/account-messages.js, css/account-messages.css draws the card itself).
 *
 * Alex, 20 Oct 2026: "I don't like these dark colors… we should be more lighthearted and
 * fun… a little fun animation… very low key… it can't be like so distracting when people
 * are in the dashboard… plays once when it loads up… a little celebration party, like
 * Claude's got a friend, ChatGPT's arrived."
 *
 * Light and playful: a soft mint-to-peach band (ChatGPT's green, Claude's warm orange),
 * white tiles, dark text. THE PARTY plays once per page load, only while `.is-playing`
 * is on the card (the script puts it on the first time the card is really shown and takes it
 * off when the party is over, so a card that comes round again in the rotation stays still):
 *   1. ChatGPT hops in from the left to sit beside Claude, who is already there;
 *   2. Claude gives a little wiggle hello;
 *   3. a handful of confetti pops between them and fades;
 *   4. both bob twice, then rest. About two seconds in all, then nothing moves.
 * Reduced motion: no party at all, the still picture only.
 * Since 24 Nov 2026 it is the house card (.amsg-card), so it is the same size as every other card
 * and turns with them; only its glow, its marks and its party are here. */
.amsg-card.amsg-connect {
  background:
    radial-gradient(220px 140px at 80px 50%, rgba(16, 163, 127, 0.16), transparent 70%),
    radial-gradient(220px 140px at 170px 50%, rgba(217, 119, 87, 0.16), transparent 70%),
    linear-gradient(100deg, #E8FAF2 0%, #F4FBF7 45%, #FFF4EC 100%);
  border-color: #CDEFE1;
}
/* The marks sit in the media box, on the card's own glow rather than the dark video tile. */
.amsg-connect .amsg-media.amsg-marks {
  display: flex; align-items: center; justify-content: center; overflow: visible; background: transparent;
}

/* The two friends. */
.cgi-marks { flex: 0 0 auto; position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.cgi-tile {
  width: 54px; height: 54px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid rgba(28, 30, 38, 0.06);
}
.cgi-tile-chatgpt { color: #10171A; box-shadow: 0 6px 16px rgba(16, 163, 127, 0.22); }
.cgi-tile-claude { box-shadow: 0 6px 16px rgba(217, 119, 87, 0.24); }
.cgi-heart { color: #F27E9E; font-size: 18px; line-height: 1; }

/* The confetti: still and invisible unless the party is playing. */
.cgi-confetti { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.cgi-confetti i {
  position: absolute; left: -3px; top: -3px; width: 7px; height: 7px; border-radius: 2px; opacity: 0;
}
.cgi-confetti i:nth-child(1) { background: #10A37F; --dx: -26px; --dy: -30px; }
.cgi-confetti i:nth-child(2) { background: #D97757; --dx: 24px; --dy: -32px; border-radius: 50%; }
.cgi-confetti i:nth-child(3) { background: #F5C451; --dx: -6px; --dy: -38px; }
.cgi-confetti i:nth-child(4) { background: #7C9CF5; --dx: 34px; --dy: -14px; border-radius: 50%; }
.cgi-confetti i:nth-child(5) { background: #F27E9E; --dx: -34px; --dy: -10px; }
.cgi-confetti i:nth-child(6) { background: #10A37F; --dx: 12px; --dy: 30px; border-radius: 50%; }
.cgi-confetti i:nth-child(7) { background: #F5C451; --dx: -18px; --dy: 28px; border-radius: 50%; }

/* ── The party: once, about two seconds, only while .is-playing ── */
@media (prefers-reduced-motion: no-preference) {
  .amsg-connect.is-playing .cgi-tile-chatgpt { animation: cgi-hop-in 700ms cubic-bezier(.3, 1.4, .5, 1) both, cgi-bob 520ms ease-in-out 900ms 2; }
  .amsg-connect.is-playing .cgi-tile-claude { animation: cgi-wiggle 520ms ease-in-out 520ms both, cgi-bob 520ms ease-in-out 1000ms 2; }
  .amsg-connect.is-playing .cgi-heart { animation: cgi-pop 500ms ease-out 640ms both; }
  .amsg-connect.is-playing .cgi-confetti i { animation: cgi-confetti 900ms ease-out 640ms both; }
  .amsg-connect.is-playing .cgi-confetti i:nth-child(even) { animation-delay: 700ms; }
}
@keyframes cgi-hop-in {
  0%   { transform: translate(-40px, 0) rotate(-12deg); opacity: 0; }
  45%  { transform: translate(-12px, -16px) rotate(-4deg); opacity: 1; }
  75%  { transform: translate(0, 2px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes cgi-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg); }
  50% { transform: rotate(7deg); }
  75% { transform: rotate(-4deg); }
}
@keyframes cgi-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes cgi-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes cgi-confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(160deg); opacity: 0; }
}

/* On a phone the marks take a short row of their own over the words, not a tall 16:9 box. */
@media (max-width: 760px) {
  .amsg-connect .amsg-media.amsg-marks { aspect-ratio: auto; height: 64px; justify-content: flex-start; }
}
