/* Pekosoft Index */
/* pekosoft.net/css/index.css */

/* VARIABLES */

:root {
  --color1: #0080ff;
  --color2: #ff00ff;
  --grey0: #111;
  --grey1: #222;
  --grey2: #444;
  --white: #fff;
  --black: #000;
  --font-size: 22px;
  --maxwidth: 4096px;
  --size1: 28px;
  --size2: 32px;
  --size3: 40px;
}

/* TAGS */

/* GENERAL */

* {
  box-sizing: border-box;
  /* border: 1px solid var(--color1); */
}

html {
  background-color: var(--black);
  font-size: var(--font-size);
}

body {
  color: var(--white);
  margin: 0;
  font-family: Arial, sans-serif;
  text-decoration: none;
  font-weight: normal;
  line-height: 1.5;
  text-align: center;
  padding-top: 96px;
  padding-bottom: 48px;
}

h1 {
  font-size: 28px;
  font-weight: bold;
  margin: 0px;
}

canvas {
  display: block;
}

::selection {
  color: var(--white);
  background-color: var(--color1);
}

/* Apply focus styles on devices with hover capability (desktop) */
@media (hover: hover) {
  :focus {
    outline: 1px solid var(--color1);
    outline-offset: -1px;
    /* Adjust the spacing between the outline and the element */
  }
}

/* Apply focus styles on devices without hover capability (phone) */
@media (hover: none) {
  :focus {
    outline: none;
    /* Remove outline on devices without hover capability */
  }
}

/* LINKS */

a {
  text-decoration: none;
  color: var(--color1);
}

a:not(:has(img, svg)):hover {
  background: var(--white);
}

a:visited {
  color: var(--color2);
}

/* FORM */

button {
  width: 104px;
  height: var(--size2);
  padding: 8px;
  margin: 0;
  min-width: 104px;
  font-size: var(--font-size);
  background: transparent;
  color: var(--white);
  border: 1px solid var(--grey2);
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  line-height: 16px;
  /* Center vertically */
}

select,
input[type="number"],
input[type="text"],
label {
  width: auto;
  min-width: 0;
}

select,
input[type="number"] {
  font-size: var(--font-size);
  height: var(--size2);
  color: var(--white);
  background-color: var(--black);
  padding: 4px;
  margin: 0px;
  border: 1px solid var(--grey2);
  text-align: center;
}

select {
  padding: 4px;
  background-color: var(--black);
  border-radius: 0;
  padding-top: 2px;
}

input[type="text"] {
  font-size: var(--font-size);
  height: var(--size2);
  color: var(--white);
  background-color: var(--black);
  padding: 8px;
  margin: 0px;
  border: 1px solid var(--grey2);
  text-align: center;
}

input[type="file"] {
  display: none;
}

label {
  font-size: var(--font-size);
  height: var(--size2);
  color: var(--white);
  padding: 8px;
  margin: 0px;
  min-width: 96px;
  border: 1px solid var(--grey2);
  white-space: nowrap;
  text-align: center;
  line-height: 16px;
  /* Center vertically */
  user-select: none;
  overflow: hidden;
}

textarea {
  min-height: 256px;
  color: var(--white);
  width: 100%;
  max-width: var(--maxwidth);
  padding: 8px;
  font-family: Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  border: 0;
  outline: none;
  resize: none;
  display: block;
  background-color: transparent;
}

textarea::placeholder {
  color: var(--grey2);
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--grey2);
  border-radius: 0;
  position: relative;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background-color: var(--color1);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--white);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}

input[type="radio"]:checked::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color1);
}

input[type="radio"]:hover {
  border-color: var(--color1);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--size2);
  background: transparent;
  flex: 1;
  margin-left: 8px;
  margin-right: 8px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: var(--size2);
  background: transparent;
  border: 1px solid var(--white);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: var(--size2);
  cursor: pointer;
  background: var(--grey1);
}

/* TABLE */

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  max-width: var(--maxwidth);
}

thead {
  background-color: var(--black);
  height: 40px;
  position: sticky;
  top: 0;
  z-index: 2;
}

tr {
  height: 40px;
}

td,
th {
  padding: 0 8px;
  border: 1px solid var(--grey2);
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  width: 110px;
  min-width: 110px;
}

td:first-child,
th:first-child {
  border-left: none;
}

tr:first-child td,
tr:first-child th {
  border-top: none;
}

tr:last-child td {
  border-bottom: none;
}

td:last-child,
th:last-child {
  border-right: none;
}

tbody tr:hover {
  background: var(--black);
}

/* CLASSES */

