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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  background: radial-gradient(circle at top, #1f2933, #050810);
  color: #f9fafb;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.app {
  display: flex;
  flex-direction: column;
  max-width: 1120px;
  width: 100%;
  padding: 24px 20px 32px;
  gap: 20px;
}

.app-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
}

.app-header p {
  margin: 0;
  color: #9ca3af;
  font-size: 0.95rem;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #9ca3af;
}

.lang-switcher select {
  min-width: 110px;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.controls,
.preview-inner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(3, 7, 18, 0.98));
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 18px 18px 16px;
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.8);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.control-group label {
  font-weight: 500;
  color: #e5e7eb;
}

.file-label {
  position: relative;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #0ea5e9, #2563eb);
  color: #f9fafb;
  padding: 10px 16px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
  overflow: hidden;
}

.file-label input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.55);
  filter: brightness(1.03);
}

select,
input[type="color"],
input[type="range"],
input[type="date"] {
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #f9fafb;
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

select:focus,
input[type="color"]:focus,
input[type="range"]:focus,
input[type="date"]:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

.colors-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

input[type="color"] {
  padding: 0;
  height: 34px;
  cursor: pointer;
}

.slider-group input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.buttons {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.buttons button,
.buttons a {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.buttons button {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.9);
  color: #e5e7eb;
}

.buttons button:hover {
  background: rgba(31, 41, 55, 0.9);
}

.buttons .primary {
  background: linear-gradient(135deg, #10b981, #22c55e);
  color: #0b1120;
  box-shadow: 0 16px 30px rgba(16, 185, 129, 0.55);
}

.buttons .primary:hover {
  filter: brightness(1.04);
}

.hint {
  margin: 0;
  margin-top: 2px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.preview {
  display: flex;
  align-items: stretch;
}

.preview-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

canvas {
  max-width: 100%;
  height: auto;
  border-radius: 24px;
  background: #020617;
}

.app-footer {
  font-size: 0.75rem;
  color: #6b7280;
}

@media (max-width: 860px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-inner {
    margin-top: 4px;
  }
}

@media (max-width: 560px) {
  .app {
    padding-inline: 14px;
  }

  .controls,
  .preview-inner {
    padding-inline: 14px;
  }

  .colors-group {
    grid-template-columns: minmax(0, 1fr);
  }
}

