/* (c) Innings2, generated by Mathigon Studio */
x-quiz {
  display: block;
}
x-quiz .quizcard {
  width: 100%;
}
x-quiz .question {
  display: none;
  font-size: 1.2em;
}
x-quiz .question .correct_answer {
  display: none;
}
x-quiz .question .answers {
  margin-top: 40px;
  list-style: none;
}
x-quiz .question .answers li {
  padding: 0;
  margin: 0px;
  border: 1px solid rgba(33, 36, 44, 0.64);
  border-right: 0px;
  border-left: 0px;
  padding: 5px;
}
x-quiz .question .answers li:hover {
  background-color: #e5e5e5;
}
x-quiz .question .answers li.active {
  background-color: #e5e5e5;
}
x-quiz .question .hint {
  margin-top: 20px;
  font-size: 0.9em;
  color: #555;
}
x-quiz .nav {
  height: 40px;
  position: relative;
}
x-quiz .dots {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}
x-quiz .dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(24, 24, 36, 0.2);
  float: left;
  margin: 4px;
  transition: background 0.2s;
}
html[theme=dark] x-quiz .dot {
  background: rgba(255, 255, 255, 0.4);
}
x-quiz .dot.on {
  background: rgba(0, 0, 0, 0.8);
}
html[theme=dark] x-quiz .dot.on {
  background: white;
}

x-relation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 680px;
  margin: 1.5em auto;
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
x-relation .item {
  background: #f5f5f6;
  border: 1px solid #ccc;
  padding: 3px 12px;
  margin: 6px 0;
  border-radius: 4px;
}
x-relation .item.active {
  background: #e1e1e1;
}
x-relation .item img, x-relation .item svg, x-relation .item object {
  width: 100%;
  pointer-events: none;
}
x-relation .domain, x-relation .range {
  width: 33.333%;
}
x-relation .domain .item {
  cursor: pointer;
}
x-relation svg.connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
x-relation .connections line {
  stroke: #656073;
  stroke-width: 4px;
  stroke-linecap: round;
}
x-relation .line_red {
  stroke: #cd0e66 !important;
  stroke-width: 4px;
  stroke-linecap: round;
}
x-relation .line_green {
  stroke: #22ab24 !important;
  stroke-width: 4px;
  stroke-linecap: round;
}