/* GENERAL */

.border {
  border: 4px solid var(--grey1);
}

.left {
  text-align: left;
}

.right {
  text-align: right;
}

.justify {
  text-align: justify;
}

.container {
  width: 100%;
  max-width: var(--maxwidth);
  margin: 16px auto 8px;
}

.colored {
  background-color: var(--grey1);
}

.release-title {
  user-select: none;
}

/* DIVS */

.standard {
  text-align: center;
  max-width: var(--maxwidth);
  padding: 8px;
  margin: 8px auto 0;
}

.wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
  max-width: var(--maxwidth);
  /*margin: 4px auto 0;*/
  gap: 8px;
}

.module-values {
  text-align: center;
  width: 100%;
  max-width: var(--maxwidth);
  margin: 0 auto;
}

.module-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  width: 100%;
  min-height: 40px;
  padding: 0 4px;
}

#panel-container .standard {
  margin-top: 0;
  padding: 0;
}

#panel-container textarea {
  margin: 0;
}


/* Pair = one grouped UI unit */
.pair {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: 180px;
  width: 100%;
}

/* Inside a pair, margins should not participate in layout */
.pair>* {
  margin: 0;
}

/* h1 and other direct children should not grow */
.pair>h1 {
  flex: 0 0 auto;
}

/* Label column */
.pair>label {
  flex: 0 0 auto;
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

/* Field: stretch inputs only */
.pair>input[type="text"],
.pair>input[type="number"] {
  flex: 1;
  min-width: 80px;
}

/* Menu: stretch to fill */
.pair>select {
  flex: 1;
  min-width: 80px;
}

.controls-values.wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: var(--maxwidth);
  margin: 0 auto;
}

@media (max-width: 768px) {
  .controls-values.wrapper {
    grid-template-columns: repeat(2, 1fr);
  }

  .module-footer {
    gap: 12px;
  }
}



.padded {
  max-width: var(--maxwidth);
  margin: 16px auto 0;
  padding: 8px;
}

.table-container {
  /* height: 512px; */
  max-height: 512px;
  overflow-y: auto;
  margin-top: 8px;
}

/* BUTTONS */

.square {
  width: var(--size2);
  min-width: var(--size2);
  padding: 0;
  border: none;
}

.button-on {
  color: var(--color1);
}

.button-on .icons {
  fill: var(--color1);
}

.button-text {
  display: none;
}

/* Show text on buttons when toggled, except icon-only, square, and TOC buttons */
.show-button-text button:not(.transparent):not(.icon-only):not(.square):not(.toc-button) .icons {
  display: none;
}

.show-button-text button:not(.transparent):not(.icon-only):not(.square):not(.toc-button) .button-text {
  display: inline;
}

/* Always keep icons visible for icon-only, square, and TOC buttons */
.show-button-text button.icon-only .icons,
.show-button-text button.square .icons,
.show-button-text button.toc-button .icons {
  display: block;
}

/* LAYOUT */

.checkbox {
  width: auto;
  border: none;
}

li h1 {
  display: flex;
  /* Use flexbox for alignment */
  align-items: center;
  /* Vertically center-align the content */
}

li h1 img {
  margin-right: 16px;
  /* Spacing between icons and text */
}

.releases {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: var(--maxwidth);
  margin: 16px auto 0;
}

@media (min-width: 320px) {
  .releases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .releases {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.item {
  border: 0;
  padding: 8px;
  background-color: var(--grey1);
}

.assets {
  width: auto;
  height: 32px;
  margin: 4px;
  vertical-align: middle;
  fill: var(--white);
  display: inline-block;
}

.speaker {
  width: 100%;
  height: auto;
  margin: 0px;
  fill: var(--grey1);
  display: block;
}

.icons {
  height: var(--size1);
  width: var(--size1);
  fill: var(--white);
  display: block;
  margin: 0 auto;
}

.icons-toc {
  height: 32px;
  width: 32px;
  fill: var(--white);
  display: block;
  margin: 0 8px 0 0;
}

.link-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
}

.standard-image {
  width: 256px;
  display: block;
  margin: 0;
}

.standard-image-help {
  width: 256px;
  height: 256px;
  margin: 0;
  fill: var(--grey1);
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .standard-image-help {
    width: 128px;
    height: 128px;
  }
}

#controls-container {
  width: 100%;
  max-width: var(--maxwidth);
  margin-left: auto;
  margin-right: auto;
}

.top-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--maxwidth);
  margin: 0 auto;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 15;
  padding: 4px 8px;
}

.top-heading a {
  display: inline-block;
}

