:root {
  --red: #e50914;
  --red-dark: #8f0710;
  --gold: #f5c451;
  --black: #111111;
  --white: #fff;
  --muted: #6b7280;
  --card: #ffffff;
  --bg: #f5f1ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #181818;
  background:
    radial-gradient(circle at 8% 0%, rgba(229, 9, 20, .10), transparent 30%),
    radial-gradient(circle at 95% 15%, rgba(245, 196, 81, .16), transparent 28%),
    linear-gradient(135deg, #fff 0%, var(--bg) 100%);
}

.app { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 20px; }

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--white);
  border-radius: 22px;
  padding: 28px 32px;
  background:
    radial-gradient(circle at 90% 0%, rgba(245,196,81,.30), transparent 25%),
    linear-gradient(120deg, #65040a 0%, #c90914 48%, #8c0610 100%);
  box-shadow: 0 18px 45px rgba(92, 10, 16, .22);
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -120px;
  width: 330px;
  height: 330px;
  border: 2px solid rgba(255,255,255,.16);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(255,255,255,.05), 0 0 0 36px rgba(245,196,81,.08);
}

.hero-badge {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 50%;
  background: #fff;
  color: var(--red);
  font-size: .67rem;
  line-height: 1.1;
  font-weight: 950;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

.hero > div:last-child { position: relative; z-index: 1; }
.eyebrow { display: inline-block; font-weight: 900; font-size: .78rem; letter-spacing: .14em; color: var(--gold); }
h1 { margin: 7px 0 5px; font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: .02em; }
.hero p { margin: 0; opacity: .88; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; margin-top: 22px; }
.preview-card, .panel { background: var(--card); border-radius: 20px; box-shadow: 0 12px 35px rgba(35, 19, 19, .11); }
.preview-card { padding: 16px; }
.preview-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 2px 4px 13px; }
.preview-title span { font-size: .78rem; font-weight: 950; letter-spacing: .12em; color: var(--red); }
.preview-title small { color: var(--muted); font-size: .72rem; }

.canvas-wrap { position: relative; width: min(100%, 760px); margin: auto; overflow: hidden; border-radius: 14px; background: #130507; line-height: 0; user-select: none; touch-action: none; -webkit-user-select: none; }
canvas { display: block; width: 100%; height: auto; cursor: grab; }
canvas.dragging { cursor: grabbing; }

.empty-state {
  border: 1px solid rgba(255,255,255,.20);
  font: inherit;
  cursor: pointer;
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 4px;
  text-align: center;
  padding: 16px 20px;
  color: white;
  background: rgba(28, 3, 6, .86);
  border-radius: 14px;
  line-height: 1.3;
  pointer-events: auto;
  z-index: 5;
  touch-action: manipulation;
}
.empty-state strong { color: #fff; }
.empty-state span { font-size: .82rem; opacity: .75; }

.panel { padding: 22px; }
.upload-box { padding: 18px; text-align: center; border: 2px dashed #e4b6b9; border-radius: 15px; background: #fff8f8; }
.upload-icon { width: 38px; height: 38px; display: grid; place-items: center; margin: 0 auto 9px; border-radius: 50%; background: #ffe2e4; color: var(--red); font-weight: 950; }
.upload-box p { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }
.top-download { width: 100%; margin-top: 9px; }

button { border: 0; border-radius: 11px; padding: 12px 15px; font: inherit; font-weight: 850; cursor: pointer; transition: transform .15s, filter .15s, opacity .15s; }
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.03); }
button:disabled { cursor: not-allowed; opacity: .45; }
.primary { width: 100%; color: white; background: linear-gradient(135deg, #ee1a25, #a80811); }
.controls { margin-top: 23px; }
.controls label { display: flex; justify-content: space-between; margin: 15px 0 7px; font-size: .85rem; font-weight: 750; }
.controls output { color: var(--red); font-weight: 900; }
input[type="range"] { width: 100%; accent-color: var(--red); }
.hint { display: grid; gap: 4px; margin-top: 22px; padding: 13px; border-radius: 12px; background: #faf1f1; color: #62545a; font-size: .78rem; line-height: 1.45; }
.hint strong { color: #731018; }
.actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 9px; margin-top: 20px; }
.secondary { background: #f0e8e8; color: #4a1e22; }
.download { background: linear-gradient(135deg, #f5c451, #dca01c); color: #281b00; }

.signature { margin: 18px 0 0; padding: 14px 18px; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; border-radius: 15px; background: linear-gradient(90deg, #fff, #fff8e8, #fff); border: 1px solid #ecd8b2; text-align: center; }
.signature strong { color: var(--red); letter-spacing: .08em; }
.signature span { color: #725f43; font-size: .78rem; }

footer { text-align: center; color: #71809a; font-size: .72rem; line-height: 1.6; padding: 18px 0 4px; }
footer a { color: #a40812; text-decoration: none; font-weight: 700; }
footer a:hover { text-decoration: underline; }

@media (max-width: 860px) { .workspace { grid-template-columns: 1fr; } .panel { width: 100%; } }
@media (max-width: 500px) {
  .app { width: min(100% - 14px, 1180px); padding-top: 10px; }
  .hero { border-radius: 16px; padding: 20px; }
  .hero-badge { width: 58px; height: 58px; font-size: .55rem; }
  .preview-card { padding: 8px; }
  .preview-title { display: grid; gap: 3px; }
  .panel { padding: 16px; }
}

.rotate-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rotate-buttons button { padding: 9px 10px; font-size: .82rem; }


/* Tombol berbagi media sosial */
.share {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #eef3ff;
  color: #183b8f;
  transition: transform .15s ease, opacity .15s ease;
}

.share:hover:not(:disabled) {
  transform: translateY(-1px);
}

.share:disabled {
  opacity: .45;
  cursor: not-allowed;
}
