/* ── BROKEN SCRIPT style applied to Loop Font UI ── */
@font-face {
  font-family: "OOArketa";
  src: url("OOArketa-Regular.woff2") format("woff2"), url("OOArketa-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  color: #111;
  font-family: "OOArketa", "Trebuchet MS", "Segoe UI", Tahoma, Geneva, sans-serif;
  font-size: 14.5px;
}

canvas {
  display: block;
}

* {
  box-sizing: border-box;
  font-size: 14.5px;
}

/* ── Root shell ── */
#root {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
}

/* ── Canvas container ── */
#canvas-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

#sketch-holder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sketch-holder canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ── Toggle button (bottom bar) ── */
.control-toggle {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  border: none;
  background: #000;
  color: #fff;
  padding: 16px 16px;
  text-align: center;
  font-family: "OOArketa", "Trebuchet MS", "Segoe UI", Tahoma, Geneva, sans-serif;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.04em;
}

.control-toggle:hover {
  background: #222;
}

/* ── Controls panel ── */
#controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 46px;
  width: 100%;
  max-height: calc(100vh - 46px);
  overflow: hidden;
  font-family: "OOArketa", "Trebuchet MS", "Segoe UI", Tahoma, Geneva, sans-serif;
  padding: 14px;
  background: #fefefe;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid #000;
  transform: translateY(102%);
  transition: transform 0.2s ease;
  z-index: 40;
}

#controls.open {
  transform: translateY(0);
  overflow: auto;
}

/* ── Controls header ── */
.controls-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000;
  padding-bottom: 8px;
}

/* ── Textarea ── */
.block-control {
  display: grid;
  gap: 6px;
}

.block-control > span {
  font-size: 14.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #000;
}

.block-control textarea {
  min-height: 80px;
  width: 100%;
  font-size: 14.5px;
  resize: vertical;
  padding: 8px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-family: "OOArketa", "Trebuchet MS", "Segoe UI", Tahoma, Geneva, sans-serif;
  outline: none;
  border-radius: 0;
  max-width: 100%;
}

.block-control textarea:focus {
  outline: 2px solid #000;
  outline-offset: 0;
}

/* ── Control grid ── */
.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

/* ── Slider controls ── */
.slider-control {
  display: grid;
  gap: 4px;
  font-size: 14.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #000;
  min-width: 0;
}

.slider-control > span:first-child {
  font-size: 14.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #000;
}

.slider-control input[type="range"] {
  width: 100%;
  margin: 0;
  height: 18px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  accent-color: #000;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: #000;
  border-radius: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  border: none;
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: #000;
  border-radius: 0;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  border: none;
}

.slider-control .value {
  color: #111;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  justify-self: end;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Select ── */
.select-control {
  width: 100%;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  padding: 4px 6px;
  font-family: "OOArketa", "Trebuchet MS", "Segoe UI", Tahoma, Geneva, sans-serif;
  font-size: 14.5px;
  border-radius: 0;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.select-control:focus {
  outline: 2px solid #000;
  outline-offset: 0;
}

/* ── Actions row ── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid #000;
}

/* ── Toggles / checkboxes ── */
.toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: #000;
}

.toggle-control input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid #000;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  border-radius: 0;
}

.toggle-control input[type="checkbox"]:checked {
  background: #000;
}

.toggle-control input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* ── OpenType row ── */
.opentype-row {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}

/* ── Export buttons ── */
.export-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-btns button,
.actions button {
  background: #000;
  color: #fff;
  padding: 5px 14px;
  cursor: pointer;
  border-radius: 50px;
  border: none;
  font-family: "OOArketa", "Trebuchet MS", "Segoe UI", Tahoma, Geneva, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}

.export-btns button:hover,
.actions button:hover {
  background: #fff;
  color: #000;
  outline: 1px solid #000;
}

.export-btns button:active,
.actions button:active {
  background: #000;
  color: #fff;
}

@media (max-width: 980px) {
  .control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .control-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
