/* ============ Player screens ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px 10px calc(var(--gutter) + 12px);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(253, 251, 242, .9);
  backdrop-filter: blur(4px);
  border-bottom: 2.5px dashed var(--ink);
}
.logo { font-family: var(--font-marker); font-size: 1.3rem; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
#whoami { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }

.stage {
  position: relative; z-index: 1;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 26px 16px 110px calc(var(--gutter) + 16px);
}
@media (max-width: 640px) { .stage { padding: 18px 16px 110px 26px; } .topbar { padding-left: 26px; } }

.screen { animation: page-in .45s cubic-bezier(.2,.9,.3,1.2); }
@keyframes page-in { from { opacity: 0; transform: translateX(40px) rotate(3deg); } to { opacity: 1; transform: none; } }
.screen.leaving { animation: page-out .3s ease forwards; }
@keyframes page-out { to { opacity: 0; transform: translateX(-60px) rotate(-5deg); } }

.bg-doodles span { position: fixed; z-index: 0; font-size: 2.4rem; color: rgba(42,42,42,.12); animation: bob 5s ease-in-out infinite; pointer-events: none; }
.bg-doodles span:nth-child(2n) { animation-delay: -2s; animation-duration: 6s; }
@media (max-width: 640px) { .bg-doodles { display: none; } }

/* --- welcome / name --- */
.hero { text-align: center; margin: 10px 0 26px; }
.hero .big-emoji { font-size: 4.2rem; display: inline-block; animation: wiggle 2.4s ease-in-out infinite; }
.name-row { display: flex; gap: 10px; }
.name-row .input { font-size: 1.25em; }
.code-input { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-family: var(--font-marker); font-size: 1.6em !important; }

/* --- waiting room --- */
.waiting { text-align: center; }
.waiting .doodle-clock { font-size: 5rem; display: inline-block; animation: bob 1.6s ease-in-out infinite; }
.tips { margin-top: 22px; text-align: left; }
.tips li { margin-bottom: 4px; }

