:root {
  --bg: #111;
  --panel: #151515;
  --ink: #eaeaea;
  --muted: #a8a8a8;
  --line: #262626;
  --accent: #ff5e00;
  --accent-2: #ff842b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --btn-fg: #111;
  --checker: #1a1a1a;
  --checker-2: #242424;
}

* {
  box-sizing: border-box;
}

/* Keep [hidden] winning over display:flex/grid on cards */
[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.45 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    Cantarell,
    "Helvetica Neue",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 28px;
  height: 28px;
  display: block;
}

.titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.titles h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.lang-btn {
  flex-shrink: 0;
  background: #0f0f0f;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.lang-btn:hover {
  color: var(--ink);
  border-color: #2e2e2e;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px clamp(16px, 2.5vw, 24px);
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px dashed #3a3a3a;
  border-radius: 12px;
  background: #0f0f0f;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: #141414;
  outline: none;
}

.dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone__title {
  font-size: 18px;
  font-weight: 600;
}

.dropzone__hint {
  color: var(--muted);
  font-size: 14px;
}

.status {
  min-height: 1.4em;
  margin: 0;
  color: #ffb199;
  font-size: 14px;
}

.status.is-ok {
  color: var(--muted);
}

.original {
  padding-top: 14px;
  border-top: 1px dashed #1f1f1f;
}

.original__meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}

.original__meta strong {
  color: var(--ink);
  font-weight: 600;
}

.variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.variant {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.variant__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.variant__note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.variant__preview {
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1e1e1e;
  background:
    linear-gradient(45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker) 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  background-color: var(--checker-2);
}

.variant__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.variant__size {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.btn {
  appearance: none;
  border: 1px solid #2a2a2a;
  background: #181818;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  margin-top: auto;
}

.btn-accent {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--btn-fg);
  font-weight: 600;
}

.btn-accent:hover {
  filter: brightness(1.05);
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px #111,
    0 0 0 4px rgba(255, 94, 0, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .dropzone,
  .btn-accent {
    transition: none;
  }
}
