/* ================= Round 1: Client en colère ================= */
.r1-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; margin-top: 8px; }
.r1-radio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; position: relative; overflow: hidden; }
.r1-grille { position: absolute; left: 22px; right: 22px; bottom: 20px; height: 34px; border-radius: 10px; background: radial-gradient(circle, rgba(0, 0, 0, .55) 2px, transparent 2.5px) 0 0 / 9px 9px, rgba(0, 0, 0, .15); }
.r1-ham { position: relative; transition: transform .3s var(--ease-pop); }
.r1-ham.pop { animation: r1pop 1s var(--ease-pop); }
@keyframes r1pop { 0% { transform: scale(1) } 35% { transform: scale(1.55); filter: hue-rotate(-20deg) saturate(1.6) } 45% { transform: scale(.7) } 70% { transform: scale(1.08) } 100% { transform: scale(1) } }
.r1-ham.calm { animation: r1calm .9s ease; }
@keyframes r1calm { 40% { transform: scale(.9, 1.05) } }
.r1-name { text-align: center; } .r1-name b { font-family: Fredoka; font-size: 22px; display: block; } .r1-name small { color: var(--muted); }
.r1-meter-wrap { position: absolute; right: 20px; top: 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.r1-meter { position: relative; width: 30px; height: 150px; border-radius: 18px; background: rgba(0, 0, 0, .3); overflow: hidden; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5); }
.r1-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, #FFC54A, #FF5A6E 60%, #C9364B); transition: height .25s; }
.r1-emo { font-size: 34px; transition: transform .2s; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.r1-meter.hot { animation: shk .42s infinite; }
.r1-heart { position: absolute; bottom: 40%; font-size: 28px; animation: heartUp 1.8s ease-out forwards; pointer-events: none; }
@keyframes heartUp { to { transform: translateY(-160px) scale(1.4); opacity: 0 } }
.r1-fez { position: absolute; top: 18%; left: 45%; animation: fezFly 2.2s cubic-bezier(.2, .7, .3, 1) forwards; pointer-events: none; z-index: 5; }
@keyframes fezFly { to { transform: translate(140px, -420px) rotate(900deg); opacity: .2 } }
.r1-chat { display: flex; flex-direction: column; padding: 18px 20px; min-height: 0; overflow: hidden; }
.r1-chat-head { font-family: Fredoka; font-size: 17px; color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 0 6px 10px; border-bottom: 2px dashed rgba(255, 244, 226, .15); }
.r1-led { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); animation: blinkDot 1.2s steps(2) infinite; }
.r1-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px 6px; scrollbar-width: thin; }
.r1-msg { display: flex; animation: popIn .35s var(--ease-pop) both; }
.r1-msg.him { justify-content: flex-start; padding-left: 12px; } .r1-msg.me { justify-content: flex-end; }
.r1-msg.me .bubble { background: #C9F5E3; } .r1-msg.me .bubble::after { left: auto; right: 24px; border-top-color: #C9F5E3; }
.r1-msg .bubble { max-width: 78%; font-size: 20px; }
.r1-msg.typing .bubble { width: 70px; text-align: center; letter-spacing: 3px; animation: dotb 1s infinite; }
.r1-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 10px; }
.r1-end { grid-column: 1 / -1; text-align: center; font-family: Fredoka; font-size: 22px; color: var(--gold); }
.r1-static { position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 4px), var(--noise-l); mix-blend-mode: screen; animation: staticA .12s steps(3) infinite; pointer-events: none; }
@keyframes staticA { 50% { background-position: 0 3px, 40px 20px } }
.r1-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.r1-slot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 64px; border-radius: 16px; border: 2px dashed rgba(255, 244, 226, .25); color: var(--muted); font-size: 14px; line-height: 1.25; }
.r1-slot-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: Fredoka; font-weight: 700; background: rgba(255, 255, 255, .08); }
.r1-slot.ok { border-style: solid; border-color: var(--mint); background: rgba(67, 224, 168, .12); color: var(--thread); animation: popIn .4s var(--ease-pop); }
.r1-slot.ok .r1-slot-n { background: var(--mint); color: #06301F; }
.r1-slot.ko { border-style: solid; border-color: var(--coral); background: rgba(255, 90, 110, .12); color: var(--thread); }
.r1-slot.ko .r1-slot-n { background: var(--coral); color: #fff; }
.r1-slot b { font-family: Fredoka; font-weight: 600; }

/* ================= Round 2: Qui est qui ? ================= */
.r2-wall { position: relative; flex: 1; min-height: 0; border-radius: 22px; overflow: hidden;
  background: repeating-linear-gradient(180deg, transparent 0 44px, rgba(255, 244, 226, .14) 44px 46px), var(--noise-d), linear-gradient(180deg, #4C4870, #36325A); padding: 14px 18px 0 58px; }
.r2-marks { position: absolute; left: 10px; top: 14px; bottom: 0; display: flex; flex-direction: column; justify-content: space-between; font-family: Fredoka; font-size: 13px; color: rgba(255, 244, 226, .5); }
.r2-line { height: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; }
.r2-suspect { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; padding-bottom: 12px; cursor: pointer; transition: transform .3s var(--ease-pop); }
.r2-suspect:focus-visible { outline-offset: -4px; }
.picking .r2-suspect:hover { transform: translateY(-6px); }
.picking .r2-suspect .r2-slot { border-color: var(--gold); color: var(--gold); }
.r2-clue { font-size: 15.5px; line-height: 1.3; margin-bottom: 10px; max-width: 230px; min-height: 64px; display: flex; align-items: center; }
.r2-clue.said { background: #FFE9A8; } .r2-clue.said::after { border-top-color: #FFE9A8; }
.r2-art { height: 160px; display: flex; align-items: flex-end; justify-content: center; }
.r2-trio { display: flex; align-items: flex-end; } .r2-trio .plush { margin: 0 -14px; }
.r2-slot { margin-top: 6px; min-height: 46px; min-width: 160px; padding: 6px 12px; border-radius: 14px; border: 2px dashed rgba(255, 244, 226, .35); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); }
.r2-slot.on { border: 0; background: var(--noise-l), linear-gradient(180deg, #FFF8EC, #F1DFC0); color: var(--ink); font-family: Fredoka; font-size: 16px; box-shadow: 0 6px 12px rgba(0, 0, 0, .3); animation: popIn .4s var(--ease-pop); }
.r2-slot .patch { width: 28px; height: 28px; font-size: 14px; --c: var(--gold); box-shadow: 0 0 0 2px #8a6a20; }
.r2-slot .patch::after { inset: 3px; }
.r2-placard { margin-top: 8px; padding: 4px 12px; border-radius: 8px; background: #1B1830; font-family: Fredoka; font-size: 15px; color: var(--thread); }
.r2-suspect.nope { animation: shk .42s; }
.r2-suspect.ejected { animation: ejectS 2.2s ease-in forwards; pointer-events: none; }
@keyframes ejectS { 30% { transform: translateY(-20px) rotate(-10deg) } 100% { transform: translate(120vw, -40px) rotate(540deg); opacity: 0 } }
.r2-suspect.ears .r2-art { animation: shk .42s 3; }
.r2-tray { display: flex; flex-direction: column; gap: 8px; }
.r2-hint { font-size: 15px; text-align: center; }
.r2-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.r2-badge { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; text-align: left; touch-action: none;
  background: var(--noise-l), linear-gradient(180deg, #FFF8EC, #EAD5B0); background-blend-mode: soft-light, normal; color: var(--ink);
  box-shadow: inset 0 2px 0 #fff, inset 0 -5px 0 rgba(120, 72, 30, .2), 0 8px 18px rgba(0, 0, 0, .3); transition: transform .2s var(--ease-pop); position: relative; }
.r2-badge::before { content: ''; position: absolute; inset: 5px; border-radius: 13px; border: 2px dashed rgba(120, 72, 30, .25); pointer-events: none; }
.r2-badge .patch { width: 44px; height: 44px; font-size: 20px; flex: none; --c: var(--gold); }
.r2-badge.imp .patch { --c: var(--coral); }
.r2-badge b { font-family: Fredoka; font-weight: 600; font-size: 18px; display: block; }
.r2-badge small { color: #6E5A44; font-size: 13px; }
.r2-badge:hover { transform: translateY(-3px) rotate(-1deg); }
.r2-badge.sel { transform: translateY(-6px); box-shadow: 0 0 0 4px var(--gold), 0 14px 24px rgba(0, 0, 0, .35); }
.r2-badge.used { opacity: .3; transform: scale(.94); pointer-events: none; }
.drag-src { opacity: .35; }
.drag-ghost { box-shadow: 0 24px 40px rgba(0, 0, 0, .5) !important; }
.r2-keyboard { position: absolute; left: 50%; bottom: 70px; translate: -50% 0; width: 200px; z-index: 4; animation: popIn .4s var(--ease-pop); }
.r2-screen { background: #0C1A12; color: #6CFF9E; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; padding: 8px 10px; border-radius: 8px 8px 0 0; border: 3px solid #3B3675; border-bottom: 0; min-height: 40px; }
.r2-caret { display: inline-block; width: 9px; height: 18px; background: #6CFF9E; vertical-align: middle; animation: blinkDot .8s steps(2) infinite; }
.r2-keys { height: 34px; border-radius: 0 0 10px 10px; background: radial-gradient(circle, #6E6A9A 3px, transparent 3.5px) 0 0 / 14px 11px, #3B3675; }
.r2-shock { position: absolute; left: 50%; top: 45%; pointer-events: none; z-index: 4; }
.r2-shock i { position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%; border: 6px solid var(--gold); animation: ring 1s ease-out infinite; }
.r2-shock i:nth-child(2) { animation-delay: .25s } .r2-shock i:nth-child(3) { animation-delay: .5s }
@keyframes ring { to { transform: scale(7); opacity: 0 } }
.r2-prod { position: absolute; left: 50%; top: 40%; translate: -50% -50%; z-index: 6; font-family: Fredoka; font-weight: 700; font-size: 44px; color: #fff; background: var(--coral); padding: 10px 24px; border-radius: 18px; transform: rotate(-4deg); box-shadow: var(--shadow); animation: popIn .4s var(--ease-pop); }

/* ================= Round 3: Priority Rush ================= */
.r3 { padding: 0; overflow: hidden; touch-action: none; }
.r3-sky { position: absolute; inset: 0; }
.r3-crate { position: absolute; top: 0; width: 168px; padding: 12px 12px 14px; border-radius: 10px; text-align: center; color: #3B2615; will-change: transform;
  background: var(--fibers), var(--noise-d), linear-gradient(180deg, #D9A86C, #B9844E); background-blend-mode: soft-light, multiply, normal;
  box-shadow: inset 0 0 0 3px rgba(90, 59, 34, .35), 0 12px 20px rgba(0, 0, 0, .35); }
.r3-crate::before { content: ''; position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(90deg, transparent 46%, rgba(90, 59, 34, .25) 46% 54%, transparent 54%); pointer-events: none; }
.r3-crate .r3-ico { display: block; font-size: 34px; position: relative; }
.r3-crate .r3-lbl { position: relative; display: block; font-family: Fredoka; font-weight: 600; font-size: 16px; line-height: 1.15; margin-top: 4px; background: #FFF6E9; border-radius: 6px; padding: 4px 6px; }
.r3-tape { position: absolute; left: 50%; top: -8px; translate: -50% 0; width: 70px; height: 18px; background: rgba(244, 233, 204, .9); clip-path: polygon(2% 0, 98% 6%, 100% 50%, 97% 100%, 3% 94%, 0 50%); }
.r3-crate.grabbed { animation: grab .45s ease-in forwards; }
@keyframes grab { to { scale: .3; opacity: 0; translate: 0 60px } }
.r3-beam { position: absolute; bottom: 0; left: 50%; translate: -50% 0; width: 200px; height: 190px; pointer-events: none; transition: left .05s linear; }
.r3-cone { position: absolute; left: 50%; bottom: 60px; translate: -50% 0; width: 190px; height: 130px; background: linear-gradient(0deg, rgba(77, 232, 255, .55), rgba(77, 232, 255, 0)); clip-path: polygon(38% 100%, 62% 100%, 100% 0, 0 0); animation: beamPulse 1s ease-in-out infinite; }
@keyframes beamPulse { 50% { opacity: .55 } }
.r3-emitter { position: absolute; left: 50%; bottom: 8px; translate: -50% 0; width: 110px; height: 58px; border-radius: 60px 60px 18px 18px; background: var(--noise-l), radial-gradient(circle at 40% 30%, #FFF3DF, #D9A86C 70%); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), 0 0 30px rgba(77, 232, 255, .6); }
.r3-emitter::after { content: ''; position: absolute; left: 50%; top: 14px; translate: -50% 0; width: 22px; height: 16px; border-radius: 50%; background: #3B2615; }
.r3-beam.off .r3-cone { opacity: 0; animation: none; }
.r3-count { position: absolute; left: 18px; top: 22px; z-index: 4; display: flex; align-items: center; gap: 10px; font-family: Fredoka; font-size: 18px; }
.r3-count .patch { width: 44px; height: 44px; font-size: 22px; --c: var(--gold); }
.r3-unicorns { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.r3-unicorns span { position: absolute; left: -10%; font-size: 52px; animation: gallop 3.4s linear forwards; }
.r3-unicorns i { font-style: normal; position: absolute; right: 100%; top: 6px; font-size: 40px; opacity: .8; }
@keyframes gallop { 0% { transform: translateX(0) translateY(0) } 25% { transform: translateX(30vw) translateY(-14px) } 50% { transform: translateX(60vw) translateY(0) } 75% { transform: translateX(90vw) translateY(-14px) } 100% { transform: translateX(120vw) } }
.r3-coffee { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.r3-coffee i { position: absolute; top: 0; width: 7%; border-radius: 0 0 40px 40px; background: linear-gradient(180deg, #6B3E1F, #8B5A2B); animation: drip 2.6s ease-in forwards; transform-origin: top; }
@keyframes drip { from { transform: scaleY(0) } 60% { transform: scaleY(1) } to { transform: scaleY(1); opacity: 0 } }
.r3-lina { position: absolute; right: 18px; top: 70px; z-index: 6; display: flex; align-items: center; gap: 6px; animation: popIn .4s var(--ease-pop); }
.r3-lina .bubble { max-width: 260px; font-size: 17px; }
.r3-summary { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(12, 10, 36, .55); animation: screenIn .5s both; }
.r3-sum-card { padding: 28px 32px; width: min(860px, 92%); }
.r3-sum-card h3 { font-size: 26px; color: var(--ink); text-align: center; }
.r3-notes { display: flex; gap: 16px; justify-content: center; margin: 18px 0 10px; flex-wrap: wrap; }
.r3-note { width: 220px; min-height: 170px; padding: 14px 14px 12px; background: #FFF2A8; color: var(--ink); box-shadow: 0 10px 18px rgba(0, 0, 0, .25); transform: rotate(var(--r)); display: flex; flex-direction: column; gap: 6px; position: relative; }
.r3-note::before { content: ''; position: absolute; left: 50%; top: -10px; translate: -50% 0; width: 70px; height: 20px; background: rgba(244, 233, 204, .9); }
.r3-note.later { background: #CDEBFF; } .r3-note.trap { background: #FFC9D3; }
.r3-note b { font-family: Fredoka; font-size: 17px; } .r3-note span { font-size: 14.5px; line-height: 1.35; flex: 1; }
.r3-note em { font-style: normal; font-weight: 800; font-size: 13px; color: #6E5A44; }
.r3-truth { text-align: center; color: #3B2615; font-weight: 800; font-size: 16px; }

/* ================= Round 4: Réacteur ================= */
.r4-goal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 4px 0; transition: transform .2s; }
.r4-goal.need .r4-goal-btn { box-shadow: 0 0 0 3px var(--coral); }
.r4-goal-btn { padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 2px dashed rgba(255, 244, 226, .3); font-weight: 800; font-size: 16px; }
.r4-goal-btn[aria-pressed="true"] { background: var(--gold); color: #3A2600; border: 2px solid var(--gold); }
.r4-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.05fr 170px; gap: 16px; align-items: stretch; }
.r4-backlog h3, .r4-sprint h3 { font-size: 18px; margin-bottom: 8px; }
.r4-tasks { display: flex; flex-direction: column; gap: 8px; }
.r4-task { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; text-align: left; font-weight: 800; font-size: 16px; color: var(--ink); touch-action: none;
  background: var(--fibers), linear-gradient(180deg, #F7E2BF, #E2BE88); background-blend-mode: soft-light, normal; box-shadow: inset 0 -4px 0 rgba(120, 72, 30, .2), 0 6px 12px rgba(0, 0, 0, .25); transition: transform .2s var(--ease-pop), opacity .2s; }
.r4-task:hover { transform: translateX(4px) rotate(-.5deg); }
.r4-task.in { opacity: .35; transform: scale(.97); }
.r4-pts { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: Fredoka; font-weight: 700; font-size: 18px; color: #fff; background: var(--felt-hi); box-shadow: 0 0 0 2px rgba(255, 244, 226, .8), inset 0 -3px 0 rgba(0, 0, 0, .25); }
.r4-reactor { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 0; }
.r4-gauge { width: min(280px, 100%); height: auto; overflow: visible; }
.r4-gauge .core-bg { fill: #120F33; stroke: #8A6A45; stroke-width: 6; }
.r4-gauge .seg { fill: rgba(255, 255, 255, .08); transition: fill .3s; }
.r4-gauge .seg.on { fill: var(--mint); } .r4-gauge .seg.over { fill: rgba(255, 90, 110, .18); } .r4-gauge .seg.over.on { fill: var(--coral); }
.r4-gauge .core { fill: url(#r4core); fill: #2B2665; stroke: rgba(255, 244, 226, .3); stroke-width: 2; stroke-dasharray: 5 4; transition: fill .4s; }
.r4-gauge .load { font-family: Fredoka; font-weight: 700; font-size: 58px; fill: var(--thread); }
.r4-gauge .cap { font-family: Nunito; font-weight: 800; font-size: 14px; fill: var(--muted); }
.r4-reactor.good .core { fill: #1F6D5A; } .r4-reactor.over .core { fill: #8E1E33; }
.r4-reactor.blue .core { fill: #1C5CA8; filter: drop-shadow(0 0 30px #4DE8FF); }
.r4-reactor.smoke .r4-gauge { animation: shk .42s 4; filter: drop-shadow(0 0 30px #FF5A6E); }
.r4-sprint { width: 100%; min-height: 0; }
.r4-in { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; padding: 10px; border-radius: 16px; border: 2px dashed rgba(255, 244, 226, .3); }
.r4-chip { padding: 6px 10px; border-radius: 12px; background: #FFF6E9; color: var(--ink); font-weight: 800; font-size: 14px; animation: popIn .3s var(--ease-pop); }
.r4-chip b { margin-left: 4px; color: var(--felt-hi); }
.r4-devs { display: flex; flex-direction: column; justify-content: space-around; gap: 6px; }
.r4-dev { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.r4-energy { width: 110px; height: 12px; border-radius: 8px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.r4-energy i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--mint-2), var(--mint)); transition: width .4s; }
.r4-energy.low i { background: var(--coral); }
.r4-dev.zzz::after { content: 'z Z z'; position: absolute; right: 8px; top: 0; font-family: Fredoka; font-size: 20px; color: #CFE6FF; animation: zz 1.6s ease-in-out infinite; }
@keyframes zz { 50% { transform: translateY(-10px); opacity: .5 } }
.r4-dev.melt .plush { animation: melt 1.6s ease-in forwards; transform-origin: 50% 95%; }
@keyframes melt { to { transform: scale(1.5, .25) } }
.r4-foot { display: flex; justify-content: center; }
.r4-burnout { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(40, 6, 16, .78); animation: screenIn .4s both; }
.r4-burn-title { font-family: Fredoka; font-weight: 700; font-size: 92px; color: #FFE3E7; text-shadow: 0 6px 0 #8E1E33, 0 0 40px rgba(255, 90, 110, .8); transform: rotate(-4deg); }
.r4-burnout p { font-size: 20px; }
.r4-room { position: relative; padding: 10px 40px; } .r4-room .bubble { position: absolute; right: -90px; top: 6px; }
.r4-room .fl { position: absolute; font-size: 44px; animation: flick .5s ease-in-out infinite alternate; }
.r4-room .f1 { left: 0; bottom: 0 } .r4-room .f2 { right: 0; bottom: 10px; animation-delay: .2s } .r4-room .f3 { left: 40%; top: -20px; animation-delay: .1s }
@keyframes flick { to { transform: scale(1.15) translateY(-4px) } }
.r4-toast { position: absolute; left: 50%; bottom: 96px; translate: -50% 0; z-index: 9; padding: 16px 26px; font-family: Fredoka; font-size: 22px; display: flex; align-items: center; gap: 12px; animation: popIn .4s var(--ease-pop); }

/* ================= Round 5: Bug Attack ================= */
.r5-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 310px; gap: 16px; }
.r5-hull { position: relative; overflow: hidden; touch-action: none; cursor: crosshair; }
.r5-vents i { position: absolute; width: 54px; height: 30px; border-radius: 16px; background: repeating-linear-gradient(90deg, #0D0A26 0 6px, #2E2A60 6px 10px); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .6), 0 0 0 4px rgba(255, 244, 226, .15); }
.r5-bugs { position: absolute; inset: 0; }
.r5-bug { position: absolute; left: 0; top: 0; padding: 0; will-change: transform; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); }
.r5-bug .bug-legs { animation: legs .18s steps(2) infinite; }
@keyframes legs { 50% { transform: translateY(2px) } }
.r5-bug.splat { pointer-events: none; animation: splat .5s ease-out forwards; }
@keyframes splat { 30% { scale: 1.3 .4 } to { scale: 1.5 .1; opacity: 0 } }
.r5-bug.flee { pointer-events: none; animation: flee .5s ease-in forwards; }
@keyframes flee { to { opacity: 0; scale: .3 } }
.r5-bug.hurt svg { animation: shk .3s; filter: brightness(1.5); }
.r5-bug.hidden-behind { opacity: .25; pointer-events: none; }
.r5-banner { position: absolute; left: 50%; top: 22px; translate: -50% 0; z-index: 6; display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-radius: 16px; background: #FFF6E9; color: var(--ink); font-family: Fredoka; font-size: 20px; box-shadow: var(--shadow); animation: popIn .35s var(--ease-pop); white-space: nowrap; }
.r5-banner.bad { background: #FFD6DC; } .r5-banner.warn { background: #FFE9A8; } .r5-banner.good { background: #C9F5E3; }
.r5-block { position: absolute; left: 0; top: 0; bottom: 0; width: 38%; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px;
  background: repeating-linear-gradient(-45deg, rgba(255, 197, 74, .25) 0 18px, rgba(27, 24, 48, .5) 18px 36px); border-right: 4px dashed var(--gold); }
.r5-block p { font-family: Fredoka; font-size: 18px; } .r5-lock { font-size: 54px; }
.r5-block.freed { animation: fadeOut .6s ease 1s forwards; background: rgba(67, 224, 168, .25); border-color: var(--mint); }
.r5-daily { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; background: rgba(12, 10, 36, .55); animation: screenIn .3s both; }
.r5-daily-card { padding: 22px 26px; width: min(720px, 92%); }
.r5-daily-head { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.r5-daily-head h3 { font-size: 24px; } .r5-daily-head p { color: #6E5A44; }
.r5-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.r5-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.r5-chart { padding: 16px 16px 12px; position: relative; }
.r5-chart h3 { font-size: 18px; margin-bottom: 6px; }
.r5-svg { width: 100%; height: auto; }
.r5-svg .grid line { stroke: rgba(255, 244, 226, .1); }
.r5-svg .ax { font-size: 10px; fill: var(--muted); font-family: Nunito; font-weight: 700; }
.r5-svg .ideal { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; }
.r5-svg .crew { fill: none; stroke: var(--crew); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.r5-svg .me { fill: none; stroke: var(--thread); stroke-width: 2.5; stroke-dasharray: 2 4; stroke-linecap: round; }
.r5-legend { display: flex; gap: 12px; font-size: 13px; color: var(--muted); justify-content: center; }
.r5-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.l-ideal { background: var(--muted); } .l-crew { background: var(--crew); } .l-me { background: var(--thread); }
.r5-stats { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; text-align: center; gap: 10px; }
.r5-stats b { font-family: Fredoka; font-size: 44px; color: var(--gold); display: block; line-height: 1; }
.r5-stats span { color: var(--muted); font-size: 14px; }
.r5-dancer { position: absolute; right: 18px; top: 40px; animation: dance .4s ease-in-out infinite alternate; }

/* ================= Round 6: Boss ================= */
.r6-review { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; transition: opacity .5s, transform .5s; }
.r6-review.leave { opacity: 0; transform: scale(.95); }
.r6-demo { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.r6-screen { width: 100%; padding: 18px; border-radius: 18px; background: #0B1730; box-shadow: inset 0 0 0 4px #3B3675, inset 0 0 40px rgba(77, 232, 255, .15); font-family: Fredoka; }
.r6-os { color: #4DE8FF; font-size: 22px; margin-bottom: 12px; letter-spacing: 2px; }
.r6-sys { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; margin-top: 8px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 20px; color: #8FA2C8; }
.r6-sys i { width: 14px; height: 14px; border-radius: 50%; background: #FF5A6E; box-shadow: 0 0 10px #FF5A6E; }
.r6-sys.on { color: #EAFBFF; } .r6-sys.on i { background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.r6-client { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.r6-talk { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.r6-choices { display: grid; gap: 10px; }
.r6-note { color: var(--gold); font-family: Fredoka; font-size: 18px; text-align: center; }
.r6-title { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(12, 10, 36, .85); animation: screenIn .3s both; }
.r6-title b { font-family: Fredoka; font-size: 30px; color: var(--muted); } .r6-title span { font-family: Fredoka; font-weight: 700; font-size: 60px; color: #FFE3E7; text-shadow: 0 6px 0 #8E1E33, 0 0 40px rgba(255, 90, 110, .7); }
.r6-fight { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; justify-items: center; }
.r6-bars { display: flex; gap: 14px; width: 100%; justify-content: center; }
.r6-bar { display: flex; flex-direction: column; gap: 5px; width: 230px; font-family: Fredoka; font-size: 16px; }
.r6-bar .hp { height: 18px; border-radius: 10px; background: rgba(0, 0, 0, .35); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5); }
.r6-bar .hp i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .2) 0 6px, transparent 6px 12px), linear-gradient(90deg, #C9364B, #FF5A6E); transition: width .5s; }
.r6-bar.ko span::after { content: ' · K.O.'; color: var(--mint); }
.r6-boss { --s: 1; display: grid; place-items: center; min-height: 0; height: 100%; transform: scale(var(--s)); transition: transform .5s var(--ease-pop); filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .5)); }
.r6-boss.enter { animation: bossIn .9s var(--ease-pop); }
@keyframes bossIn { from { transform: translateY(-60px) scale(.4); opacity: 0 } }
.r6-boss.hit { animation: bossHit .5s; } @keyframes bossHit { 30% { translate: 18px 0; filter: brightness(2) } 60% { translate: -10px 0 } }
.r6-boss.grow { animation: bossGrow .7s var(--ease-pop); } @keyframes bossGrow { 40% { scale: 1.18 } }
.r6-card-slot { min-height: 96px; display: grid; place-items: center; }
.r6-card { width: 420px; max-width: 90%; padding: 14px 18px; border-radius: 16px; text-align: center; cursor: grab; touch-action: none; color: var(--ink);
  background: repeating-linear-gradient(180deg, transparent 0 23px, rgba(77, 124, 255, .18) 23px 24px), #FFFDF6; box-shadow: 0 12px 24px rgba(0, 0, 0, .35); animation: popIn .35s var(--ease-pop); position: relative; }
.r6-card::before { content: ''; position: absolute; left: 50%; top: -10px; translate: -50% 0; width: 80px; height: 20px; background: rgba(244, 233, 204, .9); }
.r6-card p { font-family: Fredoka; font-weight: 600; font-size: 22px; line-height: 1.25; }
.r6-card-n { font-size: 13px; color: #6E5A44; font-weight: 800; }
.r6-card.fly-ok { animation: flyOk .45s ease-in forwards; } @keyframes flyOk { to { transform: translateY(120px) scale(.4); opacity: 0 } }
.r6-card.fly-bad { animation: shk .42s, flyOk .4s ease-in .42s forwards; }
.r6-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.r6-col { position: relative; padding: 18px 10px 14px; border-radius: 18px 18px 26px 26px; font-family: Fredoka; font-size: 22px; color: var(--ink);
  background: var(--fibers), linear-gradient(180deg, #F7E2BF, #D9A86C); background-blend-mode: soft-light, normal; box-shadow: inset 0 6px 10px rgba(0, 0, 0, .15), 0 8px 18px rgba(0, 0, 0, .3); transition: transform .2s var(--ease-pop); }
.r6-col:nth-child(1) { background: var(--fibers), linear-gradient(180deg, #C9F5E3, #5FD3A8); background-blend-mode: soft-light, normal; }
.r6-col:nth-child(2) { background: var(--fibers), linear-gradient(180deg, #FFD6DC, #FF8FA0); background-blend-mode: soft-light, normal; }
.r6-col:nth-child(3) { background: var(--fibers), linear-gradient(180deg, #DCE2FF, #8E9BFF); background-blend-mode: soft-light, normal; }
.r6-col:hover { transform: translateY(-4px); }
.r6-pocket-stitch { position: absolute; left: 10px; right: 10px; top: 8px; border-top: 2px dashed rgba(27, 24, 48, .3); }
.r6-col-count { position: absolute; right: 12px; top: 10px; font-size: 14px; color: #3B3675; }
.r6-star { position: fixed; z-index: 99; font-size: 34px; transition: transform .5s cubic-bezier(.3, .7, .3, 1); pointer-events: none; }
.r6-smoke { position: absolute; inset: 0; z-index: 9; pointer-events: none; background: radial-gradient(circle at 50% 40%, rgba(120, 116, 150, .85), rgba(80, 76, 110, .5) 40%, transparent 70%); animation: fadeOut 1.6s ease forwards; }
.r6-hint { position: absolute; left: 50%; top: 40%; translate: -50% 0; z-index: 10; padding: 12px 20px; border-radius: 16px; background: #FFD6DC; color: var(--ink); font-family: Fredoka; font-size: 20px; box-shadow: var(--shadow); animation: popIn .3s var(--ease-pop); }
.r6-done { font-family: Fredoka; font-size: 28px; color: var(--gold); }

/* ================= Finale ================= */
.reveal .rv-boss { position: relative; transition: transform 1.6s ease-in, opacity 1.6s; }
.reveal .rv-boss.deflate { transform: scale(.15, .05) translateY(600px); opacity: 0; }
.reveal .rv-mask { position: absolute; left: 50%; top: 40%; translate: -50% 0; font-size: 90px; animation: maskFall 2s ease-in 2.2s forwards; }
@keyframes maskFall { to { transform: translateY(260px) rotate(200deg); opacity: 0 } }
.reveal .rv-cap { font-family: Fredoka; font-size: 32px; margin-top: 20px; }
.rv-lines { gap: 10px; }
.rv-line { font-family: Fredoka; font-weight: 600; font-size: clamp(28px, 3.4vw, 46px); min-height: 1.2em; }
.rv-line.gold { color: var(--gold); }
.game.full .hud { background: transparent; }
.game.paused::after { content: 'Pause'; position: fixed; left: 50%; top: 50%; translate: -50% -50%; z-index: 60; font-family: Fredoka; font-size: 60px; padding: 16px 40px; border-radius: 26px; background: rgba(12, 10, 36, .85); box-shadow: var(--shadow); }

@media (max-width: 1180px) {
  .r1-grid { grid-template-columns: 1fr; } .r1-radio { display: none; }
  .r1-values { grid-template-columns: 1fr 1fr; }
  .r4-grid { grid-template-columns: 1fr 1fr; } .r4-devs { display: none; }
  .r5-grid { grid-template-columns: 1fr; } .r5-side { display: none; }
  .r6-bar { width: 160px; }
}
@media (max-height: 760px) {
  .r2-art { height: 120px; } .r2-art .plush { width: 110px; height: 110px; }
  .r1-values .r1-slot { min-height: 50px; }
}

.r6-boss svg { height: 100%; max-height: 240px; width: auto; }
.r2-art { height: 200px; }

/* ---- "Comment jouer" briefing before each round ---- */
.briefing { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 18px; background: radial-gradient(ellipse at 50% 40%, rgba(40, 30, 90, .55), rgba(10, 8, 30, .88)); backdrop-filter: blur(5px); animation: fadeIn .35s ease both; overflow: auto; }
.briefing.leave { animation: fadeOut .35s ease forwards; }
.brief-card { width: min(820px, 100%); padding: 28px 34px 24px; display: flex; flex-direction: column; gap: 10px; animation: popIn .5s var(--ease-pop) both; }
.brief-num { font-family: Fredoka; font-weight: 700; color: var(--gold); font-size: 18px; letter-spacing: .02em; }
.brief-card h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.05; }
.brief-story { font-size: 19px; color: #FFE3B8; font-style: italic; }
.brief-card h3 { font-family: Fredoka; font-size: 20px; margin-top: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.brief-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; padding: 0; margin: 0; }
.brief-steps li { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 14px; font-size: 20px; line-height: 1.3; padding: 10px 14px; border-radius: 16px; background: rgba(255, 244, 226, .07); border: 2px dashed rgba(255, 244, 226, .18); animation: popIn .45s var(--ease-pop) both; }
.brief-steps .ic { width: 52px; height: 52px; display: grid; place-items: center; font-size: 28px; border-radius: 50%; background: #F3E3C3; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), 0 3px 0 rgba(0, 0, 0, .25); }
.brief-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.brief-left { font-family: Fredoka; font-size: 20px; color: var(--muted); text-align: center; }
.brief-left b { color: var(--gold); font-size: 28px; }
.brief-bar { height: 12px; border-radius: 999px; background: rgba(0, 0, 0, .3); overflow: hidden; border: 2px dashed rgba(255, 244, 226, .2); }
.brief-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #FF9A3C); transform-origin: left; transform: scaleX(0); transition: transform .25s linear; }
@media (max-height: 760px) { .brief-card { padding: 20px 26px 18px; gap: 6px; } .brief-steps li { font-size: 17px; padding: 7px 12px; } .brief-steps .ic { width: 42px; height: 42px; font-size: 22px; } .brief-story { font-size: 17px; } }
@keyframes fadeIn { from { opacity: 0 } }

/* ---- short laptop windows (Windows display scaling: ~1280x600 inside the browser) ---- */
.screen:not(.game) { overflow-y: auto; overflow-x: hidden; }
@media (max-height: 700px) {
  .logo { font-size: clamp(60px, 7vw, 96px); }
  .alert-pill { margin-bottom: 10px; padding: 6px 14px 6px 12px; font-size: 14px; }
  .join-left .sub { font-size: 24px; margin-top: 8px; }
  .join-left p.tagline { font-size: 17px; margin-top: 8px; }
  .join-card { padding: 20px 26px 18px; margin-top: 16px !important; }
  .join-card h2 { font-size: 22px; }
  .code-boxes { margin: 10px 0 4px; }
  .code-boxes input { width: 54px; height: 62px; font-size: 32px; border-radius: 16px; }
  .builder { grid-template-columns: 290px 1fr; gap: 18px; padding: 10px 0; }
  .builder .preview { padding: 14px; }
  .builder .preview .plush { width: 200px; height: 200px; }
  .builder .preview .name-tag { font-size: 22px; }
  .builder .opts { padding: 16px 22px; gap: 10px; }
  .opt-row h3 { font-size: 15px; margin-bottom: 6px; }
  .name-input { height: 46px; font-size: 20px; }
  .swatch { width: 36px; height: 36px; }
  .accs { grid-template-columns: repeat(8, minmax(0, 62px)); gap: 8px; }
  .acc { border-radius: 12px; }
  .crews { gap: 8px; }
  .crew-btn { padding: 7px 10px; gap: 10px; }
  .crew-btn .patch { width: 32px; height: 32px; font-size: 15px; }
  .crew-btn b { font-size: 17px; }
  .btn.big { padding-top: 10px; padding-bottom: 10px; }
  /* round 2: shorter lineup */
  .r2-clue { font-size: 13.5px; min-height: 0; margin-bottom: 6px; padding: 8px 10px; }
  .r2-art { height: 104px; }
  .r2-art > .plush { width: 104px; height: 104px; }
  .r2-trio .plush { width: 72px; height: 72px; margin: 0 -10px; }
  .r2-slot { min-height: 34px; margin-top: 4px; padding: 4px 10px; }
  .r2-placard { margin-top: 4px; font-size: 13px; padding: 2px 10px; }
  .r2-suspect { padding-bottom: 6px; }
  .r2-badge { padding: 6px 10px; gap: 8px; }
  .r2-badge .patch { width: 32px; height: 32px; font-size: 16px; }
  .r2-badge b { font-size: 16px; }
  .r2-hint { font-size: 13px; }
  /* round 4: tighter backlog */
  .r4-tasks { gap: 5px; }
  .r4-task { padding: 5px 10px; font-size: 14px; gap: 8px; border-radius: 12px; }
  .r4-pts { width: 28px; height: 28px; font-size: 15px; }
  .r4-backlog h3, .r4-sprint h3 { font-size: 15px; margin-bottom: 4px; }
  .r4-goal { padding-top: 4px; }
  .r4-goal-btn { padding: 6px 12px; font-size: 14px; }
}

/* ---- R1: Si Hamouda's anger stages (one per wrong answer, they stay) ---- */
.r1-ham .plush { transition: filter .5s; }
.r1-ham.stage-1 .plush { filter: saturate(1.3) hue-rotate(-6deg) drop-shadow(0 0 14px rgba(255, 90, 110, .45)); }
.r1-ham.stage-2 .plush { filter: saturate(1.7) hue-rotate(-14deg) drop-shadow(0 0 24px rgba(255, 60, 80, .7)); animation: r1tremble .3s linear infinite; }
.r1-ham.stage-3 .plush { filter: saturate(2.3) hue-rotate(-22deg) brightness(.92) drop-shadow(0 0 34px rgba(255, 40, 40, .95)); animation: r1tremble .14s linear infinite; }
@keyframes r1tremble { 25% { transform: translate(-2px, 1px) rotate(-1deg) } 75% { transform: translate(2px, -1px) rotate(1deg) } }
.r1-fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.r1-fx span { position: absolute; opacity: 0; transition: opacity .4s; }
.r1-vein { right: 26%; top: 16%; font-size: 40px; animation: veinBeat .7s ease-in-out infinite; }
@keyframes veinBeat { 50% { transform: scale(1.25) } }
.r1-steam { top: 20%; font-size: 38px; animation: steamUp 1.4s ease-out infinite; }
.r1-steam.s1 { left: 18%; transform: scaleX(-1); } .r1-steam.s2 { right: 18%; animation-delay: .7s; }
@keyframes steamUp { from { translate: 0 10px; opacity: .2 } 60% { opacity: 1 } to { translate: 0 -40px; opacity: 0 } }
.r1-fire { top: 6%; font-size: 40px; animation: flick .4s ease-in-out infinite alternate; }
.r1-fire.f1 { left: 34%; } .r1-fire.f2 { left: 46%; top: 2%; font-size: 48px; animation-delay: .15s; } .r1-fire.f3 { left: 58%; animation-delay: .3s; }
.r1-radio.stage-1 .r1-vein, .r1-radio.stage-2 .r1-vein, .r1-radio.stage-3 .r1-vein { opacity: 1; }
.r1-radio.stage-2 .r1-steam, .r1-radio.stage-3 .r1-steam { opacity: 1; }
.r1-radio.stage-3 .r1-fire { opacity: 1; }
.r1-radio.stage-3 { animation: redPulse 1s ease-in-out infinite; }
@keyframes redPulse { 50% { box-shadow: inset 0 0 60px rgba(255, 50, 60, .55), 0 0 30px rgba(255, 50, 60, .35); } }
.r1-mood { font-family: Fredoka; font-size: 16px; padding: 5px 14px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 2px solid rgba(255, 244, 226, .2); z-index: 4; }
.r1-mood.m1 { border-color: #FF9A3C; color: #FFD2A8; } .r1-mood.m2 { border-color: #FF5A6E; color: #FFC2CB; background: rgba(120, 10, 30, .45); } .r1-mood.m3 { border-color: #FF2D3D; color: #fff; background: rgba(170, 10, 25, .7); }
.r1-mood.bump { animation: popIn .45s var(--ease-pop); }
.r1-stage-pop { position: absolute; left: 50%; top: 42%; translate: -50% -50%; z-index: 6; white-space: nowrap; padding: 10px 18px; border-radius: 14px; background: #FF5A6E; color: #fff; font-family: Fredoka; font-weight: 700; font-size: 22px; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); animation: popIn .4s var(--ease-pop), fadeOut .4s ease 1.4s forwards; }

/* ---- R2: wrong-badge reaction, then the first sentence comes back ---- */
.r2-clue.no { background: #FFC9D3; } .r2-clue.no::after { border-top-color: #FFC9D3; }
.r2-clue.back { animation: popIn .4s var(--ease-pop); }
.r2-slot.bad { border: 2px solid var(--coral); color: #FFC2CB; background: rgba(255, 90, 110, .15); }
.r2-wrong-tag { font-family: Fredoka; font-size: 14px; }

/* ---- R3: colour-coded priority crates, each for one part of the ship ---- */
.r3-crate { width: 196px; padding: 10px 12px 12px; border: 4px solid #8A6A45; }
.r3-crate .r3-ico { font-size: 44px; line-height: 1.05; }
.r3-crate .r3-lbl { font-size: 18px; }
.r3-prio { position: relative; display: inline-block; font-family: Fredoka; font-weight: 700; font-size: 14px; letter-spacing: .06em; padding: 2px 10px; border-radius: 999px; color: #fff; margin-bottom: 2px; }
.r3-part { position: relative; display: block; margin-top: 5px; font-size: 13px; font-weight: 800; color: #5A3B22; }
.r3-crate.p-vital { border-color: #FF3D55; box-shadow: 0 0 0 3px rgba(255, 61, 85, .35), 0 0 26px rgba(255, 61, 85, .7), 0 10px 18px rgba(0, 0, 0, .35); }
.r3-crate.p-vital .r3-prio { background: #E8233F; }
.r3-crate.p-later { border-color: #FF9A3C; filter: saturate(.8); }
.r3-crate.p-later .r3-prio { background: #E07A1F; }
.r3-crate.p-gadget { border-color: #9A97B8; filter: grayscale(.55) brightness(.9); }
.r3-crate.p-gadget .r3-prio { background: #77739A; }
.r3-legend { position: absolute; left: 50%; top: 18px; translate: -50% 0; z-index: 4; display: flex; gap: 8px; }
.r3-legend .lg { font-family: Fredoka; font-weight: 600; font-size: 15px; padding: 5px 12px; border-radius: 999px; color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.r3-legend .vital { background: #E8233F; } .r3-legend .later { background: #E07A1F; } .r3-legend .gadget { background: #77739A; }
.r3-backlog { position: absolute; right: 14px; top: 66px; z-index: 4; width: 220px; padding: 12px; border-radius: 16px; background: rgba(12, 10, 36, .72); border: 2px dashed rgba(255, 244, 226, .25); display: flex; flex-direction: column; gap: 6px; }
.r3-backlog h4 { font-family: Fredoka; font-size: 16px; color: var(--gold); margin: 0 0 2px; }
.r3-slot { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 14px; color: var(--muted); }
.r3-slot .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); font-family: Fredoka; font-size: 13px; flex: none; }
.r3-slot.filled { color: #fff; font-weight: 800; animation: popIn .35s var(--ease-pop); }
.r3-slot.p-vital { background: rgba(232, 35, 63, .45); } .r3-slot.p-later { background: rgba(224, 122, 31, .4); } .r3-slot.p-gadget { background: rgba(119, 115, 154, .45); }
.r3-lina { right: auto; left: 18px; top: 76px; }
@media (max-height: 700px) { .r3-crate { width: 176px; } .r3-crate .r3-ico { font-size: 36px; } .r3-crate .r3-lbl { font-size: 16px; } .r3-backlog { width: 190px; top: 58px; } }

/* ---- R4: guided steps ---- */
.r4-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 8px; justify-content: center; }
.r4-steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; font-family: Fredoka; font-size: 16px; color: var(--muted); background: rgba(255, 255, 255, .05); border: 2px solid transparent; }
.r4-steps li b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); font-size: 14px; }
.r4-steps li.on { color: var(--ink); background: var(--gold); border-color: #FFE3A0; box-shadow: 0 0 18px rgba(255, 197, 74, .5); }
.r4-steps li.on b { background: #3A2600; color: var(--gold); }
.r4-steps li.done { color: #BFF5DE; border-color: rgba(67, 224, 168, .5); } .r4-steps li.done b { background: var(--mint); color: #06301F; }
.r4-step1 { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 2px; }
.r4-q { font-family: Fredoka; font-size: 22px; }
.r4-goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.r4 .r4-goal-btn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; font-size: 18px; font-weight: 800; text-align: left; color: var(--ink); background: var(--noise-l), linear-gradient(180deg, #FFF8EC, #F1DFC0); border: 3px solid transparent; box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
.r4 .r4-goal-btn .gi { font-size: 30px; }
.r4 .r4-goal-btn:hover { transform: translateY(-3px); }
.r4 .r4-goal-btn.wrong { border-color: var(--coral); background: #FFD6DC; opacity: .75; }
.r4 .r4-goal-btn.right { border-color: var(--mint); background: #C9F5E3; }
.r4-why { min-height: 26px; font-family: Fredoka; font-size: 19px; text-align: center; }
.r4-why.good { color: var(--mint); } .r4-why.bad { color: #FFB0BC; }
.r4-goal-chip { align-self: center; padding: 6px 16px; border-radius: 999px; background: rgba(67, 224, 168, .15); border: 2px solid rgba(67, 224, 168, .5); font-size: 16px; }
.r4-grid.locked { opacity: .25; filter: grayscale(.7); pointer-events: none; }
.r4-backlog h3 small { font-size: 13px; color: var(--muted); font-family: Nunito; }
.r4-task { position: relative; }
.r4-tl { flex: 1; }
.r4-target { font-size: 20px; opacity: 0; transition: opacity .3s; }
.r4.unlocked .r4-target { opacity: 1; animation: popIn .4s var(--ease-pop); }
.r4-chip { cursor: pointer; }
.r4-foot { flex-direction: column; align-items: center; gap: 6px; }
.r4-help { font-family: Fredoka; font-size: 19px; text-align: center; min-height: 26px; }
.r4-help.bad { color: #FFB0BC; } .r4-help.good { color: var(--mint); }
.r4-help b { color: var(--gold); }
.r4-launch[disabled] { opacity: .4; cursor: not-allowed; }
.r4-launch.ready { animation: readyPulse 1.1s ease-in-out infinite; }
@keyframes readyPulse { 50% { transform: scale(1.06); box-shadow: 0 0 30px rgba(255, 197, 74, .8); } }
@media (max-height: 700px) {
  .r4-steps li { font-size: 14px; padding: 4px 12px 4px 4px; } .r4-steps li b { width: 22px; height: 22px; }
  .r4-q { font-size: 18px; } .r4 .r4-goal-btn { padding: 10px 12px; font-size: 15px; } .r4 .r4-goal-btn .gi { font-size: 24px; }
  .r4-help { font-size: 16px; min-height: 20px; }
  .r4-gauge { width: min(210px, 100%); }
}

/* ---- R6: "Les canons de la rétro" ---- */
.r6n .r6-step { font-family: Fredoka; font-size: 17px; color: var(--muted); text-align: center; }
.r6n .r6-ask { font-family: Fredoka; font-size: 19px; text-align: center; }
.r6n .r6-title em { font-style: normal; font-family: Fredoka; font-size: 22px; color: var(--gold); margin-top: 10px; }
.r6n .r6-fight { grid-template-rows: auto minmax(0, 1fr) auto; }
.r6-arena { position: relative; width: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 16px; }
.r6n .r6-boss { height: 100%; }
.r6n .r6-boss svg { height: 100%; max-height: 230px; width: auto; }
.r6n .r6-boss.ko { animation: bossKO 1.2s ease-in forwards; }
@keyframes bossKO { 40% { transform: scale(1.1) rotate(-6deg); } to { transform: scale(.2) rotate(30deg); opacity: 0; } }
.r6n .r6-card-slot { min-height: 0; }
.r6n .r6-card { width: 100%; max-width: 520px; cursor: default; padding: 16px 20px; }
.r6n .r6-card p { font-size: 23px; margin: 6px 0; }
.r6-card-q { font-size: 14px; font-weight: 800; color: #6E5A44; }
.r6-canons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.r6-canon { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 12px 12px; border-radius: 22px 22px 26px 26px; color: var(--ink); text-align: center; box-shadow: 0 7px 0 rgba(0, 0, 0, .3); transition: transform .15s var(--ease-pop); }
.r6-canon b { font-family: Fredoka; font-size: 22px; }
.r6-canon small { font-size: 14px; font-weight: 800; line-height: 1.25; opacity: .85; }
.r6-canon .barrel { position: absolute; left: 50%; top: -18px; translate: -50% 0; width: 34px; height: 30px; border-radius: 8px 8px 4px 4px; background: inherit; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), 0 0 0 3px rgba(27, 24, 48, .25); }
.r6-canon:hover { transform: translateY(-4px); }
.r6-canon.recoil { animation: recoil .3s ease; } @keyframes recoil { 30% { transform: translateY(8px) scale(.97); } }
.r6-canon.c-start { background: var(--fibers), linear-gradient(180deg, #C9F5E3, #5FD3A8); background-blend-mode: soft-light, normal; }
.r6-canon.c-stop { background: var(--fibers), linear-gradient(180deg, #FFD6DC, #FF8FA0); background-blend-mode: soft-light, normal; }
.r6-canon.c-keep { background: var(--fibers), linear-gradient(180deg, #DCE2FF, #8E9BFF); background-blend-mode: soft-light, normal; }
.r6-shot { position: fixed; z-index: 99; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; transition: transform .4s cubic-bezier(.3, .7, .3, 1); pointer-events: none; box-shadow: 0 0 20px 8px currentColor; }
.r6-shot.c-start { background: #5FD3A8; color: #5FD3A8; } .r6-shot.c-stop { background: #FF5A6E; color: #FF5A6E; } .r6-shot.c-keep { background: #8E9BFF; color: #8E9BFF; }
.r6-say { position: absolute; left: 50%; bottom: 4px; translate: -50% 0; z-index: 8; max-width: 92%; padding: 10px 18px; border-radius: 14px; font-family: Fredoka; font-size: 19px; text-align: center; box-shadow: var(--shadow); animation: popIn .3s var(--ease-pop); }
.r6-say.good { background: #C9F5E3; color: #06301F; } .r6-say.bad { background: #FFD6DC; color: #5A0E1B; }
@media (max-height: 700px) {
  .r6n .r6-boss svg { max-height: 150px; } .r6n .r6-card p { font-size: 19px; } .r6-canon { padding: 20px 10px 8px; } .r6-canon b { font-size: 18px; } .r6-canon small { font-size: 12.5px; }
  .r6-say { font-size: 16px; }
}
/* R4 layout: keep everything inside the stage */
.r4 { gap: 10px; }
.r4 .r4-grid { overflow: hidden; grid-template-columns: 1fr 1fr 120px; }
.r4 .r4-backlog { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.r4 .r4-reactor { min-height: 0; overflow: hidden; }
.r4 .r4-gauge { width: min(210px, 100%); flex: none; }
.r4 .r4-sprint { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.r4 .r4-in { flex: 1; min-height: 0; overflow-y: auto; align-content: flex-start; scrollbar-width: thin; }
.r4 .r4-chip { font-size: 13px; padding: 5px 8px; }
.r4 .r4-dev-art .plush { width: 76px; height: 76px; }
.r4 .r4-energy { width: 84px; }
.r4 .r4-foot { flex-direction: row; justify-content: center; gap: 18px; flex: none; }
.r4 .r4-help { margin: 0; max-width: 60%; text-align: right; }
@media (max-height: 700px) { .r4 .r4-gauge { width: min(160px, 100%); } .r4 .r4-dev-art .plush { width: 60px; height: 60px; } .r4 .r4-foot .btn.big { min-height: 52px; font-size: 20px; } }
.r2-suspect { min-width: 0; }
.r2 .r2-clue { max-width: 100%; box-sizing: border-box; }
@media (max-height: 860px) {
  .r4 .r4-tasks { gap: 5px; }
  .r4 .r4-task { padding: 5px 10px; font-size: 14.5px; gap: 8px; border-radius: 12px; }
  .r4 .r4-pts { width: 28px; height: 28px; font-size: 15px; }
  .r4 .r4-backlog h3, .r4 .r4-sprint h3 { font-size: 15px; margin-bottom: 4px; }
  .r4 .r4-goal-chip { padding: 4px 14px; font-size: 14px; }
}
@media (max-height: 640px) {
  .r4 { padding-top: 14px; padding-bottom: 12px; gap: 6px; }
  .r4 .r4-tasks { gap: 3px; }
  .r4 .r4-task { padding: 3px 8px; font-size: 13px; }
  .r4 .r4-pts { width: 24px; height: 24px; font-size: 13px; }
  .r4 .r4-target { font-size: 16px; }
  .r4 .r4-steps li { font-size: 13px; }
}

/* ---- R5: Panne générale (board + circuit + daily + burndown) ---- */
.r5n-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr) 270px; gap: 14px; }
.r5n-board { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; }
.r5n-board h3 { font-size: 17px; }
.r5n-col { border-radius: 14px; padding: 8px; background: rgba(0, 0, 0, .2); border: 2px dashed rgba(255, 244, 226, .18); }
.r5n-col h4 { font-family: Fredoka; font-size: 15px; margin: 0 0 6px; color: var(--muted); }
.r5n-col[data-col="doing"] { border-color: rgba(255, 197, 74, .5); } .r5n-col[data-col="done"] { border-color: rgba(67, 224, 168, .5); }
.r5n-cards { display: flex; flex-direction: column; gap: 6px; min-height: 30px; }
.r5n-card { text-align: left; padding: 8px 10px; border-radius: 10px; font-weight: 800; font-size: 14.5px; color: var(--ink); background: var(--noise-l), linear-gradient(180deg, #FFF8EC, #F1DFC0); box-shadow: 0 4px 0 rgba(0, 0, 0, .25); animation: popIn .35s var(--ease-pop); }
.r5n-card.todo { cursor: pointer; } .r5n-card.todo:hover { transform: translateY(-2px) rotate(-1deg); }
.r5n-card.doing { background: #FFE9A8; cursor: default; } .r5n-card.done { background: #C9F5E3; cursor: default; opacity: .9; }
.r5n-empty { color: var(--muted); font-size: 13px; padding-left: 4px; }
.r5n-lockb { font-size: 13px; }
.r5n-work { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; min-height: 0; border-radius: var(--r-lg); }
.r5n-help { font-family: Fredoka; font-size: 19px; text-align: center; max-width: 92%; }
.r5n-help.warn { color: #FFB0BC; } .r5n-help.good { color: var(--mint); }
.r5n-circuit { display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 10px; }
.r5n-src { width: 70px; height: 70px; border-radius: 18px; display: grid; place-items: center; font-size: 34px; line-height: 1; background: #2B2665; border: 3px solid #8A6A45; color: var(--gold); text-align: center; }
.r5n-src small { font-size: 11px; font-family: Fredoka; color: var(--muted); }
.r5n-src.on { box-shadow: 0 0 24px rgba(255, 197, 74, .8); }
.r5n-tiles { display: grid; grid-template-columns: repeat(5, var(--t)); grid-template-rows: repeat(3, var(--t)); gap: 6px; --t: clamp(52px, 9vh, 76px); }
.r5n-tile { position: relative; width: var(--t); height: var(--t); border-radius: 12px; background: #1A1640; border: 2px solid #3B3675; padding: 0; cursor: pointer; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3); }
.r5n-tile:hover { border-color: var(--gold); }
.r5n-tile .rot { display: block; width: 100%; height: 100%; transition: transform .2s ease; }
.r5n-tile svg { width: 100%; height: 100%; display: block; }
.r5n-tile .wire-bg { stroke: #0B0A20; stroke-width: 16; stroke-linecap: butt; fill: none; }
.r5n-tile .wire { stroke: #7A7698; stroke-width: 9; stroke-linecap: butt; fill: none; transition: stroke .2s; }
.r5n-tile .hub { fill: #7A7698; }
.r5n-tile.on .wire, .r5n-tile.on .hub { stroke: #FFC54A; fill: #FFC54A; filter: drop-shadow(0 0 6px #FFC54A); }
.r5n-tile.on .wire { fill: none; }
.r5n-tile.locked { cursor: not-allowed; border-color: var(--coral); background: repeating-linear-gradient(45deg, rgba(255, 90, 110, .18) 0 8px, transparent 8px 16px), #1A1640; }
.r5n-tile .lk { position: absolute; right: -6px; top: -8px; font-style: normal; font-size: 20px; }
.r5n-void { width: var(--t); height: var(--t); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.r5n-targets { display: grid; grid-template-rows: repeat(3, var(--t)); gap: 6px; --t: clamp(52px, 9vh, 76px); }
.r5n-tg { width: 76px; height: var(--t); border-radius: 14px; display: grid; place-items: center; font-size: 30px; line-height: 1; text-align: center; }
.r5n-tg.on { background: #2B2665; border: 3px dashed var(--coral); animation: tgBlink 1s steps(2) infinite; }
.r5n-tg small { font-size: 11px; font-family: Fredoka; color: var(--muted); display: block; }
.r5n-tg.powered { border: 3px solid var(--mint); animation: none; box-shadow: 0 0 26px rgba(67, 224, 168, .8); }
@keyframes tgBlink { 50% { border-color: rgba(255, 90, 110, .3); } }
.r5n-daily { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(12, 10, 36, .7); padding: 14px; }
.r5n-dcard { width: min(600px, 100%); padding: 18px 22px; color: var(--ink); animation: popIn .4s var(--ease-pop); }
.r5n-dhead { display: flex; align-items: center; gap: 12px; } .r5n-dhead h3 { font-size: 21px; } .r5n-dhead p { font-size: 14px; color: #6E5A44; }
.r5n-q { font-family: Fredoka; font-size: 22px; margin: 10px 0 8px; }
.r5n-opts { display: grid; gap: 8px; }
.r5n-dnote { min-height: 22px; margin-top: 8px; font-weight: 800; color: #3B3675; }
.r5n-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.r5n-zen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14.5px; animation: popIn .4s var(--ease-pop); }
.r5n-zen .plush { flex: none; }
@media (max-height: 700px) { .r5n-grid { grid-template-columns: 200px minmax(0, 1fr) 230px; } .r5n-help { font-size: 16px; } .r5n-card { font-size: 13px; padding: 6px 8px; } .r5n-q { font-size: 18px; } .r5n-dcard { padding: 12px 16px; } .r5n-dhead .plush { display: none; } }
/* R5: keep the circuit inside the middle column on every laptop size */
.r5n-grid { grid-template-columns: 190px minmax(0, 1fr) 220px; }
.r5n-tiles, .r5n-targets { --t: clamp(40px, min(8.5vh, 4.2vw), 70px); gap: 5px; }
.r5n-circuit { gap: 8px; }
.r5n-src { width: 56px; height: 56px; font-size: 26px; border-radius: 14px; }
.r5n-tg { width: 64px; font-size: 24px; }
@media (max-width: 1400px) { .r5n-grid { grid-template-columns: 170px minmax(0, 1fr) 200px; gap: 10px; } .r5n-card { font-size: 13px; padding: 6px 8px; } }

/* ---- Pause: everything stops and nothing can be clicked until the host resumes ---- */
.game.paused::before { content: ''; position: fixed; inset: 0; z-index: 59; background: rgba(8, 6, 24, .55); backdrop-filter: blur(3px); cursor: not-allowed; }
.game.paused::after { content: '⏸ Pause'; pointer-events: none; }
.game.paused .game-content *, .game.paused .game-content *::before, .game.paused .game-content *::after { animation-play-state: paused !important; }
.game.paused .hud { position: relative; z-index: 61; }
/* Daily hint + results board */
.r5n-hint { font-size: 15px; font-weight: 800; color: #6E5A44; margin: -2px 0 8px; }
.res-board { padding: 14px 16px; margin-top: 6px; }
.res-board h3 { font-size: 18px; margin-bottom: 8px; }
.res-board .mini-board { max-height: 30vh; }
.listen-foot .bar { display: none; }
