/* Smocza Matematyka — module 'listwy' (strip boards). All selectors start with .mod-listwy.
 * Geometry (module area 1040 x 712): board 112–254 (numbers 118–182, working row 190–246), proof row 258–314,
 * hit columns 114–318, strip boxes 254–588, zeszyt 792–1024 x 336–584, action bar 592–712.
 */

.mod-listwy {
  /* strip-board red / blue = the base Montessori tokens (§1.6); -hi / -lo are their bevel shades */
  --lw-red: var(--m-hundreds);
  --lw-red-hi: #ef5466;
  --lw-red-lo: #b81d31;
  --lw-blue: var(--m-tens);
  --lw-blue-hi: #4a8fe6;
  --lw-blue-lo: #1b56ab;
  --lw-wood: #f2e2bf;
  --lw-wood-2: #e9d4a8;
  --lw-wood-edge: #c9a46a;
  --lw-grid: #dcc79c;
  --lw-cell: #fbf3df;
  background: radial-gradient(ellipse at 40% 30%, #fbf5e8 0%, var(--bg) 70%);
}

/* ---------- task card in the band ---------- */

.mod-listwy .lw-card {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-num);
  font-size: 62px;
  font-weight: 700;
  line-height: 1;
}
.mod-listwy .lw-c-blue { color: var(--lw-blue); }
.mod-listwy .lw-c-red { color: var(--lw-red); }
.mod-listwy .lw-c-ink { color: var(--ink); }
.mod-listwy .lw-c-gold {
  color: var(--gold-deep);
  text-shadow: 0 2px 0 #fff1bf;
}
.mod-listwy .lw-c-op {
  color: var(--ink-soft);
  font-size: 54px;
}
.mod-listwy .lw-slot {
  min-width: 88px;
  height: 82px;
  padding: 0 12px;
  border: 4px dashed #c9bda5;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b9ad94;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.mod-listwy .lw-slot.is-pending {
  border-color: var(--gold);
  color: var(--ink);
  background: #fffaf0;
}
.mod-listwy .lw-slot.is-done {
  border-style: solid;
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
  box-shadow: 0 0 0 4px rgba(242, 183, 5, 0.25);
}
.mod-listwy .lw-slot.is-blue {
  border-style: solid;
  border-color: #bcd3f3;
  color: var(--lw-blue);
  background: #f2f7fe;
}
.mod-listwy .lw-slot.is-red {
  border-style: solid;
  border-color: #f2c0c6;
  color: var(--lw-red);
  background: #fef4f5;
}
.mod-listwy .lw-c-rows {
  display: inline-flex;
  gap: 10px;
  margin-left: 22px;
}
.mod-listwy .lw-c-rows i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--gold-deep);
  background: #fff;
}
.mod-listwy .lw-c-rows i.on {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.3);
}

/* Księga button next to the ear (72 px, 24 px apart) */
.mod-listwy .lw-book-btn {
  width: 72px;
  height: 72px;
  margin-right: 8px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--panel);
  color: #8a5a1c;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex: none;
  padding: 0;
}
.mod-listwy .lw-book-btn:active {
  transform: translateY(2px);
}
.mod-listwy .lw-book-btn.is-off {
  opacity: 0.4;
}

/* ---------- the board ---------- */

.mod-listwy .lw-board {
  position: absolute;
  left: 0;
  top: 0;
  width: 1040px;
  height: 0;
}
.mod-listwy .lw-tablet {
  position: absolute;
  left: 8px;
  top: 110px;
  width: 1024px;
  height: 146px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 40%),
    repeating-linear-gradient(92deg, rgba(160, 112, 48, 0.05) 0 3px, rgba(255, 255, 255, 0) 3px 17px),
    linear-gradient(180deg, var(--lw-wood), var(--lw-wood-2));
  border: 3px solid var(--lw-wood-edge);
  box-shadow: 0 5px 0 rgba(120, 84, 30, 0.18), 0 10px 22px rgba(42, 34, 56, 0.12);
  z-index: 1;
}
.mod-listwy .lw-tablet-proof {
  position: absolute;
  left: 8px;
  top: 250px;
  width: 1024px;
  height: 72px;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(180deg, var(--lw-wood-2), var(--lw-wood));
  border: 3px solid var(--lw-wood-edge);
  border-top: 0;
  z-index: 0;
  display: none;
}
.mod-listwy .lw-board.has-proof .lw-tablet-proof {
  display: block;
}
.mod-listwy .lw-board.has-proof .lw-tablet {
  border-radius: 20px 20px 0 0;
  border-bottom-color: transparent;
}

