* {
  box-sizing: border-box;
}

:root {
  --background: #101011;
  --panel: #1b1b1d;
  --field: #252527;
  --text: #f4f1eb;
  --muted: #aaa6a0;
  --accent: #d7b787;
  --border: rgba(255, 255, 255, 0.13);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 2px 22px;
}

.brand {
  margin: 0;
  color: var(--accent);
  font-family: Georgia, serif;
  letter-spacing: 0.34em;
}

h1 {
  margin: 4px 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
}

.tagline {
  margin: 0;
  color: var(--muted);
}

.preview-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.38);
}

.room {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-image: url("./assets/gallery8-room-background.png");
  background-size: cover;
  background-position: center;
}

.artwork {
  position: absolute;
  left: 51%;
  top: 28%;
  width: 22%;
  min-width: 45px;
  min-height: 45px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 3;
}

.artwork:active {
  cursor: grabbing;
}

.artwork img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.upload-prompt {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 115px;
  border: 2px dashed rgba(40, 34, 28, 0.25);
  color: #665f56;
  background: rgba(255, 255, 255, 0.72);
}

.artwork.frame-black,
.artwork.frame-oak,
.artwork.frame-white {
  padding: var(--float-gap, 4px);
  background: #f4f1ea;
}

.artwork.frame-black {
  border: var(--frame-profile, 5px) solid #171717;
}

.artwork.frame-oak {
  border: var(--frame-profile, 5px) solid #b88a58;
  box-shadow:
    inset 0 0 0 1px rgba(65, 39, 18, 0.18),
    0 14px 28px rgba(0, 0, 0, 0.26);
}

.artwork.frame-white {
  border: var(--frame-profile, 5px) solid #f7f7f4;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 14px 28px rgba(0, 0, 0, 0.22);
}

.preview-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  color: rgba(34, 29, 24, 0.75);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  font-size: 0.82rem;
}

.controls-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.primary-button {
  color: #17130f;
  background: var(--accent);
  border-color: transparent;
  font-weight: 700;
}

.secondary-button {
  color: var(--text);
  background: transparent;
}

.file-button {
  cursor: pointer;
}

.file-button input {
  display: none;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #d8d4ce;
  font-size: 0.92rem;
}

input[type="number"],
select {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 13px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.instructions {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 760px) {
  .app {
    padding: 10px;
  }

  .header {
    align-items: center;
  }

  .tagline {
    font-size: 0.88rem;
  }

  .room {
    aspect-ratio: 4 / 5;
    background-position: 30% center;
  }

  .input-grid {
    grid-template-columns: 1fr 1fr;
  }

  .range-grid {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    padding: 16px;
  }
}
