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

body {
  background: #f0f0f0;
  font-family: monospace;
  padding: 24px;
  overflow-y: hidden;
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(1280px, calc((100vh - 180px) * 1280 / 720));
  margin: 0 auto;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

h1 {
  font-size: 2rem;
  color: #222;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 52px;
  margin: 0;
  padding: 0 16px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 18px;
  flex-wrap: wrap;
  margin-left: auto;
}

.toolbar-label {
  font-size: 1rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toolbar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}
.toolbar-circle:hover { transform: scale(1.15); }

.colour-swatch {
  border: 3px solid transparent;
}
.colour-swatch.active {
  border-color: #222;
  box-shadow: 0 0 0 2px #f0f0f0, 0 0 0 4px #222;
}

.divider { width: 1px; height: 28px; background: #ddd; }

.eraser-toggle {
  border: 3px dotted #ccc;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 0;
}

input[type=range] {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
}

.canvas-container {
  position: relative;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* Caption bar — overlaid on the bottom 48px of the 720px canvas (6.667%). */
#captionPreview {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6.667%;
  background: #80CBC4;
  color: #000;
  font-weight: bold;
  font-size: clamp(9px, 1.4vw, 18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1em;
  overflow: hidden;
  white-space: nowrap;
}
#captionPreview .caption-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  outline: none;
  cursor: text;
  color: #000;
}
#captionPreview .caption-text:empty::before {
  content: attr(data-placeholder);
  color: rgba(0,0,0,0.35);
}

#captionPreview .caption-datetime { flex-shrink: 0; padding-left: 1em; opacity: 0.8; pointer-events: none; }

#drawCanvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  background: #fff;
}


button {
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 40px;
  height: 52px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #fff;
  color: #333;
  transition: background 0.15s, border-color 0.15s;
}
button:hover { background: #f5f5f5; border-color: #999; }

button.primary {
  background: #222;
  color: #fff;
  border-color: #222;
}
button.primary:hover { background: #444; border-color: #444; }

@media (max-width: 900px) {
  .header-row {
    flex-wrap: wrap;
  }
  .toolbar {
    margin-left: 0;
    width: 100%;
  }
}

#copyStatus {
  font-size: 0.85rem;
  color: #444;
  min-height: 20px;
  text-align: center;
}
