:root {
  --bg: #1c1c1c;
  --panel: #a8a8a8;
  --panel-dark: #8f8f8f;
  --text: #222;
  --accent: #e8531f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: #eee;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: #141414;
  border-bottom: 1px solid #333;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.subtitle {
  font-size: 0.8rem;
  color: #999;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  align-items: flex-start;
}

.preview {
  flex: 1 1 640px;
  min-width: 320px;
}

.canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #050505;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  border: 1px solid #333;
}

.tile {
  position: absolute;
  overflow: hidden;
}

.tile-text {
  top: 6%;
  left: 4%;
  max-width: 55%;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.line-kicker { font-size: clamp(0.7rem, 1.4vw, 1rem); letter-spacing: 0.05em; font-weight: 600; }
.line-title  { font-size: clamp(1.6rem, 4.2vw, 3.2rem); font-weight: 800; line-height: 1.05; }
.line-time   { font-size: clamp(1rem, 2vw, 1.4rem); font-weight: 500; }

.tile-drop {
  background: rgba(30,30,30,0.55);
  border: 1px dashed rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  text-align: center;
  cursor: pointer;
}
.tile-drop.dragover { border-color: var(--accent); color: #fff; }
.tile-drop img.dropImg {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile-drop.hasImage .dropLabel { display: none; }
.tile-drop.hasImage img.dropImg { display: block; }

#tileB { top: 6%;  right: 4%;  width: 34%; height: 32%; }
#tileC { bottom: 6%; left: 4%; width: 30%; height: 30%; }
#tileD { bottom: 6%; right: 4%; width: 30%; height: 30%; }

.hint {
  color: #777;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.sidebar {
  flex: 0 0 300px;
  background: var(--panel);
  color: var(--text);
  padding: 1rem;
  border-radius: 4px;
}

.field {
  margin-bottom: 0.85rem;
}
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
  color: #333;
}
.field input[type="text"],
.field input[type="range"] {
  width: 100%;
}
.field input[type="text"] {
  padding: 0.35rem 0.4rem;
  border: 1px solid #777;
  border-radius: 2px;
  font-family: monospace;
  background: #fff;
}
.field select {
  width: 100%;
  font-family: inherit;
  border: 1px solid #777;
  border-radius: 2px;
}

.swatchRow {
  display: flex;
  gap: 0.35rem;
}
.swatch {
  flex: 1;
  aspect-ratio: 1;
  border: 2px solid rgba(0,0,0,0.25);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.swatch.active {
  outline: 2px solid #111;
  outline-offset: 2px;
}

hr {
  border: none;
  border-top: 1px solid #999;
  margin: 1rem 0;
}