/* Responsive Binary Swipe Component */
x-binary-swipe {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5em 0;
  width: 100%;
  max-width: 100%;
  /* Very small screens adjustments */
}
x-binary-swipe h3 {
  text-transform: uppercase;
  color: #aaa;
  font-size: clamp(14px, 3vw, 22px);
  margin-top: 0;
  text-align: center;
  overflow-wrap: break-word;
}
x-binary-swipe .stack {
  height: min(260px, 20vw);
  width: min(220px, 28vw);
  position: relative;
  margin: 10px auto;
  border-radius: 8px;
  background: var(--grey-background, #f5f5f5);
}
x-binary-swipe .option .stack .card-wrap {
  z-index: 10;
}
x-binary-swipe .card-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
x-binary-swipe .card-wrap.active {
  cursor: grab;
}
x-binary-swipe .card-wrap.dragging {
  z-index: 20;
}
x-binary-swipe .card {
  border-radius: 8px;
  color: white;
  height: min(220px, 20vw - 10px);
  width: min(200px, 28vw - 10px);
  padding: clamp(6px, 2vw, 16px);
  box-sizing: border-box;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  font-size: clamp(10px, 1.5vw, 16px);
}
x-binary-swipe .card.c-red {
  background: var(--red, #f44336);
}
x-binary-swipe .card.c-orange {
  background: var(--orange, #ff9800);
}
x-binary-swipe .card.c-yellow {
  background: var(--yellow, #ffeb3b);
}
x-binary-swipe .card.c-lime {
  background: var(--lime, #cddc39);
}
x-binary-swipe .card.c-green {
  background: var(--green, #4caf50);
}
x-binary-swipe .card.c-teal {
  background: var(--teal, #009688);
}
x-binary-swipe .card.c-blue {
  background: var(--blue, #2196f3);
}
x-binary-swipe .card.c-purple {
  background: var(--purple, #9c27b0);
}
x-binary-swipe .card::after {
  content: "";
  position: absolute;
  top: 0;
  width: 33%;
  display: block;
  height: 100%;
  background: transparent;
  transition: background 1s;
  mix-blend-mode: overlay;
  border-radius: 8px;
}
x-binary-swipe .card-wrap.committed-left .card::after {
  left: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75));
}
x-binary-swipe .card-wrap.committed-right .card::after {
  right: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75));
}
x-binary-swipe .option .card {
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}
x-binary-swipe .card-wrap.active .card {
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
@media (min-width: 768px) {
  x-binary-swipe .card-wrap.active .card {
    transform: scale(1.1);
  }
}
x-binary-swipe .card-wrap.dragging .card {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
}
@media (min-width: 768px) {
  x-binary-swipe .card-wrap.dragging .card {
    transform: scale(1.2);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.45);
  }
}
@media (max-width: 480px) {
  x-binary-swipe {
    gap: 0.5rem;
  }
  x-binary-swipe .stack {
    height: min(260px, 28vw);
    width: min(220px, 30vw);
    margin: 5px auto;
  }
  x-binary-swipe .card {
    height: min(220px, 28vw - 10px);
    width: min(200px, 30vw - 10px);
    padding: 4px;
  }
}

x-buckets {
  display: block;
  margin: 1.5em 0;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  color: #333;
  width: 100%;
}
x-buckets .inputs, x-buckets .bucket {
  position: relative;
}
x-buckets .inputs > *, x-buckets .bucket > * {
  position: absolute;
}
x-buckets .inputs {
  z-index: 1;
  width: 100%;
  min-height: 50px;
}
x-buckets .buckets {
  display: flex;
  margin: 0 -8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
x-buckets .input {
  cursor: move;
  background: rgba(255, 255, 255, 0.6);
  box-sizing: border-box;
  padding: 5px 12px;
  margin: 6px 0;
  border-radius: 4px;
  width: 180px;
  font-size: 16px;
  line-height: 1.35;
  text-align: center;
  transition: left 0.2s, top 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
x-buckets .input.touch-device {
  /* Increase tap target size on touch devices */
  padding: 8px 12px;
}
x-buckets .inputs .input {
  background: #c5c2cc;
}
x-buckets .input.error {
  background: #e9b0cb;
  color: #cd0e66;
}
x-buckets .input.correct {
  background: #b6dfb7;
  color: #22ab24;
}
x-buckets .input.active {
  z-index: 10; /* Ensure active items appear on top */
  background: white;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.45);
  color: inherit;
}
x-buckets .bucket {
  width: 200px;
  border-radius: 8px;
  margin: 6px;
  position: relative;
  padding-bottom: 6px;
  background: #3a3645;
  transition: box-shadow 0.2s;
}
x-buckets .bucket .title {
  text-align: center;
  font-weight: 600;
  margin-top: 8px;
  color: white;
}
x-buckets .bucket.active {
  box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.4);
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  x-buckets .bucket {
    width: 180px; /* Slightly smaller buckets on tablets */
    margin: 4px;
  }
  x-buckets .input {
    width: 160px; /* Slightly smaller input items */
    font-size: 15px;
  }
}
@media (max-width: 480px) {
  x-buckets .buckets {
    margin: 0 -4px;
  }
  x-buckets .bucket {
    width: calc(50% - 8px); /* Half width minus margins on mobile */
    min-width: 140px; /* Ensure minimum readable width */
    margin: 4px;
  }
  x-buckets .bucket .title {
    font-size: 14px;
    margin-top: 6px;
  }
  x-buckets .input {
    width: 140px; /* Smaller input items on mobile */
    font-size: 14px;
    padding: 6px 8px;
    margin: 4px 0;
  }
  x-buckets .input.active {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45); /* Smaller shadow on mobile */
  }
}
/* Extra small devices */
@media (max-width: 360px) {
  x-buckets .bucket {
    width: 100%; /* Full width on very small devices */
    max-width: 260px;
    margin: 4px auto;
  }
  x-buckets .input {
    width: 130px;
    font-size: 13px;
  }
}
x-binary-swipe {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.5em 0;
}
x-binary-swipe h3 {
  text-transform: uppercase;
  text-align: center;
  color: #aaa;
  font-size: 22px;
  margin-top: 0;
}
x-binary-swipe .stack {
  width: 150px;
  height: 220px;
  position: relative;
  margin: 20px auto;
  border-radius: 8px;
  background: #f5f5f6;
}
x-binary-swipe .option .stack .card-wrap {
  z-index: 10;
}
x-binary-swipe .card-wrap {
  position: absolute;
  top: 0;
  left: 0;
}
x-binary-swipe .card-wrap.active {
  cursor: grab;
}
x-binary-swipe .card-wrap.dragging {
  z-index: 20;
}
x-binary-swipe .card {
  border-radius: 8px;
  color: white;
  height: 220px;
  width: 150px;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.2s, transform 0.2s;
}
x-binary-swipe .card.c-red {
  background: #cd0e66;
}
x-binary-swipe .card.c-orange {
  background: #eb4726;
}
x-binary-swipe .card.c-yellow {
  background: #fd8c00;
}
x-binary-swipe .card.c-lime {
  background: #bfc212;
}
x-binary-swipe .card.c-green {
  background: #22ab24;
}
x-binary-swipe .card.c-teal {
  background: #009ea6;
}
x-binary-swipe .card.c-blue {
  background: #0f82f2;
}
x-binary-swipe .card.c-purple {
  background: #6d3bbf;
}
x-binary-swipe .card::after {
  content: "";
  position: absolute;
  top: 0;
  width: 33%;
  display: block;
  height: 100%;
  background: transparent;
  transition: background 1s;
  mix-blend-mode: overlay;
}
x-binary-swipe .card-wrap.committed-left .card::after {
  left: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75));
}
x-binary-swipe .card-wrap.committed-right .card::after {
  right: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75));
}
x-binary-swipe .option .card {
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}
x-binary-swipe .card-wrap.active .card {
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
x-binary-swipe .card-wrap.dragging .card {
  transform: scale(1.2);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.45);
}

