/* Reset a základní nastavení */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Menu styl */
.main-menu {
  background: #fff;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 1.2rem;
  padding: 0.5rem 0 0.5rem 2rem; /* zarovnání vlevo, ne centrování */
}
.main-menu ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  justify-content: flex-start; /* změna z center na flex-start */
  margin: 0;
  padding: 0;
}
.main-menu li {
  display: inline;
}
.main-menu a {
  text-decoration: none;
  color: #1e40af;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.main-menu a.active,
.main-menu a:hover {
  background: #e0e7ff;
  color: #0f172a;
}

/* Sekce pro záložky */
.menu-section {
  display: none;
  width: 100%;
  max-width: 900px;
  margin: 1.5rem 0 0 0;
  background: #fff;
  border-radius: 16px;
  padding: 2rem 2rem;
  box-shadow: none;
}
.menu-section.active {
  display: block;
  margin-left: 2rem; /* stejné zarovnání vlevo jako ostatní obsah */
}

/* Zbytek tvého CSS zůstává beze změny */

body {
  font-family: 'Inter', Arial, sans-serif;
  background: #fff;
  margin: 0;
  padding: 0;
}

header {
  background: #fff;
  padding-bottom: 0;
  margin-bottom: 0;
  padding: 1.2rem 0.5rem 0.2rem 2rem; /* poslední 0.2rem = menší mezera pod headerem */
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  text-align: left;
  border-radius:8px;
}

header p {
  margin-bottom: 0.2em;
}

header h1 {
  font-weight: 700;
  font-size: 2rem;
  color: #1e40af;
  margin-bottom: 0.2em;
}

main {
  padding: 0 2rem 2rem 2rem;
  padding-top: 0;
  margin-top: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin: 0;
  width: 100%;
  max-width: none;
}

.main-flex {
  margin-top: 0; /* těsně pod nadpisem */
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  justify-content: flex-start;
  width: 100%;
}

.form-block {
  background-color: #f3f4f6;
  padding: 2rem 2rem;
  border-radius: 8px;
  width: 350px;
  min-width: 260px;
  max-width: 400px;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-size: 1.08rem;
  margin-top: 0;
}


.form-block label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.form-block input[type="email"],
.form-block input[type="file"],
.form-block input[type="url"],
.form-block input[type="text"] {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.form-block input[type="email"]:focus,
.form-block input[type="file"]:focus,
.form-block input[type="url"]:focus,
.form-block input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
}

/*#blockPreview {
  width: 100%;
  height: 120px;
  border-radius: 10px;
  border: 1px solid #9ca3af;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-bottom: 1.2rem;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}*/

#buyBlockBtn {
  background-color: #2563eb;
  color: white;
  font-weight: 700;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

#buyBlockBtn:disabled {
  background-color: #93c5fd;
  cursor: not-allowed;
}

#buyBlockBtn:hover:not(:disabled) {
  background-color: #1e40af;
}

#formMsg {
  color: #dc2626;
  font-size: 0.98rem;
  min-height: 1.2rem;
}

#pixelGridWrapper {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-top: 0;
  padding-top: 0;
}
#pixelGridWrapper::-webkit-scrollbar { display: none; } /* Chrome, Safari */

#pixelGrid {
  display: grid;
  grid-template-columns: repeat(192, 10px);
  grid-template-rows: repeat(108, 10px);
  gap: 0;
  border: 1.5px solid #f1f1f1;
  border-radius: 0px;
  box-shadow:  0 0 4px 0 rgba(0,0,0,0.13);
  background: #fff;
  max-width: 1930px;
  max-height: 1090px;
  margin: 0;
}

.pixel-block {
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border: 0.5px solid transparent;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.1s, background-color 0.1s;
}

.pixel-block.selected {
  border-color: #2563eb;
  background-color: #bfdbfe;
}

.pixel-block.occupied {
  background-color: #e5e7eb;
  cursor: not-allowed;
}

.pixel-block img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 4px;
}

/* Responsivita */
@media (max-width: 1400px) {
  main { padding: 0 1rem 1rem 1rem; }
  .main-flex { flex-direction: column; align-items: flex-start; gap: 2rem; }
  .form-block { width: 100%; max-width: 600px; margin: 0 0 1.5rem 0; }
  #pixelGridWrapper { justify-content: flex-start; }
  #pixelGrid { max-width: 100vw; }
  .menu-section.active { margin-left: 1rem; }
}

@media (max-width: 900px) {
  main { padding: 0 0.5rem 1rem 0.5rem; }
  .form-block { padding: 1rem; }
  #blockPreview { height: 80px; }
  #pixelGrid { grid-template-columns: repeat(96, 10px); grid-template-rows: repeat(54, 10px);}
  .pixel-block { width: 10px; height: 10px; }
  .menu-section.active { margin-left: 0.5rem; }
}

@media (max-width: 600px) {
  .form-block { padding: 0.5rem; }
  #blockPreview { height: 60px; }
  #pixelGrid { grid-template-columns: repeat(48, 8px); grid-template-rows: repeat(27, 8px);}
  .pixel-block { width: 8px; height: 8px; }
  .menu-section.active { margin-left: 0.2rem; }
}


.image-upload-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.file-label {
  position: relative;
  display: inline-block;
  cursor: pointer;
  background: #f3f4f6;
  border: 2px dashed #9ca3af;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  transition: border-color 0.2s;
  min-width: 170px;
}

.file-label input[type="file"] {
  opacity: 0;
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  cursor: pointer;
}

.file-label-text {
  color: #374151;
  font-size: 1rem;
}

.file-label.dragover {
  border-color: #2563eb;
  background: #e0e7ff;
}

.image-preview {
  width: 100px;
  height: 100px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fafafa;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 600px) {
  .image-upload-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }
  .image-preview {
    margin-left: 0;
    margin-top: 0.7rem;
  }
}

