/* Beginners lesson interactives */

.bix {
  margin-top: 0.75rem;
}

.bix-shell > p:last-child {
  margin-bottom: 0 !important;
}

/* Buttons - light border, small drop shadow and colours from the
   site design system (lesson-designed.css) */
.bix-btn {
  display: inline-block;
  margin: 0.35rem 0.35rem 0 0;
  padding: 0.55rem 1rem;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  background: #fff;
  color: #212121;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.bix-btn[hidden] {
  display: none;
}

.bix-btn:hover,
.bix-btn:focus {
  background: #f5f5f5;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(61, 75, 90, 0.12);
}

.bix-btn--primary {
  background: #FFC107;
  border-color: #E5A000;
  color: #212121;
}

.bix-btn--primary:hover,
.bix-btn--primary:focus {
  background: #E5A000;
  color: #212121;
}

.bix-btn.is-selected {
  background: #00BFA5;
  border-color: #008F7A;
  color: #fff;
}

.bix-btn.is-correct {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

.bix-btn.is-wrong {
  background: #b03a2e;
  border-color: #b03a2e;
  color: #fff;
}

.bix-feedback {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.5;
}

.bix-feedback--ok {
  background: rgba(46, 125, 79, 0.12);
  color: #1b5e20;
}

.bix-feedback--bad {
  background: rgba(198, 40, 40, 0.1);
  color: #b71c1c;
}

.bix-feedback--info {
  background: rgba(93, 38, 193, 0.08);
  color: #4527a0;
}

/* Simplified playing cards - HTML/CSS, same style as the absolute-beginner
   activities (ab-playing-card), four-colour suits from lesson-designed.css */
.bix-card {
  --bix-card-w: 52px;
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  width: var(--bix-card-w);
  height: calc(var(--bix-card-w) * 1.4);
  flex: 0 0 var(--bix-card-w);
  padding: calc(var(--bix-card-w) * 0.07) calc(var(--bix-card-w) * 0.09);
  border: 1px solid #c8c2b8;
  border-radius: calc(var(--bix-card-w) * 0.11);
  background: #fffcf7;
  color: #1a1a1a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-weight: 700;
  line-height: 1;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bix-card__rank {
  align-self: flex-start;
  font-size: calc(var(--bix-card-w) * 0.28);
}

.bix-card__pip {
  align-self: center;
  font-size: calc(var(--bix-card-w) * 0.4);
}

.bix-card__corner {
  align-self: flex-end;
  transform: rotate(180deg);
  font-size: calc(var(--bix-card-w) * 0.22);
}

/* Four-colour suits - site-wide palette (lesson-designed.css) */
.bix-card--s { color: #0645ad; }
.bix-card--h { color: #e53935; }
.bix-card--d { color: #f9a825; }
.bix-card--c { color: #2e7d32; }

.bix-card--back {
  background: repeating-linear-gradient(135deg, #1c5f51 0 6px, #3a6e58 6px 12px);
  border-color: #1e3d31;
}

.bix-card--back > span {
  visibility: hidden;
}

.bix-card--lg {
  --bix-card-w: 64px;
}

.bix-card--clickable {
  cursor: pointer;
}

.bix-card--clickable:hover {
  transform: translateY(-4px);
}

.bix-card.is-legal {
  outline: 3px solid #FFC107;
  outline-offset: 2px;
}

.bix-card.is-winner {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px #2e7d4f, 0 4px 14px rgba(46, 125, 79, 0.35);
}

.bix-card.is-shake {
  animation: bix-shake 0.4s ease;
}

@keyframes bix-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Four-colour suit symbols in prose - site-wide palette (lesson-designed.css) */
.bix-suit-s { color: #0645ad; }
.bix-suit-h { color: #e53935; }
.bix-suit-d { color: #f9a825; }
.bix-suit-c { color: #2e7d32; }

.bix-suit-s,
.bix-suit-h,
.bix-suit-d,
.bix-suit-c {
  font-weight: 600;
}

/* Trick demo */
.bix-trick {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.bix-trick__table {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
  justify-items: center;
  width: min(100%, 340px);
  padding: 0.75rem;
  background: #b99b5d;
  border-radius: 12px;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.bix-trick__seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Card slot keeps its footprint so the table doesn't jump as cards appear */
.bix-trick__seat > div {
  min-height: calc(64px * 1.4);
  display: flex;
  align-items: center;
}

.bix-trick__seat--n { grid-column: 2; grid-row: 1; }
.bix-trick__seat--w { grid-column: 1; grid-row: 2; }
.bix-trick__seat--e { grid-column: 3; grid-row: 2; }
.bix-trick__seat--s { grid-column: 2; grid-row: 3; }

.bix-trick__caption {
  text-align: center;
  font-size: 0.95rem;
  color: #3E4A59;
  min-height: 2.5rem;
}

/* Follow suit / hand row */
.bix-hand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}

.bix-prompt {
  font-weight: 600;
  color: #3E4A59;
  margin: 0.5rem 0;
}

/* Bridge table diagram */
.bix-table-diagram {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.5rem;
  max-width: 320px;
  margin: 0 auto;
}

.bix-seat {
  padding: 1rem 0.5rem;
  border-radius: 10px;
  border: 1px solid #E0E0E0;
  background: #fff;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  font-weight: 700;
  font-size: 1.1rem;
}

.bix-seat:hover {
  transform: translateY(-2px);
}

.bix-seat--n { grid-column: 2; }
.bix-seat--w { grid-column: 1; grid-row: 2; }
.bix-seat--center {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #b99b5d;
  color: #fff;
  cursor: default;
  font-size: 0.8rem;
  min-height: 80px;
}
.bix-seat--e { grid-column: 3; grid-row: 2; }
.bix-seat--s { grid-column: 2; grid-row: 3; }

.bix-seat.is-ns {
  background: rgba(255, 193, 7, 0.25);
  border-color: #FFC107;
}

.bix-seat.is-ew {
  background: rgba(0, 191, 165, 0.12);
  border-color: #00BFA5;
}

.bix-scoreboard {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-weight: 600;
}

.bix-scoreboard span {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: #f5f7fa;
}

/* Dummy reveal */
.bix-dummy-layout {
  display: grid;
  gap: 0.75rem;
}

.bix-dummy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.bix-dummy-row__label {
  width: 100%;
  font-weight: 700;
  font-size: 0.85rem;
  color: #3E4A59;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bix-dummy-row .bix-card {
  --bix-card-w: 36px;
}

.bix-dummy-row.is-face-up .bix-card {
  --bix-card-w: 42px;
}

.bix-dummy-row.is-dummy .bix-card {
  box-shadow: 0 0 0 2px #FFC107;
}

/* Role match */
.bix-roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.bix-role {
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  border: 1px dashed #E0E0E0;
  background: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: border-color 0.2s, background 0.2s;
}

.bix-role.is-target {
  border-color: #FFC107;
  background: rgba(255, 193, 7, 0.1);
}

.bix-role.is-done {
  border-style: solid;
  border-color: #2e7d32;
  background: rgba(46, 125, 50, 0.1);
  cursor: default;
}

.bix-statement {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #E6ECF1;
  font-weight: 500;
  margin: 0.5rem 0;
}

.bix-matched {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.bix-matched li {
  margin: 0.35rem 0 0;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  background: #E8F5E9;
  border: 1px solid #C8E6C9;
  color: #1B5E20;
  font-size: 0.95rem;
}

/* Stepper */
.bix-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.bix-step-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid #E0E0E0;
  background: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: #3E4A59;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.bix-step-dot.is-active {
  background: #FFC107;
  border-color: #E5A000;
  color: #212121;
}

.bix-step-dot.is-done {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

.bix-step-panel {
  padding: 1rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #E6ECF1;
  min-height: 4rem;
}

/* HCP counter */
.bix-hcp {
  display: grid;
  gap: 0.75rem;
}

.bix-hcp__total {
  font-size: 1.5rem;
  font-weight: 700;
  color: #5d26c1;
}

.bix-hcp__total span {
  font-size: 2rem;
}

.bix-hcp__hint {
  font-size: 0.85rem;
  color: #3E4A59;
  background: #f5f7fa;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  display: inline-block;
}

.bix-honor.is-tapped {
  opacity: 0.55;
  transform: scale(0.95);
  outline: 3px solid #2e7d4f;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Contract dial */
.bix-dial {
  display: grid;
  gap: 0.75rem;
}

.bix-dial__contracts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bix-dial__slider-wrap {
  padding: 0.5rem 0;
}

.bix-dial__slider {
  width: 100%;
  accent-color: #FFC107;
}

.bix-dial__readout {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bix-dial__box {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem;
  border-radius: 10px;
  text-align: center;
  background: #fff;
  border: 2px solid #E6ECF1;
}

.bix-dial__box strong {
  display: block;
  font-size: 1.5rem;
  color: #5d26c1;
}

.bix-dial__box--def {
  border-color: rgba(93, 38, 193, 0.35);
}

/* Cheat sheet panel */
.bix-cheat {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #E6ECF1;
  font-size: 0.9rem;
}

.bix-cheat h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: #5d26c1;
}

.bix-cheat dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
}

.bix-cheat dt {
  font-weight: 700;
}

/* Quiz */
.bix-quiz-q {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #E6ECF1;
}

.bix-quiz-q:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.bix-quiz-q > p {
  font-weight: 600;
  margin-bottom: 0.5rem !important;
}

.bix-quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Trick ladder */
.bix-ladder {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100px;
  margin: 0.75rem 0;
  padding: 0.5rem;
  background: #f5f7fa;
  border-radius: 8px;
}

.bix-ladder__bar {
  flex: 1;
  background: #5d26c1;
  border-radius: 4px 4px 0 0;
  min-height: 8px;
  transition: opacity 0.2s;
  position: relative;
}

.bix-ladder__bar.is-book {
  background: #bdbdbd;
}

.bix-ladder__bar.is-target {
  background: #FFC107;
}

.bix-ladder__label {
  position: absolute;
  bottom: -1.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Winners tap */
.bix-winners {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .bix-winners {
    grid-template-columns: 1fr;
  }
}

.bix-winners__hand {
  padding: 0.75rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #E6ECF1;
}

.bix-winners__hand h5 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3E4A59;
}

.bix-progress {
  font-size: 0.85rem;
  font-weight: 600;
  color: #3E4A59;
  margin-bottom: 0.5rem;
}

/* Capstone play widget */
.bix-play__intro {
  font-size: 0.95rem;
  line-height: 1.6;
}

.bix-play__intro p {
  margin: 0 0 0.5rem !important;
}

.bix-play__status {
  font-weight: 600;
  color: #3E4A59;
  margin: 0 0 0.35rem !important;
}

.bix-play__score {
  font-size: 1.1rem;
  font-weight: 700;
  color: #5d26c1;
  margin: 0 0 0.75rem !important;
}

.bix-play__board {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bix-play__mid {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 160px) 1fr;
  gap: 0.5rem;
  align-items: center;
}

.bix-play__seat {
  padding: 0.5rem;
  border-radius: 10px;
  background: #fff;
  border: 2px solid #E6ECF1;
  min-height: 70px;
}

.bix-play__seat.is-active {
  border-color: #FFC107;
  background: rgba(255, 193, 7, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
}

.bix-play__seat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3E4A59;
  margin-bottom: 0.35rem;
}

.bix-play__cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
}

.bix-play__cards .bix-card {
  --bix-card-w: 40px;
}

.bix-play__trick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
  min-height: 90px;
  padding: 0.5rem;
  background: #b99b5d;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.bix-play__trick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.bix-play__trick-card .bix-card {
  --bix-card-w: 44px;
}

.bix-play__trick-card span {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

@media (max-width: 520px) {
  .bix-play__mid {
    grid-template-columns: 1fr;
  }

  .bix-play__cards .bix-card {
    --bix-card-w: 34px;
  }
}