.mod-listwy .lw-num {
  position: absolute;
  top: 118px;
  width: 56px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 14px;
  z-index: 2;
  transition: transform 0.18s ease, opacity 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.mod-listwy .lw-num.is-red { color: var(--lw-red); }
.mod-listwy .lw-num.is-blue { color: var(--lw-blue); }
.mod-listwy .lw-board.is-live .lw-num {
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 2px 0 rgba(120, 84, 30, 0.18);
  transform: scale(0.92);
}
.mod-listwy .lw-num.is-covered {
  opacity: 0.25;
}
.mod-listwy .lw-num.is-rock {
  opacity: 0;
}
.mod-listwy .lw-board .lw-num.is-sel {
  transform: scale(1.5);
  z-index: 7;
  background: #fff;
  opacity: 1;
  box-shadow: 0 0 0 3px var(--gold), 0 8px 18px rgba(42, 34, 56, 0.28);
}
.mod-listwy .lw-board .lw-num.is-ok {
  z-index: 6;
  opacity: 1;
  background: var(--gold-soft);
  box-shadow: 0 0 0 4px var(--gold), 0 0 22px rgba(242, 183, 5, 0.75);
  transform: scale(1.2);
}
.mod-listwy .lw-board .lw-num.is-amber {
  z-index: 6;
  opacity: 1;
  background: #fff7ee;
  transform: scale(1.06);
  box-shadow: 0 0 0 5px var(--err);
}
.mod-listwy .lw-board .lw-num.is-hint {
  z-index: 6;
  background: var(--gold-soft);
  transform: scale(1.06);
  box-shadow: 0 0 0 5px var(--gold), 0 0 0 10px rgba(242, 183, 5, 0.25);
}
.mod-listwy .lw-num.is-target {
  z-index: 6;
  background: var(--gold-soft);
  box-shadow: 0 0 0 4px var(--gold);
}
.mod-listwy .lw-num.is-pulse {
  animation: lw-pulse 0.5s ease;
}

.mod-listwy .lw-cell {
  position: absolute;
  top: 190px;
  width: 56px;
  height: 56px;
  background: var(--lw-cell);
  border: 1px solid var(--lw-grid);
  z-index: 2;
}
.mod-listwy .lw-cell[data-n='1'] { border-radius: 10px 0 0 10px; }
.mod-listwy .lw-cell[data-n='18'] { border-radius: 0 10px 10px 0; }
.mod-listwy .lw-cell-proof {
  top: 258px;
  display: none;
}
.mod-listwy .lw-board.has-proof .lw-cell-proof {
  display: block;
}

/* the red 10-line */
.mod-listwy .lw-line {
  position: absolute;
  left: 573px;
  top: 115px;
  width: 6px;
  height: 136px;
  border-radius: 3px;
  background: linear-gradient(180deg, #e0364b, #b81d31);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
  z-index: 4;
}
.mod-listwy .lw-board.has-proof .lw-line {
  height: 203px;
}
/* subtraction board: 1–9 blue, 10–18 red, the dividing line after 9 (the result is always a blue number) */
.mod-listwy.lw-op-sub .lw-line {
  left: 517px;
}
.mod-listwy.lw-op-sub .lw-board.has-proof .lw-line {
  height: 136px;
}
/* the proof row ("Sprawdź dodawaniem") is an addition board: its own red line after 10 */
.mod-listwy .lw-line-proof {
  position: absolute;
  left: 573px;
  top: 252px;
  width: 6px;
  height: 66px;
  border-radius: 3px;
  background: linear-gradient(180deg, #e0364b, #b81d31);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
  z-index: 4;
  display: none;
}
.mod-listwy.lw-op-sub .lw-board.has-proof .lw-line-proof {
  display: block;
}

/* level 3: the golden finish line */
.mod-listwy .lw-target {
  position: absolute;
  top: 184px;
  width: 6px;
  height: 68px;
  border-radius: 3px;
  background: repeating-linear-gradient(180deg, var(--gold) 0 10px, var(--gold-deep) 10px 14px);
  box-shadow: 0 0 10px rgba(242, 183, 5, 0.8);
  z-index: 6;
  display: none;
}
.mod-listwy .lw-target.is-on {
  display: block;
}
.mod-listwy .lw-board.has-proof .lw-target {
  height: 136px;
}

/* ---------- strips and the rock ---------- */

.mod-listwy .lw-strips {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
}
.mod-listwy .lw-strip {
  position: absolute;
  top: 196px;
  height: 44px;
  border-radius: 7px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22), 0 6px 10px rgba(42, 34, 56, 0.2);
  transform-origin: 0 50%;
}
.mod-listwy .lw-strip.is-proof {
  top: 264px;
}
.mod-listwy .lw-strip-blue {
  background: linear-gradient(180deg, var(--lw-blue-hi) 0%, var(--lw-blue) 55%, var(--lw-blue-lo) 100%);
}
.mod-listwy .lw-strip-red {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 54px, rgba(255, 236, 238, 0.95) 54px 56px),
    linear-gradient(180deg, var(--lw-red-hi) 0%, var(--lw-red) 55%, var(--lw-red-lo) 100%);
}
.mod-listwy .lw-strip-blue.has-squares {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 54px, rgba(232, 241, 255, 0.95) 54px 56px),
    linear-gradient(180deg, var(--lw-blue-hi) 0%, var(--lw-blue) 55%, var(--lw-blue-lo) 100%);
}
.mod-listwy .lw-strip::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  top: 4px;
  height: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.28);
}
.mod-listwy .lw-strip-num {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.mod-listwy .lw-strip.is-appear {
  animation: lw-appear 0.26s ease;
}
.mod-listwy .lw-strip.is-leaving {
  transition: opacity 0.25s ease, transform 0.25s ease !important;
  opacity: 0;
  transform: translateY(26px) !important;
}
.mod-listwy .lw-strip.is-amber {
  box-shadow: 0 0 0 5px var(--err), 0 6px 10px rgba(42, 34, 56, 0.2);
  animation: lw-amber 1.4s ease-in-out infinite;
}
.mod-listwy .lw-strip.is-ok {
  box-shadow: 0 0 0 4px var(--gold), 0 0 20px rgba(242, 183, 5, 0.8);
}

.mod-listwy .lw-rock {
  position: absolute;
  top: 113px;
  height: 140px;
  border-radius: 16px 4px 4px 16px;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 55%),
    repeating-linear-gradient(176deg, rgba(110, 86, 52, 0.08) 0 6px, rgba(255, 255, 255, 0) 6px 22px),
    linear-gradient(180deg, #d9c8a4 0%, #bfa77d 60%, #a68e65 100%);
  border: 3px solid #8f7752;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.1), -4px 4px 10px rgba(42, 34, 56, 0.25);
  transform: translateX(110%);
  transition: transform 0.6s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.mod-listwy .lw-rock.is-in {
  transform: none;
}
.mod-listwy .lw-rock::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 10px;
  height: 40px;
  margin-top: -20px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.35);
}

