/* Emerald Valley Library - Interactive Mathematics, generated by Mathigon Studio */
x-automaton {
  display: block;
}
x-automaton .cellular-rules {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
x-automaton .cellular-rules > svg {
  margin: 5px;
  cursor: pointer;
  transition: transform 0.2s;
}
x-automaton .cellular-rules > svg:hover {
  transform: scale(1.2);
}
x-automaton .cellular-grid {
  margin: 0 auto;
  cursor: crosshair;
}
x-automaton .cellular-rules rect, x-automaton .cellular-grid rect {
  stroke: #dddce1;
  fill: white;
}
x-automaton .cellular-rules rect.fill, x-automaton .cellular-grid rect.fill {
  fill: #3a3645;
  stroke: #504b5c;
}
x-automaton .cellular-rules rect.red, x-automaton .cellular-grid rect.red {
  stroke: #cd0e66;
  stroke-width: 2px;
  stroke-linejoin: round;
}
x-automaton .highlight {
  fill: none;
  stroke: #fd8c00;
  stroke-width: 5px;
  opacity: 0.85;
  display: none;
}
x-automaton svg.focus .highlight {
  display: block;
}

.chaos-game {
  margin: 1.5rem 0;
}
@media screen and (max-width: 540px) {
  .chaos-game {
    margin: 1.5em -24px;
  }
}
.chaos-game x-select.tabs {
  position: relative;
  z-index: 1;
}
.chaos-game x-geopad {
  border-radius: 4px 4px 0 0;
}
.chaos-game .chaos-rules {
  background: #c5c2cc;
  display: flex;
  flex-wrap: wrap;
  padding: 8px;
  border-radius: 0 0 4px 4px;
}
.chaos-game .chaos-rules .form-field, .chaos-game .chaos-rules .button-field {
  padding: 8px;
}
.chaos-game .chaos-rules .form-field {
  flex-grow: 1;
}
.chaos-game .chaos-rules .btn {
  display: block;
  height: 49px;
  line-height: 49px;
}

.fractal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
x-step.focus .fractal-overlay {
  opacity: 0.85;
}

svg.var .red {
  fill: #cd0e66;
}
svg.var .blue {
  fill: #0f82f2;
}
svg.var .white {
  fill: white;
}
svg.var .overlay {
  fill: white;
  opacity: 0;
  transition: opacity 0.2s;
}
svg.var .overlay.focus {
  opacity: 0.9;
}

.sierpinski {
  overflow: visible;
}
.sierpinski g {
  transition: transform 0.3s, fill 0.3s;
}
.focus .sierpinski .t1 {
  transform: translate(10px, 5px);
  fill: #0f82f2;
}
.focus .sierpinski .t2 {
  transform: translate(-10px, 5px);
  fill: #22ab24;
}
.focus .sierpinski .t3 {
  transform: translate(0, -10px);
  fill: #fd8c00;
}

x-menger-sponge {
  display: block;
}

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

.coastline path {
  fill: #656073;
}
.coastline line {
  stroke: #fd8c00;
  stroke-width: 6px;
  stroke-linecap: square;
}
.coastline line.border {
  stroke: #933f36;
  stroke-width: 10px;
}

#coastline-grid .grid, #coastline-grid .cells {
  transition: opacity 0.8s;
}
#coastline-grid .coast {
  vector-effect: non-scaling-stroke;
}

.pascal-grid {
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.pascal-grid .r {
  display: flex;
  justify-content: center;
}
.pascal-grid .c {
  cursor: pointer;
  width: 36px;
  font-size: 13px;
  background: #ddd;
  margin: 1px;
  text-align: center;
  position: relative;
  line-height: 20px;
  border-radius: 3px;
  transition: color 0.4s, background 0.4s;
  box-shadow: inset 0 -1px rgba(0, 0, 0, 0.3);
  padding-bottom: 1px;
}
.pascal-grid .c.red {
  color: white;
  background: #cd0e66;
  cursor: default;
}
.pascal-grid.done .c {
  cursor: default;
}

.pascal-canvas {
  position: relative;
  float: left;
  shape-outside: polygon(0 0, 240px 0, 480px 420px, 0 420px);
  shape-margin: 32px;
  margin: 0 32px 1.5em 0;
}
.pascal-canvas canvas {
  width: 480px;
  max-width: 100%;
  height: auto;
}
.pascal-canvas .label {
  position: absolute;
  top: 32px;
  left: 24px;
  font-weight: 600;
  color: #333;
}
.pascal-canvas .circled {
  width: 32px;
  height: 32px;
  line-height: 32px;
}
@media screen and (max-width: 1007px) and (min-width: 841px) {
  .pascal-canvas {
    float: none;
    max-width: 480px;
    margin: 0 auto 1.5em;
    shape-outside: none;
  }
}
@media screen and (max-width: 727px) {
  .pascal-canvas {
    float: none;
    max-width: 480px;
    margin: 0 auto 1.5em;
    shape-outside: none;
  }
}
@media screen and (max-width: 460px) {
  .pascal-canvas .label {
    top: 12px;
    left: 0;
  }
}

x-geopad .points circle.chaos-point {
  stroke: none;
  fill: currentColor;
}

.geo-legend {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 14px;
}
.geo-legend .formula, .geo-legend .sequence {
  width: -moz-fit-content;
  width: fit-content;
  background: #e2e1e6;
  border: 2px solid white;
  padding: 2px 4px;
  border-radius: 8px;
}
.geo-legend .formula {
  margin-top: -2px;
  border-bottom-left-radius: 0;
}
.geo-legend .sequence {
  margin-top: -2px;
  border-top-left-radius: 0;
}
.geo-legend .pill {
  padding: 0 8px;
  min-width: 0;
}
.geo-legend .vdots {
  transform: rotate(90deg);
  display: inline-block;
  margin-left: 13px;
  margin-right: 24px;
}
@media screen and (max-width: 940px) and (min-width: 841px), screen and (max-width: 660px) {
  .geo-legend {
    font-size: 12px;
  }
  .geo-legend .pill {
    padding: 0 7px;
  }
  .geo-legend .formula, .geo-legend .sequence {
    padding: 2px 3px;
  }
}
@media screen and (max-width: 560px) {
  .geo-legend {
    font-size: 10px;
  }
  .geo-legend .pill {
    padding: 0 6px;
  }
  .geo-legend .formula, .geo-legend .sequence {
    padding: 1px 2px;
  }
}
@media screen and (max-width: 400px) {
  .geo-legend {
    display: none;
  }
}

.mandel-frame {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  padding-bottom: 65.79%;
}
.mandel-frame img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.mandel-frame .scale {
  position: absolute;
  left: 50%;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: 1px solid white;
  border-radius: 20px;
  line-height: 24px;
  font-size: 16px;
  padding: 0 14px;
  transform: translateX(-50%);
}

x-geopad img {
  transition: opacity 0.2s;
}

.focus x-geopad img {
  opacity: 0.2;
}