/* Quackle.bit — interactive extras (pairs with qb-interactive.js) */
:root { --qb-px: 3px; --qb-accent: #469ca0; --qb-card: #171717; --qb-ink: #fff; --qb-muted: rgba(255,255,255,.62); --qb-line: rgba(255,255,255,.14); }
html.light-mode { --qb-card: #f5f6f6; --qb-ink: #262728; --qb-muted: #5d6262; --qb-line: rgba(38,39,40,.14); }

/* ---------- Duck ---------- */
.qb-duck {
  position: fixed; left: 0; top: 0; z-index: 9990;
  width: calc(26 * var(--qb-px)); height: calc(26 * var(--qb-px)); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; will-change: transform; -webkit-tap-highlight-color: transparent;
}
.qb-duck.is-dragging, .qb-peek.is-dragging { cursor: grabbing; }
.qb-duck canvas { transform-origin: 50% 100%; width: calc(26 * var(--qb-px)); height: calc(26 * var(--qb-px)); image-rendering: pixelated; display: block; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); pointer-events: none; }
.qb-duck:focus-visible, .qb-peek:focus-visible { outline: 2px dashed var(--qb-accent); outline-offset: 4px; }
.qb-duck-parade { pointer-events: none; cursor: default; }
.qb-duck-stars { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font-size: 13px; letter-spacing: 3px; color: #e8a33c;
  white-space: nowrap; display: none; pointer-events: none; text-shadow: 0 1px 0 #2f2f24; }
.qb-duck.is-stunned .qb-duck-stars { display: none; }   /* the stunned sprite draws its own stars */
.qb-duck-bubble {            /* pixel speech box: notched corners, chunky 3px outline, hard drop shadow */
  position: absolute; bottom: calc(15 * var(--qb-px) + 15px); left: 0; transform: translateY(6px);
  width: max-content; max-width: min(240px, 80vw); white-space: normal; text-align: left;
  padding: 9px 13px; font-family: "Roboto", sans-serif; font-size: 13px; font-weight: 500; line-height: 1.4;
  color: var(--qb-ink); background: var(--qb-card); border: 0; border-radius: 0;
  box-shadow: 0 -3px 0 0 var(--qb-ink), 0 3px 0 0 var(--qb-ink), -3px 0 0 0 var(--qb-ink), 3px 0 0 0 var(--qb-ink),
              6px 9px 0 0 rgba(0,0,0,.3);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.qb-duck-bubble::before, .qb-duck-bubble::after {   /* stepped pixel tail pointing at the duck */
  content: ""; position: absolute; left: var(--tail, 50%); top: 100%;
}
.qb-duck-bubble::after  { width: 18px; height: 9px; margin-left: -9px; background: var(--qb-ink);
  clip-path: polygon(0 0,100% 0,100% 33.3%,83.3% 33.3%,83.3% 66.6%,66.6% 66.6%,66.6% 100%,33.3% 100%,33.3% 66.6%,16.6% 66.6%,16.6% 33.3%,0 33.3%); }
.qb-duck-bubble::before { width: 12px; height: 6px; margin-left: -6px; background: var(--qb-card); z-index: 1;
  clip-path: polygon(0 0,100% 0,100% 50%,75% 50%,75% 100%,25% 100%,25% 50%,0 50%); }
.qb-duck-bubble.below { bottom: auto; top: calc(26 * var(--qb-px) + 10px); }
.qb-duck-bubble.below::before, .qb-duck-bubble.below::after { top: auto; bottom: 100%; transform: scaleY(-1); }
.qb-duck-bubble.show { opacity: 1; transform: translateY(0); }
/* the hiding duck: just a long neck and a head peeking from a screen edge */
.qb-peek {
  position: fixed; left: 0; top: 0; z-index: 9990; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  transition: transform .55s cubic-bezier(.3,1.5,.5,1);
}
.qb-peek.is-dragging { transition: none; }
.qb-peek canvas { position: absolute; left: 50%; top: 50%; width: calc(16 * var(--qb-px)); height: calc(20 * var(--qb-px)); margin: calc(-10 * var(--qb-px)) 0 0 calc(-8 * var(--qb-px));
  image-rendering: pixelated; pointer-events: none; animation: qb-neck 2.4s ease-in-out infinite alternate; }
/* content the duck munches / hauls around (always restored by the script) */
.qb-eaten { will-change: clip-path; }
.qb-p { position: fixed; z-index: 9991; pointer-events: none; image-rendering: pixelated; }
.qb-poptext { position: fixed; z-index: 9992; pointer-events: none; font-family: "Roboto", sans-serif; font-weight: 700; font-size: 14px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--qb-ink); text-shadow: 0 1px 3px rgba(0,0,0,.45); white-space: nowrap; }
.qb-gone { visibility: hidden !important; }
.qb-back { animation: qb-pop .6s cubic-bezier(.3,1.7,.5,1); }
@keyframes qb-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes qb-chomp { 50% { transform: translateY(3px) rotate(-6deg); } }
@keyframes qb-wobble { 0%,100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@keyframes qb-stars { from { transform: translateX(-50%) scaleX(1); } 50% { transform: translateX(-50%) scaleX(-1); } to { transform: translateX(-50%) scaleX(1); } }
@keyframes qb-neck { from { transform: rotate(var(--r0, -5deg)); } to { transform: rotate(var(--r1, 5deg)); } }
@keyframes qb-blink { 50% { opacity: 0; } }

/* ---------- Play in browser ---------- */
.qb-play {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: grid; place-items: center; width: 26px; height: 26px; padding: 0 0 0 2px; border-radius: 50%;
  font-size: 10px; line-height: 1; color: #fff; text-decoration: none;
  background: rgba(20,20,20,.75); border: 1px solid rgba(255,255,255,.3);
  transition: background .2s, border-color .2s, transform .2s;
}
a.qb-game:hover .qb-play, .qb-play:hover { background: var(--qb-accent); border-color: var(--qb-accent); transform: scale(1.12); }

@keyframes qb-fade { from { opacity: 0; } }

/* ---------- Team: character select ---------- */
.team-item.qb-char { cursor: pointer; }
.team-item.qb-char .image { position: relative; }
.qb-char-select {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .18em; font-weight: 700; color: var(--qb-accent);
  animation: qb-blink 1.2s steps(2) infinite; pointer-events: none;
}
.qb-char-card {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center; gap: 9px;
  padding: 18px 22px; text-align: left;
  background: var(--qb-card);
  border: 2px solid var(--qb-accent); border-radius: 6px;
  opacity: 0; transform: scale(.97); transition: opacity .2s, transform .2s; pointer-events: none;
}
.team-item.qb-char:focus-visible .qb-char-card,
.team-item.qb-char.is-selected .qb-char-card { opacity: 1; transform: none; }
.team-item.qb-char.is-selected .qb-char-select { opacity: 0; animation: none; }
@media (hover: hover) {
  .team-item.qb-char:not(.qb-off):hover .qb-char-card { opacity: 1; transform: none; }
  .team-item.qb-char:not(.qb-off):hover .qb-char-select { opacity: 0; animation: none; }
}
.team-item.qb-char.is-selected { box-shadow: 0 0 0 2px var(--qb-accent); }
.qb-char-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.qb-char-player { font-weight: 800; font-size: 13px; color: #2f2f24; background: var(--qb-accent); padding: 2px 8px; border-radius: 3px; }
.qb-char-class { font-size: 12px; color: var(--qb-muted); }
.qb-stat { display: grid; grid-template-columns: 7.5em 1fr 2em; align-items: center; gap: 10px; font-size: 12px; color: var(--qb-ink); }
.qb-stat i { height: 8px; background: var(--qb-line); border-radius: 1px; overflow: hidden; }
.qb-stat b { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--qb-accent) 0 6px, transparent 6px 8px); transition: width .6s steps(12); }
.team-item.qb-char:focus-visible .qb-stat b,
.team-item.qb-char.is-selected .qb-stat b { width: var(--v); }
@media (hover: hover) { .team-item.qb-char:not(.qb-off):hover .qb-stat b { width: var(--v); } }
.qb-stat em { font-style: normal; text-align: right; color: var(--qb-muted); }
.qb-char-special { margin-top: 4px; font-size: 12px; color: var(--qb-accent); }

/* ---------- Awards: achievements ---------- */
.clients-item.qb-ach { position: relative; }
.clients-item.qb-ach:focus-within { opacity: 1; }
.clients-item.qb-ach img { transition: transform .25s, filter .25s; }
.clients-item.qb-ach:hover img, .clients-item.qb-ach:focus-within img { transform: translateY(-4px) scale(1.04); filter: drop-shadow(0 0 10px rgba(70,156,160,.45)); }
.qb-ach-tip {
  position: absolute; left: 50%; bottom: calc(100% - 6px); z-index: 5; width: max-content; max-width: 260px;
  transform: translate(-50%, 6px); display: flex; gap: 10px; align-items: center; padding: 10px 14px;
  background: var(--qb-card); border: 1px solid var(--qb-accent); border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.3);
  text-align: left; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.clients-item.qb-ach:hover .qb-ach-tip, .clients-item.qb-ach:focus-within .qb-ach-tip { opacity: 1; transform: translate(-50%, 0); }
.qb-ach-tip small, .qb-toast small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--qb-accent); }
.qb-ach-tip strong, .qb-toast strong { display: block; font-size: 14px; color: var(--qb-ink); line-height: 1.3; }
.qb-ach-tip em { display: block; font-style: normal; font-size: 12px; color: var(--qb-muted); }
.qb-ach-icon { font-size: 22px; line-height: 1; }