.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--maxwidth);
  margin: 0 auto;
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
  padding: 4px 8px;
}

.heading img {
  vertical-align: middle;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  max-width: var(--maxwidth);
  margin: 0 auto;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 5;
}

.footer img {
  vertical-align: middle;
}

.footer a.current .icons {
  fill: var(--color1);
}

.footer-spacer {
  height: 2px;
}

/* Hide columns on medium screens */
@media (max-width: 2048px) {
  .hide-on-medium-screen {
    display: none;
  }
}

.scrollable {
  white-space: nowrap;
  overflow-x: auto;
  /* Enable horizontal scrollbar */
  width: 100%;
  scrollbar-width: none;
}

.timeline-scroll {
  width: 100%;
}

.scrollable::-webkit-scrollbar {
  display: none;
}

.invert-colors {
  filter: invert(1) hue-rotate(180deg);
}

/* Table of contents */

.toc-container {
  display: none;
  position: absolute;
  top: 48px;
  left: 0px;
  background-color: var(--grey1);
  border: 0px;
  padding: 0px;
  z-index: 999;
  max-width: var(--maxwidth);
  width: 100%;
  height: calc(100vh - 40px);
  padding: 4px 0px;
}

.toc-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding-bottom: 80px;
}

.toc-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.toc-close {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding-bottom: 320px;
}

.toc-open {
  display: block;
}

.toc-button {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  font-size: 28px;
  font-weight: bold;
  padding: 0 6px;
  color: var(--white);
  cursor: pointer;
  user-select: none;
}

.toc-button:focus {
  outline: 1px solid var(--color1);
  outline-offset: -1px;
}

.toc-spacer {
  height: 48px;
}

#burger-container,
#release-burger-container {
  display: flex;
}

/* Release TOC */

.release-toc-container {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 48px;
  left: 0px;
  background-color: var(--black);
  border: 0px;
  padding: 0px;
  z-index: 999;
  max-width: var(--maxwidth);
  width: 100%;
  height: calc(100vh - 88px);
  align-items: flex-start;
}

.release-toc-open {
  display: block;
}

body.release-toc-active #tool-container,
body.release-toc-active #controls-container,
body.release-toc-active #timeline-container,
body.release-toc-active #panel-container {
  visibility: hidden;
}

/* Three columns layout */

.three-columns-container {
  display: flex;
  max-width: var(--maxwidth);
  margin: 16px auto 0;
}

.three-columns {
  flex: 1;
}

.column-sides {
  flex: 0.5;
  padding: 0px;
}

.column-middle {
  padding-top: 0px;
}

.column-middle-about {
  padding: 8px;
  padding-top: 16px;
}

.column-left {
  padding-right: 16px;
}

.column-right {
  padding-left: 16px;
}

.code-container {
  width: 100%;
  overflow-x: auto;
  /* Enable horizontal scrollbar if needed */
}

.code-container code {
  display: block;
  white-space: pre-wrap;
  /* Preserve white spaces and wrap lines */
}

html.show-grid {
  background-image:
    linear-gradient(to right, #101010 1px, transparent 1px),
    linear-gradient(to bottom, #101010 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: -1px -1px;
  background-attachment: fixed;
}

body.blink-bg {
  background-color: var(--color1);
}

body.blink-bg::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--color1);
  z-index: -1;
  pointer-events: none;
}

.large-icon {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 1 / 1;
  height: auto;
  fill: var(--black);
  display: inline-block;
  margin: 0 auto;
  vertical-align: middle;
}

.release-header {
  text-align: center;
  margin-top: 16px;
  max-width: 100%;
  word-break: break-word;
}

@media (max-width: 768px) {
  .release-header::after {
    content: "";
    display: block;
  }

  .release-header {
    white-space: pre-line;
  }
}

a:has(> svg.icons) {
  display: block;
}

.canvas-container {
  text-align: left;
  overflow-x: hidden;
  padding: 0px;
}

.hidden {
  display: none;
}

.label {
  font-weight: bold;
  color: var(--color1);
}

.range-input-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: var(--maxwidth);
  margin: 8px auto 0;
  padding: 0px;
  text-align: center;
}

/* controls module borders and layout adjustments */
.controls {
  /* outer border for entire controls section */

  max-width: var(--maxwidth);
  margin: auto;
}

.controls .wrapper {
  /* remove extra margins inside controls so sections touch */
  margin: 0;
}

.controls-buttons {
  /* separator between buttons and values */
  border-bottom: 4px solid var(--grey1);
}

.controls-sliders {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  border-top: 4px solid var(--grey1);
  padding: 4px 4px;
  background-color: var(--black);
}

