/* Reset a bit */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  background: #fafafa;
  color: #333;
  padding: 20px;
  margin: 0 auto;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2rem;
  color: #222;
  font-weight: 600;
}

/* Controls box */
#controls {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-width: 400px;
  margin: 0 auto 30px auto;
}

#controls label {
  display: block;
  font-weight: 500;
  margin-bottom: 10px;
  color: #444;
}

#controls input[type="file"],
#controls input[type="number"] {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

#controls button {
  margin-top: 15px;
  width: 100%;
  background: #0078d7;
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

#controls button:hover {
  background: #005fa3;
}

/* Result section */
h2 {
  text-align: center;
  margin-bottom: 12px;
  font-size: 1.5rem;
  color: #333;
}

#resultBox {
  font-size: 12px;
  font-family: sans-serif;
  background: #111; /* dark */
  color: #f5f5f5;   /* light text */
  border: 1px solid #333;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 90%;
  min-height: 200px;
  max-height: 10000px;
  margin: 0 auto 40px auto;
  text-align: center;  
  white-space: pre;      /* respects \n for line breaks */
  overflow: visible;     /* words can overflow container if too long */
  word-wrap: normal;     /* don’t break long words */
  word-break: normal;    /* same: prevent breaking words */
  transform: scale(1);     
  transform-origin: 0 0;  
}

/* Overlay */
#overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  display: none;
  z-index: 1000;
}
/* Hide native file input */
#fileInput {
  display: none;
}

/* Styled file selector */
.file-label {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: #0078d7;
  color: #fff !important;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 6px;
}
.file-label:hover {
  background: #005fa3;
}

.file-name {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: #fff !important;
  text-align: center;
  word-break: break-word;
}
canvas{
  margin: 0 !important;
  padding: 0 !important;
  display:block;
}
#download-btn {
  margin: 0 auto;        /* centers the button itself horizontally */
  text-align: center;    /* centers text inside button (usually redundant) */
  padding: 12px 16px;
  font-size: 1rem;
  cursor: pointer;
}
#copy-btn {
  margin: 0 auto;        /* centers the button itself horizontally */
  text-align: center;    /* centers text inside button (usually redundant) */
  padding: 12px 16px;
  font-size: 1rem;
  cursor: pointer;
}
/* Container for the content sections */
.main-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center; /* center all child blocks horizontally */
  padding: 20px;
}

/* Headings */
h2 {
  margin: 0 auto;
  font-size: 24px;
  margin-top: 40px;
  margin-bottom: 20px;
  text-align: left;      /* text stays left-aligned */
  max-width: 800px;
  width: 100%;
}

/* Paragraphs */
p {
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: left;      /* text stays left-aligned */
  max-width: 800px;
  width: 100%;
  word-wrap: break-word;
}


/* Optional: center all text for smaller devices */
@media (max-width: 600px) {
  p {
    text-align: center;
  }
}
.parent {
  text-align: center;
}

a {
  margin: 0 auto;
  display: inline-block;
  background: #0066cc;
  color: #fff;
  padding: 0.7em 1.4em;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  transition: all 0.25s ease;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  cursor: pointer;
}
a:hover {
  background: #004b94;
  transform: translateY(-2px);
}