/* ---------- effects layer: crossing 10, gap, ghost, counting ---------- */

.mod-listwy .lw-fx {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none;
}
.mod-listwy .lw-beyond {
  position: absolute;
  top: 192px;
  height: 52px;
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(242, 183, 5, 0.9), 0 0 18px rgba(242, 183, 5, 0.7);
  background: rgba(255, 241, 191, 0.18);
  display: none;
}
.mod-listwy .lw-beyond.is-on {
  display: block;
}
.mod-listwy .lw-gap {
  position: absolute;
  top: 192px;
  height: 52px;
  border-radius: 8px;
  border: 4px dashed var(--err);
  background: rgba(240, 140, 46, 0.18);
  display: none;
}
.mod-listwy .lw-gap.is-on {
  display: block;
}
.mod-listwy .lw-gap.is-pulse {
  animation: lw-amber 1.2s ease-in-out infinite;
}
.mod-listwy .lw-ghost {
  position: absolute;
  top: 196px;
  height: 44px;
  border-radius: 9px;
  border: 3px dashed var(--gold-deep);
  background: rgba(242, 183, 5, 0.12);
  display: none;
}
.mod-listwy .lw-ghost.is-on {
  display: block;
}
.mod-listwy .lw-count {
  position: absolute;
  top: 190px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  opacity: 0;
}
.mod-listwy .lw-count.is-on {
  opacity: 1;
}
.mod-listwy .lw-count.is-on::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 9px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff7d6;
  box-shadow: 0 0 0 3px var(--gold);
  z-index: -1;
}
.mod-listwy .lw-count.is-pulse {
  animation: lw-pulse 0.42s ease;
}

