* {
  box-sizing: border-box;
}

:root {
  --orange-main: #ffa011;
  --orange-bright: #ffb22f;
  --orange-dark: #ce7b00;
  --brown-deep: #7a4300;
  --panel-dark: #202530;
  --panel-dark-hover: #2a3140;
  --download: #111827;
  --download-hover: #1f2937;
  --text-light: #f3f4f6;
  --text-soft: #fff2dc;
  --error-soft: #ffd1d1;
  --canvas-bg: #0d1015;
  --sticker-height-desktop: 180px;
  --sticker-height-mobile: 145px;
  --site-max-width: 1600px;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--orange-main);
  color: var(--text-light);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  display: flex;
  justify-content: center;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app {
  width: 100%;
  max-width: var(--site-max-width);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* main mag gewoon meegroeien */
.main {
  display: flex;
  flex-direction: column;
}

.save-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.save-overlay-inner {
  width: 100%;
  max-width: 720px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.save-close-btn {
  align-self: flex-end;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: #202530;
  color: #fff;
  cursor: pointer;
}

.save-overlay-text {
  margin: 0;
  color: #fff2dc;
  font-size: 14px;
  text-align: center;
}

.save-preview-image {
  max-width: 100%;
  max-height: 78dvh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  background: #111;
}

/* BANNER */

.top-banner {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 18px 42px;
  background: linear-gradient(
    180deg,
    rgba(255, 178, 47, 0.92) 0%,
    rgba(255, 160, 17, 0.72) 55%,
    rgba(255, 160, 17, 0.18) 100%
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.logo-banner {
  width: min(100%, 1200px);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter:
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 25px rgba(255, 160, 17, 0.55));
  opacity: 0.98;
  object-fit: contain;
}

.banner-links {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: calc(100% - 24px);
}

.banner-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  background: rgba(32, 37, 48, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.banner-links a:hover {
  background: rgba(32, 37, 48, 0.52);
  color: #ffffff;
}

.banner-links a:active {
  transform: translateY(1px);
}

/* TOOLBAR */

.toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--orange-main) 0%, #f49800 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.toolbar-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn,
.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel-dark);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

.btn:hover,
.file-label:hover {
  background: var(--panel-dark-hover);
}

.btn:active,
.file-label:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-download {
  background: var(--download);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-download:hover {
  background: var(--download-hover);
}

.hidden-input {
  display: none;
}

.muted {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.4;
}

.error {
  color: var(--error-soft);
  font-size: 13px;
  line-height: 1.4;
}

/* CANVAS */
/* Geen vaste hoogte meer, geen interne scroll meer */
.canvas-area {
  padding: 12px;
  display: block;
  overflow: visible;
  background:
    linear-gradient(45deg, var(--orange-main) 25%, transparent 25%),
    linear-gradient(-45deg, var(--orange-main) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--orange-dark) 75%),
    linear-gradient(-45deg, transparent 75%, var(--orange-dark) 75%);
  background-size: 32px 32px;
  background-position: 0 0, 0 16px, 16px -16px, -16px 0;
}

.canvas-frame {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--canvas-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  overflow: visible;
}

#editorCanvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

/* STICKERS */
/* Niet meer geforceerd vast onderin in viewport, gewoon blok onder de editor */
.stickers-bottom {
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, var(--orange-dark) 0%, var(--brown-deep) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stickers-header {
  text-align: center;
  margin-bottom: 10px;
}

.stickers-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.06em;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.thumb-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1b2130;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  color: #fff;
  text-align: left;
  transition: background 0.15s ease, transform 0.15s ease;
}

.thumb-btn:hover {
  background: #252d40;
}

.thumb-btn:active {
  transform: translateY(1px);
}

.thumb-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.thumb-name {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.2;
  word-break: break-word;
  color: #d4d9e2;
}

.empty-state {
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f7e4c6;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 768px) {
  .top-banner {
    padding: 10px 10px 40px;
  }

  .logo-banner {
    width: min(100%, 92vw);
  }

  .banner-links {
    gap: 8px;
    bottom: 6px;
    max-width: calc(100% - 16px);
  }

  .banner-links a {
    min-height: 26px;
    padding: 0 10px;
    font-size: 11px;
  }

  .toolbar {
    padding: 10px 10px 12px;
    gap: 7px;
  }

  .toolbar-group {
    gap: 6px;
  }

  .btn,
  .file-label {
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .canvas-area {
    padding: 10px;
  }

  .thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 8px;
  }

  .thumb-name {
    font-size: 10px;
  }
}