* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9fafb;
  margin: 0;
  padding: 20px;
  color: #222;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  padding: 25px 30px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  text-align: center;
}

h1 {
  margin-bottom: 0.2em;
  color: #0073e6;
}

.description {
  font-size: 1rem;
  margin-bottom: 1.5em;
  color: #555;
}

.scanner-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 aspect ratio */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}

video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

button {
  background-color: #0073e6;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  min-width: 100px;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  background-color: #005bb5;
}

input[type="file"] {
  cursor: pointer;
  border-radius: 5px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  font-size: 1rem;
  min-width: 150px;
}

.result-section {
  text-align: left;
}

.result-section h2 {
  margin-bottom: 0.5em;
  color: #0073e6;
}

#result {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  resize: vertical;
  color: #333;
}

@media (max-width: 500px) {
  .controls {
    flex-direction: column;
  }
  button, input[type="file"] {
    min-width: 100%;
  }
}