/* ---------- hit columns (§1.4 b: 56 x 204, the number grows, a 2nd tap confirms) ---------- */

.mod-listwy .lw-cols {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
}
.mod-listwy .lw-col {
  position: absolute;
  top: 114px; /* 24 px below the 72 px band buttons (Księga, ear) */
  width: 56px;
  height: 204px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  cursor: pointer;
}
.mod-listwy .lw-cols.is-live .lw-col {
  pointer-events: auto;
}
.mod-listwy .lw-col.is-sel::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 144px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(242, 183, 5, 0.3);
}

/* ---------- strip boxes ---------- */

.mod-listwy .lw-box {
  position: absolute;
  top: 254px;
  width: 370px;
  height: 334px;
  padding: 8px;
  border-radius: 26px;
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-auto-rows: 88px;
  gap: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(26px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  z-index: 9;
}
.mod-listwy .lw-box.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}
.mod-listwy .lw-box.is-closed {
  top: 470px;
  height: 114px;
  opacity: 0.6;
  visibility: visible;
  pointer-events: none;
  transform: none;
  grid-template-columns: none;
  transition: opacity 0.25s ease, top 0.3s ease, height 0.3s ease;
}
.mod-listwy .lw-box.is-closed .lw-pick {
  display: none;
}
.mod-listwy .lw-box-lid {
  display: none;
}
.mod-listwy .lw-box.is-closed .lw-box-lid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 92px;
  padding-left: 22px;
}
.mod-listwy .lw-box-lid i {
  display: block;
  height: 7px;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.mod-listwy .lw-box-blue .lw-box-lid i {
  background: linear-gradient(180deg, var(--lw-blue-hi), var(--lw-blue-lo));
}
.mod-listwy .lw-box-red .lw-box-lid i {
  background: repeating-linear-gradient(90deg, var(--lw-red) 0 31px, #ffd6db 31px 32px);
}
.mod-listwy.lw-op-sub .lw-box-blue .lw-box-lid i {
  background: repeating-linear-gradient(90deg, var(--lw-blue) 0 31px, #d9e7fb 31px 32px);
}
.mod-listwy .lw-box-blue {
  left: 12px;
  background: linear-gradient(180deg, #edf4fe, #dce9fb);
  border: 3px solid #b9d0f1;
}
.mod-listwy .lw-box-red {
  left: 400px;
  background: linear-gradient(180deg, #fff1f2, #fde0e3);
  border: 3px solid #f0bcc3;
}
.mod-listwy .lw-pick {
  width: 100px;
  height: 88px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 4px 0 rgba(42, 34, 56, 0.14), 0 6px 12px rgba(42, 34, 56, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.mod-listwy .lw-pick:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(42, 34, 56, 0.14);
}
.mod-listwy .lw-pick-num {
  font-family: var(--font-num);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}
.mod-listwy .lw-pick-blue .lw-pick-num { color: var(--lw-blue); }
.mod-listwy .lw-pick-red .lw-pick-num { color: var(--lw-red); }
.mod-listwy .lw-mini {
  display: block;
  height: 14px;
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.mod-listwy .lw-mini-blue {
  background: linear-gradient(180deg, var(--lw-blue-hi), var(--lw-blue-lo));
}
.mod-listwy .lw-mini-red {
  background: repeating-linear-gradient(90deg, var(--lw-red) 0 8px, #ffd6db 8px 9px);
}
.mod-listwy.lw-op-sub .lw-mini-blue {
  background: repeating-linear-gradient(90deg, var(--lw-blue) 0 8px, #d9e7fb 8px 9px);
}
.mod-listwy .lw-box:not(.is-active) .lw-pick {
  opacity: 0.42;
  filter: grayscale(0.5);
}

/* ---------- zeszyt (booklet) ---------- */

.mod-listwy .lw-zeszyt {
  position: absolute;
  left: 792px;
  top: 336px;
  width: 232px;
  height: 248px;
  padding: 8px 10px 8px 30px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0) 20px, rgba(215, 38, 61, 0.35) 20px 22px, rgba(0, 0, 0, 0) 22px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 39px, rgba(35, 103, 201, 0.16) 39px 40px),
    #fffefb;
  background-position: 0 0, 0 2px, 0 0;
  box-shadow: 0 4px 0 rgba(42, 34, 56, 0.1), 0 8px 18px rgba(42, 34, 56, 0.1);
  border: 2px solid #eadfca;
  z-index: 3;
}
/* level 3: 52 px rows (sum + mini strips) — the ruling follows the rows */
.mod-listwy .lw-zeszyt.is-rows {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0) 20px, rgba(215, 38, 61, 0.35) 20px 22px, rgba(0, 0, 0, 0) 22px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 51px, rgba(35, 103, 201, 0.16) 51px 52px),
    #fffefb;
  background-position: 0 0, 0 -10px, 0 0;
}
.mod-listwy .lw-zeszyt-title {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-soft);
}
.mod-listwy .lw-pencil {
  display: flex;
}
.mod-listwy .lw-zeszyt-list {
  display: flex;
  flex-direction: column;
}
.mod-listwy .lw-z-line {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-num);
  font-size: 27px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.mod-listwy .lw-z-op {
  color: var(--ink-soft);
  font-size: 24px;
}
.mod-listwy .lw-z-line.is-new {
  animation: lw-write 0.6s ease;
}
.mod-listwy .lw-z-row {
  height: 52px;
  border-radius: 10px;
  padding: 0 4px;
}
.mod-listwy .lw-z-row .lw-z-line {
  height: 30px;
  font-size: 24px;
}
.mod-listwy .lw-z-row.is-new {
  animation: lw-write 0.6s ease;
}
.mod-listwy .lw-z-row.is-twin {
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px var(--gold);
}
.mod-listwy .lw-z-empty {
  height: 46px;
  display: flex;
  align-items: center;
  font-family: var(--font-num);
  font-size: 24px;
  color: #cfc3aa;
}
.mod-listwy .lw-z-mini {
  display: flex;
  height: 12px;
  margin-top: 2px;
}
.mod-listwy .lw-z-mb {
  height: 12px;
  border-radius: 3px 0 0 3px;
  background: var(--lw-blue);
}
.mod-listwy .lw-z-mr {
  height: 12px;
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(90deg, var(--lw-red) 0 10px, #ffd6db 10px 11px);
}

/* ---------- proof, sliding, level 6 controls ---------- */

.mod-listwy .lw-proof-btn {
  position: absolute;
  left: 24px;
  top: 348px;
  height: 96px;
  display: none;
  z-index: 10;
}
.mod-listwy .lw-proof-btn.is-on {
  display: inline-flex;
  animation: lw-appear 0.3s ease;
}
.mod-listwy .lw-slide {
  position: absolute;
  left: 230px;
  top: 344px;
  gap: 40px;
  display: none;
  z-index: 10;
}
.mod-listwy .lw-slide.is-on {
  display: flex;
}
.mod-listwy .lw-slide-btn {
  width: 96px;
  height: 96px;
  padding: 0;
  justify-content: center;
}

.mod-listwy .lw-keys {
  position: absolute;
  left: 700px;
  top: 134px;
  display: none;
  z-index: 10;
}
/* no display row here (the card shows the typed number), so the keys can have the full 96 px (§1.4 c) */
.mod-listwy .lw-keys .keypad-phone {
  grid-auto-rows: 96px;
  gap: 16px;
}
.mod-listwy.lw-keysmode .lw-keys {
  display: block;
}
.mod-listwy.lw-keysmode .lw-board,
.mod-listwy.lw-keysmode .lw-box {
  display: none;
}
.mod-listwy.lw-keysmode .lw-zeszyt {
  left: 40px;
  top: 334px;
  width: 440px;
  height: 236px;
}
.mod-listwy .lw-showboard {
  position: absolute;
  left: 40px;
  top: 128px;
  width: 440px;
  height: 176px;
  border-radius: 28px;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}
.mod-listwy .lw-showboard.is-on {
  display: flex;
}
.mod-listwy .lw-showboard:active {
  transform: translateY(3px);
}
.mod-listwy .lw-showboard-label {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
}
.mod-listwy .lw-miniboard {
  display: flex;
}

/* main button ready to check: a soft gold breath */
.mod-listwy .action-bar .btn-main.lw-ready {
  animation: lw-breathe 1.8s ease-in-out infinite;
}

/* ---------- Księga (control chart) ---------- */

.mod-listwy .lw-book {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(246, 239, 224, 0.95);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mod-listwy .lw-book.is-open {
  opacity: 1;
}
.mod-listwy .lw-book-page {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  padding: 14px 24px 20px;
  border-radius: 26px;
  background: #fffdf7;
  border: 3px solid #e2d0a8;
  box-shadow: 0 8px 0 rgba(120, 84, 30, 0.12), 0 16px 32px rgba(42, 34, 56, 0.16);
}
.mod-listwy .lw-book-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 52px;
  font-size: 32px;
  font-weight: 700;
  color: #8a5a1c;
}
.mod-listwy .lw-chart {
  display: grid;
  gap: 3px;
  font-family: var(--font-num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mod-listwy .lw-chart-add {
  grid-template-columns: repeat(10, 58px);
  grid-auto-rows: 44px;
  font-size: 25px;
}
.mod-listwy .lw-chart-sub {
  grid-template-columns: repeat(18, 49px);
  grid-auto-rows: 42px;
  font-size: 22px;
}
.mod-listwy .lw-ch,
.mod-listwy .lw-cc {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.mod-listwy .lw-ch {
  background: #f3ead6;
}
.mod-listwy .lw-ch-corner { color: var(--ink-soft); }
.mod-listwy .lw-ch-blue { color: var(--lw-blue); }
.mod-listwy .lw-ch-red { color: var(--lw-red); }
.mod-listwy .lw-ch-ink { color: var(--ink); }
.mod-listwy .lw-cc {
  background: #fff;
  border: 1px solid #efe4cc;
  color: var(--ink);
}
.mod-listwy .lw-cc.is-high {
  color: var(--lw-blue);
}
.mod-listwy .lw-cc.is-empty {
  background: #f8f3e8;
  border-color: transparent;
}
.mod-listwy .lw-ch.is-hot,
.mod-listwy .lw-cc.is-hot {
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px var(--gold);
  color: var(--ink);
}
.mod-listwy .lw-book-close {
  position: absolute;
  right: 24px;
  top: 604px;
  min-width: 220px;
  height: 96px;
}

/* ---------- sparkles ---------- */

.mod-listwy .lw-sparkle {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 30;
  pointer-events: none;
}
.mod-listwy .lw-sparkle i {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  transform: rotate(var(--a)) translateY(-18px);
  animation: lw-spark 0.9s ease-out forwards;
}

/* ---------- keyframes ---------- */

@keyframes lw-pulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.28); }
}
@keyframes lw-amber {
  0%, 100% { box-shadow: 0 0 0 5px var(--err), 0 6px 10px rgba(42, 34, 56, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(240, 140, 46, 0.55), 0 6px 10px rgba(42, 34, 56, 0.2); }
}
@keyframes lw-appear {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: none; }
}
@keyframes lw-write {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}
@keyframes lw-spark {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(-14px) scale(0.6); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-64px) scale(1.1); }
}
@keyframes lw-breathe {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 0 7px rgba(242, 183, 5, 0.35), var(--shadow); }
}