sup {
  font-weight: 600;
}

x-atom {
  display: block;
  margin: 0 auto;
}

x-atom canvas {
  width: 100%;
  height: auto;
}

.col-grid td {
  padding: 0.4em 0.6em;
}
.col-grid tr:first-child td {
  padding: 0 0.6em 0.4em;
  border: 0;
}

.col {
  background: #fd8c00;
  height: 120px;
  width: 50px;
  margin: 0 auto;
  transform-origin: center bottom;
  transition: opacity 0.2s, transform 1s;
  box-shadow: 0 0 12px 1px rgba(253, 140, 0, 0.6);
  border-radius: 2px;
}
.col.c1, .col.c2, .col.c3, .col.c4 {
  opacity: 0;
  transform: scaleY(0);
}
.col.on {
  opacity: 1;
  transform: none;
}
.col.c1 {
  height: 60px;
  margin-top: 60px;
}
.col.c2 {
  height: 30px;
  margin-top: 90px;
}
.col.c3 {
  height: 15px;
  margin-top: 105px;
}
.col.c4 {
  height: 7.5px;
  margin-top: 112.5px;
}

.text-wrap {
  display: block;
  float: right;
  shape-margin: 24px;
  margin: 0 0 24px 24px;
  shape-outside: circle();
}
@media (max-width: 560px) {
  .text-wrap {
    float: none !important;
    margin: 0 auto 1em;
  }
}

.decay-box {
  position: relative;
  height: 112px;
}
.decay-box x-atom {
  position: absolute;
  top: 0;
}
.decay-box x-atom:first-child:hover {
  transform: scale(1.08);
}
.decay-box x-atom:first-child:active {
  transform: scale(0.92);
}
.decay-box .label {
  position: absolute;
  top: 72px;
  width: 72px;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
}
.decay-box .operator {
  position: absolute;
  top: 16px;
  font-size: 20px;
  color: #333;
}

x-algebra-flow x-blank input {
  min-width: 74px;
  transition: min-width 0.2s;
}
x-algebra-flow x-blank.invalid input {
  min-width: 54px;
}

align-r {
  text-align: right !important;
}

body {
  font-family: Arial, sans-serif;
}

#content {
  transition: filter 0.3s ease;
}

.modal {
  display: none;
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  z-index: 6;
}

.modal-content {
  background-color: rgb(242, 172, 172);
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.blurred {
  filter: blur(10px);
}

.para {
  font-size: 15px;
}

.instruction-btn {
  background-color: red;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 0;
  cursor: pointer;
}

x-picker .item {
  border: 4px solid #ecd1ff;
  border-radius: 8px;
  cursor: pointer;
  margin: 4px;
  position: relative;
  transition: border 0.2s, opacity 0.2s;
  width: 150px;
}

x-picker .item.correct {
  border-color: #22ab24;
  cursor: default;
}