/* --- quiz header --- */
.q-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.q-page { font-family: var(--font-marker); font-size: 1.1rem; }
.pencil-progress { position: relative; height: 22px; margin: 4px 0 22px; border: 3px solid var(--ink); border-radius: 12px 6px 14px 5px / 5px 14px 6px 12px; background: #fff; overflow: visible; }
.pencil-progress .fill {
  height: 100%; border-radius: 8px 3px 10px 3px;
  background: repeating-linear-gradient(-45deg, var(--marker) 0 8px, #ff86a8 8px 16px);
  transition: width .6s cubic-bezier(.2,.9,.3,1.2);
}
.pencil-progress .pencil { position: absolute; top: -18px; font-size: 1.7rem; transform: translateX(-40%) rotate(-10deg); transition: left .6s cubic-bezier(.2,.9,.3,1.2); }

.question-card { margin-bottom: 26px; }
.question-card .q-text { font-size: clamp(1.35rem, 4.6vw, 1.8rem); line-height: 1.3; margin: 6px 0 0; overflow-wrap: anywhere; }
.lock-note { margin-top: 12px; font-size: .9em; }

/* --- options --- */
.options { display: grid; gap: 14px; }
@media (min-width: 700px) { .options.two-col { grid-template-columns: 1fr 1fr; } }
.option {
  --bg: #fff;
  position: relative;
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px;
  padding: 10px 16px;
  font: inherit; font-size: 1.12em; text-align: left; color: var(--ink);
  background: var(--bg);
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  box-shadow: 4px 5px 0 var(--ink);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s, opacity .3s;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;
}
.option:nth-child(2n) { border-radius: var(--wobble-2); }
.option:hover:not([disabled]) { transform: translate(-2px, -3px) rotate(-.8deg); box-shadow: 6px 8px 0 var(--ink); background: var(--yellow); }
.option:active:not([disabled]) { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.option:focus-visible { outline: 3px dashed var(--marker); outline-offset: 4px; }
.option .letter {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px;
  font-family: var(--font-marker); font-size: 1.15rem;
  border: 3px solid var(--ink); border-radius: 50% 45% 52% 48%;
}
.option:nth-child(6n+1) .letter { background: var(--yellow); }
.option:nth-child(6n+2) .letter { background: var(--pink); }
.option:nth-child(6n+3) .letter { background: var(--blue); }
.option:nth-child(6n+4) .letter { background: var(--green); }
.option:nth-child(6n+5) .letter { background: var(--orange); }
.option:nth-child(6n+6) .letter { background: var(--purple); }
.option[disabled] { cursor: default; }
.option.busy { animation: wiggle .4s ease infinite; }

.option.correct { --bg: #b2f2bb; animation: jump .6s ease; }
.option.correct .letter { background: var(--good) !important; color: #fff; }
.option.correct::after { content: '✔'; position: absolute; right: 16px; font-size: 2rem; color: var(--good); animation: pop-in .35s ease; }
@keyframes jump { 30% { transform: translateY(-14px) scale(1.04) rotate(-2deg); } 60% { transform: translateY(0) scale(.98); } }

.option.crossed { --bg: #f1f1f1; color: #8a8a8a; box-shadow: 2px 2px 0 #999; border-color: #999; }
.option.crossed .text { 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 25 1 50 5 T 100 4' fill='none' stroke='%23e03131' stroke-width='2.5'/%3E%3C/svg%3E") center / 100% 60% no-repeat; }
.option.crossed .letter { background: #ddd !important; }
.option.ghost { opacity: .32; border-style: dashed; transform: scale(.94); box-shadow: none; }
.option.inked { --bg: #f3e8ff; }
.option.inked::before {
  content: ''; position: absolute; inset: -6px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60'%3E%3Cpath d='M40 30c-8-14 10-22 20-12 4-12 22-14 26 0 10-6 22 2 16 12 14 0 16 18 2 20 4 12-14 16-22 8-6 10-24 8-24-4-12 4-22-8-12-16-10-2-10-12-6-8z' fill='%237048e8' opacity='.35'/%3E%3Ccircle cx='150' cy='14' r='5' fill='%237048e8' opacity='.35'/%3E%3Ccircle cx='168' cy='40' r='3' fill='%237048e8' opacity='.35'/%3E%3Ccircle cx='24' cy='50' r='4' fill='%237048e8' opacity='.35'/%3E%3C/svg%3E") center / contain no-repeat;
}
.option.vanishing { animation: vanish .6s ease-in forwards; }
@keyframes vanish { 40% { transform: scale(1.06) rotate(-4deg); } 100% { transform: scale(0) rotate(200deg); opacity: 0; } }
.option.collapse { overflow: hidden; transition: max-height .35s ease, min-height .35s ease, padding .35s, margin .35s, border-width .35s; max-height: 0 !important; min-height: 0 !important; padding-top: 0; padding-bottom: 0; border-width: 0; margin: -7px 0; }
.option.shake { animation: shake .5s ease; }
@keyframes shake { 10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(5px); } 30%,50%,70% { transform: translateX(-10px) rotate(-2deg); } 40%,60% { transform: translateX(10px) rotate(2deg); } }

/* --- hint: "psst, it's this one" --- */
.option.hint { --bg: #fff9c4; z-index: 2; animation: hint-pulse 1.1s ease-in-out infinite; }
.option.hint .circle-mark {
  position: absolute; left: -10px; top: -12px; pointer-events: none;
  width: calc(100% + 20px); height: calc(100% + 24px); overflow: visible;
}
.option.hint .circle-mark path { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes hint-pulse { 50% { transform: scale(1.03) rotate(-.6deg); } }
.hint-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 14px); z-index: 3;
  transform: translateX(-50%) rotate(-3deg);
  padding: 6px 14px; white-space: nowrap;
  font-family: var(--font-marker); font-size: .95rem;
  background: var(--marker); color: #fff;
  border: 3px solid var(--ink); border-radius: var(--wobble);
  box-shadow: 3px 3px 0 var(--ink);
  animation: bubble-bob 1s ease-in-out infinite;
  pointer-events: none;
}
.hint-bubble::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 10px solid transparent; border-top-color: var(--ink); }
@keyframes bubble-bob { 0%,100% { transform: translateX(-50%) translateY(0) rotate(-3deg); } 50% { transform: translateX(-50%) translateY(-7px) rotate(2deg); } }
.hint-hand { position: absolute; right: -8px; top: 50%; font-size: 2.3rem; z-index: 3; animation: point 0.8s ease-in-out infinite; pointer-events: none; }
@keyframes point { 0%,100% { transform: translate(40px, -50%); } 50% { transform: translate(24px, -50%); } }
@media (max-width: 640px) { .hint-hand { right: 4px; top: auto; bottom: -26px; } @keyframes point { 0%,100% { transform: translateY(0) rotate(90deg); } 50% { transform: translateY(-10px) rotate(90deg); } } }

.answer-note { margin-top: 18px; padding: 12px 16px; font-size: 1.05em; animation: pop-in .35s ease; }

/* --- bottom action bar --- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(253,251,242,.95) 30%);
  animation: slide-up .35s cubic-bezier(.2,.9,.3,1.3);
}
.action-bar .btn { width: min(460px, 100%); }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }

/* --- finish --- */
.finish { text-align: center; }
.score-circle {
  display: inline-grid; place-items: center;
  width: 170px; height: 170px; margin: 10px auto 16px;
  font-family: var(--font-marker); font-size: 3rem; line-height: 1;
  background: var(--yellow); border: 4px solid var(--ink); border-radius: 50% 46% 52% 48% / 48% 52% 46% 50%;
  box-shadow: 5px 6px 0 var(--ink);
  animation: pop-in .6s ease, wiggle 3s ease-in-out 1s infinite;
}
.score-circle small { display: block; font-family: var(--font-hand); font-size: 1.05rem; }
.stars { font-size: 2.4rem; letter-spacing: 6px; }
.stars span { display: inline-block; animation: pop-in .4s ease backwards; }
.stars span.off { filter: grayscale(1); opacity: .3; }

/* ============ FX layer (bursts, particles, stamps) ============ */
.fx { position: fixed; z-index: 800; pointer-events: none; left: 0; top: 0; }
.fx-burst {
  display: grid; place-items: center;
  width: 170px; height: 170px; margin: -85px 0 0 -85px;
  font-family: var(--font-marker); font-size: 2.1rem; color: #fff;
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 3px 3px 0 var(--ink);
  animation: burst 1s cubic-bezier(.2,1.4,.4,1) forwards;
}
.fx-burst::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink); clip-path: var(--shape); transform: translate(5px, 5px); }
.fx-burst::after { content: ''; position: absolute; inset: 6px; z-index: -1; background: var(--c, #ff922b); clip-path: var(--shape); }
.fx-burst.boom { --c: #ff6b3d; --shape: polygon(50% 0%, 61% 25%, 88% 10%, 76% 38%, 100% 45%, 77% 58%, 92% 88%, 63% 75%, 52% 100%, 40% 76%, 12% 92%, 23% 62%, 0% 52%, 23% 38%, 8% 12%, 37% 24%); }
.fx-burst.poof { --c: #e9ecef; color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; width: 190px; margin-left: -95px; --shape: path('M40 120 C 5 120 5 75 35 70 C 25 35 70 20 85 45 C 95 10 150 15 150 55 C 185 55 190 105 160 115 C 165 140 120 150 105 130 C 90 155 45 150 40 120 Z'); }
.fx-burst.splat { --c: #845ef7; --shape: path('M85 10 C 100 10 95 45 110 40 C 130 25 150 40 130 60 C 165 60 170 90 140 95 C 160 120 130 145 110 120 C 105 160 65 160 65 125 C 40 150 10 130 35 105 C 0 100 5 65 40 65 C 20 40 50 20 70 40 C 70 25 75 10 85 10 Z'); }
.fx-burst.nope { --c: #ffd43b; color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; font-size: 1.8rem; --shape: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.fx-burst.yay { --c: #51cf66; --shape: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); font-size: 1.5rem; width: 200px; height: 200px; margin: -100px 0 0 -100px; }
.fx-burst.sparkle { --c: transparent; color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; font-size: 1.4rem; }
.fx-burst.sparkle::before { display: none; }
@keyframes burst {
  0% { transform: scale(.1) rotate(-30deg); opacity: 0; }
  25% { transform: scale(1.25) rotate(8deg); opacity: 1; }
  45% { transform: scale(1) rotate(-4deg); }
  80% { opacity: 1; }
  100% { transform: scale(1.15) rotate(0) translateY(-30px); opacity: 0; }
}
.fx-particle {
  font-size: var(--size, 22px); line-height: 1;
  animation: fly var(--dur, .9s) cubic-bezier(.1,.8,.3,1) forwards;
}
@keyframes fly {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); opacity: 0; }
}
.fx-confetti { width: 10px; height: 16px; background: var(--c); border: 1.5px solid var(--ink); border-radius: 2px; animation: confetti var(--dur, 1.6s) cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
.fx-stamp {
  padding: 6px 18px; transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--font-marker); font-size: 1.9rem; color: var(--good); white-space: nowrap;
  border: 4px solid var(--good); border-radius: 10px 4px 12px 5px;
  background: rgba(255,255,255,.85);
  animation: stamp .9s ease forwards;
}
@keyframes stamp {
  0% { transform: translate(-50%, -50%) rotate(-12deg) scale(3); opacity: 0; }
  30% { transform: translate(-50%, -50%) rotate(-12deg) scale(.95); opacity: 1; }
  40% { transform: translate(-50%, -50%) rotate(-12deg) scale(1.05); }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -80%) rotate(-12deg) scale(1); opacity: 0; }
}
.screen-shake { animation: screen-shake .45s ease; }
@keyframes screen-shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -2px); } }

/* --- share on LinkedIn --- */
.first-try { font-size: 1.1em; margin: 4px 0 8px; }
.btn.linkedin { --bg: #0a66c2; color: #fff; margin-top: 10px; }
.btn.linkedin:hover { --bg: #0b74dc; }
.in-logo { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; font-family: Arial, sans-serif; font-weight: 700; font-size: .85em; color: #0a66c2; background: #fff; border-radius: 4px; }
.share-img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 10px 4px 12px 5px; box-shadow: 4px 5px 0 var(--ink); }
.share-text { font-size: .95em; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.share-actions .btn.linkedin { margin-top: 0; }
@media (max-width: 640px) { .share-actions .btn { flex: 1 1 100%; } }
.btn.linkedin.share-main { width: min(360px, 100%); font-size: 1.2em; min-height: 56px; }
.li-steps { margin-top: 14px; padding: 12px 16px; font-size: 1.05em; animation: pop-in .35s ease; }
.kbd { display: inline-block; padding: 0 8px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 1px 2px 0 var(--ink); white-space: nowrap; }
.li-steps { margin-top: 14px; padding: 12px 16px; font-size: 1.05em; animation: pop-in .35s ease; }
.kbd { display: inline-block; padding: 0 8px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 1px 2px 0 var(--ink); white-space: nowrap; }
/* phone share steps */
.m-steps { margin: 6px 0 0; padding-left: 1.6em; display: grid; gap: 12px; }
.m-steps li { padding-left: 4px; }
.m-steps li::marker { font-family: var(--font-marker); }
.m-steps .btn { margin-bottom: 4px; }
.m-steps .btn.done { --bg: #c8f2c2; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--ink-soft); font-size: .9em; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 2px dashed #bbb; }
.pick-tip { padding: 12px 14px; margin-bottom: 12px; font-size: .95em; }
.pick-row { display: grid; gap: 6px; margin: 8px 0; }
.pick { display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: #fff; border: 2px solid var(--ink); border-radius: var(--wobble); }
.pick .in-logo { background: #0a66c2; color: #fff; }
.pick small { color: var(--ink-soft); }
.pick.good { border-color: var(--good); box-shadow: 2px 2px 0 var(--good); }
.pick.bad { opacity: .7; text-decoration: line-through; text-decoration-color: var(--bad); }
.btn.linkedin.big { font-family: var(--font-hand); font-size: 1.3em; }
