/* (c) Innings2, generated by Mathigon Studio */
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;
}

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-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-solid, x-polyhedron {
  display: block;
  position: relative;
  margin: 0 auto;
}
x-solid canvas, x-polyhedron canvas {
  max-width: 100%;
  height: auto;
}
x-solid .label3d, x-polyhedron .label3d {
  position: absolute;
  line-height: 1.2;
  font-style: italic;
  pointer-events: none;
}

x-solid, x-polyhedron {
  display: block;
  position: relative;
  margin: 0 auto;
}
x-solid canvas, x-polyhedron canvas {
  max-width: 100%;
  height: auto;
}
x-solid .label3d, x-polyhedron .label3d {
  position: absolute;
  line-height: 1.2;
  font-style: italic;
  pointer-events: none;
}

.poly {
  position: relative;
  display: flex;
  border-radius: 4px 0 0 4px;
  --canvas-bg: #f5f5f6;
}
[theme=dark] .poly {
  --canvas-bg: #2d2c38;
}
.poly x-polypad {
  height: 450px;
  flex-grow: 1;
  background: var(--canvas-bg);
}
.poly svg.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
  width: auto;
  right: 52px;
  overflow: visible;
  stroke-linejoin: round;
}
.poly .menu {
  background: #3a3645;
  border-radius: 0 4px 4px 0;
  padding: 2px 0;
}
.poly .add {
  width: 48px;
  height: 48px;
  padding: 0 2px;
  cursor: grab;
}
.poly .overlap .polygon-tile {
  fill: #ff5354, green !important;
}
.poly .btn-row {
  position: absolute;
  bottom: 12px;
  left: 12px;
}
.poly #pentagons svg.overlay {
  right: 104px;
}
#pentagons .poly .menu {
  width: 104px;
  display: flex;
  flex-wrap: wrap;
}

x-buckets.solid-one .input {
  width: 100px;
  height: 100px;
  overflow: hidden;
  background-size: contain;
}
x-buckets.solid-one .bucket {
  width: 300px;
}
x-buckets.solid-one .bucket:nth-child(1) {
  background: #25abb2;
}
x-buckets.solid-one .bucket:nth-child(2) {
  background: #8157c7;
}
x-buckets.solid-one .bucket:nth-child(3) {
  background: #25abb2;
}

x-buckets.solid-two .input {
  width: 100px;
  height: 100px;
  overflow: hidden;
  background-size: contain;
}
x-buckets.solid-two .bucket {
  width: 300px;
}
x-buckets.solid-two .bucket:nth-child(1) {
  background: #25abb2;
}
x-buckets.solid-two .bucket:nth-child(2) {
  background: #8157c7;
}
x-buckets.solid-two .bucket:nth-child(3) {
  background: #25abb2;
}

x-buckets.solid-three .input {
  width: 100px;
  height: 100px;
  overflow: hidden;
  background-size: contain;
}
x-buckets.solid-three .bucket {
  width: 300px;
}
x-buckets.solid-three .bucket:nth-child(1) {
  background: #25abb2;
}
x-buckets.solid-three .bucket:nth-child(2) {
  background: #8157c7;
}
x-buckets.solid-three .bucket:nth-child(3) {
  background: #25abb2;
}

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

x-voxel-painter {
  display: block;
  cursor: pointer;
  margin: 0 auto;
  max-width: 100%;
  position: relative;
}
x-voxel-painter .eraser {
  position: absolute;
  width: 40px;
  height: 40px;
  background: red;
}
x-voxel-painter .icon-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
}

#cube-draw x-polypad svg, #cube-net-draw x-polypad svg {
  height: 400px;
}

div.die-faces {
  width: 620px;
  height: 600px;
  text-align: center;
}
div.die-faces svg {
  width: 620px;
  height: 465px;
  background-color: white;
}
div.die-faces svg path.target {
  fill: transparent;
  stroke: black;
  stroke-width: 2px;
}
div.die-faces svg path.target.over {
  fill: #bfc212;
}
div.die-faces div.faces {
  display: inline-flex;
  flex-wrap: wrap;
  margin: auto;
  justify-content: center;
}
div.die-faces div.faces div.face {
  width: 90px;
  height: 90px;
  max-width: 90px;
  flex: 90px;
  margin: 2px;
  background-color: white;
  border: 3px solid black;
  background-size: contain;
  display: inline-block;
}
div.die-faces div.faces div.face svg {
  width: 90px;
  height: 90px;
}