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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
  Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: #16213e;
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dropzone {
  border: 2px dashed #007bff;
  padding: 1.5rem;
  background: #e9f5ff;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1rem;
}

input[type='file'] {
  display: none;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  justify-content: flex-start;
}

.controls label {
  display: flex;
  flex-direction: column;
  font-size: .95rem;
  min-width: 120px;
}

input, select, button {
  padding: .4rem;
  font-size: 1rem;
}

.btn-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-right: auto;
}

.file-download-group {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 280px;
  flex-wrap: wrap;
}

.file-download-group input[type='text'] {
  flex: 1 1 auto;
  padding: .4rem;
  font-size: 1rem;
}

.file-download-group button {
  padding: .4rem 1rem;
  font-weight: bold;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.file-download-group select {
  padding: .4rem;
  margin-left: 1rem;
  font-size: 1rem;
}

.compression-display {
  font-size: .9rem;
  color: #555;
  margin-top: -.5rem;
  text-align: center;
  width: 100%;
}

.aspect-ratio-checkbox {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: .5rem;
  font-size: .9rem;
}

.panels {
  display: flex;
  gap: 1rem;
}

.panel {
  background: white;
  border: 2px dashed #ccc;
  padding: 1rem;
  flex: 1;
  min-height: 300px;
  position: relative;
}

canvas, img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: auto;
}

#previewSize {
  color: #d9534f;       /* red */
  font-weight: 600;     /* semi-bold */
  margin-top: .25rem;  /* spacing below image */
  text-align: center;
  font-size: 1rem;
  user-select: none;
  letter-spacing: .02em;
}

.panel > div:first-child {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: .5rem;
  text-align: center;
}

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group {
    margin-right: 0;
    margin-bottom: .5rem;
  }

  .file-download-group {
    flex-direction: column;
    align-items: stretch;
  }

  .file-download-group select {
    margin-left: 0;
    margin-top: .5rem;
  }

  .file-download-group button {
    width: 100%;
    margin-top: .5rem;
  }

  .panels {
    flex-direction: column;
  }

  .panel {
    min-height: 250px;
  }
}

/* Header */
header {
  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;
}

/* Main content */
main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 3rem 1rem;
  background: white;
  color: #000;
  border-radius: 16px;
  border: 1px solid #3a3a5e;
  box-shadow: 0 8px 24px rgb(0 71 171 / .15);
}

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

main h1 {
  /* Standard font here */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
  Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 28px;
  margin-bottom: 1rem;
  text-align: center;
  color: #0047ab;
}

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

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

/* Footer */
footer {
  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: 1240px) {
  main {
    flex: 1;
    max-width: 1100px;
  }
}

@media (max-width: 1120px) {
  main {
    flex: 1;
    max-width: 950px;
  }
}

@media (max-width: 1000px) {
  main {
    flex: 1;
    max-width: 850px;
  }
}

@media (max-width: 880px) {
  main {
    flex: 1;
    max-width: 700px;
  }
}

@media (max-width: 740px) {
  main {
    flex: 1;
    max-width: 500px;
  }
}

@media (max-width: 530px) {
  main {
    flex: 1;
    max-width: 400px;
  }
}

@media (max-width: 450px) {
  main {
    flex: 1;
    max-width: 370px;
  }
}

@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;
  }
}
