:root {
  --primary: #2196f3;
  --primary-dark: #1976d2;
  --success: #4caf50;
  --error: #f44336;
  --text: #212121;
  --text-light: #757575;
  --background: #fafafa;
  --surface: #ffffff;
  --border: #e0e0e0;

/* removed .button-small and .row-inline after removing mute toggle UI */
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  margin: 0;
  padding: 20px;
  background: var(--background);
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.app-header {
  text-align: center;
  margin-bottom: 40px;
}

.app-title {
  font-size: 2.5rem;
  color: var(--primary);
  margin: 0;
}

.app-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin: 10px 0 0;
}

/* Header external links */
.app-links {
  margin-top: 8px;
  display: inline-flex;
  flex-direction: column; /* stack coffee under YouTube */
  gap: 6px;
  align-items: center;
}
.app-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}
.app-link:hover { text-decoration: underline; color: var(--primary-dark); }
.app-link-icon { width: 16px; height: 16px; fill: currentColor; flex: 0 0 16px; }
.app-link.yt { color: #cc0000; }
.app-link.yt:hover { color: #a80000; }
.app-link.coffee { color: #6f4e37; }
.app-link.coffee:hover { color: #5b3f2d; }

.main-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.control-section {
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


.section-title {
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.input-group {
  margin-bottom: 15px;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
}

.button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.button:hover {
  background: var(--primary-dark);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

.preview-container {
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  margin-top: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.preview-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  margin: 10px 0;
}

.preview-canvas,
.preview-video {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  background: #000;
  margin: 0 auto;
  display: block;
}

.video-preview {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.video-preview.has-video {
  opacity: 1;
}

.progress-bar-container {
  background: var(--border);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin: 20px 0;
}

.progress-bar {
  background: var(--primary);
  height: 100%;
  width: 0;
  transition: width 0.3s ease;
}

.message {
  padding: 10px 15px;
  border-radius: 4px;
  margin: 10px 0;
}

.message.success {
  background: #e8f5e9;
  color: var(--success);
  border: 1px solid #c8e6c9;
}

.message.error {
  background: #ffebee;
  color: var(--error);
  border: 1px solid #ffcdd2;
}

.warning-text {
  color: #f57c00;
  font-size: 0.85em;
  margin-top: 4px;
}

.preview-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.preview-video {
  display: none; /* Initially hidden, shown after generation */
  max-width: 100%;
  width: 360px; /* Match preview canvas width */
  height: auto;
  margin: 20px auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  background: #000;
}

input[type="file"],
input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input[type="file"] {
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.helper-text {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 6px;
}
.helper-text ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
}
.helper-text li {
  margin: 2px 0;
}

.helper-go {
  margin: 10px 0;
}

.helper-up {
  margin-top: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#progressPercent {
  text-align: center;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .main-controls {
    grid-template-columns: 1fr;
  }
  
  .app-title {
    font-size: 2rem;
  }
}

/* Fixed maker badge in the right corner */
.made-by-badge {
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  line-height: 1.2;
  text-align: right;
  pointer-events: none; /* don't block UI */
}
.made-by-line1 {
  font-family: 'PT Sans', 'Noto Sans', 'Roboto', Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.made-by-line2 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  opacity: 0.9;
}

/* Fixed link in left upper corner */
.top-left-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 1001; /* above badge */
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.top-left-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* Badge under the About link (top-left) */
.about-badge {
  position: fixed;
  left: 12px;
  top: 52px; /* sits just below the About link */
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.about-badge-line1 {
  /* Cyrillic-capable font (PT Sans loaded with cyrillic subset) */
  font-family: 'PT Sans', 'Noto Sans', 'Roboto', Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.about-badge-line2 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  opacity: 0.95;
}

/* Simple center footer for bottom links */
.page-footer {
  text-align: center;
  margin: 30px auto 12px;
  color: var(--text-light);
}
.page-footer a {
  color: var(--primary);
  text-decoration: none;
}
.page-footer a:hover {
  text-decoration: underline;
}

/* Button inside the fixed about badge to jump to creation controls */
.go-make-btn {
  margin-top: 6px;
  width: 100%;
  padding: 8px 10px;
  font-size: 0.9rem;
  box-sizing: border-box;
}