/* BeeSpeaker Small Talk Survivor — komiks + teatr: scena z kurtyną, postać w roli głównej, dymek, karty odpowiedzi.
 * Barwy rodziny: granat #1d1e4f, żółty #ffd801, różowy #ff4f9a; własny akcent gry: koral #ff7847.
 * Każda scena ma swój nastrój: --sa (akcent) i --sb (tło sceny) ustawiane przez .app[data-scene]. */
:root {
  --navy: #1d1e4f;
  --navy-2: #2a2b6e;
  --yellow: #ffd801;
  --pink: #ff4f9a;
  --coral: #ff7847;
  --mint: #3ee09a;
  --red: #ff5d5d;
  --paper: #fffdf4;
  --muted: #cfd0f2;
  --sa: #ff7847;
  --sb: #ffe1ad;
  --display: "Bungee", "Baloo 2", system-ui, sans-serif;
  --body: "Baloo 2", system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
html:lang(ja) { --display: "Baloo 2", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif; }
html:lang(ja) .title, html:lang(ja) .burst, html:lang(ja) .mic-txt b, html:lang(ja) .next-btn, html:lang(ja) .scene-card .nm, html:lang(ja) .pl-name,
html:lang(ja) .pl-num, html:lang(ja) .gauge-label, html:lang(ja) .scene-card .new, html:lang(ja) .bee::after, html:lang(ja) .who, html:lang(ja) .sel-stars { font-weight: 800; }
html:lang(ja) .gauge-label { font-size: 9.5px; }
.app[data-scene="cafe"] { --sa: #ff7847; --sb: #ffe1ad; }
.app[data-scene="airport"] { --sa: #3e9bff; --sb: #c9ecff; }
.app[data-scene="hotel"] { --sa: #f6b60b; --sb: #7d1d3a; }
.app[data-scene="taxi"] { --sa: #ffd801; --sb: #1b1f5e; }
.app[data-scene="shop"] { --sa: #ff4f9a; --sb: #ffd0e2; }
.app[data-scene="party"] { --sa: #a66bff; --sb: #4a2190; }

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--navy);
  color: #fff;
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
  overflow: hidden;
}
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
p { margin: 0; }

.app {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
}
.rays, .dots { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; }
.rays {
  left: -50%; top: -50%; right: -50%; bottom: -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 120, 71, .11) 0deg 12deg, rgba(255, 120, 71, 0) 12deg 24deg);
  animation: spin 70s linear infinite;
}
.dots { background-image: radial-gradient(rgba(255, 255, 255, .08) 2px, transparent 2.5px); background-size: 18px 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

.screen { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ---------- tytuł / ekran pod startem ---------- */
.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 11vw, 50px);
  line-height: .95;
  text-align: center;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--navy), 5px 5px 0 rgba(0, 0, 0, .35);
  letter-spacing: .01em;
}
.title .alt { color: var(--coral); }
.title.small { font-size: clamp(19px, 6vw, 26px); text-align: left; }
.idle { align-items: center; justify-content: center; gap: 14px; }
.idle-bee { width: 170px; height: 170px; animation: bob 2.6s ease-in-out infinite; }
.idle-bee svg, .bee svg { width: 100%; height: 100%; display: block; overflow: visible; }
.idle-bubbles { position: relative; width: 260px; height: 74px; }
.ib {
  position: absolute; background: #fff; color: var(--navy); font-weight: 800; font-size: 17px; padding: 5px 13px; border: 3px solid var(--navy);
  border-radius: 16px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .3); white-space: nowrap;
}
.ib1 { left: 4px; top: 30px; transform: rotate(-8deg); background: var(--yellow); }
.ib2 { right: 10px; top: 36px; transform: rotate(7deg); }
.ib3 { left: 50%; top: 0; transform: translateX(-50%) rotate(-2deg); background: #ffd9e8; }

/* ---------- przyciski-ikony ---------- */
.icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 13px; border: 3px solid var(--navy); background: rgba(255, 255, 255, .14); color: #fff;
  display: grid; place-items: center; padding: 0;
}
.icon-btn svg { width: 22px; height: 22px; display: block; }
.icon-btn .off, .icon-btn.muted .on { display: none; }
.icon-btn.muted .off { display: block; }

/* ---------- wybór sceny ---------- */
.select { gap: 8px; }
.sel-head { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.sel-head .title { flex: 1; }
.sel-stars { display: flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 15px; color: var(--yellow); background: rgba(0, 0, 0, .25); padding: 4px 10px; border-radius: 999px; }
.sel-stars svg { width: 18px; height: 18px; }
.scenes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); gap: 9px; }
.scene-card {
  position: relative; display: flex; flex-direction: column; min-height: 0; padding: 0; text-align: left; overflow: hidden;
  border: 4px solid var(--navy); border-radius: 20px; background: var(--paper); color: var(--navy);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, .4); transition: transform .12s ease;
  animation: card-in .4s cubic-bezier(.2, 1.3, .4, 1) both;
}
.scene-card:nth-child(2) { animation-delay: .05s; } .scene-card:nth-child(3) { animation-delay: .1s; }
.scene-card:nth-child(4) { animation-delay: .15s; } .scene-card:nth-child(5) { animation-delay: .2s; } .scene-card:nth-child(6) { animation-delay: .25s; }
@keyframes card-in { from { transform: translateY(18px) scale(.94); opacity: 0; } }
.scene-card:active { transform: translate(2px, 3px); box-shadow: 2px 2px 0 rgba(0, 0, 0, .4); }
.scene-card .thumb { position: relative; flex: 1; min-height: 0; overflow: hidden; border-bottom: 4px solid var(--navy); }
.scene-card .thumb .tb { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.scene-card .thumb .tb svg { width: 100%; height: 100%; display: block; }
.scene-card .thumb .tc { position: absolute; left: 0; right: 0; bottom: -4%; height: 104%; display: flex; justify-content: center; }
.scene-card .thumb .tc svg { height: 100%; width: auto; display: block; overflow: visible; }
.scene-card .num {
  position: absolute; left: 6px; top: 6px; z-index: 2; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 9px; background: var(--navy); color: var(--yellow);
  font-family: var(--display); font-size: 14px; display: grid; place-items: center;
}
.scene-card .new {
  position: absolute; right: -4px; top: 8px; z-index: 2; background: var(--pink); color: #fff; font-family: var(--display); font-size: 11px; padding: 3px 10px 3px 8px;
  border: 3px solid var(--navy); border-radius: 8px 0 0 8px; animation: pulse 1.2s ease-in-out infinite;
}
.scene-card .info { flex: none; padding: 5px 9px 6px; display: flex; flex-direction: column; gap: 1px; }
.scene-card .nm { font-family: var(--display); font-size: clamp(13px, 4vw, 16px); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-card .wh { font-size: 12.5px; font-weight: 700; color: #5a5b8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-card .st {
  position: absolute; right: 5px; bottom: 5px; z-index: 2; display: flex; padding: 2px 5px; border-radius: 999px; background: var(--navy);
}
.scene-card .st svg { width: 17px; height: 17px; }
.scene-card .st .star path { stroke-width: 0; }
.scene-card .st .star:not(.on) path { fill: rgba(255, 255, 255, .22); }
.scene-card.locked .thumb .tb, .scene-card.locked .thumb .tc { filter: grayscale(1) brightness(.55); }
.scene-card.locked { background: #d9d9ea; }
.scene-card .lock { position: absolute; left: 50%; top: 50%; width: 38px; transform: translate(-50%, -50%); z-index: 2; }
.scene-card .lock svg { width: 100%; display: block; }
.scene-card.nope { animation: nope .4s ease; }
.scene-card.next { box-shadow: 4px 5px 0 var(--pink); }
@keyframes nope { 25% { transform: translateX(-6px) rotate(-2deg); } 75% { transform: translateX(6px) rotate(2deg); } }
.sel-note { min-height: 18px; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--muted); line-height: 1.25; }

/* ---------- HUD ---------- */
.play { gap: 6px; }
.hud { position: relative; z-index: 2; flex: none; display: flex; align-items: center; gap: 8px; height: 46px; }
.gauge { position: relative; flex: none; width: 62px; height: 46px; display: flex; flex-direction: column; align-items: center; }
.gauge-dial { width: 60px; height: 37px; }
.gauge-dial svg { width: 100%; height: 100%; display: block; overflow: visible; }
.gauge-label { font-family: var(--display); font-size: 8.5px; line-height: 1; letter-spacing: .02em; color: var(--muted); white-space: nowrap; margin-top: 1px; }
.gauge .needle { transform-origin: 50px 52px; transform: rotate(-62deg); transition: transform .7s cubic-bezier(.3, 2.2, .4, .9); }
.gauge[data-miss="1"] .needle { transform: rotate(-18deg); }
.gauge[data-miss="2"] .needle { transform: rotate(26deg); animation: tremble .16s linear infinite alternate; }
.gauge[data-miss="3"] .needle { transform: rotate(72deg); }
.gauge[data-miss="2"] .gauge-label { color: var(--yellow); }
.gauge[data-miss="3"] .gauge-label { color: var(--red); }
.gauge.hit { animation: gauge-hit .6s ease; }
@keyframes tremble { from { transform: rotate(23deg); } to { transform: rotate(30deg); } }
@keyframes gauge-hit { 20% { transform: scale(1.5) rotate(-8deg); } 50% { transform: scale(1.3) rotate(6deg); } }
.pips { flex: 1; display: flex; justify-content: center; align-items: center; gap: clamp(2px, 1vw, 4px); min-width: 0; }
.pip { flex: none; width: clamp(9px, 3vw, 13px); height: clamp(9px, 3vw, 13px); border-radius: 4px; border: 2.5px solid var(--navy); background: rgba(255, 255, 255, .2); transition: background .2s, transform .2s; }
.pip.now { background: var(--yellow); transform: scale(1.25) rotate(8deg); }
.pip.ok { background: var(--mint); }
.pip.bad { background: var(--red); }
.streak {
  position: absolute; right: 44px; top: -3px; z-index: 1; font-family: var(--display); font-size: 11px; line-height: 1; color: #fff; background: var(--coral); padding: 3px 6px;
  border-radius: 999px; border: 2.5px solid var(--navy); transform: rotate(8deg); animation: streak-in .35s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes streak-in { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.pts {
  flex: none; font-family: var(--display); font-size: 17px; color: var(--navy); background: var(--yellow);
  padding: 3px 10px; border-radius: 999px; border: 3px solid var(--navy); box-shadow: 3px 3px 0 rgba(0, 0, 0, .35); min-width: 52px; text-align: center;
}
.pts.bump { animation: bump .4s ease-out; }
@keyframes bump { 40% { transform: scale(1.25) rotate(-4deg); } }

/* ---------- scena ---------- */
.stage {
  position: relative; flex: 1 1 0; min-height: 150px; display: flex; flex-direction: column;
  border: 4px solid var(--navy); border-radius: 22px; overflow: hidden; background: var(--sb);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .35);
}
.stage.shake { animation: stage-shake .4s linear; }
@keyframes stage-shake { 15% { transform: translate(-6px, 3px) rotate(-.6deg); } 30% { transform: translate(5px, -4px) rotate(.5deg); } 45% { transform: translate(-4px, 3px); } 60% { transform: translate(4px, 3px) rotate(-.4deg); } 80% { transform: translate(-2px, -2px); } }
.bg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.bg svg { width: 100%; height: 100%; display: block; }

.bubble-zone {
  position: relative; z-index: 4; flex: none; min-height: 34%;
  display: flex; align-items: flex-end; justify-content: center; padding: 29px 10px 17px;
}
.bubble {
  position: relative; max-width: 100%; min-width: 46%; background: #fff; color: var(--navy); border: 4px solid var(--navy); border-radius: 20px;
  padding: 9px 46px 9px 14px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .28); animation: bubble-in .3s cubic-bezier(.2, 1.5, .4, 1) both; transform-origin: 50% 100%;
}
@keyframes bubble-in { from { transform: scale(.5) translateY(14px); opacity: 0; } }
.bubble::before, .bubble::after { content: ""; position: absolute; left: 50%; border-style: solid; }
.bubble::before { bottom: -17px; margin-left: -4px; border-width: 15px 12px 0 12px; border-color: var(--navy) transparent transparent transparent; }
.bubble::after { bottom: -9px; margin-left: 0; border-width: 11px 8px 0 8px; border-color: #fff transparent transparent transparent; }
.bubble.react { background: #fff3d6; }
.bubble.react::after { border-top-color: #fff3d6; }
.who {
  position: absolute; left: 12px; top: -13px; background: var(--navy); color: var(--yellow); font-family: var(--display); font-size: 11px; line-height: 1;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap; transform: rotate(-2deg);
}
.line { font-weight: 800; font-size: clamp(16px, 4.9vw, 20px); line-height: 1.14; min-height: 1.14em; }
.line-tr { font-weight: 600; font-size: clamp(12px, 3.5vw, 13.5px); line-height: 1.2; color: #5a5b8a; margin-top: 2px; }
.line-tr:empty { display: none; }
.replay {
  position: absolute; right: 6px; top: 50%; margin-top: -17px; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--navy); background: var(--yellow); color: var(--navy);
  display: grid; place-items: center; padding: 0;
}
.replay svg { width: 18px; height: 18px; }
.replay.playing { background: var(--mint); animation: pulse .6s ease-in-out infinite; }

.actors { position: relative; flex: 1; min-height: 0; z-index: 2; }
.char { position: absolute; left: 0; right: 0; bottom: 1%; height: 100%; display: flex; justify-content: center; pointer-events: none; transform-origin: 50% 100%; }
.char svg { height: 100%; width: auto; display: block; overflow: visible; }
.fg { position: absolute; left: 0; right: 0; bottom: 0; height: 17%; min-height: 30px; z-index: 3; pointer-events: none; }
.fg svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bee { position: absolute; left: 3%; bottom: 3%; width: 27%; min-width: 64px; max-width: 124px; z-index: 5; pointer-events: none; transform-origin: 50% 90%; }
.bee svg { animation: bob 2.4s ease-in-out infinite; }
.bee::after { /* etykieta „TY” robi z pszczoły awatar gracza */
  content: attr(data-you); position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); background: var(--navy); color: var(--yellow);
  font-family: var(--display); font-size: 9.5px; line-height: 1; padding: 3px 7px; border-radius: 999px; white-space: nowrap;
}

/* miny postaci */
.char .e, .idle-bee .b, .bee .b { display: none; }
.char[data-expr="neutral"] .e-neutral, .char[data-expr="talk"] .e-talk, .char[data-expr="happy"] .e-happy,
.char[data-expr="confused"] .e-confused, .char[data-expr="shocked"] .e-shocked { display: inline; }
.bee[data-expr="neutral"] .b-neutral, .bee[data-expr="talk"] .b-talk, .bee[data-expr="happy"] .b-happy, .bee[data-expr="oops"] .b-oops,
.idle-bee .b-neutral { display: inline; }
.char .head { transform-origin: 150px 250px; animation: nod 3.4s ease-in-out infinite; }
.char .body { transform-origin: 150px 360px; animation: breathe 3.4s ease-in-out infinite; }
.blink { transform-box: fill-box; transform-origin: 50% 55%; animation: blink 4.2s infinite; }
.talkmouth { transform-box: fill-box; transform-origin: 50% 40%; animation: talk .22s steps(2) infinite; }
.char .fx { transform-box: fill-box; transform-origin: 50% 50%; animation: fx-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.char[data-expr="talk"] .head, .char.speaking .head { animation: talk-nod .5s ease-in-out infinite; }
.char[data-expr="happy"] { animation: hop .5s ease-out 2; }
.char[data-expr="shocked"] { animation: recoil .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.char[data-expr="shocked"] .head { animation: shiver .09s linear 8 alternate; }
.char[data-expr="confused"] .head { animation: tilt .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.bee .blush { opacity: 0; transition: opacity .4s; }
.bee[data-miss="1"] .blush { opacity: .5; }
.bee[data-miss="2"] .blush, .bee[data-miss="3"] .blush { opacity: .95; }
.bee[data-expr="happy"] { animation: hop .45s ease-out 2; }
.bee[data-expr="oops"] { animation: shiver-bee .1s linear 6 alternate; }
.bee.flee { animation: flee .9s cubic-bezier(.5, -0.3, .8, .4) forwards; }
.bee .wings { transform-box: fill-box; transform-origin: 50% 100%; animation: flap .16s linear infinite alternate; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes nod { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.4deg) translateY(-2px); } }
@keyframes talk-nod { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg) translateY(-4px); } }
@keyframes breathe { 50% { transform: scaleY(1.012); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes talk { 50% { transform: scaleY(.35); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-7%) scale(1.03); } }
@keyframes recoil { 0% { transform: scale(1); } 35% { transform: scale(1.09) translateY(-4%); } 100% { transform: scale(1.04) translateY(-2%); } }
@keyframes shiver { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
@keyframes shiver-bee { from { transform: translateX(-3px) rotate(-3deg); } to { transform: translateX(3px) rotate(3deg); } }
@keyframes tilt { to { transform: rotate(7deg) translateX(4px); } }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(.55); } }
@keyframes fx-pop { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
@keyframes flee { 0% { transform: translateX(0) rotate(0); } 25% { transform: translateX(14px) rotate(8deg) scale(1.08); } 100% { transform: translateX(-340%) translateY(-40%) rotate(-28deg) scale(.7); opacity: .2; } }

/* punkty wylatujące z odpowiedzi */
.fly { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none; }
.fly span {
  position: absolute; left: 80%; bottom: 42%; font-family: var(--display); font-size: 26px; color: var(--yellow); white-space: nowrap;
  text-shadow: 2px 2px 0 var(--navy), -2px -2px 0 var(--navy), 2px -2px 0 var(--navy), -2px 2px 0 var(--navy), 0 5px 0 rgba(0, 0, 0, .3);
  animation: fly-up 1.1s ease-out forwards;
}
.fly span.minus { color: #ff9aa5; font-size: 20px; }
.fly span small { display: block; font-family: var(--body); font-weight: 800; font-size: 13px; color: #fff; text-align: center; }
@keyframes fly-up { 0% { transform: translate(-50%, 20px) scale(.4); opacity: 0; } 20% { transform: translate(-50%, 0) scale(1.15); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -90px) scale(1); opacity: 0; } }

.burst {
  position: absolute; left: 50%; top: 84%; transform: translate(-50%, -50%) rotate(-4deg); z-index: 11;
  padding: 9px 16px; background: var(--yellow); color: var(--navy); font-family: var(--display); font-size: clamp(19px, 6.2vw, 26px); line-height: 1.05;
  border: 4px solid var(--navy); border-radius: 16px; box-shadow: 6px 6px 0 var(--pink), 0 10px 26px rgba(0, 0, 0, .4);
  max-width: 92%; width: max-content; text-align: center; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; pointer-events: none;
}
.burst.bad { background: var(--red); color: #fff; box-shadow: 6px 6px 0 var(--navy), 0 10px 26px rgba(0, 0, 0, .4); }
.burst.good { background: var(--mint); }
.burst.small { left: 62%; top: 88%; font-size: clamp(15px, 4.8vw, 19px); padding: 6px 12px; }
.burst.big { top: 30px; transform: translate(-50%, 0) rotate(-3deg); animation-name: pop-big; padding: 10px 18px 11px; }
@keyframes pop-big { from { transform: translate(-50%, 0) scale(.2) rotate(-30deg); opacity: 0; } }
.burst-stars { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.burst-stars:empty { display: none; }
.burst-stars svg { width: 34px; height: 34px; animation: star-in .5s cubic-bezier(.2, 1.8, .4, 1) both; }
.burst-stars svg:nth-child(2) { animation-delay: .25s; } .burst-stars svg:nth-child(3) { animation-delay: .5s; }
@keyframes star-in { from { transform: scale(0) rotate(-120deg); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.2) rotate(-30deg); opacity: 0; } }
.confetti { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: confetti 1.9s ease-in forwards; }
@keyframes confetti { to { transform: translateY(560px) rotate(720deg); opacity: .6; } }

/* kurtyna */
.curtain {
  position: absolute; top: 0; bottom: 0; width: 51%; z-index: 8; pointer-events: none;
  background: repeating-linear-gradient(90deg, #d0162f 0 13px, #a80f24 13px 22px, #e32d47 22px 31px, #b91228 31px 38px);
  box-shadow: inset 0 -10px 0 #f6b60b, inset 0 -14px 0 var(--navy);
  transition: transform .8s cubic-bezier(.7, 0, .25, 1);
}
.curtain.left { left: 0; border-right: 3px solid var(--navy); }
.curtain.right { right: 0; border-left: 3px solid var(--navy); }
.stage.open .curtain.left { transform: translateX(-102%); }
.stage.open .curtain.right { transform: translateX(102%); }
.valance {
  position: absolute; left: 0; right: 0; top: 0; height: 14px; z-index: 9; pointer-events: none; background: #a80f24; border-bottom: 3px solid var(--navy);
  background-image: radial-gradient(circle at 12px 0, #d0162f 10px, transparent 11px); background-size: 24px 14px;
  box-shadow: 0 3px 0 #f6b60b;
}
.placard {
  position: absolute; left: 50%; top: 50%; z-index: 10; transform: translate(-50%, -50%) rotate(-3deg); width: max-content; max-width: 86%;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 12px 20px 13px;
  background: var(--paper); color: var(--navy); border: 4px solid var(--navy); border-radius: 18px; box-shadow: 6px 6px 0 var(--sa), 0 12px 28px rgba(0, 0, 0, .45);
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.pl-num { font-family: var(--display); font-size: 13px; color: #fff; background: var(--navy); padding: 3px 12px; border-radius: 999px; }
.pl-name { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 9vw, 38px); line-height: 1; }
.pl-who { font-weight: 800; font-size: 15px; color: #5a5b8a; }

/* ---------- pasek czasu i podpowiedź ---------- */
.timer { flex: none; height: 13px; border: 3px solid var(--navy); border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.timer-fill { height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sa), var(--yellow)); transform-origin: 0 50%; }
.timer.wait .timer-fill { opacity: .45; }
.timer.low .timer-fill { background: var(--red); }
.timer.low { animation: pulse .5s ease-in-out infinite; }
.status {
  flex: none; height: 17px; line-height: 17px; text-align: center; font-size: clamp(11.5px, 3.5vw, 13.5px); font-weight: 700; color: #e9e9ff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status.warn { color: var(--yellow); }

/* ---------- odpowiedzi ---------- */
.replies { flex: none; display: flex; flex-direction: column; gap: 7px; }
.reply {
  position: relative; display: flex; align-items: stretch; min-height: 47px; background: var(--paper); color: var(--navy);
  border: 3px solid var(--navy); border-radius: 16px; box-shadow: 3px 4px 0 var(--sa);
  animation: reply-in .32s cubic-bezier(.2, 1.4, .4, 1) both; transition: opacity .25s, background .2s;
}
.reply:nth-child(2) { animation-delay: .07s; }
.reply:nth-child(3) { animation-delay: .14s; }
.reply.ghost { visibility: hidden; animation: none; }
@keyframes reply-in { from { transform: translateX(-26px) rotate(-2deg); opacity: 0; } }
.reply .pick {
  flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; text-align: left; border: 0; background: none;
  padding: 5px 4px 5px 13px; border-radius: 13px 0 0 13px;
}
.reply .txt { font-weight: 800; font-size: clamp(15px, 4.6vw, 17.5px); line-height: 1.12; }
.reply .tr { font-weight: 600; font-size: clamp(11.5px, 3.4vw, 13px); line-height: 1.15; color: #5a5b8a; }
.reply .tr:empty { display: none; }
.reply .spk { flex: none; width: 44px; border: 0; border-left: 2px dashed rgba(29, 30, 79, .22); background: none; color: var(--navy); display: grid; place-items: center; padding: 0; border-radius: 0 13px 13px 0; }
.reply .spk svg { width: 20px; height: 20px; opacity: .8; }
.reply .spk.playing { background: var(--yellow); }
.reply:active { transform: translate(1px, 2px); box-shadow: 2px 2px 0 var(--sa); }
.reply.is-picked { background: var(--yellow); transform: scale(1.02); }
.reply.is-good { background: var(--mint); animation: good-pop .4s ease; }
.reply.is-bad { background: #ffb3bd; animation: nope .4s ease; }
.reply.is-bad .txt { text-decoration: line-through; text-decoration-color: rgba(200, 16, 46, .7); text-decoration-thickness: 2px; }
.reply.is-answer { background: #d8ffe9; box-shadow: 0 0 0 4px var(--mint), 3px 5px 0 rgba(0, 0, 0, .3); animation: answer-glow 1s ease-in-out infinite; }
.reply.is-answer::before, .reply.is-good::before {
  content: "✓"; position: absolute; left: -13px; top: -13px; box-sizing: border-box; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: var(--navy);
  border: 3px solid var(--navy); font-weight: 800; font-size: 13px; line-height: 18px; text-align: center; z-index: 1;
}
.reply.is-dim { opacity: .42; }
.replies.locked .reply .pick { pointer-events: none; }
.replies.nudge .reply { animation: nudge .5s ease 2; }
@keyframes good-pop { 40% { transform: scale(1.05) rotate(-1deg); } }
@keyframes answer-glow { 50% { box-shadow: 0 0 0 7px rgba(62, 224, 154, .55), 3px 5px 0 rgba(0, 0, 0, .3); } }
@keyframes nudge { 50% { transform: translateX(5px); } }

/* ---------- dolny pasek: tłumaczenie, mikrofon, dalej ---------- */
.dock { flex: none; display: flex; gap: 8px; align-items: stretch; min-height: 56px; }
.dock-note { flex: 1; align-self: center; text-align: center; font-weight: 800; font-size: 15px; color: var(--muted); }
.hint-btn, .mic, .next-btn { border: 4px solid var(--navy); border-radius: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 10px; min-width: 0; }
.hint-btn { flex: 0 0 auto; max-width: 50%; background: #fff; color: var(--navy); box-shadow: 0 4px 0 var(--navy); }
.hint-btn:only-child, .hint-btn.wide { flex: 1; max-width: none; }
.hint-ico { font-size: clamp(17px, 5.4vw, 22px); line-height: 1; }
.hint-txt, .mic-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.05; }
.hint-txt b { font-weight: 800; font-size: clamp(12.5px, 3.8vw, 15px); white-space: nowrap; }
.hint-txt small { font-weight: 700; font-size: 11.5px; color: #8a2a44; white-space: nowrap; }
.hint-btn[disabled] { opacity: .45; }
.mic {
  flex: 1; background: linear-gradient(180deg, #ff7fb4, var(--pink)); color: #fff; box-shadow: 0 5px 0 var(--navy), 0 10px 22px rgba(255, 79, 154, .4);
}
.mic-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.mic-ico svg { width: 22px; height: 22px; display: block; }
.mic-txt b { font-family: var(--display); font-weight: 400; font-size: clamp(15px, 4.8vw, 19px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mic-txt small { font-weight: 800; font-size: 12px; color: #fff3b0; white-space: nowrap; }
.mic:active, .hint-btn:active, .next-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
.mic.listening { background: linear-gradient(180deg, #ffe85a, var(--yellow)); color: var(--navy); animation: rec 1s ease-in-out infinite; }
.mic.listening .mic-txt small { color: var(--navy); }
.mic.listening .mic-ico { background: var(--pink); color: #fff; animation: pulse .6s ease-in-out infinite; }
@keyframes rec { 50% { box-shadow: 0 5px 0 var(--navy), 0 0 0 9px rgba(255, 216, 1, .28); } }
.next-btn {
  flex: 1; font-family: var(--display); font-size: clamp(17px, 5.4vw, 21px); color: var(--navy);
  background: linear-gradient(180deg, #ffe85a, var(--yellow) 55%, #f6b60b); box-shadow: 0 5px 0 var(--navy); animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.035); } }

/* ---------- niskie ekrany (iPhone SE: 320×568, przeglądarki w aplikacjach) ---------- */
@media (max-height: 640px) {
  .play { gap: 5px; }
  .hud { height: 42px; }
  .gauge { height: 42px; }
  .gauge-dial { width: 54px; height: 33px; }
  .bubble-zone { padding: 28px 8px 16px; }
  .bubble { padding: 7px 42px 7px 12px; border-width: 3px; }
  .line { font-size: clamp(15px, 4.7vw, 17px); }
  .reply { min-height: 42px; }
  .reply .txt { font-size: clamp(14.5px, 4.5vw, 16px); }
  .replies { gap: 6px; }
  .dock { min-height: 50px; }
  .mic-ico { width: 30px; height: 30px; }
  .timer { height: 11px; }
  .idle-bee { width: 130px; height: 130px; }
  .scenes { gap: 7px; }
  .scene-card .info { padding: 3px 8px 4px; }
}
/* telefon poziomo: scena po lewej, odpowiedzi po prawej */
@media (orientation: landscape) and (max-height: 520px) {
  .app { max-width: 920px; }
  .play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 5px; }
  .play .hud { grid-column: 1 / 3; grid-row: 1; height: 38px; }
  .play .stage { grid-column: 1; grid-row: 2 / 6; min-height: 0; }
  .play .timer { grid-column: 2; grid-row: 2; }
  .play .status { grid-column: 2; grid-row: 3; }
  .play .replies { grid-column: 2; grid-row: 4; align-self: center; }
  .play .dock { grid-column: 2; grid-row: 5; min-height: 46px; }
  .gauge { height: 38px; }
  .gauge-dial { width: 48px; height: 29px; }
  .scenes { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
  .sel-note { display: none; }
  .idle { flex-direction: row; flex-wrap: wrap; align-content: center; }
  .idle-bubbles { display: none; }
}
@media (min-height: 780px) {
  .reply { min-height: 54px; }
  .dock { min-height: 64px; }
  .play { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
