* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #f3f4f6;
  color: #111827;
}

#app {
  max-width: 1200px;
  margin: 10px auto;
  padding: 10px;
}

header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

header h1 {
  font-size: 1.6rem;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button {
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
}

button:hover {
  background: #1d4ed8;
}

button:disabled {
  background: #9ca3af;
  cursor: default;
}

main {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 10px;
}

#palette {
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    overflow-y: auto;        /* 🔥 görgethetővé teszi a panelt */
    max-height: calc(100vh - 120px);  /* 🔥 nem nyúlhat túl a képernyőn */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}


#palette h2 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.palette-section {
  margin-bottom: 10px;
}

.palette-section h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.palette-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.palette-item-btn {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.palette-item-btn img {
  max-width: 40px;
  max-height: 40px;
}

.palette-item-btn:hover {
  background: #e0f2fe;
  border-color: #93c5fd;
}

#canvas-area {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#scene {
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  background: #e5f2ff;
  display: block;
  margin: 0 auto;
}

#framesBar {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.frame-thumb {
  min-width: 80px;
  height: 50px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.frame-thumb.active {
  border-color: #2563eb;
  background: #dbeafe;
}

.frame-thumb span {
  pointer-events: none;
}


#toolWarning {
    font-size: 14px;
    color: #b91c1c;
    margin-top: 6px;
    min-height: 18px;
}

button.active {
    background-color: #ffffff !important;
    color: #2563eb !important;
    border: 2px solid #2563eb !important;
    box-shadow: 0 0 6px rgba(37, 99, 235, 0.4) !important;
    font-weight: bold;
}


button.active:hover {
    background-color: #f0f5ff !important;
}



button.active img {
    filter: brightness(0) invert(1);
}

/* Toolbar sor */
#toolbar {
    background: #ffffff;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
}

/* Csoport – egy sorban maradnak! */
.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    padding: 6px 10px;
    background: #f3f4f6;
    border-radius: 6px;
}

/* Gombok */
.toolbar-group button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.toolbar-group button:hover {
    background: #1d4ed8;
}

.toolbar-group button.active {
    background: #1d4ed8;
    box-shadow: 0 0 0 2px #1e40af inset;
}

/* Speed selector */
.speed-label {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}


.speed-label select {
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    margin-left: 4px;
}

.tool-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

#textControls {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#textControls input {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
}

.speed-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.speed-slider input[type="range"] {
    width: 140px;
}
