*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f4f8;
  color: #1a202c;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #1a56db, #0e9f6e);
  color: white;
  padding: 1.5rem 2rem;
  text-align: center;
}

.logo { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.logo-icon { font-size: 2rem; }
.logo h1 { font-size: 1.75rem; font-weight: 700; }
.tagline { margin-top: 0.4rem; opacity: 0.85; font-size: 0.95rem; }

main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.translator-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .translator-panel { grid-template-columns: 1fr; }
}

.input-area, .player-area {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.input-area label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #374151;
}

textarea {
  width: 100%;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}
textarea:focus { outline: none; border-color: #1a56db; }

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

#char-count { font-size: 0.8rem; color: #9ca3af; }

.btn-primary {
  background: #1a56db;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: #1649c0; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.player-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

#player-wrapper {
  width: 100%;
  height: 300px;
}

#player-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.status {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  text-align: center;
}
.status.loading { background: #eff6ff; color: #1d4ed8; }
.status.error   { background: #fef2f2; color: #dc2626; }
.status.success { background: #f0fdf4; color: #16a34a; }
.status.hidden  { display: none; }
