@font-face {
  font-family: Chicago;
  src: url("./assets/ChicagoKare-Regular.otf");
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: #eeeafa;
  background: #0c0919;
}
button,
input,
select {
  font: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button,
select {
  min-height: 36px;
  border: 2px solid;
  border-color: #06050e #615b78 #615b78 #06050e;
  background: #252039;
  color: #f4efff;
  padding: 6px 12px;
  border-radius: 0;
}
button:hover,
select:hover {
  background: #363049;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid #7bf4ff;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button[aria-pressed="true"],
.primary {
  color: #8cf7ff;
  border-color: #70dbe4 #16333c #16333c #70dbe4;
  background: #18333e;
}
input[type="range"] {
  accent-color: #65dae4;
  max-width: 180px;
}
input[type="number"] {
  width: 76px;
  background: #100d1c;
  color: #fff;
  border: 1px solid #655d7b;
  padding: 6px;
}
input[type="color"] {
  width: 40px;
  height: 30px;
  padding: 2px;
  border: 1px solid #605878;
  background: #171223;
}
input[type="checkbox"] {
  accent-color: #67e8f9;
}
label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
label:has(input[type="number"]) {
  flex-direction: column;
  align-items: start;
}
canvas {
  touch-action: none;
}
#app,
#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#canvas {
  outline: none;
}
[hidden] {
  display: none !important;
}
.window {
  border: 2px solid #797087;
  background: rgba(20, 15, 34, 0.96);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.38);
}
.titlebar {
  min-height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: repeating-linear-gradient(0deg, #262035 0 2px, #342a47 2px 4px);
  border-bottom: 2px solid #797087;
  font:
    13px Chicago,
    monospace;
  letter-spacing: 1px;
}
.titlebar button {
  min-height: 28px;
  padding: 2px 9px;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.gamebar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.gamebar button {
  min-height: 26px;
  padding: 3px 7px;
  font-size: 11px;
}
.wordmark {
  font:
    12px Chicago,
    monospace;
  letter-spacing: 1px;
  color: #21182d;
  margin-right: auto;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.8);
}
small {
  font: 9px Arial;
}
.tools {
  position: absolute;
  top: 42px;
  left: 8px;
  width: max-content;
  max-width: calc(100% - 16px);
  max-height: calc(100dvh - 96px);
  overflow: auto;
  border-width: 1px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.28);
}
.tool-content {
  display: grid;
  gap: 5px;
  padding: 5px;
}
.tools .row {
  gap: 4px;
}
.tools button,
.tools select {
  font-size: 11px;
  min-height: 24px;
  padding: 2px 6px;
  border-width: 1px;
}
.tools #lineType {
  width: 120px;
}
.tools label,
.tools summary {
  font-size: 10px;
  gap: 4px;
}
.tools input[type="range"] {
  width: 100px;
  margin: 0;
}
.tools input[type="number"] {
  width: 58px;
  padding: 3px;
  font-size: 11px;
}
.tools input[type="color"] {
  width: 28px;
  height: 24px;
}
#extraTools {
  max-width: 345px;
  border-top: 1px solid #514760;
  padding-top: 5px;
}
#extraTools details {
  margin-top: 5px;
}
#extraTools details .row {
  margin-top: 8px;
}
.game-footer {
  position: absolute;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.game-footer > * {
  pointer-events: auto;
}
#status,
#speed {
  font-size: 10px;
  color: #292035;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 6px;
}
#speed {
  margin-left: auto;
}
#playButton {
  min-width: 64px;
  min-height: 28px;
  padding: 3px 8px;
  font:
    13px Chicago,
    monospace;
}
.overlay {
  position: absolute;
  inset: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 90%, #482344 0, transparent 65%), #0c0919;
}
.cover-card {
  width: min(440px, 100%);
}
.cover-body {
  padding: 32px;
  display: grid;
  gap: 12px;
}
.version {
  font:
    12px Chicago,
    monospace;
  letter-spacing: 4px;
  color: #eb79ca;
}
h1 {
  font:
    clamp(26px, 6vw, 48px)/1.05 Chicago,
    monospace;
  margin: 6px 0;
  color: #f8edff;
  letter-spacing: 2px;
}
.cursor {
  color: #e974c8;
}
.large {
  font:
    18px Chicago,
    monospace;
  height: 48px;
}
#coverArt {
  width: 100%;
  height: 120px;
}
.back-link {
  color: #8bdde7;
  text-decoration: none;
  text-align: center;
  padding-top: 8px;
  font-size: 12px;
}
.creator-window {
  width: min(1050px, 100%);
}
.creator-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) minmax(220px, 1fr);
  gap: 24px;
  padding: 20px;
}
.editor-side {
  display: grid;
  gap: 12px;
}
.steps {
  display: flex;
  gap: 4px;
}
.steps button {
  flex: 1;
  padding: 6px;
}
#rigCanvas {
  display: block;
  width: min(100%, 480px);
  height: auto;
  justify-self: center;
  background: #181322;
  border: 2px solid #615772;
}
.creator-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.section-label {
  font:
    12px Chicago,
    monospace;
  color: #e888ca;
  letter-spacing: 2px;
}
#characterPreview {
  width: 100%;
  height: auto;
  background: #ebe7ed;
  border: 2px solid #615772;
}
.colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.colors label {
  justify-content: space-between;
}
.creator-settings > button {
  min-height: 42px;
}
.creator-settings > .row > button {
  flex: 1;
}
#creatorStatus {
  font-size: 12px;
  line-height: 1.5;
  min-height: 40px;
  color: #c4b7d5;
}
#frameControls label {
  flex: 1;
  flex-direction: column;
  align-items: start;
}
#frameControls input {
  width: 100%;
}
#accelerationControls {
  border-left: 2px solid #e25369;
  padding-left: 12px;
}
#redDirection {
  font-size: 12px;
  color: #fb9bb2;
}
.editor-side .row button {
  font-size: 12px;
}
@media (max-width: 650px) {
  .overlay {
    padding: 12px;
    align-items: flex-start;
  }
  .cover-card {
    margin: auto;
  }
  .creator-layout {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 20px;
  }
  .creator-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .creator-settings .section-label,
  .creator-settings #creatorStatus,
  .creator-settings #characterPreview {
    grid-column: 1/-1;
  }
  .creator-settings .colors {
    grid-column: 1/-1;
  }
  #characterPreview {
    max-height: 180px;
    object-fit: contain;
  }
  #rigCanvas {
    max-height: none;
  }
  .gamebar {
    gap: 4px;
  }
  .gamebar button {
    font-size: 11px;
    padding: 3px 5px;
  }
  .wordmark {
    font-size: 11px;
    padding: 4px;
  }
  .wordmark small {
    display: none;
  }
  .tools {
    top: 40px;
  }
  .row {
    gap: 6px;
  }
  .tools button,
  .tools select {
    font-size: 11px;
  }
  .game-footer {
    gap: 4px;
  }
  #status {
    max-width: 55%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  h1 {
    font-size: 52px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
