/* Penzlyk v2.3 — neo-brutal UI like Drukaryk (fullscreen canvas, toggle teal panel under purple) */

html,
body {
  height: 100%;
}

body {
  /* layout vars controlled by JS */
  --extra-top: 0px;
  /* where teal bar should start (below purple) */


  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background-image: radial-gradient(#000 8%, transparent 8%);
  background-size: 24px 24px;
  height: calc(var(--app-vh, 1vh) * 100);
  min-height: 100dvh;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
  /* no page scroll */
}

html.dark body {
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 8%, transparent 8%);
}

/* Neo buttons */
.neo-btn {
  border-radius: 1.25rem;
  border: 4px solid #000;
  box-shadow: 4px 4px 0px 0px #000;
  transition: all .12s cubic-bezier(.175, .885, .32, 1.275);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.neo-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px 0px #000;
}

.neo-btn.active {
  background-color: #000 !important;
  color: #fff !important;
}

html.dark .neo-btn.active {
  background-color: #fff !important;
  color: #000 !important;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Palette swatches */
.color-swatch {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 3px solid #000;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.color-swatch:hover {
  transform: scale(1.12);
}

.color-swatch.active {
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px #000;
  transform: scale(1.08);
}

html.dark .color-swatch.active {
  box-shadow: inset 0 0 0 3px #000, inset 0 0 0 6px #fff;
}

/* Range (size slider) */
.neo-range {
  width: 190px;
  accent-color: #000;
}

@media (min-width: 640px) {
  .neo-range {
    width: 240px;
  }
}

/* Checkbox */
.neo-check {
  width: 22px;
  height: 22px;
  accent-color: #000;
  cursor: pointer;
  transform: translateY(1px);
}

/* Main padding adjusts when teal panel open (no scroll, canvas shrinks) */
main.app-main {
  padding: 12px;
}

@media (min-width: 640px) {
  main.app-main {
    padding: 16px;
  }
}

/* Canvas */
.canvas-wrap {
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  background: #fff;
  position: relative;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* Teal extra toolbar — fixed under purple */
.extra-toolbar-fixed {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--extra-top);
  z-index: 45;
}

.extra-toolbar-fixed-inner {
  pointer-events: auto;
  background: #67E8F9;
  /* teal-300 */
  border-bottom: 4px solid #000;
  padding: 12px 12px;
}

html.dark .extra-toolbar-fixed-inner {
  background: #1f2937;
  /* gray-800 */
  color: #fff;
}

/* Toast animation */
@keyframes slideUp {
  from {
    transform: translateY(28px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast-anim {
  animation: slideUp .25s ease-out forwards;
}

/* Accessibility focus ring */
.neo-btn:focus-visible,
.color-swatch:focus-visible {
  outline: 4px solid rgba(0, 0, 0, 0.7);
  outline-offset: 2px;
}

html.dark .neo-btn:focus-visible,
html.dark .color-swatch:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.7);
}

/* ------------------------------------------------------------------
   Fallback for custom Tailwind tokens (in case CDN config is ignored)
-------------------------------------------------------------------*/
.bg-neo-yellow {
  background-color: #FFDE00 !important;
}

.bg-neo-blue {
  background-color: #3B82F6 !important;
}

.bg-neo-red {
  background-color: #FF4D4D !important;
}

.bg-neo-green {
  background-color: #00E055 !important;
}

.bg-neo-purple {
  background-color: #A855F7 !important;
}

.bg-neo-dark {
  background-color: #1a1a1a !important;
}

.bg-dark-bg {
  background-color: #121212 !important;
}

.bg-dark-card {
  background-color: #1e1e1e !important;
}

.text-neo-dark {
  color: #1a1a1a !important;
}

.shadow-neo {
  box-shadow: 4px 4px 0px 0px #000 !important;
}

.shadow-neo-sm {
  box-shadow: 2px 2px 0px 0px #000 !important;
}

.shadow-neo-lg {
  box-shadow: 8px 8px 0px 0px #000 !important;
}

.neo-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 2px 2px 0px 0px #000 !important;
}