:root {
  --bg: #0f0c29;
  --bg-2: rgba(19, 23, 44, 0.88);
  --bg-3: rgba(31, 37, 66, 0.8);
  --border: rgba(143, 154, 208, 0.28);
  --text: #e9eeff;
  --dim: #9da9d4;
  --primary: #64ffda;
  --primary-2: #4facfe;
  --warn: #ff7b72;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 580px at 15% -10%, rgba(79, 172, 254, 0.25), transparent 60%),
    radial-gradient(860px 520px at 85% 0%, rgba(100, 255, 218, 0.18), transparent 65%),
    linear-gradient(135deg, #0f0c29 0%, #1f1b45 45%, #161730 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(16, 21, 40, 0.72);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand span {
  color: var(--primary);
}

.desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--dim);
}

.workspace {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-3);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.panel-title {
  font-size: 14px;
  color: #c5d2ff;
  margin-bottom: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.row.compact {
  margin-bottom: 4px;
}

button,
input {
  border-radius: 8px;
  border: 1px solid var(--border);
}

button {
  height: 36px;
  padding: 0 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  color: #0f1833;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost-btn {
  background: rgba(79, 172, 254, 0.14);
  color: #b9dcff;
  border: 1px solid rgba(79, 172, 254, 0.35);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-name {
  font-size: 12px;
  color: var(--dim);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.code-input {
  height: 36px;
  flex: 1;
  min-width: 160px;
  max-width: 240px;
  background: #101634;
  color: var(--text);
  padding: 0 10px;
  letter-spacing: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

.hint {
  min-height: 18px;
  font-size: 12px;
  color: var(--dim);
}

.hint.error {
  color: var(--warn);
}

.result-box {
  margin-top: auto;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 12, 28, 0.55);
}

.result-label {
  font-size: 12px;
  color: var(--dim);
}

.share-code {
  margin: 6px 0 10px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 6px;
  color: #7cf4dd;
}

.meta-box {
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 12, 28, 0.55);
  font-size: 13px;
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .brand {
    font-size: 18px;
  }

  .desc {
    display: none;
  }
}