.controls-slider-block {
  min-width: 0;
}

.controls-slider-block .range-input-wrapper {
  max-width: 100%;
  margin: 0;
}

@media (min-width: 769px) {
  .controls-sliders {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

input[type="number"] {
  /* blue bar shown via inline background-size adjustments in JS */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1' height='1'><rect width='1' height='1' fill='%23ff00ff' /></svg>");
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0px 4px;
  /* match table row height */
}

.grey {
  color: var(--grey2);
}

/* Help */

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
  text-align: left;
  padding: 16px;
}

.feature-row h1 {
  margin-bottom: 6px;
}

.module {
  background-color: var(--grey1);
}

.module svg {
  fill: var(--black);
}

.object {
  color: var(--grey2);
}

.module .object {
  color: var(--black);
}

.default {
  color: var(--color1);
}

.example {
  color: var(--grey2);
}

/* History */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-entry {
  margin-bottom: 0;
}

.history-minor {
  background-color: var(--grey1);
}

.history-entry-content {
  flex: 1;
}

.history-entry-content h1 {
  margin-bottom: 6px;
}

.history-text {
  color: inherit;
}

.history-version-circle {
  width: 256px;
  height: 256px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 92px;
  font-weight: 900;
  line-height: 1;
  padding: 8px;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.history-major .history-version-circle {
  background-color: var(--grey1);
  color: var(--black);
}

.history-minor .history-version-circle {
  background-color: var(--black);
  color: var(--grey1);
}

@media (max-width: 800px) {
  .history-version-circle {
    width: 128px;
    height: 128px;
    font-size: 48px;
  }
}

/* IDs */

#tempo-slider,
#volume-slider,
#progress-slider {
  flex: 1;
  position: relative;
  z-index: 2;
}

#tempo-slider::after,
#volume-slider::after,
#progress-slider::after {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--black);
  font-size: 24px;
  font-weight: 900;
  font-family: Arial, sans-serif;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  z-index: 1;
}

#tempo-slider::after {
  content: "T E M P O";
  letter-spacing: 2px;
}

#volume-slider::after {
  content: "V O L U M E";
  letter-spacing: 2px;
}

#progress-slider::after {
  content: "P R O G R E S S";
  letter-spacing: 2px;
}

/* Module Header */

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  min-height: var(--size3);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  background-color: var(--grey1);
}

.module-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-icon-btn {
  border: none;
  padding: 0;
}

.module-header-left .icons {
  fill: var(--white);
  flex-shrink: 0;
}

.module-title {
  font-size: var(--font-size);
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}

.module-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.module-header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.module-header-actions[hidden] {
  display: none;
}

body.hide-module-headers .module-header {
  display: none;
}

/* Keep More button neutral even when actions are open */
.module-more-btn.button-on {
  color: var(--white);
}

.module-more-btn.button-on .icons {
  fill: var(--white);
}

/* Header should connect directly to first module content block */
.container > .module-header + * {
  margin-top: 0;
}

/* Minimized: hide everything except the header */
.module-minimized > *:not(.module-header) {
  display: none !important;
}

/* Maximized: fill entire viewport */
.module-maximized {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  overflow: auto;
  margin: 0;
  width: min(100vw, var(--maxwidth));
  height: 100vh;
  max-width: var(--maxwidth);
  background: var(--black);
  display: flex;
  flex-direction: column;
}

/* Header should not stretch */
.module-maximized .module-header {
  flex-shrink: 0;
}

/* Standard wrapper should fill remaining space and act as flex container */
.module-maximized .standard {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
}

/* Controls fill full width in maximized view */
.module-maximized .controls {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

/* Timeline maximize: canvas height fills the module */
#timeline-container.module-maximized .canvas-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#timeline-container.module-maximized .timeline-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

#timeline-container.module-maximized .timeline-scroll canvas {
  height: 100% !important;
  max-height: none;
}

/* Textarea should fill available space in maximized view */
.module-maximized textarea {
  flex: 1;
  min-height: 0;
  max-width: none;
}

/* Tool module: make the content area scale in maximized mode like Panel. */
#tool-container.module-maximized > *:not(.module-header):not(.module-footer) {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-width: none;
  margin: 0;
}

#tool-container.module-maximized > *:not(.module-header):not(.module-footer) > svg,
#tool-container.module-maximized > *:not(.module-header):not(.module-footer) canvas,
#tool-container.module-maximized > *:not(.module-header):not(.module-footer) img {
  max-width: 100%;
  max-height: 100%;
}

/* END OF FILE */