@font-face {
  font-family: "FKGrotesk";
  src: url("../../fonts/FKGrotesk-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "FlechaM";
  src: url("../../fonts/FlechaM-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --light-orange: rgba(250, 125, 0, 255);
  --dark-orange: rgba(152, 72, 0, 255);
  --black: #000;
  --white: #fff;
}

* {
  font-family: "FKGrotesk", sans-serif;
  font-size: 1rem;
  color: #D1CDCD;
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--black);
}

.main-canvas {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

@media (min-width: 1000px) {
  .container {
    max-width: 1280px;
  }
}
@media (min-width: 1280px) {
  /* fixes size */
  .container {
    width: 1200px;
  }
}
.ui-container {
  position: absolute;
  /* or fixed, as needed */
  top: 20px;
  background: rgba(0, 0, 0, 0.9);
  padding: 1em;
  border-radius: 8px;
  z-index: 1;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  gap: 1em;
}
@media screen and (min-width: 768px) {
  .ui-container {
    top: 0;
    max-width: 370px;
  }
}
#ui-collapsible {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 1000px;
  /* enough to show all content */
  opacity: 1;
}

#ui-collapsible.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

#toggle-ui-menu {
  background: none;
  border: 1px solid var(--light-orange);
  padding: 0.5rem 1rem;
  color: var(--light-orange);
  cursor: pointer;
  width: fit-content;
}
#toggle-ui-menu:hover {
  background-color: var(--dark-orange);
  color: var(--black);
}

.main-options {
  display: flex;
  gap: 0.5rem;
}

.title--primary {
  font-family: "FlechaM", serif;
  font-weight: 400;
  color: var(--white);
  font-size: 2.4375rem;
}
@media (min-width: 768px) {
  .title--primary {
    font-size: 2.4375rem;
  }
}
@media (min-width: 1280px) {
  .title--primary {
    font-size: 3.8125rem;
  }
}

.title--secondary {
  font-size: 1.5625rem;
  font-weight: 400;
  color: var(--white);
}

.text {
  line-height: 150%;
}

/* UI Element General Styling */
.ui-label {
  margin: 0;
  font-size: 12px;
}

.ui-control {
  /* Common margin for controls like buttons, sliders, dropdowns */
  margin-bottom: 1em;
}

.ui-text-italic {
  font-style: italic;
}

/* Specific Element Styling */
.ui-camera-select {
  /* For the select dropdown itself */
  width: 100%;
  background-color: #333231;
  color: #9B9997;
  border: 1px solid #333231;
  padding: 0.5rem;
}

/* Dropdown for algorithm selection */
.ui-algo-select {
  width: 100%;
}

.radio-container {
  display: flex;
  gap: 2rem;
}

.ui-algo-radio input[type=radio] {
  position: absolute;
  opacity: 0;
}
.ui-algo-radio input[type=radio] + label:before {
  content: "";
  background: black;
  border-radius: 100%;
  border: 2px solid #D1CDCD;
  display: inline-block;
  width: 1rem;
  height: 1rem;
  position: relative;
  top: -0.2em;
  margin-right: 1rem;
  vertical-align: top;
  cursor: pointer;
  text-align: center;
  transition: all 250ms ease;
}
.ui-algo-radio input[type=radio]:checked + label:before {
  background-color: #D1CDCD;
  box-shadow: inset 0 0 0 4px black;
}
.ui-algo-radio input[type=radio]:focus + label:before {
  outline: none;
  border-color: #FF9411;
}
.ui-algo-radio input[type=radio]:disabled + label:before {
  border-color: black;
  background: black;
}
.ui-algo-radio input[type=radio] + label:empty:before {
  margin-right: 0;
}

.ui-capture-button {
  /* For the capture button */
  margin-top: 1em;
}

.ui-button,
.ui-aspect-button,
.ui-share-button,
.sharing-div-button {
  background-color: var(--light-orange);
  color: var(--black);
  border: none;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  border-radius: 0;
}

.preview-redo {
  background-color: var(--black);
  color: var(--light-orange);
  border: 1px solid var(--light-orange);
  padding: 0.5rem 2rem;
  cursor: pointer;
  border-radius: 0;
}

