@import url('https://fonts.googleapis.com/css2?family=Nova+Flat&display=swap');

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: #16213e;
  color: #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

h1 {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
}

#dropZone {
  width: 90vw;
  max-width: 600px;
  padding: 30px;
  border: 3px dashed #2196f3;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  color: #222;
  font-size: 1.2rem;
  margin-bottom: 20px;
  cursor: pointer;
  user-select: none;
}

#dropZone.hover {
  background-color: #0d47a1;
  color: #fff;
}

#canvasWrapper {
  width: 90vw;
  max-width: 600px;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 2px solid #d0d7de;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  display: block;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 15px 0 25px;
  max-width: 600px;
}

.control-group {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  flex: 1 1 120px;
}

label {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: .9rem;
}

select, input[type='range'], input[type='text'] {
  border-radius: 8px;
  border: none;
  padding: 8px 10px;
  font-size: 1rem;
}

input[type='text'] {
  background: #222;
  color: #eee;
  border: 1px solid #444;
  font-family: monospace;
}

button {
  background: #2196f3;
  border: none;
  color: white;
  font-size: 1rem;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  flex: 1 1 140px;
  transition: background-color .2s ease;
  user-select: none;
}

button:hover:not(:disabled) {
  background-color: #1769aa;
}

button:disabled {
  background-color: #555;
  cursor: default;
}

#status {
  min-height: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-top: 15px;
  font-size: 1rem;
  color: #4caf50;
  user-select: none;
}

@media (max-width: 480px) {
  .controls {
    flex-direction: column;
    max-width: 100%;
  }

  button {
    flex: 1 1 100%;
  }
}

.main-container {
  background: #f0f2f5;
  padding: 2rem 1rem;
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
}

/* Mobile fix */

/* Mobile stacking improvements */
@media (max-width: 600px) {
  #dropZone,
  canvas,
  #status,
  .controls,
  button,
  .control-group {
    width: 100% !important;
    max-width: 100% !important;
  }

  body {
    padding: 10px;
  }

  h1 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 16px;
  }

  .controls {
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    margin-top: 10px;
  }

  .control-group {
    flex: 1 1 auto;
    min-width: 100%;
  }

  input[type="range"] {
    width: 100%;
  }

  button {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
  }

  #status {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 12px;
  }
}


/* Header */
header {
  width: 100%;
  background: #1a1a2e;
  border-bottom: 1px solid #3a3a5e;
  padding: 12px 24px;
  text-align: center;
}

header a {
  font-family: 'Nova Flat', cursive;
  font-size: 22px;
  color: #ffd700;
  text-decoration: none;
}

header a:hover {
  text-decoration: none;
}

p {
  font-size: 20px;
  text-align: center;
}

/* Footer */
footer {
  width: 100%;
  margin-top: 40px;
  background: #1a1a2e;
  border-top: 1px solid #3a3a5e;
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
  Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

footer .left a, footer .right a {
  color: #0dcaf0;
  text-decoration: none;
  margin: 0 .6rem;
}

footer .left a:hover, footer .right a:hover {
  text-decoration: none;
}

footer .left {
  flex: 1 1 40%;
  text-align: left;
}

footer .right {
  flex: 1 1 50%;
  text-align: right;
}

@media (max-width: 480px) {
  header a {
    font-size: 22px;
  }
}

/* Responsive */
@media (max-width: 480px) {
  footer {
    flex-direction: column;
    gap: .5rem;
    font-size: 13px;
    text-align: center;
  }

  footer .left, footer .right {
    flex: unset;
    text-align: center;
  }

  footer .right a {
    margin: 0 .4rem;
  }
}
