:root {
  --ink: #525b58;
  --radius: 22px;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  --card-white: rgba(255, 255, 255, 0.92);
  --card-peach: rgba(255, 239, 233, 0.88);
}

/* Reset */
* {
  box-sizing: border-box;
}

/* ===== PAGE BACKGROUND ===== */
body {
  margin: 0;
  font-family: "Raleway", sans-serif;
  color: var(--ink);

  /* texture.png at ~25% scale, repeating */
  background-image: url("texture.png");
  background-repeat: repeat;
  background-size: 25%;

  background-color: #f7f4f2;
}

/* ===== MAIN LAYOUT ===== */
.app {
  max-width: 1240px;
  margin: 40px auto;
  padding: 24px;

  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: stretch;
}

/* ===== CARDS ===== */
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  display: flex;
  flex-direction: column;
  height: 760px; /* lock equal heights */
}

.tester-card {
  background: var(--card-white);
}

.controls-card {
  background: var(--card-peach);
}

/* ===== TESTER DROP ZONE ===== */
.drop-zone {
  position: relative;
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;

  /* Background pattern inside tester */
  background-image: url("bg-tile.png");
  background-repeat: repeat;
  background-position: center;

  /* DOUBLED scale */
  background-size: 70%;
}

.drop-zone input {
  display: none;
}

.drop-text {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  z-index: 2;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
}

/* ===== CONTROLS CARD ===== */
.studio-header {
  width: 100%;
  display: block;
  margin-bottom: 6px;
}

.subtitle {
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.intro,
.steps,
.meta p {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Scale */
.scale-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 8px;
}

input[type="range"] {
  width: 100%;
}

/* Divider */
.divider {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 16px 0 6px;
}

/* Repeat controls */
.repeat-row {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.repeat-col {
  flex: 1;
}

label {
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}

select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-family: inherit;
  font-weight: 400;
  background: rgba(255, 255, 255, 0.92);
}

/* Buttons */
.button-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

button {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
}

button.primary {
  background: #8ebabb;
  color: #1f2a28;
}

/* Footer text + logo */
.meta {
  margin-top: 10px;
  font-size: 12px;
}

.logo {
  width: 10%;
  max-width: 56px;
  margin: auto auto 0;
  display: block;
  opacity: 0.9;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .card {
    height: auto;
    min-height: 640px;
  }
}
