/* Smocza kasa (module 'kasa') — every selector starts with .mod-kasa.
 * Module area 1040 x 712: task band 0–110 | counting-up line 12–716 x 122–372 (L4: from 94, its top is empty) |
 * customer column 728–1028 x 112–460 | till (szuflada kasy) 16–1024 x 466–584, L4: two rows 16–704 x 362–588
 * (Targ: the money is always at the bottom, §1.1) | L5: the dragon's change 16–1024 x 470–586 | action bar 592–712.
 * Keypad step: the till and the customer step aside, the keypad comes in at 714–1030; help cards 16–704 x 382–588.
 * L6: story strip 16–704 x 116–220, material panel (line + coins) 16–704 x 224–588, keypad always on.
 * Colours: tokens of css/base.css (error = amber --err, success = gold). */

.mod-kasa .ks-stage {
  position: absolute;
  inset: 0;
}

/* ---------- task band: [item] [price tag] Płaci: [money] ---------- */

.mod-kasa .ks-band .task-content {
  font-family: var(--font);
}
.mod-kasa .ks-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.mod-kasa .ks-card-item {
  display: flex;
  flex: none;
  filter: drop-shadow(0 3px 0 rgba(42, 34, 56, 0.12));
}
.mod-kasa .ks-card-word {
  font-family: var(--font);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-left: 6px;
}
.mod-kasa .ks-card-paid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease;
}
.mod-kasa .ks-card-paid .ks-money {
  filter: drop-shadow(0 3px 0 rgba(42, 34, 56, 0.15));
}
.mod-kasa .ks-card-sum {
  font-family: var(--font);
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  margin-left: 4px;
}
.mod-kasa .ks-card-q {
  font-family: var(--font);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  margin-left: 8px;
}
.mod-kasa .ks-card-tag.ks-amber,
.mod-kasa .ks-card-tag {
  border-radius: 12px;
}

/* question + answer boxes */
.mod-kasa .ks-ask {
  display: flex;
  align-items: center;
  gap: 26px;
}
.mod-kasa .ks-q {
  font-family: var(--font);
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.mod-kasa .ks-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 22px;
  padding: 4px 6px;
}
.mod-kasa .ks-box {
  width: 118px;
  height: 84px;
  border-radius: 18px;
  border: 4px solid var(--line);
  background: #fff;
  font-family: var(--font-num);
  font-size: 54px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: inset 0 3px 0 rgba(42, 34, 56, 0.06);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mod-kasa .ks-box.is-gr {
  width: 100px;
}
.mod-kasa .ks-box.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 5px var(--gold-soft);
}
.mod-kasa .ks-box.is-ghost {
  color: #c4b9a4;
}
.mod-kasa .ks-field.is-stale .ks-box {
  color: var(--ink-soft);
}
.mod-kasa .ks-field.is-err .ks-box {
  border-color: var(--err);
  background: var(--err-soft);
  box-shadow: none;
}
.mod-kasa .ks-field.is-ok .ks-box {
  border-color: var(--gold-deep);
  background: var(--gold-soft);
  box-shadow: 0 0 0 5px rgba(242, 183, 5, 0.35);
}
.mod-kasa .ks-unit {
  font-family: var(--font);
  font-size: 36px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-right: 8px;
}
.mod-kasa .ks-times {
  margin: 0 2px 0 4px;
}
.mod-kasa .ks-unit-coin {
  display: inline-flex;
}

/* ---------- the counting-up line ---------- */

.mod-kasa .ks-line {
  position: absolute;
  left: 12px;
  top: 122px;
}
/* L4: no coin pictures over the arcs (the top of the line box is empty) — the line moves up to make room for the
   two-row till under it */
