@font-face {
  font-family: "Inter Display";
  src: url("assets/fonts/InterDisplay-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Inter Display";
  src: url("assets/fonts/InterDisplay-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "Inter Display";
  src: url("assets/fonts/InterDisplay-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-style: normal;
}

body {
  background: #e7e7e7;
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: "Inter Display", Arial, Helvetica, sans-serif;
  color: #171717;
}

#canvasStage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 54px 132px 64px;
  overflow: hidden;
  background: #e7e7e7;
}

#canvasWrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  border: 0;
}

#controls {
  width: 360px;
  min-width: 360px;
  background: #ffffff;
  border-right: 1px solid #eeeeee;
  padding: 34px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 12px 0 24px rgba(0, 0, 0, 0.04);
  z-index: 2;
}

#controls h1 {
  font-size: 15px;
  letter-spacing: 0;
  color: #222;
  padding-bottom: 0;
  border-bottom: 0;
  font-weight: 700;
}

#ui {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 14px;
  letter-spacing: 0;
  color: #303030;
  margin-top: 0;
  font-weight: 700;
}

.ctrl {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ctrl label {
  font-size: 13px;
  color: #7a7a7a;
  letter-spacing: 0;
  font-weight: 700;
}

.val {
  font-size: 13px;
  color: #777;
  min-width: 44px;
  text-align: right;
}

.ctrl input[type="text"],
.ctrl input[type="number"],
.ctrl select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #dadada;
  color: #111;
  padding: 9px 11px;
  font-family: "Inter Display", Arial, Helvetica, sans-serif;
  font-size: 13px;
  outline: none;
  border-radius: 999px;
}

.ctrl input[type="file"] {
  width: 100%;
  color: #7a7a7a;
  font-family: "Inter Display", Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.ctrl input[type="file"]::file-selector-button {
  margin-right: 8px;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  padding: 9px 16px;
  font-family: "Inter Display", Arial, Helvetica, sans-serif;
  font-size: 16px;
  cursor: pointer;
}

.ctrl input[type="text"]:focus,
.ctrl input[type="number"]:focus,
.ctrl select:focus {
  border-color: #b5b5b5;
}

.ctrl input[type="range"] {
  width: 100%;
  accent-color: #ff48dd;
  height: 2px;
  background: #d9d9d9;
  border: none;
  outline: none;
  cursor: pointer;
}

.ctrl input[type="color"] {
  width: 34px;
  height: 26px;
  border: 1px solid #dadada;
  background: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 999px;
}

.divider {
  border: 0;
  border-top: 1px solid #eeeeee;
}

.hint,
.status {
  margin-top: 2px;
  font-size: 13px;
  color: #9a9a9a;
  letter-spacing: 0;
  line-height: 1.35;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.save-btn,
.secondary-btn,
.choice-btn {
  background: #ffffff;
  border: 1px solid #dcdcdc;
  color: #111;
  padding: 10px 16px;
  font-family: "Inter Display", Arial, Helvetica, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  flex: 1 1 120px;
}

.choice-btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
}

.save-btn:hover,
.secondary-btn:hover,
.choice-btn:hover {
  background: #f2f2f2;
  border-color: #c8c8c8;
}

.save-btn:active,
.secondary-btn:active,
.choice-btn:active {
  background: #ffffff;
  border-color: #999;
}

.choice-btn.active {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

.color-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.color-btn {
  height: 38px;
  border: 2px solid #e1e1e1;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
}

.color-btn:hover {
  border-color: #9d9d9d;
}

.color-btn.active {
  border-color: #111111;
  box-shadow: 0 0 0 2px #ffffff inset;
}

.floating-actions {
  position: absolute;
  right: 24px;
  display: flex;
  gap: 4px;
  z-index: 3;
}

.top-actions {
  top: 13px;
}

.bottom-actions {
  bottom: 21px;
}

.floating-actions button {
  min-width: 95px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #050505;
  font-family: "Inter Display", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.18s ease, background 0.18s ease;
}

.floating-actions button:hover {
  background: #f7f7f7;
  transform: translateY(-1px);
}

.floating-actions button:active {
  transform: translateY(0);
}

.floating-actions .dark-pill {
  background: #000000;
  color: #ffffff;
  font-size: 16px;
}

.floating-actions .dark-pill:hover {
  background: #151515;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  #controls {
    width: 100%;
    min-width: 0;
    border-right: 0;
    border-top: 1px solid #eeeeee;
    max-height: 45vh;
  }

  #canvasStage {
    min-height: 55vh;
    padding: 76px 18px 86px;
  }

  .floating-actions {
    right: 18px;
  }

  .floating-actions button {
    min-width: 78px;
    height: 42px;
    font-size: 16px;
  }
}
