:root {
  --bg: #111117;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f8;
  --accent: #8be9fd;
  --accent-strong: #50fa7b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #1c1c23;
  background-color: #c8cfd6;
  background-image: url("./public/background-ghost.png");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-blend-mode: multiply;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

.top-brand {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(245, 248, 251, 0.94);
  border: 1px solid rgba(28, 28, 35, 0.08);
  box-shadow: 0 14px 30px rgba(28, 28, 35, 0.05);
}

.top-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.top-logo {
  width: 48px;
  max-height: 48px;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.app-shell {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px 32px;
}

header {
  margin-bottom: 30px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(236, 240, 245, 0.95);
  border: 1px solid rgba(28, 28, 35, 0.05);
  box-shadow: 0 14px 30px rgba(28, 28, 35, 0.04);
}

header h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 2.4vw, 3rem);
}

header p {
  margin: 0;
  color: #5b6170;
}

.controls {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 32px;
}

.file-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  width: 100%;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(28, 28, 35, 0.12);
  background: rgba(249, 250, 252, 0.96);
  color: #1b1b23;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.file-button:hover,
.action-button:hover {
  background: rgba(232, 236, 242, 1);
  border-color: rgba(28, 28, 35, 0.24);
}

.file-button input {
  display: none;
}

.action-button.secondary {
  background: rgba(239, 242, 247, 0.95);
  border-color: rgba(28, 28, 35, 0.14);
}

.action-button.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.preview-card {
  padding: 24px;
  border-radius: 28px;
  background: rgba(244, 246, 249, 0.96);
  border: 1px solid rgba(28, 28, 35, 0.07);
}

.preview {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 28px;
}

.photo-box {
  padding: 16px;
  border-radius: 24px;
  background: rgba(248, 249, 251, 0.98);
  border: 1px solid rgba(28, 28, 35, 0.07);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.photo-box span {
  margin-bottom: 12px;
  color: rgba(245, 245, 248, 0.7);
  font-weight: 700;
}

.photo-box img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.output-area {
  border-radius: 24px;
  padding: 18px;
  background: rgba(245, 247, 250, 0.96);
  border: 1px solid rgba(28, 28, 35, 0.07);
}

.output-area h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

#outputCanvas {
  width: 100%;
  height: auto;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(28, 28, 35, 0.06);
}

@media (max-width: 720px) {
  .preview {
    grid-template-columns: 1fr;
  }
}
