@font-face {
  font-family: Determination;
  src: url("assets/fonts/font_mono.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: DeterminationK2;
  src: url("assets/fonts/font_ui.woff2") format("woff2");
  font-display: block;
  ascent-override: 75%;
  descent-override: 18.75%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;
  --red: #ff0000;
  --white: #fff;
  --dim: #aaa;
  --black: #000;
  --font: DeterminationK2, "Courier New", monospace;
}

* {
  box-sizing: border-box;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "dlig" 0;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.25;
  -webkit-font-smoothing: none;
}

button, input, select, textarea {
  font: inherit;
  font-weight: 400;
  border-radius: 0;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border: 4px solid #fff;
  background: #000;
  color: #fff;
  padding: 9px 15px;
  line-height: 1.2;
}
button:hover:not(:disabled), button:focus-visible {
  background: #fff;
  color: #000;
  outline: none;
}
button:disabled {
  border-color: #5e5e5e;
  color: #777;
  cursor: default;
  background: #000;
}
button.primary { color: #ffff00; border-color: #ffff00; }
button.primary:hover:not(:disabled) { background: #ffff00; color: #000; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
canvas:focus-visible,
.upload:focus-within {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 22px 30px;
  border-bottom: 4px solid #fff;
  min-height: 98px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  font-size: 36px;
  line-height: 1.2;
}

.soul {
  display: block;
  width: 32px;
  height: 32px;
  flex: none;
  color: #ff0000;
}
.soul svg {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}
.header-actions button { font-size: 21px; white-space: nowrap; }

.volume-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 8px;
  width: 130px;
  flex: none;
}
.volume-control label, .volume-control output { font-size: 17px; line-height: 1.2; }
.volume-control output { float: none; text-align: right; }
.volume-control input[type="range"] {
  grid-column: 1/-1;
  width: 100%;
  height: 18px;
  border-width: 3px;
  margin: 0;
}
.volume-control input[type="range"]::-webkit-slider-thumb { height: 12px; }
.volume-control input[type="range"]::-moz-range-thumb { height: 12px; }

main {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  min-height: calc(100vh - 100px);
  padding: 24px 30px;
  gap: 30px;
  max-width: 1800px;
  margin: 0 auto;
}

.editor {
  border: 5px solid #fff;
  padding: 20px;
  min-width: 0;
  align-self: start;
  background: #000;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
  justify-content: space-between;
}
.tabs button {
  position: relative;
  flex: 1;
  padding: 10px 4px;
  font-size: 22px;
  border-width: 3px;
}
.tabs button.active { border-color: #ffff00; color: #ffff00; }
.tabs button.active:hover { background: #ffff00; color: #000; }

.panel > label, .panel > .two, .panel > details { margin-bottom: 20px; }

label {
  display: block;
  font-size: 21px;
  line-height: 1.3;
  color: #fff;
}
input:not([type="range"]):not([type="checkbox"]):not([type="file"]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  border: 2px solid #aaa;
  background: #000;
  color: #fff;
  padding: 7px 9px;
  margin-top: 8px;
}
input::placeholder, textarea::placeholder { color: #777; opacity: 1; }
textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.35;
}
select {
  padding-right: 4px;
  min-height: 40px;
  font-size: 20px;
}
option { background: #000; color: #fff; }

.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.two > label {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.optional { font-size: 16px; color: #999; }

details { margin-top: 22px; }
summary {
  cursor: pointer;
  font-size: 22px;
  line-height: 1.35;
  margin-bottom: 16px;
  color: #fff;
}
summary:hover { color: #ffff00; }

.align-bottom {
  align-self: end;
  padding: 8px;
  font-size: 17px;
  min-height: 40px;
  border-width: 2px;
}

.settings > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
  padding: 8px 15px;
  list-style: none;
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.settings > summary::-webkit-details-marker { display: none; }
.settings > summary:hover, .settings[open] > summary { background: #fff; color: #000; }
.settings-body {
  border: 4px solid #fff;
  padding: 16px;
  margin-top: 10px;
}
.settings-body label + label { margin-top: 20px; }

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 22px;
  padding: 0;
  border: 4px solid #fff;
  background: #000;
  margin: 12px 0 3px;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 14px;
  background: #fff;
  border: 0;
  border-radius: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 14px;
  background: #fff;
  border: 0;
  border-radius: 0;
}
output {
  float: right;
  color: #fff;
  font-size: 19px;
}

.upload {
  border: 4px solid #fff;
  text-align: center;
  padding: 28px 8px;
  position: relative;
  cursor: pointer;
  margin-bottom: 26px !important;
}
.upload:hover, .upload.over { border-color: #ffff00; color: #ffff00; }
.upload strong {
  display: block;
  font-size: 25px;
  font-weight: 400;
  margin-bottom: 12px;
}
.upload span {
  display: block;
  font-size: 19px;
  color: #aaa;
}
.upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.section-line {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 24px;
}

h2 {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 400;
  margin: 0 0 5px;
}

.section-line p {
  font-size: 18px;
  color: #aaa;
  margin: 0;
}
.section-line > button {
  font-size: 19px;
  white-space: nowrap;
  padding: 9px 12px;
  border-width: 3px;
}

.effect {
  padding: 15px;
  border: 3px solid #fff;
  margin-bottom: 22px;
}
.effect-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 10px;
}
.effect-head > span { font-size: 21px; color: #ffff00; }
.effect-head button {
  padding: 5px 8px;
  font-size: 17px;
  border-width: 2px;
  color: #aaa;
  border-color: #777;
}

.effect > label, .effect > .two { margin-bottom: 15px; }

.cost-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.cost-row select { margin: 0; min-width: 0; }
.cost-row button { padding: 4px 11px; border-width: 2px; }
.cost-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.cost-chips button {
  font-size: 16px;
  padding: 4px 6px;
  border-width: 2px;
}

.workspace {
  position: sticky;
  top: 22px;
  align-self: start;
  min-width: 0;
  height: calc(100dvh - 150px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
  gap: 12px;
  background: #000;
}
.stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.card-wrap, .card-wrap.landscape {
  width: min(100%, 470px);
  flex: none;
  max-height: none;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}
canvas:active { cursor: grabbing; }

.preview-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  margin: 0;
}
.preview-bottom button {
  flex: none;
  font-size: 19px;
  border-width: 3px;
  padding: 8px 14px;
}

.notice {
  font-size: 18px;
  color: #aaa;
  min-height: 0;
  margin: 0;
  text-align: center;
  max-width: 650px;
}
.notice:empty { display: none; }

.warning {
  flex: 1 1 230px;
  font-size: 18px;
  padding: 10px 12px;
  border: 3px solid #ffff00;
  color: #ffff00;
  min-width: 0;
  max-width: 650px;
  margin: 0;
  background: #000;
}

[hidden] { display: none !important; }

@media (min-width: 1450px) {
  main { grid-template-columns: 470px minmax(0, 1fr); gap: 45px; }
  .editor { padding: 24px; }
  .brand { font-size: 40px; }
  .header-actions button { font-size: 24px; }
}

@media (max-width: 1100px) {
  .topbar { padding: 20px; gap: 20px; }
  .brand { font-size: 31px; }
  .header-actions { gap: 8px; }
  .header-actions button { font-size: 18px; padding: 8px 10px; }
  main {
    grid-template-columns: 375px minmax(0, 1fr);
    padding: 20px;
    gap: 20px;
  }
  .editor { padding: 16px; }
  .tabs { gap: 6px; }
  .tabs button { font-size: 20px; }
  .two { gap: 10px; }
  .align-bottom { font-size: 16px; }
  .brand .soul { width: 28px; height: 28px; }
}

@media (max-width: 800px) {
  .header-actions {
    margin: 0;
    width: 100%;
    justify-content: stretch;
  }
  .header-actions button { flex: 1; }
  .brand { font-size: 33px; white-space: normal; }
  main {
    display: flex;
    flex-direction: column;
    padding: 18px;
    gap: 24px;
  }
  .workspace {
    order: -1;
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-rows: minmax(0, min(65dvh, 650px)) auto auto;
  }
  .stage { padding: 0; }
  .editor {
    width: 100%;
    padding: 20px;
    align-self: stretch;
  }
  .preview-bottom button { font-size: 18px; }
  .notice { font-size: 17px; }
  .tabs button { font-size: 24px; }
}

@media (max-width: 420px) {
  .topbar { padding: 16px; }
  .brand { font-size: 27px; gap: 12px; }
  .soul { width: 24px; height: 24px; }
  .header-actions button {
    font-size: 16px;
    padding: 8px 5px;
    border-width: 3px;
  }
  main { padding: 12px; }
  .editor { padding: 14px; border-width: 4px; }
  .tabs button { font-size: 20px; }
  .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  label { font-size: 19px; }
  select { font-size: 18px; }
  .section-line h2 { font-size: 22px; }
  .section-line > button { font-size: 17px; }
}

@media (max-width: 800px) {
  .volume-control {
    width: 100%;
    grid-template-columns: auto minmax(80px, 1fr) auto;
    gap: 12px;
  }
  .volume-control label { grid-column: 1; grid-row: 1; }
  .volume-control input[type="range"] { grid-column: 2; grid-row: 1; }
  .volume-control output { grid-column: 3; grid-row: 1; }
}