.ui-aspect-button {
  width: 100%;
}
@media screen and (min-width: 1280px) {
  .ui-aspect-button {
    width: 300px;
  }
}

.ui-aspect-button.active-aspect {
  background-color: var(--dark-orange);
}

/* Consider p5.js specific element containers if direct styling isn't enough.
   For example, p5.js creates a div around checkboxes. If '.debugCheckbox.style(...)'
   was actually styling that container, these classes will apply to the element p5 gives us.
   If direct styling of input[type=checkbox] is needed, it's more complex and might
   require different CSS selectors, but for now, we'll assume addClass works on the
   p5 element reference. */
/* Make sure these new rules are added after existing rules or in a logical section. */
/* Pixel size slider styling */
.size-container {
  margin-bottom: 1rem;
}
@media screen and (min-width: 768px) {
  .size-container {
    max-width: 300px;
  }
}
.size-controls {
  display: flex;
  margin-top: 1rem;
  align-items: center;
}
.size-control {
  width: 20px;
  height: 20px;
  background-color: var(--dark-orange);
  /* dark orange */
  color: #FF9411;
  /* light orange text */
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 400;
  font-size: 1rem;
  cursor: pointer;
  border: none;
}

#size-input {
  -webkit-appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  margin: 0;
}

#size-input::-webkit-slider-runnable-track {
  height: 3px;
  background: var(--dark-orange);
}

#size-input::-moz-range-track {
  height: 3px;
  background: var(--dark-orange);
}

#size-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--dark-orange);
  /* light orange square */
  border: 8px solid var(--light-orange);
  margin-top: -10px;
  /* Center the thumb on the track (half of thumb height + border) */
}

/* hover makes it darker */
#size-input::-webkit-slider-thumb:hover {
  background-color: var(--dark-orange);
}

#size-input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--light-orange);
  border: 2px solid var(--dark-orange);
  border-radius: 0;
  /* Keep it square */
  cursor: pointer;
}

/* Preview overlay for sharing */
.preview-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-orange);
  z-index: 1000;
}
.preview-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 0px;
  padding: 20px;
  overflow-y: auto;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
}
.preview-image {
  width: 100%;
  max-width: 60vw;
  max-height: 60vh;
  height: auto;
  object-fit: contain;
  border-radius: 0px;
}
.preview-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0 0;
  width: 100%;
  max-width: 300px;
}

.preview-redo,
.success-button {
  background-color: var(--black);
  color: var(--light-orange);
  border: 1px solid var(--light-orange);
  width: 100%;
}
.preview-redo:hover,
.success-button:hover {
  background-color: var(--dark-orange);
  color: var(--black);
}

.success-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--black);
  display: flex;
  justify-content: center;
  z-index: 2;
}
.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--white);
  max-width: 308px;
  height: 100vh;
}
.success-message {
  font-size: 1.25rem;
  margin: 0 0 4rem;
}

.sharing-div-button:hover,
.ui-aspect-button:hover,
.ui-share-button:hover {
  background-color: var(--dark-orange);
}

.debug-container {
  display: none;
}

/* Welcome modal overlay */
#welcome-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background-image: url("/img/pixels-bg.jpg");
  background-repeat: no-repeat;
}
#welcome-modal .welcome__content {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0 40px;
}
#welcome-modal .welcome__heading {
  padding: 3rem 0 0;
}
#welcome-modal .welcome__heading .title--primary {
  width: 246px;
}
@media screen and (min-width: 1280px) {
  #welcome-modal .welcome__heading .title--primary {
    width: 480px;
    padding: 0;
  }
}
@media screen and (min-width: 768px) {
  #welcome-modal .welcome__heading .text {
    width: 300px;
  }
}
@media screen and (min-width: 1280px) {
  #welcome-modal .welcome__heading .text {
    width: 480px;
  }
}
#welcome-modal .welcome__heading .spacer {
  margin: 0 0 2rem;
}

#welcome-aspect-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fps-container {
  display: none;
}