.mod-kasa.ks-l4 .ks-line {
  top: 94px;
}
.mod-kasa .ks-cu .money-line-label:not(.is-gone):not(.is-hidden) {
  animation: ks-pop-in 0.35s ease;
}
.mod-kasa .ks-cu .money-line-arc.ks-arc-pulse {
  animation: ks-arc 0.9s ease;
}
@keyframes ks-arc {
  0%, 100% { stroke: var(--gold-deep); filter: none; }
  40% { stroke: #ffc61a; filter: drop-shadow(0 0 6px rgba(242, 183, 5, 0.95)); }
}
.mod-kasa .ks-cu.ks-glow-arcs .money-line-arc {
  stroke: var(--gold);
  stroke-width: 8;
  filter: drop-shadow(0 0 6px rgba(242, 183, 5, 0.8));
}
.mod-kasa .ks-cu.ks-glow-ends .money-line-endlabel {
  animation: ks-amber-text 1s ease-in-out 3;
}
@keyframes ks-amber-text {
  0%, 100% { fill: var(--ink); }
  50% { fill: var(--err); }
}

/* ---------- the customer (right column) ---------- */

.mod-kasa .ks-cust {
  position: absolute;
  left: 728px;
  top: 112px;
  width: 300px;
  height: 348px;
  transition: transform 0.45s ease, opacity 0.45s ease;
}
.mod-kasa .ks-cust.is-enter {
  animation: ks-enter 0.6s ease;
}
@keyframes ks-enter {
  from { transform: translateX(120px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.mod-kasa .ks-char {
  position: absolute;
  left: 45px;
  top: 34px;
  width: 210px;
  height: 200px;
  transform-origin: 50% 100%;
}
.mod-kasa .ks-cust.is-talk .ks-char {
  animation: ks-talk 0.5s ease;
}
.mod-kasa .ks-cust.is-happy .ks-char {
  animation: ks-hop 0.7s ease 2;
}
@keyframes ks-talk {
  0%, 100% { transform: none; }
  40% { transform: translateY(-6px) rotate(-2deg); }
}
@keyframes ks-hop {
  0%, 100% { transform: none; }
  40% { transform: translateY(-14px); }
}
.mod-kasa .ks-counter {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 300px;
  height: 134px;
  border-radius: 18px 18px 14px 14px;
  background:
    linear-gradient(180deg, #c8915c 0, #b57a44 22px, #94653a 23px, #7a4f2a 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 236, 200, 0.35),
    0 6px 0 rgba(60, 35, 15, 0.35),
    0 10px 20px rgba(42, 34, 56, 0.18);
}
.mod-kasa .ks-dish {
  position: absolute;
  left: 12px;
  top: 10px;
  width: 276px;
  height: 112px;
  border-radius: 50% / 46%;
  background: radial-gradient(ellipse at 50% 40%, #fffdf7 0%, #f3ead8 70%, #e2d5b8 100%);
  box-shadow: inset 0 -4px 0 rgba(140, 110, 60, 0.25), 0 3px 0 rgba(60, 35, 15, 0.3);
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 2px 4px;
  padding: 10px 26px;
}
.mod-kasa .ks-dish.is-crowded {
  gap: 0;
}
.mod-kasa .ks-dish.is-crowded .ks-money {
  margin: -4px -6px;
}
.mod-kasa .ks-dish .ks-money {
  filter: drop-shadow(0 2px 0 rgba(42, 34, 56, 0.25));
}
.mod-kasa .ks-money.is-arriving {
  visibility: hidden;
}
.mod-kasa .ks-bubble {
  position: absolute;
  /* anchored at the customer's right edge, it grows to the left over the free space above the line; long
     sentences ('18 zł 99 gr. Bez reszty. Dziękuję!') wrap instead of being cut off */
  right: 6px;
  top: -2px;
  width: max-content;
  max-width: 400px;
  padding: 6px 16px 8px;
  border-radius: 20px;
  background: #fff;
  border: 3px solid var(--ink);
  font-family: var(--font);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  text-wrap: balance;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
  pointer-events: none;
}
.mod-kasa .ks-bubble::after {
  content: '';
  position: absolute;
  right: min(96px, calc(100% - 48px));
  bottom: -14px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}
.mod-kasa .ks-bubble.is-on {
  opacity: 1;
  transform: none;
}

/* ---------- the till ---------- */

.mod-kasa .ks-drawer {
  position: absolute;
  left: 16px;
  top: 466px;
  transition: transform 0.45s ease, opacity 0.45s ease;
}
.mod-kasa .ks-drawer.is-two {
  top: 362px;
}

/* ---------- L5: the dragon's change on the counter ---------- */

.mod-kasa .ks-tray {
  position: absolute;
  left: 16px;
  top: 470px;
  width: 1008px;
  height: 116px;
  padding: 8px 14px 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, #94653a 0%, #7a4f2a 100%);
  box-shadow: inset 0 2px 0 rgba(255, 236, 200, 0.22), 0 6px 0 rgba(60, 35, 15, 0.4);
  transition: width 0.45s ease;
}
.mod-kasa .ks-tray.is-narrow {
  width: 688px;
}
.mod-kasa .ks-tray-label {
  position: absolute;
  left: 22px;
  top: -20px;
  padding: 2px 14px 4px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.mod-kasa .ks-tray-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  height: 100%;
}
.mod-kasa .ks-tcoin {
  min-width: 88px;
  height: 96px;
  padding: 0 6px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ecdcb9 0%, #f7ecd3 100%);
  box-shadow: inset 0 5px 10px rgba(80, 50, 20, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}
.mod-kasa .ks-tcoin.is-used {
  opacity: 0.25;
}
.mod-kasa .ks-tcoin.is-used .ks-money {
  visibility: hidden;
}
.mod-kasa .ks-tcoin.is-fixed {
  animation: ks-pop-in 0.4s ease;
  box-shadow: inset 0 5px 10px rgba(80, 50, 20, 0.3), 0 0 0 4px var(--gold);
}

/* ---------- keypad column (§3.0.1: its ✓ is the main button) ---------- */

.mod-kasa .ks-pad {
  position: absolute;
  left: 714px;
  top: 128px;
  width: 316px;
  display: flex;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateX(360px);
  transition: transform 0.45s ease, opacity 0.45s ease, visibility 0s linear 0.45s;
}
.mod-kasa.ks-asking .ks-pad,
.mod-kasa.ks-l6 .ks-pad {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: transform 0.45s ease, opacity 0.45s ease, visibility 0s;
}
.mod-kasa .ks-pad .key.ks-key-hit {
  background: var(--gold-soft);
  transform: translateY(3px);
}
.mod-kasa.ks-asking .ks-cust {
  transform: translateX(340px);
  opacity: 0;
  pointer-events: none;
}
.mod-kasa.ks-asking .ks-drawer {
  transform: translateY(150px);
  opacity: 0;
  pointer-events: none;
}

/* ---------- help area (keypad step): cards, coin rows ---------- */

.mod-kasa .ks-info {
  position: absolute;
  left: 16px;
  top: 382px;
  width: 688px;
  height: 206px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mod-kasa.ks-asking .ks-info {
  opacity: 1;
}
.mod-kasa.ks-l5 .ks-info {
  height: 80px;
}
.mod-kasa .ks-icard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: ks-pop-in 0.35s ease;
}
.mod-kasa .ks-icard .money-gsq-label {
  font-size: 18px;
  font-weight: 700;
}
.mod-kasa .ks-eq {
  font-family: var(--font-num);
  font-size: 40px;
  font-weight: 700;
  color: var(--ink-soft);
}
.mod-kasa .ks-amt {
  font-family: var(--font);
  font-size: 32px;
  font-weight: 700;
  white-space: nowrap;
}
.mod-kasa .ks-rcpt {
  min-width: 210px;
  padding: 4px 12px 6px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(42, 34, 56, 0.12);
  font-family: var(--font);
  font-size: 20px;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, #eee6d5 27px 28px);
}
.mod-kasa .ks-rcpt-head {
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 16px;
}
.mod-kasa .ks-rcpt-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  white-space: nowrap;
}
.mod-kasa .ks-rcpt-row.is-sum {
  border-top: 2px dashed var(--ink-soft);
  font-size: 22px;
}
.mod-kasa .ks-rcpt-paid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-soft);
}
.mod-kasa .ks-coins {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 6px 14px;
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.85);
  border: 3px solid var(--line);
  animation: ks-pop-in 0.35s ease;
}
.mod-kasa .ks-cpiece {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mod-kasa .ks-cval {
  padding: 0 10px 2px;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 2px solid var(--gold);
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}
.mod-kasa .ks-pulse {
  animation: ks-pulse 0.9s ease;
}
@keyframes ks-pulse {
  0%, 100% { transform: scale(1); filter: none; }
  40% { transform: scale(1.18); filter: drop-shadow(0 0 10px rgba(242, 183, 5, 0.95)); }
}
@keyframes ks-pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* amber outline of the PLACE of a discrepancy (rung 1), stays until she does something */
.mod-kasa .ks-amber {
  outline: 5px solid var(--err);
  outline-offset: 5px;
  border-radius: 18px;
  animation: ks-amber 1.3s ease-in-out infinite;
}
@keyframes ks-amber {
  0%, 100% { outline-color: var(--err); }
  50% { outline-color: rgba(240, 140, 46, 0.35); }
}

/* ---------- action bar: Cofnij | [Najpierw wpiszę] [Reszty nie ma] [Tak] [Nie] [Wydaję / Dalej] ---------- */

.mod-kasa .action-bar {
  gap: 24px;
}
.mod-kasa .ks-bar-right {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  pointer-events: auto;
}
.mod-kasa .ks-zero,
.mod-kasa .ks-challenge {
  height: 96px;
  font-size: 23px;
  padding: 0 16px;
  gap: 8px;
  white-space: nowrap;
}
.mod-kasa .ks-yes,
.mod-kasa .ks-no {
  height: 96px;
  min-width: 190px;
  font-size: 34px;
  font-family: var(--font);
}
.mod-kasa .ks-ico {
  width: 1.4em;
  height: 1.4em;
  flex: none;
}

/* ---------- L6: story strip and the material panel ---------- */

.mod-kasa .ks-scene6 {
  position: absolute;
  left: 16px;
  top: 116px;
  width: 688px;
  height: 104px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 3px solid var(--line);
}
.mod-kasa .ks-s6-cust {
  flex: none;
  width: 96px;
  height: 96px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}
.mod-kasa .ks-s6-cust svg {
  margin-top: 4px;
}
.mod-kasa .ks-s6-goods {
  display: flex;
  gap: 14px;
  border-radius: 16px;
  padding: 2px 4px;
}
.mod-kasa .ks-s6-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.mod-kasa .ks-s6-item .money-tag-body {
  min-height: 40px;
  padding: 2px 14px 2px 34px;
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 18px 100%, 0 50%);
}
.mod-kasa .ks-s6-item .money-tag-hole {
  left: 12px;
  width: 10px;
  height: 10px;
  margin-top: -5px;
}
.mod-kasa .ks-s6-item .money-tag-main {
  font-size: 24px;
}
.mod-kasa .ks-s6-paid,
.mod-kasa .ks-s6-coin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-radius: 14px;
  padding: 2px 4px;
}
/* §1.4: nothing below 22 px; a tight line height (and no vertical padding of the column) keeps
   'Reszta:' + coin + 'po 5 zł' inside the 104 px strip */
.mod-kasa .ks-s6-coin {
  padding-top: 0;
  padding-bottom: 0;
}
.mod-kasa .ks-s6-word {
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--ink-soft);
}
.mod-kasa .ks-s6-po {
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
/* a help card on the story strip replaces the goods and the money (the receipt carries both, §3.0.7) */
.mod-kasa .ks-s6-card {
  display: none;
  align-items: center;
}
.mod-kasa .ks-scene6.has-card .ks-s6-card {
  display: flex;
}
.mod-kasa .ks-scene6.has-card .ks-s6-goods,
.mod-kasa .ks-scene6.has-card .ks-s6-paid,
.mod-kasa .ks-scene6.has-card .ks-s6-coin {
  display: none;
}
.mod-kasa .ks-s6-card .ks-icard {
  padding: 2px 14px;
  gap: 10px;
  max-height: 96px;
  box-shadow: none;
}
.mod-kasa .ks-s6-card .ks-icard .money-gsq svg {
  width: 64px;
  height: 64px;
}
.mod-kasa .ks-s6-card .ks-icard .money-gsq-label {
  font-size: 15px;
}
.mod-kasa .ks-s6-card .ks-rcpt {
  font-size: 19px;
  min-width: 230px;
  background-image: none;
  padding: 2px 12px 4px;
}
.mod-kasa .ks-s6-card .ks-rcpt-head {
  display: none;
}
.mod-kasa .ks-s6-card .ks-rcpt-paid {
  flex-direction: row;
  font-size: 22px;
}
.mod-kasa .ks-s6-card .ks-coins {
  padding: 2px 10px;
  gap: 6px;
  border: 0;
  background: none;
}
.mod-kasa .ks-s6-card .ks-eq {
  font-size: 30px;
}
.mod-kasa .ks-s6-card .ks-amt {
  font-size: 26px;
}
.mod-kasa .ks-mat6 {
  position: absolute;
  left: 16px;
  top: 226px;
  width: 688px;
  height: 364px;
  border-radius: 22px;
  border: 3px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mod-kasa .ks-mat6.is-open {
  border-color: transparent;
  align-items: flex-start;
}
.mod-kasa .ks-mat6 .ks-open {
  font-size: 30px;
}
.mod-kasa .ks-mat6 .money-countup {
  /* arcs only (no coin pictures): the empty top of the line box goes up, the coins (>= 88 px) fit below */
  margin-top: -44px;
}

/* flights inside the module area */
.mod-kasa .ks-fly {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 40;
  pointer-events: none;
}

/* ---------- reduced motion: fades instead of slides ---------- */

@media (prefers-reduced-motion: reduce) {
  .mod-kasa .ks-cust,
  .mod-kasa .ks-drawer,
  .mod-kasa .ks-pad,
  .mod-kasa .ks-tray {
    transition-duration: 0.15s;
  }
  .mod-kasa.ks-asking .ks-cust,
  .mod-kasa.ks-asking .ks-drawer,
  .mod-kasa .ks-pad {
    transform: none;
  }
}

/* re-presentation (§7.5): the code's picture over the material zone for a moment */
.mod-kasa .ks-rep {
  position: absolute;
  left: 16px;
  top: 150px;
  width: 688px;
  display: flex;
  justify-content: center;
  z-index: 30;
  pointer-events: none;
}
.mod-kasa .ks-rep .ks-icard {
  box-shadow: var(--shadow);
}

/* exact payment of several pieces (zero change): the pieces overlap a little so the card keeps one line */
.mod-kasa .ks-card-paid.is-many {
  gap: 0;
}
.mod-kasa .ks-card-paid.is-many .ks-money + .ks-money {
  margin-left: -4px;
}
.mod-kasa .ks-card-paid.is-many .ks-card-sum {
  margin-left: 12px;
}
