* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Cormorant Unicase", serif;
  background: #ffffc9;
  touch-action: manipulation;
}

body:not(.landing) {
  background: #ffffc9;
  touch-action: manipulation;
}

.landing {
  background: #a30002;
  color: #ffffc9;

  width: 100vw;
  height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

.start-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.toolbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);

  display: grid;
  grid-template-columns: repeat(5, 1fr);  /* 👈 5 columns */
  grid-template-rows: repeat(2, auto);    /* 👈 2 rows */

  gap: 12px;

  padding: 16px;

  width: 520px;        /* 👈 IMPORTANT (gives space for 5 columns) */
  max-width: 95vw;

  background: rgba(255,255,201,0.35);
  backdrop-filter: blur(14px);

  border-radius: 40px;

  box-shadow: 0 12px 30px rgba(0,0,0,0.12);

  z-index: 1000;

  justify-items: center;
  align-items: center;
}

/* FIRST ROW */
.toolbar button:nth-child(1) { grid-column: 1; grid-row: 1; }
.toolbar button:nth-child(2) { grid-column: 2; grid-row: 1; }
.toolbar button:nth-child(3) { grid-column: 3; grid-row: 1; }
.toolbar button:nth-child(4) { grid-column: 4; grid-row: 1; }
.toolbar button:nth-child(5) { grid-column: 5; grid-row: 1; }

/* SECOND ROW (CENTERED) */
.toolbar button:nth-child(6) { grid-column: 2; grid-row: 2; }
.toolbar button:nth-child(7) { grid-column: 3; grid-row: 2; }
.toolbar button:nth-child(8) { grid-column: 4; grid-row: 2; }
.toolbar button:nth-child(9) { grid-column: 5; grid-row: 2; }

.toolbar::after {
  content: "";
}

.toolbar button {
  background: transparent;
  border: none;

  font-family: "Cormorant Unicase", serif;
  font-size: 13px;
  color: #a30002;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4px;

  padding: 6px;

  cursor: pointer;

  width: 100%;   /* 👈 fill grid cell */
}

.toolbar button span {
  display: block;
  text-align: center;
}

.toolbar button span:first-child {
  font-size: 16px;
}

.toolbar button span:last-child {
  font-size: 12px;
}

.toolbar button:hover {
  background: rgba(163, 0, 2, 0.1);
  border-radius: 20px;
  transform: scale(1.05);
}

.container {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
}

.panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);

  width: 90%;
  max-height: 40vh;
  overflow-y: auto;

  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px);

  border-radius: 20px;
  padding: 15px;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;

  z-index: 999;
}

.panel img {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.panel img:hover {
  transform: scale(1.05);
}

.hidden {
  display: none;
}


@media (max-width: 600px) {
  .toolbar {
    gap: 10px;
    padding: 10px 14px;
  }

  .toolbar button {
    font-size: 14px;
    padding: 6px 8px;
    flex: 1 1 40%;   
  }
}

@media (max-width: 600px) {
  .title {
    font-size: 20vw; 
  }

  .start-btn {
    width: 70%;
  }
}

#canvas {
  width: 95vw;
  max-width: 400px;
  height: calc(100vh - 100px);
  margin-top: 80px;
  background: #ffffc9;

  display: block;
}


.item.selected {
  outline: 2px dashed #a30002;
}


.item {
  position: absolute;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  pointer-events: none; /* VERY IMPORTANT */
}

.item div {
  font-size: clamp(14px, 4vw, 20px);
}

.delete-btn {
  width: 20px;
  height: 20px;
  font-size: 12px;
  border-radius: 50%;
}

html {
  font-size: 18px; /* base size boost */
}

.text-controls {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  align-items: center;

  gap: 8px;

  padding: 8px 10px;

  background: rgba(255,255,201,0.5);
  backdrop-filter: blur(12px);

  border-radius: 40px;

  box-shadow: 0 8px 25px rgba(0,0,0,0.08);

  z-index: 2000;
}

.text-controls > * {
  height: 32px;
  display: flex;
  align-items: center;
}

.text-controls input[type="range"] {
  width: 90px;

  accent-color: #a30002;

  background: transparent;
}

.text-controls select,
.text-controls input[type="color"] {
  border: none;
  outline: none;

  height: 32px;

  padding: 0 10px;

  border-radius: 20px;

  background: rgba(255,255,255,0.7);

  font-family: "Cormorant Unicase", serif;
}

.text-controls button {
  border: none;

  height: 32px;
  min-width: 32px;

  border-radius: 50%;

  background: rgba(255,255,255,0.7);

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
}

.text-controls button:hover {
  background: rgba(163,0,2,0.15);
}

.text-controls button:hover {
  background: rgba(163,0,2,0.1);
}

.item div {
  padding: 4px 8px;
  border-radius: 6px;
}

/* hide initially */
.hidden {
  display: none;
}

.text-controls input,
.text-controls select {
  border: none;
  outline: none;

  background: rgba(255,255,255,0.6);

  padding: 6px 10px;
  border-radius: 10px;

  font-family: "Cormorant Unicase", serif;
}




@media (max-width: 600px) {
  html {
    font-size: 20px; /* BIGGER on phones */
  }
}

/* ===== LANDING PAGE FIX ===== */

body.landing {
  margin: 0;
  height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 👈 spreads nicely */

  background: #a30002;
  color: #ffffc9;

  font-family: "Cormorant Unicase", serif;
}

/* CENTER TITLE + BUTTON */
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  margin-top: 60px;
  gap: 18px;
}

/* TITLE */
.title {
  font-size: 112px;
  letter-spacing: 2px;
  text-align: center;
}

/* BUTTON */
.start-btn {
  background: #ffffc9;
  color: #a30002;

  border: none;
  border-radius: 8px;

  padding: 12px 26px;
  font-size: 60px;

  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  font-family: "Cormorant Unicase", serif;
}

/* IMAGE */
.hero-img {
  width: 900px;   /* 👈 BIGGER */
  max-width: 80%;

  display: block;
  margin: 30px auto;

  /* filter: drop-shadow(0 15px 25px rgba(0,0,0,0.25)); */
}

/* FOOTER */
footer {
  text-align: center;
  padding-bottom: 15px;
}

/* FOOTER TEXT */
footer p {
  font-size: 60px;
  margin-bottom: 8px;
}

/* SOCIAL LINKS */
.socials a {
  font-size: 50px;
  margin: 0 12px;
  color: #ffffc9;
  text-decoration: none;
}

.socials a:hover {
  opacity: 0.7;   
}