.qb-toasts { position: fixed; right: 20px; bottom: 80px; z-index: 9995; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.qb-toast {
  display: flex; gap: 12px; align-items: center; min-width: 260px; padding: 12px 16px;
  background: var(--qb-card); border: 1px solid var(--qb-line); border-left: 4px solid var(--qb-accent); border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,.35); animation: qb-toast-in .35s cubic-bezier(.2,.9,.3,1.3);
  transition: opacity .35s, transform .35s;
}
.qb-toast.out { opacity: 0; transform: translateX(30px); }
.qb-toast-more { min-width: 0; font-size: 12px; color: var(--qb-muted); }
@keyframes qb-toast-in { from { opacity: 0; transform: translateX(40px); } }

/* ---------- Journey / level map (About) ---------- */
.qb-journey { padding: 34px 18px 26px !important; }
.qb-map { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; list-style: none; margin: 0; padding: 0; }
.qb-map::before { content: ""; position: absolute; left: 6%; right: 6%; top: 21px; border-top: 4px dotted var(--qb-line); }
.qb-map li { position: relative; text-align: center; padding: 0 4px; }
.qb-node {
  position: relative; z-index: 1; display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 12px;
  background: var(--qb-card); border: 3px solid var(--qb-accent); font-weight: 800; font-size: 13px; color: var(--qb-ink);
  box-shadow: 3px 3px 0 rgba(0,0,0,.35); transition: transform .2s;
}
.qb-map li:hover .qb-node { transform: translateY(-4px); }
.qb-map li.is-current .qb-node { background: var(--qb-accent); color: #fff; animation: qb-pulse 1.6s ease-in-out infinite; }
.qb-map .qb-year { display: block; font-size: 11px; letter-spacing: .14em; color: var(--qb-accent); font-weight: 700; }
.qb-map strong { display: block; font-size: 13px; color: var(--qb-ink); margin: 2px 0; line-height: 1.3; }
.qb-map small { display: block; font-size: 11px; color: var(--qb-muted); line-height: 1.4; }
.qb-here { display: inline-block; margin-top: 6px; font-size: 10px; letter-spacing: .14em; font-weight: 700; color: #e8a33c; animation: qb-blink 1s steps(2) infinite; }
@keyframes qb-pulse { 50% { box-shadow: 0 0 0 8px rgba(70,156,160,.18), 3px 3px 0 rgba(0,0,0,.35); } }

@media (prefers-reduced-motion: reduce) {
  .qb-duck canvas, .qb-peek canvas, .qb-duck-stars, .qb-char-select, .qb-here, .qb-map li.is-current .qb-node { animation: none; }
}
@media (max-width: 767px) {
  .qb-duck-bubble { font-size: 12px; padding: 8px 11px; }
  .qb-toasts { right: 10px; left: 10px; align-items: stretch; }
  /* journey becomes a vertical path on phones */
  .qb-map { grid-template-columns: 1fr; gap: 18px; }
  .qb-map::before { left: 21px; right: auto; top: 10px; bottom: 10px; border-top: 0; border-left: 4px dotted var(--qb-line); }
  .qb-map li { display: grid; grid-template-columns: 42px 1fr; column-gap: 16px; text-align: left; padding: 0; }
  .qb-map li .qb-node { grid-row: span 4; margin: 0; }
}
